Skip to content

feat(gateway)!: unify inclusive token accounting and explicit caps - #50

Merged
drewstone merged 1 commit into
mainfrom
fix/explicit-execution-dimensions
Sep 9, 2026
Merged

feat(gateway)!: unify inclusive token accounting and explicit caps#50
drewstone merged 1 commit into
mainfrom
fix/explicit-execution-dimensions

Conversation

@drewstone

Copy link
Copy Markdown
Contributor

Input and output usage now represent inclusive provider totals, so reasoning and tool details are not charged twice.
The gateway omits separate detail caps unless the host explicitly supplies them; explicit caps, including zero, still require measured usage and enforcement.
New quotes use inclusive totals and the provider-cost ceiling.

Historical payment outbox and A2A finalization records retain their original additive accounting and settlement amounts.
New records persist an inclusive accounting basis.
Incomplete historical receipts fail rather than substituting zero for missing details.
The README documents the 0.11.0 adapter migration and historical-record constraints.

Validation: 488 tests pass under Node 24.18.0 and 22.22.2; typecheck and build pass.
Real payment/recovery fixtures cover inclusive settlement, explicit caps, omitted details, acknowledgement loss, repeated recovery, and incomplete historical receipts.
Three deliberate mutations fail: invented detail caps, reinterpretation of historical accounting, and double billing of detail counts.

@tangletools tangletools left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the changed dispatch, settlement, reservation, and recovery paths at e6a98ac. Inclusive input/output totals own new charges; explicit detail caps remain enforced. Historical additive records retain their original arithmetic, and incomplete historical receipts now fail closed in both payment recovery and A2A finalization. Reviewed the 16-versus-22-unit settlement and acknowledgement-loss regressions, plus the historical missing-detail correction. Reported validation: 488 tests, typecheck/build, and both configured CI runtime lanes pass. Live payment failure receipt propagation remains a separate tracked follow-up; this change does not claim that proof.

@drewstone
drewstone merged commit 12d74b3 into main Sep 9, 2026
3 checks 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.

2 participants