Skip to content

release: baton 1.3.3 — stable spawn id + run-trail de-dup (observed known-count PASS)#36

Merged
andrewwint merged 2 commits into
mainfrom
feat/ledger-spawn-id-dedup
Jul 11, 2026
Merged

release: baton 1.3.3 — stable spawn id + run-trail de-dup (observed known-count PASS)#36
andrewwint merged 2 commits into
mainfrom
feat/ledger-spawn-id-dedup

Conversation

@andrewwint

Copy link
Copy Markdown
Owner

Patch release (1.3.2 → 1.3.3). Closes the run-ledger fidelity gaps an end-to-end verification surfaced, verified by an observed firing on a real routed session (not a writer unit pass). No change to the frozen 1.0 contract or the enforcement gate.

What it fixes

  • Stable spawn id on every captured lane. A live probe of the real PostToolUse payload showed the id is present at tool_response.agentId (+ top-level tool_use_id) — the earlier null task_id was a wrong-key extraction bug, not a payload limitation, so no new lifecycle hook was needed. Recorded in both record_lane_spawn.py and ledger.py; stays a secondary signal to non-generic subagent_type in the deriver (a model-visible id never solely certifies a specialist).
  • Ledger de-duplicates a double-fired spawn. Under multi-scope wiring (project + user-global) one spawn fires the hook twice; the ledger now records exactly one lane line per spawn via a race-safe O_CREAT|O_EXCL first-writer-wins marker keyed on the id (verified under 40-process contention). N routed lanes → exactly N lines even multi-wired.

Observed acceptance (the gate)

Real dispatch — implementer + code-reviewer + researcher → exactly 3 lane lines, each with its real agentId; de-dup collapsed the double-fire. Your known-count items 1–4 pass end-to-end, not just the writer suite.

Verification

  • Independent cold-read review: PASS, no blockers (40-process race stress; enforcement selftest green; id confirmed secondary-only).
  • Full smoke green: 9 hook self-tests, hooks-e2e 23; from-clean single-wired doctor-green.
  • OpenSpec add-ledger-spawn-id-and-dedup updated to the probe finding; validates --strict.

🤖 Generated with Claude Code

andrewwint and others added 2 commits July 10, 2026 20:45
…roposal

Stable spawn id (from SubagentStart/Stop, the event that carries it) + ledger de-dup
so multi-scope wiring doesn't double-count, with an OBSERVED known-count end-to-end run
as the acceptance gate (a green writer unit suite is declared insufficient). No change to
the enforcement contract — the id is for the trail/dedup/correlation, not the gate.
Validates --strict. Proposal awaiting approval before implementation.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
…observed known-count PASS

Probe-first (design mandated it): a live probe of the real PostToolUse payload showed the spawn id
IS present — tool_response.agentId (+ top-level tool_use_id) — so the null task_id was a WRONG-KEY
extraction bug, not a payload limitation, and no SubagentStart/Stop hook is needed.

- Extract the id (tool_response.agentId -> tool_use_id -> old fallbacks) in record_lane_spawn.py and
  ledger.py (kept in lockstep; a twin test pins it against drift — review R1).
- ledger.py: race-safe first-writer-wins de-dup via O_CREAT|O_EXCL per-id marker (_ledger_seen/<id>),
  so a spawn double-fired under multi-scope wiring (project + global) yields exactly ONE lane line;
  no id -> never drop. Enforcement unaffected: the id stays a SECONDARY match to non-generic
  subagent_type (it's model-visible, so forgeable), never the sole certifier.

OBSERVED acceptance (real dispatch, this double-wired repo): 3 lanes (implementer/code-reviewer/
researcher) -> exactly 3 lane lines, each carrying its real agentId; dedup collapsed the double-fire.
So items 1-4 of the known-count gate now pass end-to-end, not just the writer unit suite.

Independent cold-read review: PASS, no blockers (40-process race stress green; enforcement selftest
green). Full smoke green (9 hook self-tests, hooks-e2e 23). openspec add-ledger-spawn-id-and-dedup
updated to the probe finding; validates --strict.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@andrewwint
andrewwint merged commit 2f6e50f into main Jul 11, 2026
2 checks passed
@andrewwint
andrewwint deleted the feat/ledger-spawn-id-dedup branch July 11, 2026 01:16
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.

1 participant