Repository navigation
feat(bench): round lifecycle spine — staged → card_settled → done (#371) - #2328
Merged
Merged
Conversation
…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
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Why
A benchmark round was not an entity.
benchmark/dispatchposted 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 (#450work.card.state_changedsingle-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):BenchRoundtracker — 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, andRoundStage { Working, Done }. Working starts at dispatch (kickoffs are sent); Done when every card reaches a terminal state (closed | done | merged— the serdeCardStatevocabulary the bus event carries).modules/benchmark_grade.rsforwards eachwork.card.state_changedpayload to the tracker — ONE subscription, two reactions (advance the round, grade the card).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 countbench.round.done— the END, exactly once (the round is removed on that transition, so once is structural)benchmark_grade::is_terminalnow delegates tobench_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_oncea_card_settling_twice_does_not_double_counta_card_outside_the_set_is_ignoredobserve_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::benchmarkmods — 40 passed, 0 failed.cargo check -p continuum-core --features metal,accelerateclean (no new warnings).Deliberately skipped
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.work.card.state_changedpayload 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