Skip to content

fix(usage): bind exact profiles and trusted cost provenance - #111

Merged
drewstone merged 3 commits into
mainfrom
fix/trusted-cost-materialization-20260803
Aug 3, 2026
Merged

fix(usage): bind exact profiles and trusted cost provenance#111
drewstone merged 3 commits into
mainfrom
fix/trusted-cost-materialization-20260803

Conversation

@drewstone

@drewstone drewstone commented Aug 3, 2026

Copy link
Copy Markdown
Owner

Closes #108.

Runtime counterpart: tangle-network/agent-runtime#732.

This change makes two execution claims fail closed:

  • AgentProfile materialization now returns a v2 acknowledgment bound to the canonical profile digest, full wire model, provider, requested reasoning, applied native reasoning, and applied workspace plan. The bridge advertises that capability before model spend and retains the acknowledgment with durable run state.
  • Usage now distinguishes provider/billing receipts from local catalog estimates. Pi and OpenCode catalog dollars remain estimates, while fresh input, cache read, cache write, and output tokens remain separate.

Completion criteria:

  • Latest compatible Interface/materializer packages with one Interface installation
  • Pre-spawn profile/model/provider/reasoning/system/MCP conflict refusal
  • Session profile/model binding across resumed turns
  • Durable v2 profile acknowledgment and root capability advertisement
  • Trusted-versus-estimated cost wire contract
  • Cache token dimensions preserved
  • Focused regression suite: 169/169
  • Full typecheck/build and test suite: 618 passed, 6 skipped
  • Runtime cross-package refusal and receipt tests (fix(accounting): distinguish observed and estimated model cost tangle-network/agent-runtime#732)

Local verification at 86b23f8:

  • pnpm exec vitest run tests/docker-executor.test.ts tests/mcp-passthrough.test.ts tests/profile-mcp.test.ts tests/pi-backend.test.ts tests/sse-keepalive.test.ts — 169/169
  • pnpm test — 618 passed, 6 skipped
  • pnpm build — passed
  • pnpm list @tangle-network/agent-interface @tangle-network/agent-profile-materialize --depth 10 — one Interface 0.43.0 installation; materializer 0.10.2 uses that peer
  • git merge-tree --write-tree origin/main HEAD — clean tree 7ef40f6e6ac858dfb92576e7b55f869a4db2b3ce

@drewstone
drewstone marked this pull request as ready for review August 3, 2026 21:46
@drewstone
drewstone merged commit 2d95b4a into main Aug 3, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(pi): do not report catalog-estimated zero as billed cost

1 participant