spec(queen): scheduler control contract -- event wakeups, fenced task leases, assign/cancel, agent reuse - #6676
Merged
Conversation
… leases, assign/cancel, agent reuse specs/queen/control.t27 closes the five gaps specs/queen/dispatch.t27 measured in the running supervisor: no event IDs, no per-task lease or heartbeat, a writer that checks nothing, no cancel, first-eligible only. Events wake the Queen at once and the tick only reconciles. Task claims are fenced like queen_lease. A person assigns before the automatic choice and cancels by bumping the fence. Every free slot is offered per wake. Domain agents boot once and compact between tasks, keeping their skill lineage; clones get their own lease holder; the Queen never executes. 11 tests pass (t27c gen + zig test); 8/8 mutants killed. Closes #6675 Refs #6657, #6655 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
This was referenced Oct 6, 2026
54 tasks
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.
Closes #6675
Refs #6657, #6655
What
This PR adds
specs/queen/control.t27(moduleQueenControl), the canonical contract for the #6657 control layer. It extendsspecs/queen/dispatch.t27and reuses the Inngest app from #3594 for event delivery. It adds no second queue, lease registry, bee registry or review.queen/*Inngest names; per-stream sequence idempotency; zero wake delay; the 300 s tick only reconcilesqueen_lease), TTL 180 s / heartbeat 60 s from the runtime, reclaim on expiry, fenced writesEvidence
The local t27c (
target/release/t27c) was used to generate only, with no build. Zig is 0.16.0.t27c gen specs/queen/control.t27 > control.zig && zig test control.zigAll 11 tests passed.t27c gen-cThe deleted-fence mutant survived at first: the live-lease test refuses through the holder check anyway. The test now includes the expired-lease race, where only the fence decides.
Not in this PR
queen-tick.ts,queen-dispatch.tsandqueen-lease.ts. That is hand-written foreign code, so it is parked under the only-t27 rule. As with priority.t27 and review_valve.t27, the supervisor should import the constants viat27c gen-jsand mirror the functions. Until it does, these rules are a contract with tests, not measured runtime behaviour.gen/coutput. The local compiler predates master, and no seal is required (review_valve.t27 landed without one).varinside atestbody is emitted in Zig as a redeclaration (const fence = ...). The tests here avoid it by using one name per step.🤖 Generated with Claude Code