Skip to content

Turn /orchestrate into a queue with sleep, parallel and auto - #683

Merged
thomasluizon merged 2 commits into
feature/orchestrate-queue-toolsfrom
feature/orchestrate-queue-skill
Aug 5, 2026
Merged

Turn /orchestrate into a queue with sleep, parallel and auto#683
thomasluizon merged 2 commits into
feature/orchestrate-queue-toolsfrom
feature/orchestrate-queue-skill

Conversation

@thomasluizon

Copy link
Copy Markdown
Owner

Stacked on #682, which adds the three tools this wires in. Base is feature/orchestrate-queue-tools, so review that one first and merge bottom-up.

/orchestrate now takes one ticket, several, a project, or --auto, and grows --sleep, --parallel and --auto. One ticket with no flags behaves exactly as it did.

--sleep opens pull requests. It never merges one.

Every piece of signing, provenance, ledger and merge-sweep machinery the old --sleep needed stays deleted, because nothing here acts on a receipt. What makes an unattended run trustworthy now is verify-delivery.mjs: sole authority for "delivered", reads only git and GitHub artifacts, never a worker's self-report. That is precisely what was missing the first time, when a worker claimed work it had not done.

A failed ticket is recorded and skipped. No retry, no relaunch, nobody woken.

Stacking, because nothing merges overnight

A ticket whose blocker is in the same queue branches from its blocker's branch and targets it. It cannot branch from main: main will not contain the blocker's work until you merge it in the morning. --base is passed to verify-delivery.mjs too, or git rev-list --count main..HEAD counts the parent's commits as this ticket's and the size caps read the wrong diff.

A stack lives in one repository (GitHub requires it), so cross-repo blockers stay separate PRs and the api one deploys first. Two layers of one stack never run concurrently, even under --parallel.

Merging a layer auto-rebases and auto-retargets everything above it, so you have no rebasing to do.

New step 12: clear the Codex reviewer's threads

Nothing in this harness has ever read the second review. 8 threads opened across #676, #680 and #681. 8 still unresolved. All three merged.

  • The verdict comes from the presence of a review, never the thread count. An empty list is ambiguous between "clean" and "not yet", and a body-level CHANGES_REQUESTED opens no thread at all.
  • NO_REVIEW is never reported as clean.
  • Every resolve replies first. P1 is fixed, never filed away. isOutdated is not evidence.
  • One fix round, then re-verify and post @codex review explicitly, because the bot reviews on open and on request but never on a push. Confirmed on chore: delete and rebuild the harness #676: its only review landed at 17:23:33Z while commits ran to 17:35:14Z.

Two jump references changed meaning, not digits

0 blocking -> step 12 and all CLOSED -> step 12 used to mean "hand over" and now mean "go to the bot pass". A mechanical renumber would have skipped the new step on the cleanest and most common path so the PRs with nothing wrong would be exactly the ones whose second reviewer nobody read. The any OPEN branch reaches it too, report-only.

Preflight, both halves hardened

  • 0a now asserts the ACTIVE gh account owns the target remote, not merely that some account is logged in. This PR hit that exact failure: the push was refused for thomas-luizon_iqpay after the work was done. gh auth status shows both accounts as "Logged in", so reading it for a checkmark passes while the run is doomed. Same gap ORB-170's proving run recorded.
  • 0b runs once per distinct repo, not once per ticket, so concurrent fetch and merge --ff-only cannot race on .git/index.

The visual layer is deliberately absent

A visible-effect ticket runs, opens its PR, and is not moved to In Review. The run prints visual check owed and you look with /dev-server. The screenshots existed to prove visual correctness before a machine merged, and no machine merges. This deletes an entire planned layer and makes the 51 visible-effect tickets queueable at the same time.

Two contracts amended rather than left contradictory

  • §5.3 rule 6 now scopes "round" to the frozen cross-vendor list, or the bot fix round reads as a forbidden third round.
  • The merge prohibition now says what it means: never merges unasked. You asking for a merge in a later turn is the intended path. --admin, the raw REST and GraphQL paths, force pushes and pushes to main stay blocked in every case, run or no run.

