Skip to content

spec(queen): claim.t27 - the round's stateOfDispatch as a card, the review valve imported, not restated #8765

Closed

Description

@dmitrii-f-t27

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.t27 claim_of: the audit at supervisor pin 879799a8. An escalation is held with no clock, obsolete/cancelled is not a state, and the row's criteria are not read.
  • gHashTag/trios rings/T27-02/tick_core.t27 state_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 the queen branch, word for word.
  • claim_of_step(step, held) and criteria_read_as(criteria_read, criteria).
  • escalation_kind, next_step and the valve's kind/step codes and retry floor are imported from review_valve.t27, not restated.
  • The verdict word stays at the boundary: the supervisor maps review_state to a V_ code and the CL_ 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_of either fails a named test or is blocked by an invariant; the table is in the PR.
  • The seal .trinity/seals/queen_QueenClaim.json is 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_of as 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_of function 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_kind and next_step, When claim.t27 imports these from review_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_state to V_ codes and CL_ 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

  1. added 2 commits that reference this issue on Oct 15, 2026
    64ee41e
    c1c9939
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions