Skip to content

feat(orchestrator): a spec's tickets run as a queue of lanes - #337

Merged
bfcarrasco merged 1 commit into
mainfrom
feat/orchestrator-ticket-queue
Dec 5, 2026
Merged

bfcarrasco merged 1 commit into
mainfrom
feat/orchestrator-ticket-queue

Conversation

@bfcarrasco

Copy link
Copy Markdown
Owner

Request

#324, "Orchestrator: a spec's tickets as a queue of lanes" (behaviour 12 of spec #318; takes over the job of #133):

  • Input: a spec, or a list of tickets, in one repo or several.
  • Tickets come from tracker.mjs next. Before the start, a cheap research lane names the areas each ticket is likely to touch; tickets that share an area go in one lane, in blocker order.
  • At most three builders run at once on a machine whose builds share a target dir.
  • When a lane reports merged, the next ready ticket starts without the owner.
  • The run ends when the spec is closed, or when every open ticket waits for the owner; the last message lists those tickets with what the owner is needed for.
  • The orchestrator's context holds ticket numbers, PR numbers and states; evidence is the thread's activity list.

Closes #324

What changed

  • scripts/queue.mjs: queue.mjs <spec or ticket>... [-R owner/repo] [--areas <file>] [--running <refs>] [--builders <n>]. Refs are owner/repo#n, URLs, or #n with -R, so one call spans repos. It reads open tickets through tracker.mjs's frontier (a spec through its sub-issues, loose tickets by ref), groups tickets of one repo whose areas overlap (a directory overlaps the files under it) into one lane in blocker order, and prints { lanes, running, start, waiting, end }. A lane runs one ticket at a time; start never takes the running count past --builders (default 3). Running = claimed tickets plus --running (lane threads alive without a claim). waiting says what each non-startable ticket waits for (ready-for-human, plan:grill, plan:prototype, a missing proof tool, or its blockers). end is done with no open ticket, owner when nothing runs or can start.
  • tracker.mjs: blocked rows of next carry their open blockers (blockedBy); frontier also takes an explicit ticket list.
  • Skill: a "A queue of tickets" section: research lane for areas (saved and posted on the spec for a renewal), queue.mjs after every lane result, ready-for-human plus a comment on a ticket whose lane stopped needs_owner or capped so the queue skips it, and the two endings. README lists it.

State stays derived: the queue is recomputed from GitHub (claims, labels, closed tickets) and the areas each time; nothing is stored besides the areas comment.

Verification

@bfcarrasco

Copy link
Copy Markdown
Owner Author

bstack-judge: PASS tier=1 sha=38a78bb31d3b50dcc3f5d8dd16afc2bb1400ce17

PR 337, head 38a78bb (checked out detached, SHA confirmed). No blocking finding. I did not run the PR's throwaway-repo walk. I used bfcarrasco/bstack itself, read-only.

Criteria and proof:

  1. Input is a spec or a ticket list, in one repo or several. PROVEN.
  2. Tickets come from tracker.mjs. Tickets that share an area go in one lane, in blocker order. PROVEN.
    • collect calls tracker.mjs's frontier.
    • The unit tests cover path overlap, a directory overlapping the files under it, repos never mixed, blocker order and cycles.
    • --areas loaded a JSON file correctly on the real run.
    • The research lane is a skill step only (SKILL.md "A queue of tickets", step 1). It was not run with a real lane, and the PR says so.
  3. At most three builders at once. PROVEN. The cap and --builders are tested, and claims and --running count against it.
  4. When a lane merges, the next ready ticket starts. PROVEN by the unit test: after a merge the ticket is gone and the next ready one in the lane starts.
  5. The run ends when the spec is closed or when every open ticket waits for the owner, and the last message lists those tickets. PROVEN. end is done or owner, and waiting carries the reason for each ticket. The skill step 5 tells the orchestrator to list them in the last message.
  6. The context holds numbers and states only. PROVEN by reading. The output is refs, URLs, titles and states, and nothing is stored beyond the areas comment.

Run on head:

  • node --test tests/queue.test.mjs passed 15 of 15.
  • node tools/check-plugin.mjs printed ok.
  • The new tests are a new file, so they fail on base by construction (no queue.mjs there). I did not check the tracker.mjs change against base.

Dropped hypotheses:

  • Weakened checks: none. The diff touches no check config and removes no tests.
  • Cap overshoot: runningCount + start.length is checked before each start, so the cap holds.
  • Ticket 1 waiting for the owner while ticket 2 in the same lane is blocked by it: the lane stays blocked and end becomes owner. Correct.
  • Blockers with no url (only a number): toRef handles it with the repo.
  • areasOf throws on a malformed key in the areas file, but only if the key is reached before the matching one. It fails loudly, so it is not blocking.
[]

@bfcarrasco
bfcarrasco merged commit bfb7342 into main Dec 5, 2026
4 checks passed
@bfcarrasco
bfcarrasco deleted the feat/orchestrator-ticket-queue branch December 5, 2026 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Orchestrator: a spec's tickets as a queue of lanes

1 participant