Verification

node tools/test-tools.mjs           ORBIT TOOLS GATE OK
node .claude/hooks/test-hooks.mjs   ORBIT HOOKS OK
node tools/check-dashes.mjs         clean
launch-worker --dry-run             codex / gpt-5.6-sol / default   (config change did not trip the staleness guard)

gh stack proved on these two branches: gh stack init adopted main <- tools <- skill and found the PR for the lower branch.

.agents/skills/orchestrate/SKILL.md is byte-identical to main; it is a pointer that carries no behaviour so the two hosts cannot fork. The description: frontmatter grew 43 bytes (304 to 347) against D32's 23,981-byte total.

caps.parallelTickets is 3, not 8: each worktree is a full install, build and test run plus its own model session.

Refs ORB-179, ORB-180.

🤖 Generated with Claude Code

@vercel

vercel Bot commented Aug 5, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
orbit-ui-mobile-web Ignored Ignored Aug 5, 2026 5:06pm

Request Review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a51368bbc8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


```bash
git switch -c feature/orb-N-<slug> feature/orb-<parent>-<slug>
# and the worker's finishing contract opens the PR with: --base feature/orb-<parent>-<slug>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Pass the stack base into the worker prompt

When a queued ticket has stackParent, this line relies on the worker opening the child PR with --base feature/orb-<parent>-<slug>, but the only compose-prompt.mjs interface documented below has no base argument and the existing finishing contract still directs a PR to main. In a same-repo blocker queue, the child worker can therefore open its PR against main, causing the child PR to include the parent layer and defeating the stacked review/merge flow. Please carry the computed base branch into the composed prompt and remove the main-only finishing instruction for stacked tickets.

Useful? React with 👍 / 👎.

stale until this re-runs. `DELIVERED` continues; `STALE_PR` means the push did not land, so stop
and report; `OVERSIZE` hands over naming the overage and **never reverts the fix**.
2. Reply `fixed in <sha>` with the NEW sha, then resolve.
3. Post `@codex review` as a comment and read once more.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Wait for the new Codex review after requesting it

After fixing a Codex thread, this instruction says to post @codex review and then read once more, but tools/list-bot-threads.mjs returns immediately when any prior bot review exists; it does not wait for a review submitted after the new head/comment. In the fix path, the run can therefore report the stale pre-fix bot verdict as the second pass, exactly the failure mode this step is intended to avoid. The reread needs a freshness condition, such as waiting for reviewedAt after the re-request or for a review on the current head.

Useful? React with 👍 / 👎.

@thomasluizon
thomasluizon force-pushed the feature/orchestrate-queue-skill branch 2 times, most recently from a65b985 to d34f3cd Compare August 5, 2026 16:53
@thomasluizon

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d34f3cd590

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +324 to +326
gh stack init --base main <parent-branch> <child-branch> [<grandchild-branch> ...]
gh stack submit # links the existing PRs into a Stack; --open marks them ready
gh stack view --json # machine-readable state, for the final report

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Require the gh-stack extension before stack commands

For stacked queues, this new linking step assumes gh stack is built into any sufficiently new gh, but I checked the installed CLI (gh 2.96.0) and gh stack --help only prints that it is an official extension and says to run gh extension install github/gh-stack. With a fresh CLI that meets the stated 2.90.0 version requirement but lacks the extension, the run will fail after the stack PRs are opened instead of linking/reporting them. Please add an extension preflight/install requirement before invoking these commands.

AGENTS.md reference: AGENTS.md:L15-L28

Useful? React with 👍 / 👎.

Comment on lines +557 to +558
- Codex threads: `N found, F fixed, R filed, X not applicable, U left open`, or
`BOT REVIEW ABSENT`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Surface body-level Codex change requests

When list-bot-threads.mjs returns CHANGES_REQUESTED with zero threads, which this step explicitly calls out as possible, the handoff only has a thread-count summary or BOT REVIEW ABSENT. That can report 0 found after a clean cross-vendor review while GitHub still has a body-level Codex changes-requested review blocking the PR, so the overnight summary may hide the only failing reviewer verdict. Please include the bot verdict/review state and leave CHANGES_REQUESTED open even when there are no inline threads.

Useful? React with 👍 / 👎.

thomasluizon and others added 2 commits August 5, 2026 14:06
Wires the three tools from the parent PR into the contract. /orchestrate now
takes one ticket, several, a project, or --auto, and grows --sleep, --parallel
and --auto. One ticket with no flags behaves exactly as it did.

--sleep opens pull requests and never merges one. Every piece of signing,
provenance, ledger and merge-sweep machinery the OLD --sleep needed stays
deleted, because nothing acts on a receipt. What makes an unattended run
trustworthy now is verify-delivery.mjs, which reads only artifacts and never a
worker's self-report. That is what was missing the first time.

Stacking, because nothing merges overnight: a ticket whose blocker is in the
same queue branches from its blocker's branch and targets it, since main will
not contain the blocker's work until morning. --base is passed to
verify-delivery too, or the size caps read the parent's commits as this
ticket's. A stack lives in one repository, so cross-repo blockers stay separate
pull requests and the api one deploys first.

New step 12 clears the Codex reviewer's threads, which nothing has ever read:
8 threads opened across #676, #680 and #681, 8 still unresolved, all merged.
The verdict comes from the presence of a review, never the thread count, and
NO_REVIEW is never reported as clean. Every resolve replies first. One fix
round, then re-verify and post @codex review explicitly, because the bot
reviews on open and on request but NEVER on a push: #676's only review landed
at 17:23:33Z while commits ran to 17:35:14Z.

Two jump references changed MEANING, not just digits. "0 blocking -> step 12"
and "all CLOSED -> step 12" used to mean "hand over" and now mean "go to the
bot pass"; a mechanical renumber would have skipped the new step on the
cleanest and most common path. The OPEN branch reaches it too, report-only.

Preflight 0a now asserts the ACTIVE gh account owns the target remote, not
merely that some account is logged in. This run hit the exact failure it
guards: a push refused for thomas-luizon_iqpay after the work was done.

Preflight 0b runs once per distinct repo rather than once per ticket, so
concurrent fetch and merge --ff-only cannot race on .git/index.

The visual layer is deliberately absent. A visible-effect ticket runs, opens
its pull request, and is NOT moved to In Review: the run prints "visual check
owed" and Thomas looks with /dev-server. The screenshots existed to prove
correctness before a machine merged, and no machine merges.

Amends the §5.3 round cap to scope "round" to the frozen cross-vendor list, or
the bot fix round reads as a forbidden third round. Amends the merge
prohibition to say what it means: never merges UNASKED. Thomas asking for a
merge in a later turn is the intended path; --admin, the raw REST and GraphQL
paths, force pushes and pushes to main stay blocked in every case.

caps.parallelTickets is 3, not 8: each worktree is a full install, build and
test run plus its own model session.

node tools/test-tools.mjs           ORBIT TOOLS GATE OK
node .claude/hooks/test-hooks.mjs   ORBIT HOOKS OK
node tools/check-dashes.mjs         clean

Refs ORB-179, ORB-180.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The step 12 text claimed the bot never reviews on a push, written from #676
alone. #682 falsified it the same day: it reviewed the old head, took a push,
and reviewed the new head seven minutes later.

Both shapes are now named, and the conclusion is stronger for it. A re-review is
luck, never the mechanism, so the explicit @codex review request stays and
list-bot-threads comparing review.commit.oid to the head is what makes the
verdict correct under either behaviour.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@thomasluizon
thomasluizon force-pushed the feature/orchestrate-queue-skill branch from d34f3cd to 8d3094b Compare August 5, 2026 17:06
@sonarqubecloud

sonarqubecloud Bot commented Aug 5, 2026

Copy link
Copy Markdown

@thomasluizon
thomasluizon merged commit 9304c8c into main Aug 5, 2026
26 checks passed
@thomasluizon
thomasluizon deleted the feature/orchestrate-queue-skill branch August 5, 2026 17:24
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.

1 participant