Skip to content

feat(orchestrator): one goal from brief to merged through lanes - #334

Merged
bfcarrasco merged 5 commits into
mainfrom
feat/orchestrator-goal-lanes
Dec 5, 2026
Merged

bfcarrasco merged 5 commits into
mainfrom
feat/orchestrator-goal-lanes

Conversation

@bfcarrasco

Copy link
Copy Markdown
Owner

Request

#323 bstack:orchestrator: one goal from brief to merged through lanes. Criteria:

  • The skill orchestrator loads by /bstack:orchestrator, and its description routes on a request to orchestrate or run work across repos.
  • Given a ticket in a throwaway repo, it starts one lane in a worktree on the model model.mjs lane names, ends its turn, is woken by T3, and reports the ticket closed and the PR merged as read back from GitHub.
  • The first message of the child thread holds Goal, Done when, Constraints and Result form, in English, and no steps. For an open task it holds a goal and a done-when only.
  • The lane's result arrives as data that matches the schema file in the plugin. The orchestrator's thread shows no read of a diff, a log or the child's transcript.
  • With two lanes running: a technical question from one is answered by the orchestrator and recorded on the ticket, and a stop-list question from the other reaches the owner once, with a recommended answer, while the first lane goes on.
  • Replies to the owner are Danish at the ultra level; a warning or a question to the owner is in full sentences.
  • bstack:mode routes a run without the user in T3 Code to the skill, and the README lists the skill and how the owner starts the thread.

Closes #323

What changed

  • New skill bstack:orchestrator: sizes a goal, starts one lane per ticket with delegate_task (worktree, model and effort from model.mjs lane), ends its turn, sorts lane questions into technical (answered, recorded on the ticket) and the owner's (asked once, with a recommendation), reports in Danish at ultra.
  • skills/orchestrator/lane-result.schema.json: the lane result contract of the spec Orchestrator: one T3 Code thread that runs work in all repos from goal to merged #318.
  • scripts/lane.mjs: brief writes Goal, Done when, Constraints, Result form (an open task: goal and done-when only) and refuses numbered steps; result reads a lane's last message and prints the result only when it matches the schema.
  • bstack:mode routes a goal run in T3 Code to the skill; autonomous-run points there; README row and an Orchestrator section.

Scope

Placement over machines and accounts, queues, renewal and the decision at the round cap are their own tickets.

