Skip to content

feat(bench): round lifecycle spine — staged → card_settled → done (#371) - #2328

Merged
joelteply merged 1 commit into
canaryfrom
feat/bench-round-lifecycle
Aug 16, 2026
Merged

joelteply merged 1 commit into
canaryfrom
feat/bench-round-lifecycle

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Why

A benchmark round was not an entity. benchmark/dispatch posted cards + kickoffs, then NOTHING owned the round: no stage announcements, no END — progress was probe archaeology. Joel 8/16: "random and directed by agent, not an ecosystem." Grading was already event-driven (#450 work.card.state_changed single-emitter bridge, #451 lapsed-claim sweep), but the round itself had no owner and no terminal transition anyone could perceive.

What (smallest true slice)

  • core/continuum-core/src/cognition/bench_round.rs (new): BenchRound tracker — round id reuses the run room's uuid dispatch already mints per run (#329a, never a second id), benchmark name, the dispatched card set keyed by FULL card uuid, and RoundStage { Working, Done }. Working starts at dispatch (kickoffs are sent); Done when every card reaches a terminal state (closed | done | merged — the serde CardState vocabulary the bus event carries).
  • Wire, event-driven, zero new tasks/ticks: dispatch registers the round after its card loop; the EXISTING Auto-resume interrupted training on startup (#365) #450 bus-receiver in modules/benchmark_grade.rs forwards each work.card.state_changed payload to the tracker — ONE subscription, two reactions (advance the round, grade the card).
  • Probes at TRANSITIONS ONLY:
    • bench.round.staged — round id, benchmark, card count (empty dispatch stages and immediately ends — honest, never an unsettleable map entry)
    • bench.round.card_settled — card id, state, remaining count
    • bench.round.done — the END, exactly once (the round is removed on that transition, so once is structural)
  • Compression: benchmark_grade::is_terminal now delegates to bench_round::is_terminal_card_state — ONE definition of "terminal"; the grader and the lifecycle can never disagree about doneness.

Tests (all green, each with // what this catches:)

  • all_settled_transitions_to_done_exactly_once
  • a_card_settling_twice_does_not_double_count
  • a_card_outside_the_set_is_ignored
  • observe_parses_the_bridge_payload_and_removes_the_round_on_done (the wire seam, end-to-end through the real registry)

Plus the touched neighbors: benchmark_grade + commands::benchmark mods — 40 passed, 0 failed. cargo check -p continuum-core --features metal,accelerate clean (no new warnings).

Deliberately skipped

  • BenchViewState round-stage field: the bench fold is a ledger-scan projection (ipc/positron_bench_source.rs) — threading a stage through positron types + fold + scan is well over the ~30-line budget for this slice. Probes are the deliverable; the ViewState field is the natural follow-up.
  • Grade info in the END probe: the work.card.state_changed payload carries no grade (the grade runs minutes after close), so the END reports totals, not verdicts.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

…ttled → done (#371)

WHY: benchmark/dispatch posted cards + kickoffs and then NOTHING owned the
round — no stage announcements, no END; progress was probe archaeology.
Joel 8/16: "random and directed by agent, not an ecosystem." Grading was
already event-driven (#450 work.card.state_changed subscriber, #451 sweep),
but the ROUND itself had no owner and no terminal transition anybody could
perceive.

THE SLICE (smallest true spine, event-driven per system law — no polling):
- cognition/bench_round.rs: BenchRound tracker. Round id IS the run room's
  uuid (dispatch already mints one per run, #329a — never a second id).
  Stage enum Working → Done; per-card settled set keyed by FULL card uuid
  (the bus event's identity, not the 8-char CLI short).
- dispatch registers the round after its card loop (bench.round.staged
  probe; an empty dispatch stages and immediately ends — honest, no
  unsettleable map entry).
- the EXISTING #450 bus-receiver in modules/benchmark_grade forwards each
  work.card.state_changed payload to the tracker — ONE subscription, two
  reactions (advance the round, grade the card). No new task, no tick.
- probes at TRANSITIONS ONLY: bench.round.staged / bench.round.card_settled
  (remaining count) / bench.round.done (exactly once — the round is removed
  on that transition, so once is structural).
- ONE definition of "terminal": benchmark_grade::is_terminal now delegates
  to bench_round::is_terminal_card_state (grader and lifecycle can never
  disagree about doneness).

Tests (each with // what this catches): all-settled fires Done exactly
once; a duplicate settle never double-counts; a card outside the set is
ignored; the bridge-payload seam parses + removes the round on done.

Deliberately NOT built: BenchViewState round-stage field — the bench fold
is a ledger-scan projection (ipc/positron_bench_source.rs) and threading a
stage through positron types + fold + scan is well over the ~30-line
budget for this slice; probes are the deliverable. Grade info is not in
the END probe because the state-change payload doesn't carry it (the grade
runs minutes after close).

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply
joelteply merged commit d083813 into canary Aug 16, 2026
5 checks passed
@joelteply
joelteply deleted the feat/bench-round-lifecycle branch August 16, 2026 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant