spec(queen): claim.t27 - the round's stateOfDispatch as a card, the review valve imported, not restated #8765
Description
Why
Every round, the trios supervisor decides for every queen_dispatch row whether the row still claims its issue: running, accepted, rejected, awaitingReview, failed or cancelled. The round, the board (dispatchRowState) and the files a row holds all read that answer. Today it is stateOfDispatch in trios/agent-server/apps/server/src/api/services/queen-tick.ts (gHashTag/trios queen @ 3654fdd2, lines 791-912), written by hand.
Two specs describe older versions of that rule, and neither agrees with the code that runs:
specs/queen/dispatch.t27claim_of: the audit at supervisor pin 879799a8. An escalation is held with no clock,obsolete/cancelledis not a state, and the row's criteria are not read.- gHashTag/trios
rings/T27-02/tick_core.t27state_of_dispatch: four states, written 2026-09-04, never generated or run.
The review valve (specs/queen/review_valve.t27) already owns the two decisions the claim rule composes (escalation_kind, next_step). The supervisor mirrors them by hand.
What
A card, specs/queen/claim.t27 (module QueenClaim):
claim_of(finished, verdict, idle_minutes, send_backs, ceiling, releases, criteria_read, criteria, free_attempts, reviewer_misses) -> u8: the rule as it runs on thequeenbranch, word for word.claim_of_step(step, held)andcriteria_read_as(criteria_read, criteria).escalation_kind,next_stepand the valve's kind/step codes and retry floor are imported fromreview_valve.t27, not restated.- The verdict word stays at the boundary: the supervisor maps
review_stateto aV_code and theCL_result back to its word.
dispatch.t27 is not edited here: open #6934, #5452 and #7430 touch it.
Acceptance criteria
t27c test-report specs/queen/claim.t27: every test passes, 0 vacuous, invariants proved.- Negative controls: each mutant of a branch, floor or ceiling of
claim_ofeither fails a named test or is blocked by an invariant; the table is in the PR. - The seal
.trinity/seals/queen_QueenClaim.jsonis written by the t27c built from the PR's own tree, with Zig 0.16. - A dated
docs/now/note. - The runtime half is gHashTag/trios (separate issue): the supervisor calls
claim_ofas generated wasm, proven equal to the hand-written function first.
Dmitrii Fedorov (@dmitrii-f-t27)
User Scenarios
- Given the supervisor needs to determine the claim state for a dispatch row, When the
claim_offunction is called with the row's parameters, Then it returns the correct state code matching the hand-written implementation in queen-tick.ts - Given the review valve already defines
escalation_kindandnext_step, Whenclaim.t27imports these fromreview_valve.t27, Then the claim rule composes the same decisions without duplicating logic - Given the verdict word stays at the boundary, When the supervisor maps
review_statetoV_codes andCL_results back to words, Then the spec only deals with internal codes
Requirements
FR-001: The spec specs/queen/claim.t27 MUST define module QueenClaim with function claim_of(finished, verdict, idle_minutes, send_backs, ceiling, releases, criteria_read, criteria, free_attempts, reviewer_misses) -> u8
FR-002: The spec MUST define helper functions claim_of_step(step, held) and criteria_read_as(criteria_read, criteria)
FR-003: The spec MUST import escalation_kind, next_step, valve kind/step codes, and retry floor from specs/queen/review_valve.t27 without restating them
FR-004: The spec MUST keep verdict words at the boundary using V_ codes for input and CL_ codes for output
FR-005: The command t27c test-report specs/queen/claim.t27 MUST pass all tests with 0 vacuous tests and invariants proved
FR-006: Negative controls for each mutant of branch, floor, or ceiling of claim_of MUST either fail a named test or be blocked by an invariant
FR-007: The seal .trinity/seals/queen_QueenClaim.json MUST be written by t27c built from the PR's own tree with Zig 0.16
Boundary
- specs/queen/claim.t27
- specs/queen/review_valve.t27
- .trinity/seals/queen_QueenClaim.json
Activity
t27b ledger: specs/queen/claim.t27 passes natively (Refs gHashTag#8765)
spec(queen): claim.t27 imports OBSOLETE_STATE, so the boundary reads …
Merge origin/master into spec/queen-claim (Refs gHashTag#8765)
spec(queen): claim.t27 - the round's stateOfDispatch as a card, the r…
Merge pull request #8768 from dmitrii-f-t27/spec/queen-claim