Repository navigation
spec(queen): claim.t27 - the round's stateOfDispatch as a card, the review valve imported (Closes #8765) - #8768
Conversation
…eview valve imported (Closes gHashTag#8765) What a dispatch row still claims (running, accepted, rejected, awaitingReview, failed, cancelled), as the trios supervisor decides it on the queen branch (queen-tick.ts stateOfDispatch @ 3654fdd2). The valve's escalation_kind, next_step, kind and step codes and retry floor are imported from review_valve.t27, not restated. t27c test-report: 11 tests, 0 FAIL, 0 vacuous, 2 invariants. tri mutate spec: 40 mutants, 40 killed. Runtime: gHashTag/trios#1767.
The t27b-native ratchet on gHashTag#8768 reported the new card as UNLISTED: the reference passes it and t27b passes it. Listed as pass.
…the word from the card's typed constants (Refs gHashTag#8765) t27c gen-ts emits it as a typed constant; the runtime no longer needs the untyped queen-review-valve.gen.js for it. Functions unchanged: test-report 11/11, 0 vacuous; tri mutate spec 40/40 killed; resealed.
|
Updated 2026-10-11 15:18 UTC. Head Required checks on Checked locally on the merged tree with
The four red checks are red on
Action needed outside this PR, on Dmitrii Fedorov (@dmitrii-f-t27) |
Closes #8765. Runtime half: gHashTag/trios#1767.
Description
specs/queen/claim.t27(moduleQueenClaim) is the card for the rule the trios supervisor applies to everyqueen_dispatchrow every round: does the row still claim its issue? The answer is one ofrunning,accepted,rejected,awaitingReview,failed,cancelled. Today that rule isstateOfDispatchintrios/agent-server/apps/server/src/api/services/queen-tick.ts(gHashTag/triosqueen@ 3654fdd2, lines 791-912), and it is written by hand.Two specs describe older versions of the rule, and neither matches the code on
queen.dispatch.t27claim_ofis the audit at pin 879799a8: an escalation is held with no clock,cancelleddoes not exist, and criteria are not read. triosrings/T27-02/tick_core.t27has four states.dispatch.t27is not edited here because #6934, #5452 and #7430 touch it.claim_of(finished, verdict, idle_minutes, send_backs, ceiling, releases, criteria_read, criteria, free_attempts, reviewer_misses)queen. A running bee claims.acceptis done.failed,cancelledandstale-contractfree the issue, andobsoletecancels it.emptywaits for the retry floor. A send-back under the ceiling waits for its hour, then goes to the valve asKIND_SEND_BACK_CEILING. An escalation goes to the valve with the kind from its counters. A wait or no verdict under the ceiling is released after 6 h. Any other word is held with no clockescalation_kind_of(...)claim_of_step(step, held)criteria_read_as(read, n)UNREAD_CRITERIA= 1escalation_kind,next_step, the kind and step codes,RETRY_FLOOR_MINUTESandOBSOLETE_STATEare imported fromreview_valve.t27withuse, so nothing of the valve is restated. The seal'sclosurenamesreview_valve.t27. The verdict word stays at the boundary: the supervisor mapsreview_stateto aV_code and maps theCL_result back to its word.Clocks are whole minutes since
finished_at. Every floor is a whole number of minutes, so the supervisor'sidle_ms >= floor_msholds exactly whenfloor(idle_ms / 60000) >= floor_minutes. An unreadable or negative clock is 0, so it keeps the hold, as today.Testing
All runs used
./target/release/t27cand./target/release/tribuilt from this branch's tree (t27c 0.5.2 at c31c059), with Zig 0.16.0.t27c check specs/queen/claim.t27: OK, 0 errors. The one warning is about the 10 parameters ofclaim_of, which are the 10 inputsstateOfDispatchreads.t27c gen-c | gen-rust | gen | gen-verilog | gen-ts: all exit 0. The generated Rust compiles with barerustc --crate-type lib.t27c test-report specs/queen/claim.t27: 11 tests, 11 pass, 0 FAIL, 0 vacuous, 2 invariants proved.t27c seal specs/queen/claim.t27 --save, then--verify: all hashes MATCH. Seal tests 11/11,zig 0.16.0.t27c check-now: OK.tri mutate spec --file specs/queen/claim.t27 --jobs 6 --timeout 60: 40 mutants (drop-guard 11, flip-cmp 21, swap-logic 4, ret-default 4). All 40 are killed by a failing test.>=changed to>). Withreleases = 0the valve gives the same answer at the hour, which hid the guard. They were a test gap, closed by assertingreleases = 1, where the two answers differ.>=changed to>). They cannot change the claim, because the valve gives those kinds the step of an unrecorded kind. They are closed byescalation_kind_ofand its own test at each ceiling.t27c gen-cand thenzig 0.16.0 cc --target=wasm32-wasi -Oz -DNDEBUG -mexec-model=reactorwith one--exportfor each function of the card and each function it imports. Two builds give one hash. The module has 0 imports.CI
The required checks (
validate,check-linked-issue,parse-ratchet) are green. I compared each red check withmaster:Corpus ratchet: the same 5 unexpected failures asmasterat ddb84c5 (specs/a/b_c.t27,specs/a_b/c.t27,specs/compiler/optimizer.t27,specs/memory/graph/ingest.t27,orchestrator_bench.t27).claim.t27is not among them.duplicate-bodies: the same three findings asmaster(bits,same,clear).emit-bitexact:specs/memory/graph/ingest.t27does not generate. That spec is not touched here.Verilog widths:specs/tri/t27b/conformance/big_frame.t27. It is red onmastersince cd569e3.t27b-native-ratchet: one finding was mine.claim.t27was UNLISTED: the reference and t27b both pass it, but the ledger did not name it. 25d2335 lists it indocs/reports/t27b_expectations.json. A replay of this run'srun.jsonwith the updated ledger no longer reports it. The other UNLISTED entries aremaster's.Recorded, not changed
When a spent ceiling is handed back, the redispatch resets
send_backsand keepsceiling_releases = 1(queen-dispatch.tsupsert). The first send-back of the new attempt therefore reaches the valve with a spent release, and the valve closes it as obsolete inside its hour. That contradicts the supervisor's own comment ("then one more set"). The card keeps the answer the supervisor gives today, and the testa_send_back_under_its_ceiling_goes_back_after_the_hourpins it. A change belongs to the valve and is filed separately on the trios side.Not in this PR
dispatch.t27is unchanged.Dmitrii Fedorov (@dmitrii-f-t27)