Repository navigation
feat(accounting): durable per-turn accounting lifecycle and backend decorator (governance G-A2.1) - #189
Merged
Conversation
…ecorator Cost and quota governance phase 1, lane G-A2.1: the accounting contract and the single capture boundary. Production wiring is G-A2.2. - Accounting lifecycle: an immutable attempt start is persisted before provider dispatch. Usage is persisted before it is forwarded, and completion before the terminal result is exposed. Completion is idempotent. Interrupted or failed completion leaves durable pending accounting. - An accounting backend decorator is the only usage capture point. Context-free prompt calls refuse instead of dispatching unaccounted. - The per-turn accounting envelope carries execution/run-attempt identity, the concrete-turn attempt ID and the frozen effective model/effort/mode. - Storage reuses the G-A summary contract, snapshot merging and cost-quality rules (missing or invalid cost is never zero). - The accounting database and SQLite sidecars are checked through retained directory-descriptor identity snapshots. SQLite owns every open and close, so POSIX advisory locks are never dropped by a side descriptor. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017izEynabPeSUBT573AtvaZ
Owner
Author
|
Fixed the Windows job: |
shoedog
force-pushed
the
feat/accounting-decorator
branch
from
October 19, 2026 05:23
fae0f92 to
8777c2a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 1 of cost and quota governance (H1-2), lane G-A2.1. This adds the accounting contract and the single capture boundary. Production wiring of the decorator onto every dispatch path is lane G-A2.2.
Why one decorator: the first attempt (G-A) captured usage at each call site. Two reviews each found new uncovered paths: smoke, compatibility, MCP continuations, implement setup, compaction and preflight. That design was open-class, so the owner approved a redesign around one capture boundary.
What it adds
fcntllocks and admit a conflicting writer. A multiprocess regression covers this.Review: gpt-6.1-sol implemented; gpt-6-astra reviewed. Round history:
Verify (macOS, touched crates
bridge-core,bridge-store): fmt, clippy-D warningsandvalidate --repo-hygieneok; 1,989 passed / 0 failed. The lock regression fails on the round-2 commit. Not covered locally: the rest of the workspace (CI is the full gate). No production activation, so there is no behavior change for existing runs.🤖 Generated with Claude Code
https://claude.ai/code/session_017izEynabPeSUBT573AtvaZ