Skip to content

feat(accounting): account direct turns and compaction (G-A2.2a) - #190

Merged
shoedog merged 2 commits into
mainfrom
feat/accounting-direct-turns
Oct 21, 2026
Merged

shoedog merged 2 commits into
mainfrom
feat/accounting-direct-turns

Conversation

@shoedog

@shoedog shoedog commented Oct 20, 2026

Copy link
Copy Markdown
Owner

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

  • Usage attempts start before checkout/resolution/configuration; preparation failures settle as undispatched with zero prompts.
  • Per-turn capture view only; cached registry/session backends stay undecorated (no stacked wrappers).
  • Compaction validates handle/generation/agent/config under the claim lock (no misattribution, no wrongful context release).
  • Composite accounting failures survive internal layers; only A2A/MCP adapters project them (crates/bridge-core/tests/accounting_projection_boundary.rs enforces).
  • Peer delegation creates no originating-side charge.

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

  • macOS (touched crates core/coordinator/a2a-inbound/mcp/a2a-bridge): fmt, clippy -D warnings, tests — 0 failed.
  • Mutation probes: removing the claim-time check fails compaction_claim_rejects_stale_agent_handle_and_config_without_expiry; re-wrapping the barrier error fails preparation_failures_preserve_original_and_settlement_outcomes and the projection-boundary scan.
  • Full workspace suite: CI.

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

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
@shoedog
shoedog merged commit 3e889b7 into main Oct 21, 2026
9 checks passed
@shoedog
shoedog deleted the feat/accounting-direct-turns branch October 21, 2026 03:13
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 21, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant