Repository navigation
feat(accounting): account direct turns and compaction (G-A2.2a) - #190
Merged
Merged
Conversation
G-A2.2a, the first of four production-wiring slices for the G-A2.1 accounting decorator. Served unary/streaming (cold and warm), the local fan-out leg, MCP run/continuation and compaction now start an operation-owned usage attempt before checkout, resolution and configuration, and capture each turn through a per-turn accounting view; cached registry/session backends stay undecorated. Workflow, implement and smoke paths are unchanged until slices b-d. - Compaction validates handle, generation, agent and configuration under the same lock as the Compacting claim; stale preparations settle undispatched without releasing the context. - Composite accounting failures (original typed cause, evidence, persistence failure) are carried through bridge-core/bridge-coordinator and projected only at the A2A/MCP adapters; a source-scan test enforces the boundary. - Exposes the C2 selection seam before accounting start (no fallback here). Reviewed by gpt-6-astra over 4 rounds (APPROVE). Local verification: fmt, clippy -D warnings and tests for touched crates on macOS; mutation probes show the compaction-claim and composite-preservation regressions fail when the fix is removed. CI runs the full workspace. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017izEynabPeSUBT573AtvaZ
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.
G-A2.2a — first of four sequential slices (a direct → b workflows → c implement → d smoke/compat + full matrix) wiring the G-A2.1 accounting decorator (#189) into production.
Scope: served unary/streaming (cold/warm), local fan-out leg, MCP run/continuation, compaction, and the C2 selection seam. Coverage is monotonic: unconverted workflow/implement/smoke paths keep their existing behavior until their slice; the operator serve will not be swapped until slice d.
Key behavior
crates/bridge-core/tests/accounting_projection_boundary.rsenforces).Review: gpt-6-astra, 4 rounds → APPROVE. Rounds 1–2 converging (3 → 2 blockers); round 3 showed the cause-preservation family recurring, so round 4 applied a structural ruling over the whole population.
Verification
-D warnings, tests — 0 failed.compaction_claim_rejects_stale_agent_handle_and_config_without_expiry; re-wrapping the barrier error failspreparation_failures_preserve_original_and_settlement_outcomesand the projection-boundary scan.Deferred (recorded): returned accounting locator for internally minted streaming/compaction scopes; base-compatible behavioral harness for pre-change evidence; NotFound compaction regression test.
Size: ~2,400 changed lines, ~4× the split estimate (disclosed; slices b–d will be re-estimated before dispatch).
🤖 Generated with Claude Code
https://claude.ai/code/session_017izEynabPeSUBT573AtvaZ