Verification

  • node --test tests/*.test.mjs: 889 pass, 0 fail; tests/lane.test.mjs covers the schema, the brief and the result.
  • node tools/check-plugin.mjs: ok.
  • A run in T3 Code: evidence in a comment.

@bfcarrasco

Copy link
Copy Markdown
Owner Author

Pre-merge rehearsal in T3 Code (the skill loaded from this branch, not from the installed plugin), 5 Dec 2026, against a private throwaway repo with exposure internal and a checks file, two tickets:

  • The orchestrator thread ran model.mjs lane build <n>: {"model":"sonnet","effort":"medium"} for both, started two lanes with delegate_task, each brief written by lane.mjs brief (Goal, Done when, Constraints, Result form), and ended its turn.
  • T3 woke it when a lane finished. Lane 1 stopped with needs_owner and a question the ticket addressed to the orchestrator; the orchestrator classed it as technical, answered it with t3_thread_send and recorded question, answer and why in one comment on the ticket. Lane 1 then built and merged.
  • Both lanes ended with result JSON that lane.mjs result accepted; the orchestrator read both tickets closed and both PRs merged back from GitHub and reported in Danish. Its thread shows no read of a diff, a log or a lane transcript.
  • Found and fixed in ec76c58: a PowerShell pipe puts a byte order mark before the JSON (lane.mjs now drops it), and T3 refused a projectId other than the orchestrator's own from a child thread ("A local task runs in this thread's project"), so the skill now says how to start the lane then. Registering a repo as a T3 project needs a full-access thread; the skill sends that to the owner.
  • Not shown yet: a stop-list question reaching the owner (the data-deleting ticket was revertible through git, so its lane went on). That case runs in the proof after the merge, on the installed plugin.

@bfcarrasco

Copy link
Copy Markdown
Owner Author

bstack-judge: UNPROVEN tier=1 missing=A T3 Code session with delegate tools and a throwaway repo, to run the two-lane sha=ec76c58ea203ffca5109ec3fb59ad5a99b86e76e

Owner: the proof could not be run here: A T3 Code session with delegate tools and a throwaway repo, to run the two-lane; run the judge on a machine that has it, or give the owner's OK line as the whole PR comment: bstack-user-ok sha=ec76c58ea203ffca5109ec3fb59ad5a99b86e76e. Nothing is asked of the builder.

PR 334 verdict: UNPROVEN (head ec76c58). Criterion 5 (two lanes: a technical question answered and recorded, a stop-list question reaching the owner once) is not demonstrated. The PR's rehearsal comment says "Not shown yet" and defers it until after merge. I couldn't run it, because it needs T3 Code with delegate tools and a throwaway repo.

Proven on the real surface: node --test tests/lane.test.mjs gives 8 pass; node tools/check-plugin.mjs prints ok; risk-tier.mjs --pr 334 gives tier 1 with no weakened checks. lane.mjs brief and lane.mjs result behave as specified, which covers criteria 3 and 4 and the mode and README routing in criterion 7. Criteria 1, 2 and 6 rest on skill text plus the author's rehearsal comment, which I couldn't re-run.

Notes:

  • F2: lane.mjs brief refuses a goal whose line starts with a decimal. echo '{"goal":"1.5x faster","done":"x"}' | node plugins/bstack/scripts/lane.mjs brief fails with "no numbered steps", because STEP_LINE matches 1. in 1.5x. It is not blocking.
  • F3: lane.mjs result rejects a lane message with prose after the JSON. This matches the "nothing around it" Result form, so it is only a note.

Dropped: BOM handling (handled and tested), unknown, missing and wrong-type fields (all caught by check), and nested-object slicing in lastObject (the whole message is parsed first, so fine).

{"findings":[{"id":"F1","title":"Criterion 5 (stop-list question reaches the owner once while another lane goes on) is unproven here: the PR rehearsal omits it and I lack T3 Code","reproduction":"PR 334 rehearsal comment: 'Not shown yet: a stop-list question reaching the owner'","base":"not run","head":"not run","blocks":"no","files":["plugins/bstack/skills/orchestrator/SKILL.md"]},{"id":"F2","title":"brief refuses a valid goal that starts with a decimal like 1.5x (STEP_LINE false positive)","reproduction":"echo '{\"goal\":\"1.5x faster\",\"done\":\"x\"}' | node plugins/bstack/scripts/lane.mjs brief","base":"not run","head":"fail","blocks":"no","files":["plugins/bstack/scripts/lane.mjs"]}],"missing":"A T3 Code session with delegate tools and a throwaway repo, to run the two-lane stop-list scenario"}

@bfcarrasco

Copy link
Copy Markdown
Owner Author

Second pre-merge rehearsal in T3 Code (skill from this branch at dad857c), same private throwaway repo, two new tickets: one with a question the ticket puts to the orchestrator, one whose done-when includes e-mailing other people (stop list).

  • The orchestrator started both lanes (model.mjs lane build: sonnet, medium; briefs from lane.mjs brief), then put both questions to the owner in one user question, each with a recommended answer, while both lane threads were running (T3 thread list at the time of the question: both lanes running, orchestrator running with the question pending).
  • The owner chose the recommended answer for the e-mail (the lane merges the code, nobody sends mail in the owner's name) and handed the other question back as the orchestrator's. The orchestrator then answered it itself, sent each answer to its lane with t3_thread_send, and recorded question, answer and why on each ticket.
  • T3 woke it as each lane finished; lane.mjs result accepted both results; it read both tickets closed and both PRs merged back from GitHub and reported in Danish. Its thread shows no read of a diff, a log or a lane transcript.
  • Change from this run (head after dad857c): the skill now says a reversible choice inside a ticket's scope is technical, even when it shapes behaviour, since the orchestrator sent such a question to the owner.
  • lane.mjs brief no longer refuses a goal that starts with a decimal such as 1.5x (judge note F2), with a test.

@bfcarrasco

Copy link
Copy Markdown
Owner Author

bstack-judge: UNPROVEN tier=1 missing=A T3 Code session with delegate tools and a throwaway repo, to prove criteria 2 sha=d030925a2acc94bd1e84ecd63ec009fb06e62cc0

Owner: the proof could not be run here: A T3 Code session with delegate tools and a throwaway repo, to prove criteria 2; run the judge on a machine that has it, or give the owner's OK line as the whole PR comment: bstack-user-ok sha=d030925a2acc94bd1e84ecd63ec009fb06e62cc0. Nothing is asked of the builder.

PR 334, head d030925 (checked out detached, SHA confirmed). This head is newer than the last judged ec76c58. There were no open findings to re-run, so I judged the whole PR fresh.

Criteria

  • Criterion 1, skill loads and description routes: PASS. plugins/bstack/skills/orchestrator/SKILL.md has name orchestrator and a description that routes on orchestrate/run-across-repos. node tools/check-plugin.mjs prints ok (29 files).
  • Criterion 3, brief shape: PASS. I ran lane.mjs brief on stdin. It prints Goal, Done when, Constraints and Result form in English. A numbered-step brief is refused. An open task gets goal and done-when only (tested).
  • Criterion 4, result matches schema: PASS for the data half. lane.mjs result accepts a valid object, whether bare, fenced or after prose. It rejects bad state, wrong type, unknown field, a missing key, and text with no JSON object. The "no diff, log or transcript read" half is in the skill text: "Read a lane's thread only when it is stuck". It is not proven on a real orchestrator thread.
  • Criterion 6, Danish at ultra, full sentences for warnings and questions: the SKILL.md "To the owner" section states both. I did not observe a real reply.
  • Criterion 7, mode routing and README: PASS. The mode/SKILL.md table row, the autonomous-run pointer, the README row and the README "Orchestrator" section (how the owner starts the thread) are all present.
  • Criterion 2 (a lane on the model.mjs lane model, woken by T3, ticket closed and PR merged read back from GitHub) and criterion 5 (two lanes, a technical question answered and recorded, a stop-list question reaching the owner once): UNPROVEN. I have no T3 Code session with delegate tools. The PR comments hold only the builder's own rehearsal write-ups. Those are not independent proof. The earlier judge verdict on ec76c58 was also UNPROVEN for the same reason.
  • Tests: node --test tests/lane.test.mjs gives 8 pass, 0 fail on head. They cannot pass on base, because lane.mjs does not exist there. CI is green on ubuntu, windows and validate.

Attacks tried, all held

  • A BOM-prefixed brief is handled.
  • Trailing garbage after the result JSON is rejected with "no JSON object in the lane message". This fails closed.
  • A result with { inside a string value still parses.
  • A goal like "1.5x faster" is not treated as a step.
  • risk-tier.mjs --pr 334 gives tier 1, no reasons, and lists no weakened checks.

Findings

  • F3, non-blocking: the STEP_LINE regex ^\s*(\d+[.)](\s|$)|step\b) in plugins/bstack/scripts/lane.mjs refuses a goal that merely starts with the word "Step". Example: {"goal":"Step up logging","done":"x"} gives "no numbered steps". The orchestrator can reword the goal, so I did not block on it.
{"findings":[{"id":"F3","title":"brief refuses a goal that starts with the word Step (false positive)","reproduction":"echo '{\"goal\":\"Step up logging\",\"done\":\"x\"}' | node plugins/bstack/scripts/lane.mjs brief","base":"not run","head":"fail","blocks":"no","files":["plugins/bstack/scripts/lane.mjs"]}],"missing":"A T3 Code session with delegate tools and a throwaway repo, to prove criteria 2 and 5 (a lane started and woken, and the two-lane question routing)."}

@bfcarrasco

Copy link
Copy Markdown
Owner Author

Status: stopped at the merge gate. Head d030925 has green checks and a judge verdict of UNPROVEN: the judge agent has no T3 Code delegate tools, so it could not re-run criteria 2 and 5 (a lane started and woken by T3; two lanes with a technical question answered and a stop-list question reaching the owner). The builder's two rehearsals above cover them, but they are not independent proof.
Next step: the owner's OK line for this head, or a judge that can run in T3 Code with delegate tools. Open note F3 (non-blocking): lane.mjs brief refuses a goal that starts with the word "Step".

@bfcarrasco

Copy link
Copy Markdown
Owner Author

bstack-user-ok sha=d030925a2acc94bd1e84ecd63ec009fb06e62cc0

@bfcarrasco
bfcarrasco merged commit a4b3158 into main Dec 5, 2026
4 checks passed
@bfcarrasco
bfcarrasco deleted the feat/orchestrator-goal-lanes branch December 5, 2026 17:53
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.

bstack:orchestrator: one goal from brief to merged through lanes

1 participant