@the-vibe-company/armada 0.2.63 → 0.2.64
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -3
- package/dist/armada.js +134 -22
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -32,7 +32,7 @@ npm install -g @the-vibe-company/armada # then: armada status
|
|
|
32
32
|
2. **Enter the keys** once, on Organization > Keys: the Linear API key. It stays sealed in Armada: no laptop or runtime needs it, and no machine needs a database key either, since the CLI reaches the fleet's live data through Armada ([Keys](#keys)).
|
|
33
33
|
3. **Sign in from the terminal**: `armada login`, then approve the code in the browser. A headless coordinator sets `ARMADA_API_KEY` to an organization API key instead ([Sign in from a terminal](#sign-in-from-a-terminal)).
|
|
34
34
|
4. **Set up the repository**: `armada doctor` lists what it lacks, `armada init --program-root ABC-1` opens one pull request that adds it all ([Set up a repository](#set-up-a-repository)); merge it.
|
|
35
|
-
5. **Choose optional features.** Use the commented template and doctor’s `info` lines to configure deployment targets/smoke checks, known flakes and `[ci] setup_steps` for tool/dependency download outages before tests (exact names or `*` globs; 4xx stays a failure), acceptance checks, jobs and owner approval rules. Enable owner alerts/digests on Organization > Notifications, then select each coordinator’s name with `armada coordinator use <name>`. Launch cloud workers with `armada launch ABC-12 --runtime conductor`. For an existing checkout, follow [Upgrade an existing project](docs/runbook.md#upgrade-an-existing-project).
|
|
35
|
+
5. **Choose optional features.** Use the commented template and doctor’s `info` lines to configure deployment targets/smoke checks, known flakes and `[ci] setup_steps` for tool/dependency download outages before tests (exact names or `*` globs; registry/auth 4xx stays a failure except Docker’s explicit `toomanyrequests` during `Initialize containers`), acceptance checks, jobs and owner approval rules. Enable owner alerts/digests on Organization > Notifications, then select each coordinator’s name with `armada coordinator use <name>`. Launch cloud workers with `armada launch ABC-12 --runtime conductor`. For an existing checkout, follow [Upgrade an existing project](docs/runbook.md#upgrade-an-existing-project).
|
|
36
36
|
|
|
37
37
|
```sh
|
|
38
38
|
armada login
|
|
@@ -65,6 +65,7 @@ armada skills update # update pointers and vendored skills on y
|
|
|
65
65
|
`armada doctor` checks, in the repository you are in:
|
|
66
66
|
|
|
67
67
|
- `armada.toml` exists and is valid;
|
|
68
|
+
- the root `package.json` pins a supported `packageManager` (Bun, pnpm, npm or Yarn): a different local major/minor version warns with both versions and an alignment command. Matching and patch-only differences, or no pin, stay quiet. The same advisory line appears before a merge runs `[gates] local_commands`, using the test-merged tree's pin;
|
|
68
69
|
- the five `armada-*` skills are discovery pointers in `.agents/skills`, linked from `.claude/skills`; their descriptions trigger Claude Code and Codex to run `armada skill <name> [<file>]` and follow the installed CLI version. `skills-lock.json` records their pointer hashes with `sourceType: "armada-cli"` and a tagged GitHub source link. The scripted `ship-pr-dev`, `review-code-dev` and `capture-learning-tools` packages stay fully vendored and checked by their folder hashes;
|
|
69
70
|
- `.conductor/settings.toml` has a `[scripts] setup` command;
|
|
70
71
|
- `.gitignore` ignores `plans/ship-pr-dev/`;
|
|
@@ -188,6 +189,8 @@ armada report ready-to-merge --pr 34 --sha <full 40-character head SHA>
|
|
|
188
189
|
armada release --reason "wrong ticket"
|
|
189
190
|
```
|
|
190
191
|
|
|
192
|
+
If a worker's ticket is already Done (for example, another pull request covered it), the coordinator runs `armada stop ABC-12 --superseded "covered by another change"`. It posts the reason, releases the pinned claim, ends only that generation's Armada worker sessions and archives its runtime workspace, preserving Done. Herdr still requires a clean, fully pushed worktree. If archival fails after release, retry the same command. `armada release --ticket ABC-12 --reason "covered by another change"` also preserves Done, leaving runtime archival to `armada stop ABC-12`. Unfinished tickets keep ordinary release/stop behavior; `--superseded` requires Done.
|
|
193
|
+
|
|
191
194
|
Set `[policy] max_workers = 10` to cap project-wide worker sessions, including workers waiting for merge and launches that have not claimed yet. Coordinator sessions and waiting launch requests use no slots. At the cap, `armada launch` creates nothing: use `armada launch ABC-12 --when-unblocked` to wait for a slot or `--over-cap "<why>"` to launch anyway. Linear Urgent priority passes automatically. Bypasses carry their count and reason in pending-launch status and the activity feed; `brief --prompt` enforces the same cap, and relaunch replacements are exempt. Status shows `Workers 8 of 10`; watch lists waiting launches separately and keeps listening for their slot. Lowering the cap stops no running worker. Deploy the API migration before using the new CLI; older CLIs ignore this opt-in policy.
|
|
192
195
|
|
|
193
196
|
Queue a launch with `armada launch ABC-12 --when-unblocked [--runtime conductor|herdr] [--notes <file|->]`. It selects its profile from current labels when it starts, unless `--profile` pins one explicitly. Runtime, notes text and the profile's reason are saved; explicit launch-time options win. Requests expire after seven days with one inbox notice. Repeat the queue command to renew the same request, preserving omitted options and resetting attempts; decline with `armada answer <id> "<why>"`. Closed tickets resolve automatically, and a launched worker waiting to claim stays quiet. The running watch starts eligible requests oldest first, at most one per poll, when a blocker closes or a slot frees. Successful starts stay quiet in plain watch and show in status; failures reach the inbox. Re-arm watch for retries after five then fifteen minutes, at most three attempts total; unknown creations are never retried blindly and guided Claude Code profiles remain manual. Automatic admission checks coordinator ownership, cancellation and expiry; `coordinator take` carries the request. Deploy the dashboard first.
|
|
@@ -215,13 +218,13 @@ armada inbox --wait # returns when a new item arrives, or after --tim
|
|
|
215
218
|
armada ack '#12' --reason "No further action needed" # deliberately skip a notice, with the reason on its ticket
|
|
216
219
|
armada answer 12 "SQLite, for the first slice." # delivers and records the answer
|
|
217
220
|
armada answer 13 "approved" # delivers and records plan approval
|
|
218
|
-
armada answer --note ABC-12 "
|
|
221
|
+
armada answer --note ABC-12 "PR #12 is DIRTY: resolve conflicts and hand back the new green head" # an action needed, same path
|
|
219
222
|
```
|
|
220
223
|
|
|
221
224
|
If Conductor does not confirm an answer or note, Armada keeps its original message id and masked text. The command exits 1; nothing is posted on Linear and the question stays open. Keep `armada watch` running: it retries with delays of 1, 2, 5, 10 and 20 minutes (six tries total). Rerunning the same command reuses the kept delivery. A successful newer answer retires the older one; a replaced or released worker is never sent the old answer. Unconfirmed merge notices use the same path and skip workers that handed back. A permanent refusal or exhausted tries creates one `delivery-failed` inbox item; inspect the session and record your decision with `armada answer <item> "<why>"`. Status, inbox and the stop hook keep pending deliveries visible. A confirmed send is never repeated if recording fails. Herdr deliveries have no message id: inspect before retrying. Never send a kept message by hand too. Deploy the API and migration before the CLI.
|
|
222
225
|
|
|
223
226
|
|
|
224
|
-
- Hand-backs already in the merge queue show their position or drain step as in progress in the inbox, watch and dashboard. They need no new coordinator action. A worker reporting another phase clears its previous hand-back; its next `ready-to-merge` report wakes the watch again. Confirmed merges clear that PR's queue refusals and owner merge requests, with cleared ids in the result line. The next inbox read also clears notices for PRs merged elsewhere, using the stored GitHub reading.
|
|
227
|
+
- Hand-backs already in the merge queue show their position or drain step as in progress in the inbox, watch and dashboard. They need no new coordinator action. A worker reporting another phase clears its previous hand-back; its next `ready-to-merge` report wakes the watch again. A "main moved" notice or heads-up with no requested action needs no worker report: keep `ready-to-merge` when the PR is `CLEAN` or `BEHIND`. Integrate main only if GitHub says `DIRTY`, resolve conflicts, rerun checks, push and hand back the new green head; the coordinator's merge updates and retests a merely behind branch. Coordinators send handed-back workers a note only when they need an action (a conflict or requested change). Confirmed merges clear that PR's queue refusals and owner merge requests, with cleared ids in the result line. The next inbox read also clears notices for PRs merged elsewhere, using the stored GitHub reading.
|
|
225
228
|
- `ask` reports the `blocked` phase with `Agent status: blocked — question: <first line>` (the rest and the numbered options below it) and adds a `question` item to the coordinator's inbox on Armada. The worker then stops and waits for the answer in its session, and reports the phase it resumes. It finds the ticket like `report`.
|
|
226
229
|
- `report awaiting-approval` adds a `plan` item with the full message (and the `--plan` block) and worker handle to the coordinator's inbox. Same-phase heartbeats neither duplicate nor reopen it. Answering it, recording a note, leaving the phase or releasing the ticket closes the plan and any pending approval request. For a pre-approved plan (the brief's "Plan" line says which), post the plan with `report implementing --plan-file -` instead: no approval item is needed.
|
|
227
230
|
- Long runs go through `armada job`, on the project’s runner. A running job whose progress stays unchanged past `[jobs.<name>] stall_minutes` (default 60) shows `stalled N min` in job list/status and a stalled tag in the job strip, and creates one `job-stalled` inbox wake per stall. Check with `armada job status <id>` and stop deliberately with `armada job stop <id>`. Fraction progress (`n/m`) ignores changing ETA/clock text; movement clears the alert. Silence takes precedence; absent progress is never stalled. The alert never stops a job and only covers runs tracked through Armada jobs.
|
package/dist/armada.js
CHANGED
|
@@ -4581,7 +4581,10 @@ var NETWORK = [
|
|
|
4581
4581
|
pattern: /fatal: unable to access '[^']+': (?:Could not resolve host|Failed to connect|The requested URL returned error: 5\d\d|Operation timed out)/
|
|
4582
4582
|
},
|
|
4583
4583
|
{ name: "rpc", pattern: /RPC failed; HTTP 5\d\d/ },
|
|
4584
|
-
{
|
|
4584
|
+
{
|
|
4585
|
+
name: "docker",
|
|
4586
|
+
pattern: /Error response from daemon: .*(?:net\/http|i\/o timeout|toomanyrequests|context deadline exceeded|Client\.Timeout exceeded)/
|
|
4587
|
+
},
|
|
4585
4588
|
{ name: "python", pattern: /ReadTimeoutError: HTTPSConnectionPool|Max retries exceeded with url/ },
|
|
4586
4589
|
{ name: "http", pattern: /(?:Unexpected HTTP response|status code does not indicate success): 5\d\d/i }
|
|
4587
4590
|
];
|
|
@@ -4600,12 +4603,16 @@ function networkSetupFailure(check, log, setupSteps) {
|
|
|
4600
4603
|
const setup = import_picomatch.default(["Set up job", "Initialize containers", "Run actions/*", ...setupSteps], { dot: true });
|
|
4601
4604
|
const firstError = log.findIndex((line) => line.includes("##[error]"));
|
|
4602
4605
|
const prefix = log.slice(0, firstError < 0 ? log.length : firstError + 1);
|
|
4603
|
-
|
|
4606
|
+
const clientError = (line) => {
|
|
4607
|
+
const evidence = step.name === "Initialize containers" && /Error response from daemon: toomanyrequests\b/.test(line) ? line.replace(/\b429\b/g, "") : line;
|
|
4608
|
+
return CLIENT_ERROR.test(evidence);
|
|
4609
|
+
};
|
|
4610
|
+
if (!hasNetworkFailure(prefix) || prefix.some(clientError))
|
|
4604
4611
|
return { networkNote: "network error does not establish the first failure as a setup outage" };
|
|
4605
4612
|
if (!setup(step.name))
|
|
4606
4613
|
return { networkStep: step.name };
|
|
4607
|
-
const cleanup = (name) => steps.slice(0, failed + 1).some((parent) => parent.conclusion !== "skipped" && setup(parent.name) && (name === `Post ${parent.name}` || parent.name.startsWith("Run ") && name === `Post ${parent.name.slice(4)}`));
|
|
4608
|
-
if (steps.slice(0, failed).some((s) => s.conclusion !== "skipped" && (!setup(s.name) || s.conclusion !== "success")) || steps.slice(failed + 1).some((s) => s.conclusion !== "skipped" && !cleanup(s.name) && s.name !== "Complete job"))
|
|
4614
|
+
const cleanup = (name, conclusion) => step.name === "Initialize containers" && name === "Stop containers" && conclusion === "success" || steps.slice(0, failed + 1).some((parent) => parent.conclusion !== "skipped" && setup(parent.name) && (name === `Post ${parent.name}` || parent.name.startsWith("Run ") && name === `Post ${parent.name.slice(4)}`));
|
|
4615
|
+
if (steps.slice(0, failed).some((s) => s.conclusion !== "skipped" && (!setup(s.name) || s.conclusion !== "success")) || steps.slice(failed + 1).some((s) => s.conclusion !== "skipped" && !cleanup(s.name, s.conclusion) && s.name !== "Complete job"))
|
|
4609
4616
|
return { networkNote: "network error found, user steps ran or step evidence is incomplete" };
|
|
4610
4617
|
return { runnerReason: `network, in setup step "${step.name}"` };
|
|
4611
4618
|
}
|
|
@@ -7577,10 +7584,14 @@ var projectOf = (config) => ({
|
|
|
7577
7584
|
repository: config.github.repository,
|
|
7578
7585
|
programRoot: config.tracker.programRoot
|
|
7579
7586
|
});
|
|
7580
|
-
async function
|
|
7587
|
+
async function readTicket(ctx, id) {
|
|
7581
7588
|
const ticket = await ctx.linear.readTicket(id);
|
|
7582
7589
|
if (!ticket)
|
|
7583
7590
|
throw new Refusal(`ticket ${id} not found in Linear`, "armada status, to see the tickets of the program");
|
|
7591
|
+
return ticket;
|
|
7592
|
+
}
|
|
7593
|
+
async function readOpenTicket(ctx, id) {
|
|
7594
|
+
const ticket = await readTicket(ctx, id);
|
|
7584
7595
|
if (ticket.statusType === "completed" || ticket.statusType === "canceled")
|
|
7585
7596
|
throw new Refusal(`${ticket.id} is ${ticket.statusType}; there is nothing to work on`, "armada status, to pick a ticket ready to start");
|
|
7586
7597
|
return ticket;
|
|
@@ -7928,7 +7939,11 @@ ${reportMessage}` : reportMessage,
|
|
|
7928
7939
|
async function releaseTicket(ctx, input) {
|
|
7929
7940
|
const { config, linear } = ctx;
|
|
7930
7941
|
const groups = config.tracker.labels;
|
|
7931
|
-
const ticket = await readOpenTicket(ctx, input.ticket);
|
|
7942
|
+
const ticket = input.requireOpen ? await readOpenTicket(ctx, input.ticket) : await readTicket(ctx, input.ticket);
|
|
7943
|
+
if (input.completedOnly && ticket.statusType !== "completed")
|
|
7944
|
+
throw new Refusal(`${ticket.id}: --superseded requires a Done ticket`, "armada status");
|
|
7945
|
+
if (ticket.statusType === "canceled")
|
|
7946
|
+
throw new Refusal(`${ticket.id} is canceled; there is nothing to work on`, "armada status");
|
|
7932
7947
|
if (!ticket.agentPhase && !ticket.agentRuntime && !activeClaimComments(ticket.comments).length && !input.claim)
|
|
7933
7948
|
throw new Refusal(`${ticket.id} is not claimed; there is nothing to release`, "armada status, to see which tickets are in flight");
|
|
7934
7949
|
const holder = activeClaimComments(ticket.comments)[0]?.claim;
|
|
@@ -13963,15 +13978,15 @@ var skills_generated_default = [
|
|
|
13963
13978
|
files: [
|
|
13964
13979
|
{
|
|
13965
13980
|
path: "MERGE.md",
|
|
13966
|
-
content: "# Merging a pull request\n\n`armada merge <pr>` merges one handed-back pull request and does everything around it. It checks the rules below, takes the project's merge lock, squash-merges pinned to the head it checked, confirms the merge on GitHub, records it on Armada, then closes the ticket in Linear and cleans up. When it refuses, fix the cause (usually: the worker fixes CI or a conflict and hands back again) rather than merging by hand.\n\n## Read the result\n\nEvery run ends with one `Result:` line. Never pipe the command through `tail` or `grep`: read that line and what precedes it.\n\n- `Result: merged #N`: merged, and the bookkeeping is done.\n- `Result: not merged (…)`: no merge was confirmed; the worker and its workspace are untouched. If it says `merge unconfirmed`, GitHub may have accepted the attempt: look at the pull request before retrying.\n- `Result: merged #N, Linear pending (armada merge --finish N)`: merged; finish Linear once it answers.\n- A result naming `Armada and Linear pending`: run the printed `armada answer <hand-back id> \"resolved: PR merged\"` line as well as `--finish`.\n- Merged at a different head from the one checked: the merge stands, the mismatch is printed, and nothing is recorded or archived. Check GitHub before finishing.\n\nA confirmed merge exits 0 even with Linear pending. `--dry-run` runs the checklist only and ends `Result: not merged`. `--json` prints one object with the same text in its `result` field.\n\n## What it checks\n\n1. The worker handed back: phase `ready-to-merge`, with the full head SHA it reported. The pull request's head is that SHA, or that SHA with only the default branch merged in (a clean merge, checked with git).\n2. GitHub says `CLEAN` (or `HAS_HOOKS`), not a draft, with a Commitizen title.\n3. Every required check (`[gates] required_checks`, else all of them) passes, and no review thread is open.\n4. The head contains the default branch, or a test merge passes `[gates] local_commands`.\n5. No merge hold is open, unless you pass `--through-hold`.\n6. With `[policy] merge_approval`, you judged it (below); a pull request sent to the owner needs their approval of that head.\n7. With `[[acceptance]]`, the checklist lists the recorded acceptance passes on the head. The worker's hand-back already required them.\n\nOne check stays yours: search the default branch for callers of anything the pull request deletes or renames.\n\nA confirmed merge clears that PR's open queue refusals and owner merge requests. The result line names the cleared item ids. A PR merged elsewhere clears those notices on the next inbox read from Armada's stored GitHub reading. Queued `--no-ticket` merges clear notices when the queue finishes; a direct `--no-ticket` merge clears them on that next reading when the refusal names the PR or the merge request carries its PR number. A failed cleanup write is a warning: GitHub's confirmed merge stays successful, and the stored reading retries resolution.\n\n## Red checks on a pull request\n\n`armada ci why <pr>` names the failing tests, shows the failed step and its test error excerpt, and explains runner problems. For unknown tests it prints up to three pasteable `[[ci.known_failure]]` blocks with exact-name patterns. Only declare a flake after it passed on a rerun of the same head: open the root-cause ticket first, then replace `<root-cause ticket>` (the parser rejects the placeholder). When no test name was found, write a specific pattern from the error lines. `armada ci why <pr> --rerun` reruns failed jobs once per completed first-attempt workflow run only when every failure is a runner problem or a declared `[[ci.known_failure]]`, and names each flake's root-cause ticket. Nothing reruns automatically. Send other failures back to the worker.\n\nNetwork outages qualify as runner problems only in setup before tests/builds run, with validated step evidence. Registry/auth 4xx stays a failure. Built-in setup steps are `Set up job`, `Initialize containers` and `Run actions/*`; declare other tool/dependency downloads as exact names or `*` globs in `[ci] setup_steps`. Without step evidence, the network error stays a failure; the CLI explains unavailable evidence or hints how to declare an undeclared setup step.\n\n## After a confirmed merge\n\n`armada merge` does these by itself, in order. Do none of them by hand.\n\n1. **Records** the merge on Armada first, then closes the ticket in Linear: Done, agent labels removed, pull request linked, a merged comment saying how the merge was decided.\n2. **Tells affected workers.** Workers whose open pull request shares files with what landed get a short \"main moved\" note through their runtime; changes to `[merge] notify_paths` (CI workflows by default) or an incomplete file reading concern every working pull request. Workers without a pull request, already handed back, or owned by another coordinator stay quiet, and the output says why. A note that could not be delivered is printed: deliver it in the worker's session with the runtime guide's manual commands, after checking the claim is still that worker's and an unknown outcome did not already arrive. Never send it with `armada answer --note`, which posts it on the ticket and resolves an open plan. `--no-notify` sends nothing and prints the list instead.\n3. **Archives the merged worker's workspace** once GitHub confirmed the merge. `--no-archive` keeps it. A cleanup failure leaves the merge successful and prints the exact `armada stop <ticket> …` command to finish it; copy it whole.\n4. **Closes the spec** when this was its last open ticket, with a summary, unless the team's parent auto-close does it. A failure there is a warning only.\n5. **Lists unblocked tickets** under `Unblocked by <ticket>`: those ready to launch with their routed `armada brief <id> --prompt` command, those without a ready label, parked ones, and those that still wait on other blockers. Tickets you deferred with `armada launch --when-unblocked` are launched in the same run; one it cannot launch (a Claude Code profile, no ready label, a failed launch) keeps its request and prints the command to run.\n6. **Starts the deploy check** for each matching `[[deploy.target]]` and prints `Watching the deploy of <sha> to <target>`. If it prints an `armada deploy watch …` command instead, run that in a persistent terminal.\n7. Ends with the watch line: keep watching while workers are in flight.\n\n## Main kept moving: `--wait`\n\nWorkers hand back without chasing main, and main moves between a green hand-back and its merge. Do not ask the worker to bring main in. Without `--wait`, a head that lacks commits of main is refused, except when GitHub does not require heads to be up to date (it does not say `BEHIND`) and `[gates] local_commands` is set: Armada then test-merges it locally and runs those commands. Run `armada merge <pr> --wait [--timeout <min>]` (30 minutes by default) in the background:\n\n- In that test-merge case `--wait` test-merges too, so a busy main does not restart CI each time. Otherwise a behind head that merges cleanly is updated with GitHub's \"update branch\" (a merge commit, no force-push), its required checks are waited for, then it merges pinned to the new head. The updated head still counts as the hand-back.\n- It holds the merge lock only while merging, so two waits never block each other.\n- It stops at once on a red check, a conflict, an open hold, any refused rule, or when GitHub refuses the update. Send the cause to the worker; after an update, the worker pulls before pushing again.\n\n## A queue: `--when-green` and `--drain`\n\nWhen several pull requests are handed back, queue them instead of merging each by hand:\n\n```sh\narmada merge --when-green 12 15 --reason \"CLI only\"\narmada merge --drain\n```\n\n- `--when-green <pr...>` records durable intent, in order, with each entry's `--reason`, `--no-ticket`, `--keep-open` or `--through-hold`. It refuses broken rules now and lets readiness (CI, a behind branch, an owner decision, a hold) wait. Queuing starts nothing.\n- `armada merge --drain` merges the queue one entry at a time, in the background in a persistent terminal. Each behind branch is updated on GitHub and its checks waited for on that exact head (`[merge] queue_retest = \"ci\"`, the default; `\"local\"` uses `[gates] local_commands` instead), so the next entry always starts on the fresh main. Each merge runs every after-merge step above.\n- An open hold pauses the drain and names it; an entry queued with `--through-hold` passes it. At `--timeout <min per entry>` a paused drain exits and the entry returns to the queue without counting an attempt: clear the hold once recovery is checked, then run the drain again. The queue stays in order: a fix queued behind a paused entry waits its turn, so remove the earlier entry first when the fix must go ahead. A refused rule removes that entry, leaves one `queue-refused` inbox item and goes on with the next: fix the cause and queue it again, which clears the item, or close it with `armada answer <id> \"<why>\"`.\n- The owner's Merge button on the dashboard queues a pull request handed back at its current head: `queued_by` is the owner, and the reason, \"merge asked on the dashboard by <owner>\", serves as the `[policy] merge_approval` judgement. Any other press stays a `merge-request` for you. Queued entries with a free `merge-queue` lease and no change for 2 minutes show one `queue-stalled` item per stall: run `armada merge --drain`. The project page and `armada status` (\"Merge queue\") show the queue and the drain's current step.\n- Temporary failures retry three times (after 1, 5 and 15 minutes). A killed drain resumes its entry, reading GitHub first so a merge is never done twice. One drain runs per project; `--json` prints one object per line.\n- `armada merge queue` lists the queue and entries finished in the last day; `armada merge queue remove <pr>` removes one that has not started.\n\n## The owner's merge rule: `--reason` and `--ask-owner`\n\n`[policy] merge_approval` says in plain words which merges the owner approves first. Without it, merge on your own. With it, `armada merge` prints the rule; judge each pull request by its files and what users will see:\n\n- It may merge on its own: `armada merge <pr> --reason \"<why>\"`, for example `--reason \"CLI only\"`.\n- The rule keeps it for the owner: `armada merge <pr> --ask-owner --reason \"<why>\"`. It merges nothing. It puts the pull request (title, files, CI, preview, the ticket's screenshots) on the owner's Validations page and prints the approval link: send it with one question judged in about a minute, never a diff to read. Their decision arrives as a `decision` item; then `armada merge <pr>`. A new head, other than main merged in, needs a new approval.\n\n## A ticket in several pull requests\n\nA hand-back with `--more-prs \"<what remains>\"` is one part of its ticket. Merge it as usual: every check applies. After the merge the ticket returns to `implementing`, its worker stays signed in with its workspace, and Armada tells it to start the next part from the updated main. The final pull request, handed back without the flag, closes the ticket as usual. `armada merge <pr> --keep-open` keeps a ticket open when the hand-back did not say so; `--close` closes it despite the flag. Neither goes with `--no-ticket` or with the other.\n\n## No ticket: `--no-ticket`\n\n`armada merge <pr> --no-ticket` merges a pull request no ticket owns: the `armada init` pull request or a release pull request. Nothing is written to Linear; every other check stays. A branch named after a ticket is refused unless you add `--reason \"<why the ticket stays open>\"`, which is posted on the pull request. When none of the required checks ran on the head (a release pull request opened with the workflow's own token), it passes on GitHub's own state once the head is a minute old.\n\n## Linear is down\n\nAfter its retries, a Linear outage does not stop a merge when Armada holds an open hand-back for the same pull request and exact head: the command says `Linear did not answer; the hand-back was checked on Armada`. After the merge, the remaining Linear work becomes a `linear-pending` inbox item, `Finish Linear for #N`. Run `armada merge --finish <pr>` once Linear answers: it checks GitHub shows the merge, completes the ticket, and resolves the item. Repeating it writes nothing more; it also finishes a pull request merged by hand. Without a matching hand-back on Armada, the merge is refused and nothing is merged.\n\n## Holds, main red and deploys\n\n- `armada hold` lists the project's merge holds, shared by every coordinator; status, inbox and watch show them until cleared. They never expire.\n- `armada hold add \"<reason>\"` pauses merges. `armada merge <pr> --through-hold \"<why this fixes it>\"` merges a fix and records the reason with every hold id; the holds stay open. After verifying the recovery, `armada hold clear <id> --reason \"<what was verified>\"`.\n- `main red since #N` names the oldest failing merge since the last green commit and its failing checks; `a fix is running (#M)` follows when one is. A refreshed red main reading opens one `main-red` hold and wakes watch once per streak. It pauses single merges and the queue; merge the fix with `armada merge <pr> --through-hold \"<why this fixes it>\"`. The next green main reading clears that hold and its inbox item automatically. Running or absent checks leave it open. Clearing it by hand while main is red lets the next refresh reopen it. GitHub CI webhooks are needed for prompt detection; without refreshes no automatic pause opens.\n- With `[[deploy.target]]`, each merge starts a watcher. A failed deploy or smoke check opens a `deploy` hold and one inbox item. `armada deploy status` shows each target; `not deployed (host skipped: …)` ends quietly, opens no hold and does not clear an ancestor’s failure. Retry a failed deploy with `armada deploy retry <target>`; use `--no-redeploy` to recheck after a redeploy on the host. Never `hold clear` a deploy hold before a recheck says healthy. Merge a code fix through the hold; the next healthy deploy of a commit that contains it clears the deploy hold by itself.\n- `--no-lock` skips both the merge lock and the hold check. Use it only when Armada is down and you checked no other coordinator is merging.\n\n## Live acceptance\n\n`[[acceptance]]` declares live checks (a real build, a preview run) with their paths, timeouts and run caps. A worker runs `armada acceptance run` on its pushed head before handing back, and the hand-back is refused without a pass on that exact head. When a worker reaches the cap, judge the cause, then `armada acceptance allow <ticket> --runs 2 --reason \"<why>\"`.\n\n## The release pull request\n\nSome repositories publish through release-please: every merge opens or updates one release pull request (`chore(main): release <version>`, label `autorelease: pending`, a diff of the changelog, manifest and version fields only). Follow the repository's release rules (`AGENTS.md`).\n\n- On a release train, leave it open: the scheduled run merges and publishes it. For an urgent fix, run the release workflow the rules name, for example `gh workflow run release.yml`.\n- Where the rules ask you to merge it, use `armada merge <n> --no-ticket`. No CI runs on it and it often shows `UNSTABLE`; both are expected. Anything else in its diff, or `DIRTY`, is not: stop and tell the owner.\n- After the release run, check the registry (for example `npm view <package> version`). If it did not publish, fix the cause and re-run the failed jobs of that run: a later push does not publish a version already tagged.\n\n## By hand\n\nOnly when `armada merge` cannot run, and following the same checks:\n\n```sh\ngh pr merge <n> --squash --match-head-commit <full-sha>\n```\n\n- One merge at a time per project.\n- Leave out `--delete-branch`: it deletes local worktrees that have the branch checked out, including other agents'.\n- On a GitHub 5xx, check `gh pr view <n> --json state` before retrying.\n- Then run `armada merge --finish <n>` to close the ticket, and `armada stop <ticket>` to archive the worker.\n- Finally, for every target declared in `[[deploy.target]]`, run `armada deploy watch --sha <merge commit sha> --target <name>` in the background. Wait for its healthy deploy and smoke result before resuming normal merges; a failure keeps the deploy hold open. With no declared targets, there is no deploy check.\n"
|
|
13981
|
+
content: "# Merging a pull request\n\n`armada merge <pr>` merges one handed-back pull request and does everything around it. It checks the rules below, takes the project's merge lock, squash-merges pinned to the head it checked, confirms the merge on GitHub, records it on Armada, then closes the ticket in Linear and cleans up. When it refuses, fix the cause (usually: the worker fixes CI or a conflict and hands back again) rather than merging by hand.\n\n## Read the result\n\nEvery run ends with one `Result:` line. Never pipe the command through `tail` or `grep`: read that line and what precedes it.\n\n- `Result: merged #N`: merged, and the bookkeeping is done.\n- `Result: not merged (…)`: no merge was confirmed; the worker and its workspace are untouched. If it says `merge unconfirmed`, GitHub may have accepted the attempt: look at the pull request before retrying.\n- `Result: merged #N, Linear pending (armada merge --finish N)`: merged; finish Linear once it answers.\n- A result naming `Armada and Linear pending`: run the printed `armada answer <hand-back id> \"resolved: PR merged\"` line as well as `--finish`.\n- Merged at a different head from the one checked: the merge stands, the mismatch is printed, and nothing is recorded or archived. Check GitHub before finishing.\n\nA confirmed merge exits 0 even with Linear pending. `--dry-run` runs the checklist only and ends `Result: not merged`. `--json` prints one object with the same text in its `result` field.\n\n## What it checks\n\n1. The worker handed back: phase `ready-to-merge`, with the full head SHA it reported. The pull request's head is that SHA, or that SHA with only the default branch merged in (a clean merge, checked with git).\n2. GitHub says `CLEAN` (or `HAS_HOOKS`), not a draft, with a Commitizen title.\n3. Every required check (`[gates] required_checks`, else all of them) passes, and no review thread is open.\n4. The head contains the default branch, or a test merge passes `[gates] local_commands`.\n5. No merge hold is open, unless you pass `--through-hold`.\n6. With `[policy] merge_approval`, you judged it (below); a pull request sent to the owner needs their approval of that head.\n7. With `[[acceptance]]`, the checklist lists the recorded acceptance passes on the head. The worker's hand-back already required them.\n\nOne check stays yours: search the default branch for callers of anything the pull request deletes or renames.\n\nA confirmed merge clears that PR's open queue refusals and owner merge requests. The result line names the cleared item ids. A PR merged elsewhere clears those notices on the next inbox read from Armada's stored GitHub reading. Queued `--no-ticket` merges clear notices when the queue finishes; a direct `--no-ticket` merge clears them on that next reading when the refusal names the PR or the merge request carries its PR number. A failed cleanup write is a warning: GitHub's confirmed merge stays successful, and the stored reading retries resolution.\n\n## Red checks on a pull request\n\n`armada ci why <pr>` names the failing tests, shows the failed step and its test error excerpt, and explains runner problems. For unknown tests it prints up to three pasteable `[[ci.known_failure]]` blocks with exact-name patterns. Only declare a flake after it passed on a rerun of the same head: open the root-cause ticket first, then replace `<root-cause ticket>` (the parser rejects the placeholder). When no test name was found, write a specific pattern from the error lines. `armada ci why <pr> --rerun` reruns failed jobs once per completed first-attempt workflow run only when every failure is a runner problem or a declared `[[ci.known_failure]]`, and names each flake's root-cause ticket. Nothing reruns automatically. Send other failures back to the worker.\n\nNetwork outages qualify as runner problems only in setup before tests/builds run, with validated step evidence. Container image pulls in `Initialize containers` qualify for Docker’s explicit `toomanyrequests`, auth timeouts and pull timeouts; successful `Stop containers` cleanup is allowed. Registry/auth 4xx stays a failure except that explicit Docker rate limit; any later project-step failure stays unsafe. Built-in setup steps are `Set up job`, `Initialize containers` and `Run actions/*`; declare other tool/dependency downloads as exact names or `*` globs in `[ci] setup_steps`. Without step evidence, the network error stays a failure; the CLI explains unavailable evidence or hints how to declare an undeclared setup step.\n\n## After a confirmed merge\n\n`armada merge` does these by itself, in order. Do none of them by hand.\n\n1. **Records** the merge on Armada first, then closes the ticket in Linear: Done, agent labels removed, pull request linked, a merged comment saying how the merge was decided.\n2. **Tells affected workers.** Workers whose open pull request shares files with what landed get a short \"main moved\" note through their runtime; changes to `[merge] notify_paths` (CI workflows by default) or an incomplete file reading concern every working pull request. Workers without a pull request, already handed back, or owned by another coordinator stay quiet, and the output says why. A note that could not be delivered is printed: deliver it in the worker's session with the runtime guide's manual commands, after checking the claim is still that worker's and an unknown outcome did not already arrive. Never send it with `armada answer --note`, which posts it on the ticket and resolves an open plan. `--no-notify` sends nothing and prints the list instead.\n3. **Archives the merged worker's workspace** once GitHub confirmed the merge. `--no-archive` keeps it. A cleanup failure leaves the merge successful and prints the exact `armada stop <ticket> …` command to finish it; copy it whole.\n4. **Closes the spec** when this was its last open ticket, with a summary, unless the team's parent auto-close does it. A failure there is a warning only.\n5. **Lists unblocked tickets** under `Unblocked by <ticket>`: those ready to launch with their routed `armada brief <id> --prompt` command, those without a ready label, parked ones, and those that still wait on other blockers. Tickets you deferred with `armada launch --when-unblocked` are launched in the same run; one it cannot launch (a Claude Code profile, no ready label, a failed launch) keeps its request and prints the command to run.\n6. **Starts the deploy check** for each matching `[[deploy.target]]` and prints `Watching the deploy of <sha> to <target>`. If it prints an `armada deploy watch …` command instead, run that in a persistent terminal.\n7. Ends with the watch line: keep watching while workers are in flight.\n\n## Main kept moving: `--wait`\n\nWorkers hand back without chasing main, and main moves between a green hand-back and its merge. Do not send heads-up notes to handed-back workers unless you need an action: a conflict (`DIRTY`) or a requested change. A `CLEAN` or `BEHIND` pull request keeps its hand-back; use the merge to update and retest a behind branch. The automatic \"main moved\" notice tells working workers to integrate only if GitHub says `DIRTY`, resolve conflicts, rerun checks, push and hand back the new green head. Without `--wait`, a head that lacks commits of main is refused, except when GitHub does not require heads to be up to date (it does not say `BEHIND`) and `[gates] local_commands` is set: Armada then test-merges it locally and runs those commands. Run `armada merge <pr> --wait [--timeout <min>]` (30 minutes by default) in the background:\n\n- In that test-merge case `--wait` test-merges too, so a busy main does not restart CI each time. Otherwise a behind head that merges cleanly is updated with GitHub's \"update branch\" (a merge commit, no force-push), its required checks are waited for, then it merges pinned to the new head. The updated head still counts as the hand-back.\n- Before local commands, Armada warns if the installed Bun, pnpm, npm or Yarn major/minor differs from the test-merged root `package.json`'s `packageManager` pin. Run the printed alignment command when local checks disagree with CI; `armada doctor` shows the same warning. This is advisory and does not refuse a merge.\n- It holds the merge lock only while merging, so two waits never block each other.\n- It stops at once on a red check, a conflict, an open hold, any refused rule, or when GitHub refuses the update. Send the cause to the worker; after an update, the worker pulls before pushing again.\n\n## A queue: `--when-green` and `--drain`\n\nWhen several pull requests are handed back, queue them instead of merging each by hand:\n\n```sh\narmada merge --when-green 12 15 --reason \"CLI only\"\narmada merge --drain\n```\n\n- `--when-green <pr...>` records durable intent, in order, with each entry's `--reason`, `--no-ticket`, `--keep-open` or `--through-hold`. It refuses broken rules now and lets readiness (CI, a behind branch, an owner decision, a hold) wait. Queuing starts nothing.\n- `armada merge --drain` merges the queue one entry at a time, in the background in a persistent terminal. Each behind branch is updated on GitHub and its checks waited for on that exact head (`[merge] queue_retest = \"ci\"`, the default; `\"local\"` uses `[gates] local_commands` instead), so the next entry always starts on the fresh main. Each merge runs every after-merge step above.\n- An open hold pauses the drain and names it; an entry queued with `--through-hold` passes it. At `--timeout <min per entry>` a paused drain exits and the entry returns to the queue without counting an attempt: clear the hold once recovery is checked, then run the drain again. The queue stays in order: a fix queued behind a paused entry waits its turn, so remove the earlier entry first when the fix must go ahead. A refused rule removes that entry, leaves one `queue-refused` inbox item and goes on with the next: fix the cause and queue it again, which clears the item, or close it with `armada answer <id> \"<why>\"`.\n- The owner's Merge button on the dashboard queues a pull request handed back at its current head: `queued_by` is the owner, and the reason, \"merge asked on the dashboard by <owner>\", serves as the `[policy] merge_approval` judgement. Any other press stays a `merge-request` for you. Queued entries with a free `merge-queue` lease and no change for 2 minutes show one `queue-stalled` item per stall: run `armada merge --drain`. The project page and `armada status` (\"Merge queue\") show the queue and the drain's current step.\n- Temporary failures retry three times (after 1, 5 and 15 minutes). A killed drain resumes its entry, reading GitHub first so a merge is never done twice. One drain runs per project; `--json` prints one object per line.\n- `armada merge queue` lists the queue and entries finished in the last day; `armada merge queue remove <pr>` removes one that has not started.\n\n## The owner's merge rule: `--reason` and `--ask-owner`\n\n`[policy] merge_approval` says in plain words which merges the owner approves first. Without it, merge on your own. With it, `armada merge` prints the rule; judge each pull request by its files and what users will see:\n\n- It may merge on its own: `armada merge <pr> --reason \"<why>\"`, for example `--reason \"CLI only\"`.\n- The rule keeps it for the owner: `armada merge <pr> --ask-owner --reason \"<why>\"`. It merges nothing. It puts the pull request (title, files, CI, preview, the ticket's screenshots) on the owner's Validations page and prints the approval link: send it with one question judged in about a minute, never a diff to read. Their decision arrives as a `decision` item; then `armada merge <pr>`. A new head, other than main merged in, needs a new approval.\n\n## A ticket in several pull requests\n\nA hand-back with `--more-prs \"<what remains>\"` is one part of its ticket. Merge it as usual: every check applies. After the merge the ticket returns to `implementing`, its worker stays signed in with its workspace, and Armada tells it to start the next part from the updated main. The final pull request, handed back without the flag, closes the ticket as usual. `armada merge <pr> --keep-open` keeps a ticket open when the hand-back did not say so; `--close` closes it despite the flag. Neither goes with `--no-ticket` or with the other.\n\n## No ticket: `--no-ticket`\n\n`armada merge <pr> --no-ticket` merges a pull request no ticket owns: the `armada init` pull request or a release pull request. Nothing is written to Linear; every other check stays. A branch named after a ticket is refused unless you add `--reason \"<why the ticket stays open>\"`, which is posted on the pull request. When none of the required checks ran on the head (a release pull request opened with the workflow's own token), it passes on GitHub's own state once the head is a minute old.\n\n## Linear is down\n\nAfter its retries, a Linear outage does not stop a merge when Armada holds an open hand-back for the same pull request and exact head: the command says `Linear did not answer; the hand-back was checked on Armada`. After the merge, the remaining Linear work becomes a `linear-pending` inbox item, `Finish Linear for #N`. Run `armada merge --finish <pr>` once Linear answers: it checks GitHub shows the merge, completes the ticket, and resolves the item. Repeating it writes nothing more; it also finishes a pull request merged by hand. Without a matching hand-back on Armada, the merge is refused and nothing is merged.\n\n## Holds, main red and deploys\n\n- `armada hold` lists the project's merge holds, shared by every coordinator; status, inbox and watch show them until cleared. They never expire.\n- `armada hold add \"<reason>\"` pauses merges. `armada merge <pr> --through-hold \"<why this fixes it>\"` merges a fix and records the reason with every hold id; the holds stay open. After verifying the recovery, `armada hold clear <id> --reason \"<what was verified>\"`.\n- `main red since #N` names the oldest failing merge since the last green commit and its failing checks; `a fix is running (#M)` follows when one is. A refreshed red main reading opens one `main-red` hold and wakes watch once per streak. It pauses single merges and the queue; merge the fix with `armada merge <pr> --through-hold \"<why this fixes it>\"`. The next green main reading clears that hold and its inbox item automatically. Running or absent checks leave it open. Clearing it by hand while main is red lets the next refresh reopen it. GitHub CI webhooks are needed for prompt detection; without refreshes no automatic pause opens.\n- With `[[deploy.target]]`, each merge starts a watcher. A failed deploy or smoke check opens a `deploy` hold and one inbox item. `armada deploy status` shows each target; `not deployed (host skipped: …)` ends quietly, opens no hold and does not clear an ancestor’s failure. Retry a failed deploy with `armada deploy retry <target>`; use `--no-redeploy` to recheck after a redeploy on the host. Never `hold clear` a deploy hold before a recheck says healthy. Merge a code fix through the hold; the next healthy deploy of a commit that contains it clears the deploy hold by itself.\n- `--no-lock` skips both the merge lock and the hold check. Use it only when Armada is down and you checked no other coordinator is merging.\n\n## Live acceptance\n\n`[[acceptance]]` declares live checks (a real build, a preview run) with their paths, timeouts and run caps. A worker runs `armada acceptance run` on its pushed head before handing back, and the hand-back is refused without a pass on that exact head. When a worker reaches the cap, judge the cause, then `armada acceptance allow <ticket> --runs 2 --reason \"<why>\"`.\n\n## The release pull request\n\nSome repositories publish through release-please: every merge opens or updates one release pull request (`chore(main): release <version>`, label `autorelease: pending`, a diff of the changelog, manifest and version fields only). Follow the repository's release rules (`AGENTS.md`).\n\n- On a release train, leave it open: the scheduled run merges and publishes it. For an urgent fix, run the release workflow the rules name, for example `gh workflow run release.yml`.\n- Where the rules ask you to merge it, use `armada merge <n> --no-ticket`. No CI runs on it and it often shows `UNSTABLE`; both are expected. Anything else in its diff, or `DIRTY`, is not: stop and tell the owner.\n- After the release run, check the registry (for example `npm view <package> version`). If it did not publish, fix the cause and re-run the failed jobs of that run: a later push does not publish a version already tagged.\n\n## By hand\n\nOnly when `armada merge` cannot run, and following the same checks:\n\n```sh\ngh pr merge <n> --squash --match-head-commit <full-sha>\n```\n\n- One merge at a time per project.\n- Leave out `--delete-branch`: it deletes local worktrees that have the branch checked out, including other agents'.\n- On a GitHub 5xx, check `gh pr view <n> --json state` before retrying.\n- Then run `armada merge --finish <n>` to close the ticket, and `armada stop <ticket>` to archive the worker.\n- Finally, for every target declared in `[[deploy.target]]`, run `armada deploy watch --sha <merge commit sha> --target <name>` in the background. Wait for its healthy deploy and smoke result before resuming normal merges; a failure keeps the deploy hold open. With no declared targets, there is no deploy check.\n\n## The loop’s hand-back\n\nA hand-back shown as `queued in the merge queue (position N)` or `merging: <drain step>` needs no new action; keep the drain running. A note that sends a worker back to work leaves the hand-back until that worker reports its resumed phase, which clears it; its next `ready-to-merge` report wakes the watch again.\n\nA `hand-back` entry means the worker reported `ready-to-merge` with green CI, resolved review threads and the full head SHA. Merge it with `armada merge <pr>`, following [MERGE.md](MERGE.md). The command checks everything, merges pinned to the handed-back head under the project's merge lock, and then, by itself:\n\n- archives the merged worker's workspace once GitHub confirms the merge (never archive by hand before that; `--no-archive` keeps it);\n- tells the working workers it concerns that main moved: those whose open pull requests share files with what landed, or all of them when `[merge] notify_paths` matched or the file reading was incomplete (never send those notes yourself);\n- closes the ticket, closes its spec when it was the last open ticket, and lists the tickets it unblocked, launching those you deferred when it can;\n- starts the deploy check when `[[deploy.target]]` is set;\n- ends with one `Result:` line. Read it: `Result: merged #N` is done; `Result: not merged (…)` confirmed no merge (if it says `merge unconfirmed`, look at GitHub before retrying); `Linear pending` means run `armada merge --finish <pr>` once Linear answers.\n\nWorkers hand back without chasing main, so a head is often behind: add `--wait` in the background; it updates it on GitHub and waits for its checks (without it, a behind head is refused unless `[gates] local_commands` can test-merge it). Several hand-backs at once: queue them with `armada merge --when-green <pr...>` and run `armada merge --drain` in the background; it merges them one at a time, each retested on fresh main. With `[policy] merge_approval`, judge each pull request and pass `--reason \"<why>\"`, or `--ask-owner --reason \"<why>\"` to send it to the owner first. A hand-back with `--more-prs` keeps its ticket and worker open after the merge; `--keep-open` and `--close` override that.\n\nDone when the pull request is merged, the result line says so, and nothing it printed is left to do.\n"
|
|
13967
13982
|
},
|
|
13968
13983
|
{
|
|
13969
13984
|
path: "REFERENCE.md",
|
|
13970
|
-
content: "# Coordinator reference\n\nDetail the loop in [SKILL.md](SKILL.md) points to. Read the section you need.\n\n## Coordinator guardrails\n\n- Never block the session with a foreground command for more than a minute. Run `armada merge <pr> --wait` in the background, or queue with `armada merge --when-green <pr...>` and run `armada merge --drain` in the background. Keep `armada watch` in the background while these run. A declared long job uses `armada job start <name> --ticket <id>` on its runner.\n- Write no ticket code yourself. A fix of any size needs a ticket and a worker: cut a ticket and launch a worker. Changes to `armada.toml` that Armada asks for also go through a worker pull request merged with `armada merge`.\n- Run Armada commands bare. Never pipe them into `grep`, `tail` or `head`, redirect them to `/dev/null`, wrap `2>&1 | …`, or append `|| true`: their last lines say whether it worked and what to do next. A wrapper once hid a failed urgent launch for 2 hours 35 minutes.\n- Merge through `armada merge`. When it cannot run, follow [By hand](MERGE.md#by-hand), then `armada merge --finish <n>` and the deploy check for every declared target.\n- When the owner asks where things stand, run `armada digest` and paste its text.\n\n## Named coordinators\n\nA project can share its work between coordinators, each with a name: `ARMADA_COORDINATOR=<name>` in the environment wins, then `armada coordinator use <name>` for this checkout, else `default`.\n\n- Every launch records the coordinator that made it, and the worker inherits that owner from its launch token; a worker cannot choose it.\n- `armada status --mine`, `armada inbox --mine` and a named coordinator's `armada watch` show its own workers and unowned items. `armada inbox --all` and `armada watch --all` show the whole fleet (`armada status --all` lists every registered project instead); `default` sees the whole fleet unless it passes `--mine`. Status always keeps the whole frontier and marks another coordinator's pending launch `launching by <name>`.\n- Inbox entries name their owner or say `unowned`. Ownership follows the open worker session, then the newest pending launch, then the item. Unowned alarms reach everyone until someone takes them.\n- `armada coordinator list` shows each name, its sessions and its tickets. `armada coordinator take ABC-12 --from <name>` moves a ticket's worker (or pending launch) to you atomically; the worker keeps its phase.\n- `armada status` names another coordinator's stranded tickets after twice `[policy] silence_minutes` without activity and prints the exact `armada coordinator take … --from <name>` command; take them when resuming that role's work.\n- Each name has its own watch lock on a machine: `armada watch --stop` stops yours, `armada watch --stop --name <name>` another's.\n- Your own coordination ticket is not a worker: the watch leaves out the claim whose handle is yours (`ARMADA_COORDINATOR_HANDLE`, else Conductor's workspace and session).\n\n## The Claude Code stop hook\n\nThe hook matches the `session_id` of a coordinator that ran `inbox`, `watch`, `brief`, `launch` or `merge`, across working folders. Unknown sessions fall back to the checkout where the coordinator last watched. A session coordinating several projects is held if any of them needs a watch; the reason names each project and checkout. Worker sessions (`ARMADA_TICKET`) never register or get held. A resumed session with a new id registers on its next coordinator command.\n\nThe watch's start and end, the last lines of coordinator commands, and `armada doctor` show `Stop hook on for this session (last ran HH:MM)`, `Stop hook installed in <file>; it confirms at your next turn end`, or `Stop hook NOT on: <why> — <fix>`. Installation alone is not proof that Claude loaded it: the next Stop records a local receipt. All hook reads are local and failures let the turn end.\n\nAt Stop, the hook also reads up to 1 MiB of new transcript lines for this coordinator session. A completed foreground Bash command over 60 seconds, raw `gh pr merge`, wrapped Armada output, or `git commit`/`gh pr create` produces one reminder per rule per session, with a safe program/subcommand summary (arguments omitted) and the replacement to run. Quoted examples, comments and heredoc data are ignored. A multi-project session reads its transcript once and uses the current checkout’s deploy config; outside known checkouts, each known target command names its config explicitly. The reminder joins the watch reason in one blocked Stop; later turns do not repeat that rule, even after compaction. A reentrant Stop skips habit reminders and keeps the watch guard. Workers, subagents and unknown sessions in other checkouts are excluded; `ARMADA_STOP_HOOK=off` disables these reminders too.\n\nArmada detects the command in user settings (`~/.claude/settings.json`) and the coordinator checkout's `.claude/settings.json` or `.claude/settings.local.json`. If the session starts elsewhere, add a command hook for Stop in user settings: `armada hook stop 2>/dev/null || true`. `armada init --merge` changes repository settings only. `ARMADA_STOP_HOOK=off` opts out; the banner says so.\n\n## The SessionStart brief\n\n`armada init` and `--merge` install both Stop and SessionStart in repository settings, once; one question accepts both, and `--no-stop-hook` skips both. `armada doctor` warns when SessionStart is missing. SessionStart matches `compact|resume` only; fresh startup still follows Start in SKILL.md.\n\nAfter compact or resume, `armada hook session-start` inserts plain text into Claude's context: `Armada: you coordinate <project> as <name> from <checkout>`, tickets with phases and ages, PRs and holds, up to 20 actionable inbox lines, and the watch and Stop-hook banners. The block is at most 60 lines. Run every Armada command from the named checkout; read `armada status --mine` and `armada inbox --mine` before acting. Its final line tells you to start `armada watch` with Bash `run_in_background` when none runs. The hook never starts a watch itself. A live read records presence and only the inbox keys actually shown; omitted items can still wake the watch.\n\nLive reads share a 15-second deadline and are aborted on expiry. If unavailable or refused, the brief uses the last local tickets, read time and open jobs, and names the status/inbox recovery commands. All hook errors allow the session to start. Workers (`ARMADA_TICKET`) get nothing.\n\nResolution uses the Stop hook's registry first, then the coordinator checkout for unknown ids. A resumed session with a new id outside that checkout gets nothing. To deliver hooks for sessions starting elsewhere, install both commands at user level in `~/.claude/settings.json`: Stop runs `armada hook stop 2>/dev/null || true` (timeout 10); SessionStart runs `armada hook session-start 2>/dev/null || true` with matcher `compact|resume` (timeout 30). Init only changes repository settings.\n\n## The watch\n\nPlain `armada watch` waits until a new own or unowned item you have not been shown needs you (a question, plan, request, hand-back, merge hold, deploy failure, job notice, silent, stopped or unstarted worker), prints it and exits. Items owned by another named coordinator stay in the listing, marked `owner: <name>`, but do not wake you, even with `--all`. Reading `armada inbox` preserves shown history; `--mine` cannot prune keys from a broader `--all` read. It exits with `nothing to watch` when nothing in its scope is in flight or open. Armada being down does not end it. A timeout prints the resume command and re-arm line on stdout; start it again when it ends without news. `--for <minutes>` bounds it cleanly.\n\nStarting another plain watch is safe: it waits locally for the verified holder, then prints the holder's stdout/stderr and exit code here. A JSON waiter behind a plain holder wraps the result and captured streams in JSON; stop results stay JSON too. The private result file keeps the most recent 100 generations so a fast later holder does not erase the awaited receipt. If the holder dies without a result, a waiter takes over. `armada watch --stop` ends the holder and its waiters. A follow holder remains a stream: another watch only says it is following. Keep the watch in your harness's tracked background command; never put `&` inside a foreground command or hide its output.\n\nUnder Claude Code (`CLAUDECODE` set), either watch defaults to 100 minutes, leaving margin before the two-hour background limit. It prints the bound at start and in its final output. If a dead watch left an identity-bearing lock without a completion result and its observed lifetime was between five minutes and the current bound, Armada remembers that shorter limit and ends the next watch after 90% of it (rounded down, minimum five minutes). New locks keep a wall-clock watch start alongside the OS process identity; older timestamp identities can also teach a limit, while legacy PID-only locks cannot. `--for <minutes>` overrides the automatic bound.\n\n`armada watch --follow` prints one line per item and keeps running:\n\n- `--for <minutes>` ends it with `resume: armada watch --follow …`; the Claude Code automatic bound applies unless you set it.\n- A restart resumes this machine's stored cursor for your coordinator name. `--since <cursor>` resumes elsewhere and shows every open item once, marked `open`.\n- `--tickets ABC-1,ABC-2` and `--kinds question,hand-back` filter lines. `--kinds claim,report,release,merge,handover` (or `all`) adds informational events; `handover` is a report entering ready-to-merge. `--json` prints NDJSON with a cursor on every line.\n- A printed line counts as seen, even if your harness never read it: use follow only where every line reaches you. Harnesses that wake only when a command ends keep plain watch.\n\nBoth modes share one lock per project and name on a machine. `armada inbox --wait [--timeout <seconds>]` (300 by default) is the fallback for a runtime that cannot run a background command.\n\nPlain watch also reminds about open questions, plans, unqueued hand-backs, owner requests and decisions, runtime approval prompts, queue refusals, and unstarted or stopped workers. `[policy] coordinator_minutes` sets the first interval (10 by default); subsequent intervals double. Reminders are anchored to the first show: at 10, 30 and 70 minutes by default, even if you list the inbox between them. The output marks `! still waiting since HH:MM UTC`. `coordinator_minutes = 0` disables reminders. Other coordinators' items and queued hand-backs never remind. Losing the machine watch state restarts the clock at the next listing; follow mode retains its once-per-key stream.\n\n`armada ack <#id or key> --reason \"<why>\"` records a deliberate skip of a notice, with its reason on the ticket. It hides that entry until its key changes. A higher silence level or another merged blocker is a new key. The command refuses questions, plans, hand-backs, owner requests, approval prompts and holds, and names the action that resolves them. A ticketless notice stays recorded in Armada only; if its Linear comment fails, post the printed text yourself. Deploy the API and its migration before the new CLI.\n\nEligible notices are `queue-refused`, `deploy`, `job`, `unblocked`, `silent`, `quiet`, `stopped`, `not-started`, `job-silent` and `queue-stalled`. Derived entries print `key <entry key>` on their head line. The ticket note preserves the worker's phase. Comment creation is attempted once; never retry it blindly after a failure.\n\n## Kept deliveries\n\nAn unconfirmed Conductor answer, note or merge notice stays in Armada. The command exits 1 without posting an answer on Linear or closing its question. Keep `armada watch` running: plain and follow modes retry at most three due deliveries per poll, with the same message id and stored masked text. The delays are 1, 2, 5, 10 and 20 minutes, with six tries including the first send. Rerunning the same answer command reuses that delivery; edited text creates another, and confirming it retires the older pending answer for that item.\n\nBefore each send Armada checks the worker generation and ownership. Merge notices also skip sessions that handed back. A changed or released worker, a permanent refusal or six unconfirmed tries produces one `delivery-failed` inbox item naming the ticket and the first line of the message. Inspect the session, decide the next step, then `armada answer <failure item> \"<why>\"` records your reason without sending it. A later successful answer for the ticket also resolves its failure item. Never send a kept message by hand too.\n\nConfirmed delivery is terminal before Linear and inbox recording. A recording warning asks you to inspect the ticket; Armada never sends that confirmed message again. Pending deliveries appear in status and inbox and keep the stop hook listening. Without a watch they wait. Herdr and Claude Code have no keyed delivery and stay on their runtime guide's inspect-first path. Deploy the pending-delivery API and migration before this CLI.\n\n## Worker caps\n\n`[policy] max_workers` caps project-wide worker sessions, including open claims waiting for merge and unclaimed launches. A full fleet refuses a new launch: use `armada launch <ticket> --when-unblocked` to wait for a slot, or `armada launch <ticket> --over-cap \"<why>\"` for a recorded bypass. Never use relaunch to bypass the cap; it replaces an existing worker. Urgent tickets pass automatically with a recorded reason. Status and re-arm lines show running workers separately from launches waiting for a slot. Without this setting, launches are uncapped; lowering it stops no worker.\n\n## Silence and liveness\n\n- **Silent**: no heartbeat, report or answer for `[policy] silence_minutes` (15 by default). A worker's first allowance adds `launch_grace_minutes` (defaults to `silence_minutes`). Shipping at stage `ci` gets `ci_wait_minutes` (45 by default). Waiting phases (`awaiting-approval`, `blocked`, `awaiting-validation`) are never silent while unanswered.\n- **Conductor sessions are observed**: a session Armada sees working is only called silent past twice the allowance, and the alert says it is still working. A session idle in a working phase for five minutes without a report or answer is `stopped`: nothing will wake it.\n- A silence wakes the watch at its allowance, then at twice, four times and each doubling after.\n- **Quiet**: a live worker without a report for `quiet_minutes` (45 by default) is a note for you only.\n- **Launch failed or uncertain**: `launch-failed` and `launch-uncertain` are recorded immediately for an attempted runtime launch, including deferred launches during merge/drain. The watch wakes on them. Read the reason and run the item’s `Next:` command. Failed launches and recovered but unconfirmed launches exit 1; preflight refusals still exit 2. An uncertain launch retains its token: inspect the worker before retrying creation. The `Launched` line and dry-run plan include the ticket title; JSON includes `title`. Repeated failures rewrite the same open item. It closes on the next claim, a successful launch binding, `armada launch revoke <ticket>`, or `armada answer <id> \"<why>\"`. Recording on Armada is best-effort; a recording warning never turns failure into success.\n- **Not started**: no claim `not_started_minutes` (10 by default) after the launch. An unused token that expired produces one notice, then clears. An open `launch-failed` or `launch-uncertain` item suppresses this notice for its ticket.\n- Claims end by themselves when their ticket is Done or Canceled, their hand-back merged, their session was revoked or their workspace archived.\n\n## Upgrades\n\n`armada status` and `armada inbox` mention a new Armada release at most once a day; ordinary releases leave the watch running. Only a CLI below the server minimum stops either watch mode with a `version` item, worded `Armada <x> required (you run <y>)`. Setup behind gets a separate daily notice in status, inbox and plain watch's final output: “This project's Armada setup is behind <version>: `armada upgrade`, then merge the setup pull request it opens.” Setup drift leaves the watch running. Run `armada upgrade`: it waits for npm, installs the release, checks `armada --version`, and runs `armada init --merge` only when the project's setup is outdated. Workers in flight keep the version their brief pinned.\n\n## Specs\n\nSpecs are direct children of the program root, titled `Spec N — Name` (`Spec N/M — Name` is read too).\n\n- `armada spec add \"<name>\"` appends one with the **In short** template in the root's Linear project and the team's first backlog state (first to-do state if there is no backlog); it prints the project (or `no project`), state and URL. With neither state available, it keeps Linear's default. Earlier titles are untouched. Creation is never retried automatically: check Linear before running the command again after a failure.\n- `armada spec add \"<name>\" --at 5` previews the renames a middle insertion needs; repeat with `--apply` to write them.\n- `armada spec renumber` previews a repair of gaps, duplicates and stale totals; `--apply` writes it.\n- `[tracker] spec_titles = \"N/M\"` keeps totals in every title; appending then needs `--apply` too.\n- Writes are sequential and stop at the first failure, listing what was not confirmed: inspect Linear before retrying.\n\nCheck the printed project and state after creation. Fill in the **In short** template before cutting the spec's tickets, then run `armada lint <ticket>` on each one.\n\nWhen `armada merge` closes a spec's last open ticket, it closes the spec with a summary, unless the team's own parent auto-close does it.\n\n## Secrets\n\nThe secrets workers need (an LLM key, a test database URL) are kept per project in Armada, and workers use them through `armada run -- <command>`.\n\n- `armada secrets` lists the names, never a value. `armada doctor` names those `[secrets] names` expects and Armada lacks.\n- An owner or admin sets one with `armada secrets set <NAME>` (hidden prompt), `--value-stdin`, or `--from-env <VAR>`, which moves a variable without anyone reading it; `--org` sets it for every project. `armada secrets unset <NAME>` removes it.\n- Anyone else asks with `armada secrets request <NAME> --ticket <id> --reason \"<why>\"`: the owner gets a link and types the value into the vault. Repeated requests reuse one link.\n- Never put a value on a command line, in a brief, in notes or in chat. A value pasted anywhere must be rotated.\n\n## Long jobs\n\nLong runs (an evaluation, a backfill, a load test) run on the project's own runner, declared in `[jobs.<name>]` with its start, status and stop commands. Never run them in a session.\n\n- `armada job start <name> --ticket <id>` dispatches one and stores its runner reference; `armada job status` asks the runner, `armada job list` reads stored progress.\n- `armada job stop <id>` stops one on purpose; nothing is stopped automatically, even when its ticket is Done.\n- A runner can push progress with `armada job beat <id> --progress \"40/120\"`, signed in with an organization API key.\n- A running job with progress unchanged past `[jobs.<name>] stall_minutes` (60 by default) shows `stalled` and a `job-stalled` inbox alert. Check it with `armada job status <id>`; use `armada job stop <id>` only when you intend to stop it. Fraction progress (`n/m`) ignores ETA/clock changes; movement clears the alert and a later stall wakes the watch again. Silent jobs take precedence, and jobs without progress are never stalled. This only covers runs tracked through `armada job`; the alert never stops the job.\n- A job without news past its silence limit is a `job-silent` entry; a finished job leaves one `job` notice. Check it, or deliberately leave the notice alone with `armada ack <#id or key> --reason \"<why>\"`.\n- `armada job recover <id> --ref <reference>` attaches a runner reference that a lost answer did not record.\n\n## Shared resources\n\nMigration numbers, ports and other shared names are reserved per ticket through Armada: `armada reserve <key> --next --floor <n>` for numbers, `--value <name>` for names. `armada reserve --list` shows the holders. A release frees a ticket's reservations; a merge keeps them used for good. Declare well-known keys in `[[reservations]]` so briefs list them.\n\n## The owner's channel\n\nOrganization > Notifications (owner or admin) connects one chat webhook. Owner validations, escalated questions and a stopped coordinator with items waiting reach it by themselves, outside quiet hours. Each named coordinator is checked separately, including owner requests and project-wide operational items. A coordinator that keeps running commands also triggers one alert per unanswered plan, question, hand-back, decision or owner request after 3 × `[policy] coordinator_minutes` (30 minutes by default); queued or paused merges are excluded. Finished specs send their Linear link once after the next reading. A merge pause still open after five minutes sends its reason and project link; clearing a recorded pause sends “merges resume”. Short pauses and pre-channel history stay quiet. These milestones are channel-only, follow the alerts toggle, and are retained during quiet hours for the next summary. Act on the inbox rather than relying on command activity to keep these alerts quiet. GitHub and Linear webhook refreshes check alerts even with no live worker or viewer. Digests go out at the times set there; `armada digest --send` posts one now, and `armada digest --lang en|fr` overrides `[tracker] language` for the printed text.\n\n## Waiting launches\n\n`armada launch <ticket> --when-unblocked [--profile <name>] [--runtime conductor|herdr] [--notes <file|->]` remembers a launch until its Linear blockers close or a worker slot frees. `--after <blocker>` asserts an existing Linear relation. Without `--profile`, routing uses the ticket's labels when it starts; an explicit profile stays pinned, with its reason. Runtime and notes text survive until launch; explicit options when firing override the stored values.\n\nRequests expire after seven days. The inbox shows one expiry notice with the renew/decline commands. Repeat `armada launch <ticket> --when-unblocked` to renew the same request for seven more days and reset its attempt budget; omitted options preserve its pin and context. Decline with `armada answer <id> \"<why>\"`. Completed or cancelled tickets close their request automatically. A launched worker waiting to claim is shown quietly in status.\n\nThe running watch starts eligible requests itself, oldest first, at most one per poll, when any blocker closes or a worker slot frees. Successful starts stay quiet in plain watch and appear in status and the next re-arm line; follow prints a `launched` line, respecting `--tickets` and `--kinds` (use `--kinds launched` for starts alone). Merge/drain still fire the tickets that their merge unblocked. Only this coordinator's requests fire, with no cap bypass. Herdr starts on the watch's machine; automatic launches never prompt to install tools.\n\nFire-time admission checks cancellation, expiry and ownership; launch rechecks the request after preflight and fresh Linear readiness, including the ready label. Known failures, including missing runtime tools, arrive as one rewritten `launch-failed` inbox item. Keep/re-arm watch to retry after five minutes, then fifteen minutes, at most three attempts total. The third failure says `gave up after 3 failed launches`; renew or decline deliberately. An uncertain creation keeps its pending launch even after token expiry: inspect and revoke it before another automatic creation. Guided Claude Code profiles stay manual inbox work with `armada brief ... --prompt` for the Agent tool. `coordinator take` transfers the waiting request too. Missing readings or unavailable admission/attempt metadata prevent automatic firing: deploy the dashboard before the CLI.\n"
|
|
13985
|
+
content: "# Coordinator reference\n\nDetail the loop in [SKILL.md](SKILL.md) points to. Read the section you need.\n\n## Coordinator guardrails\n\n- Never block the session with a foreground command for more than a minute. Run `armada merge <pr> --wait` in the background, or queue with `armada merge --when-green <pr...>` and run `armada merge --drain` in the background. Keep `armada watch` in the background while these run. A declared long job uses `armada job start <name> --ticket <id>` on its runner.\n- Write no ticket code yourself. A fix of any size needs a ticket and a worker: cut a ticket and launch a worker. Changes to `armada.toml` that Armada asks for also go through a worker pull request merged with `armada merge`.\n- Run Armada commands bare. Never pipe them into `grep`, `tail` or `head`, redirect them to `/dev/null`, wrap `2>&1 | …`, or append `|| true`: their last lines say whether it worked and what to do next. A wrapper once hid a failed urgent launch for 2 hours 35 minutes.\n- Merge through `armada merge`. When it cannot run, follow [By hand](MERGE.md#by-hand), then `armada merge --finish <n>` and the deploy check for every declared target.\n- When the owner asks where things stand, run `armada digest` and paste its text.\n\n## Named coordinators\n\nA project can share its work between coordinators, each with a name: `ARMADA_COORDINATOR=<name>` in the environment wins, then `armada coordinator use <name>` for this checkout, else `default`.\n\n- Every launch records the coordinator that made it, and the worker inherits that owner from its launch token; a worker cannot choose it.\n- `armada status --mine`, `armada inbox --mine` and a named coordinator's `armada watch` show its own workers and unowned items. `armada inbox --all` and `armada watch --all` show the whole fleet (`armada status --all` lists every registered project instead); `default` sees the whole fleet unless it passes `--mine`. Status always keeps the whole frontier and marks another coordinator's pending launch `launching by <name>`.\n- Inbox entries name their owner or say `unowned`. Ownership follows the open worker session, then the newest pending launch, then the item. Unowned alarms reach everyone until someone takes them.\n- `armada coordinator list` shows each name, its sessions and its tickets. `armada coordinator take ABC-12 --from <name>` moves a ticket's worker (or pending launch) to you atomically; the worker keeps its phase.\n- `armada status` names another coordinator's stranded tickets after twice `[policy] silence_minutes` without activity and prints the exact `armada coordinator take … --from <name>` command; take them when resuming that role's work.\n- Each name has its own watch lock on a machine: `armada watch --stop` stops yours, `armada watch --stop --name <name>` another's.\n- Your own coordination ticket is not a worker: the watch leaves out the claim whose handle is yours (`ARMADA_COORDINATOR_HANDLE`, else Conductor's workspace and session).\n\n## The Claude Code stop hook\n\nThe hook matches the `session_id` of a coordinator that ran `inbox`, `watch`, `brief`, `launch` or `merge`, across working folders. Unknown sessions fall back to the checkout where the coordinator last watched. A session coordinating several projects is held if any of them needs a watch; the reason names each project and checkout. Worker sessions (`ARMADA_TICKET`) never register or get held. A resumed session with a new id registers on its next coordinator command.\n\nThe watch's start and end, the last lines of coordinator commands, and `armada doctor` show `Stop hook on for this session (last ran HH:MM)`, `Stop hook installed in <file>; it confirms at your next turn end`, or `Stop hook NOT on: <why> — <fix>`. Installation alone is not proof that Claude loaded it: the next Stop records a local receipt. All hook reads are local and failures let the turn end.\n\nAt Stop, the hook also reads up to 1 MiB of new transcript lines for this coordinator session. A completed foreground Bash command over 60 seconds, raw `gh pr merge`, wrapped Armada output, or `git commit`/`gh pr create` produces one reminder per rule per session, with a safe program/subcommand summary (arguments omitted) and the replacement to run. Quoted examples, comments and heredoc data are ignored. A multi-project session reads its transcript once and uses the current checkout’s deploy config; outside known checkouts, each known target command names its config explicitly. The reminder joins the watch reason in one blocked Stop; later turns do not repeat that rule, even after compaction. A reentrant Stop skips habit reminders and keeps the watch guard. Workers, subagents and unknown sessions in other checkouts are excluded; `ARMADA_STOP_HOOK=off` disables these reminders too.\n\nArmada detects the command in user settings (`~/.claude/settings.json`) and the coordinator checkout's `.claude/settings.json` or `.claude/settings.local.json`. If the session starts elsewhere, add a command hook for Stop in user settings: `armada hook stop 2>/dev/null || true`. `armada init --merge` changes repository settings only. `ARMADA_STOP_HOOK=off` opts out; the banner says so.\n\n## The SessionStart brief\n\n`armada init` and `--merge` install both Stop and SessionStart in repository settings, once; one question accepts both, and `--no-stop-hook` skips both. `armada doctor` warns when SessionStart is missing. SessionStart matches `compact|resume` only; fresh startup still follows [Start](#start).\n\nAfter compact or resume, `armada hook session-start` inserts plain text into Claude's context: `Armada: you coordinate <project> as <name> from <checkout>`, tickets with phases and ages, PRs and holds, up to 20 actionable inbox lines, and the watch and Stop-hook banners. The block is at most 60 lines. Run every Armada command from the named checkout; read `armada status --mine` and `armada inbox --mine` before acting. Its final line tells you to start `armada watch` with Bash `run_in_background` when none runs. The hook never starts a watch itself. A live read records presence and only the inbox keys actually shown; omitted items can still wake the watch.\n\nLive reads share a 15-second deadline and are aborted on expiry. If unavailable or refused, the brief uses the last local tickets, read time and open jobs, and names the status/inbox recovery commands. All hook errors allow the session to start. Workers (`ARMADA_TICKET`) get nothing.\n\nResolution uses the Stop hook's registry first, then the coordinator checkout for unknown ids. A resumed session with a new id outside that checkout gets nothing. To deliver hooks for sessions starting elsewhere, install both commands at user level in `~/.claude/settings.json`: Stop runs `armada hook stop 2>/dev/null || true` (timeout 10); SessionStart runs `armada hook session-start 2>/dev/null || true` with matcher `compact|resume` (timeout 30). Init only changes repository settings.\n\n## The watch\n\nPlain `armada watch` waits until a new own or unowned item you have not been shown needs you (a question, plan, request, hand-back, merge hold, deploy failure, job notice, silent, stopped or unstarted worker), prints it and exits. Items owned by another named coordinator stay in the listing, marked `owner: <name>`, but do not wake you, even with `--all`. Reading `armada inbox` preserves shown history; `--mine` cannot prune keys from a broader `--all` read. It exits with `nothing to watch` when nothing in its scope is in flight or open. Armada being down does not end it. A timeout prints the resume command and re-arm line on stdout; start it again when it ends without news. `--for <minutes>` bounds it cleanly.\n\nStarting another plain watch is safe: it waits locally for the verified holder, then prints the holder's stdout/stderr and exit code here. A JSON waiter behind a plain holder wraps the result and captured streams in JSON; stop results stay JSON too. The private result file keeps the most recent 100 generations so a fast later holder does not erase the awaited receipt. If the holder dies without a result, a waiter takes over. `armada watch --stop` ends the holder and its waiters. A follow holder remains a stream: another watch only says it is following. Keep the watch in your harness's tracked background command; never put `&` inside a foreground command or hide its output.\n\nUnder Claude Code (`CLAUDECODE` set), either watch defaults to 100 minutes, leaving margin before the two-hour background limit. It prints the bound at start and in its final output. If a dead watch left an identity-bearing lock without a completion result and its observed lifetime was between five minutes and the current bound, Armada remembers that shorter limit and ends the next watch after 90% of it (rounded down, minimum five minutes). New locks keep a wall-clock watch start alongside the OS process identity; older timestamp identities can also teach a limit, while legacy PID-only locks cannot. `--for <minutes>` overrides the automatic bound.\n\n`armada watch --follow` prints one line per item and keeps running:\n\n- `--for <minutes>` ends it with `resume: armada watch --follow …`; the Claude Code automatic bound applies unless you set it.\n- A restart resumes this machine's stored cursor for your coordinator name. `--since <cursor>` resumes elsewhere and shows every open item once, marked `open`.\n- `--tickets ABC-1,ABC-2` and `--kinds question,hand-back` filter lines. `--kinds claim,report,release,merge,handover` (or `all`) adds informational events; `handover` is a report entering ready-to-merge. `--json` prints NDJSON with a cursor on every line.\n- A printed line counts as seen, even if your harness never read it: use follow only where every line reaches you. Harnesses that wake only when a command ends keep plain watch.\n\nBoth modes share one lock per project and name on a machine. `armada inbox --wait [--timeout <seconds>]` (300 by default) is the fallback for a runtime that cannot run a background command.\n\nPlain watch also reminds about open questions, plans, unqueued hand-backs, owner requests and decisions, runtime approval prompts, queue refusals, and unstarted or stopped workers. `[policy] coordinator_minutes` sets the first interval (10 by default); subsequent intervals double. Reminders are anchored to the first show: at 10, 30 and 70 minutes by default, even if you list the inbox between them. The output marks `! still waiting since HH:MM UTC`. `coordinator_minutes = 0` disables reminders. Other coordinators' items and queued hand-backs never remind. Losing the machine watch state restarts the clock at the next listing; follow mode retains its once-per-key stream.\n\n`armada ack <#id or key> --reason \"<why>\"` records a deliberate skip of a notice, with its reason on the ticket. It hides that entry until its key changes. A higher silence level or another merged blocker is a new key. The command refuses questions, plans, hand-backs, owner requests, approval prompts and holds, and names the action that resolves them. A ticketless notice stays recorded in Armada only; if its Linear comment fails, post the printed text yourself. Deploy the API and its migration before the new CLI.\n\nEligible notices are `queue-refused`, `deploy`, `job`, `unblocked`, `silent`, `quiet`, `stopped`, `not-started`, `job-silent` and `queue-stalled`. Derived entries print `key <entry key>` on their head line. The ticket note preserves the worker's phase. Comment creation is attempted once; never retry it blindly after a failure.\n\n## Kept deliveries\n\nAn unconfirmed Conductor answer, note or merge notice stays in Armada. The command exits 1 without posting an answer on Linear or closing its question. Keep `armada watch` running: plain and follow modes retry at most three due deliveries per poll, with the same message id and stored masked text. The delays are 1, 2, 5, 10 and 20 minutes, with six tries including the first send. Rerunning the same answer command reuses that delivery; edited text creates another, and confirming it retires the older pending answer for that item.\n\nBefore each send Armada checks the worker generation and ownership. Merge notices also skip sessions that handed back. A changed or released worker, a permanent refusal or six unconfirmed tries produces one `delivery-failed` inbox item naming the ticket and the first line of the message. Inspect the session, decide the next step, then `armada answer <failure item> \"<why>\"` records your reason without sending it. A later successful answer for the ticket also resolves its failure item. Never send a kept message by hand too.\n\nConfirmed delivery is terminal before Linear and inbox recording. A recording warning asks you to inspect the ticket; Armada never sends that confirmed message again. Pending deliveries appear in status and inbox and keep the stop hook listening. Without a watch they wait. Herdr and Claude Code have no keyed delivery and stay on their runtime guide's inspect-first path. Deploy the pending-delivery API and migration before this CLI.\n\n## Worker caps\n\n`[policy] max_workers` caps project-wide worker sessions, including open claims waiting for merge and unclaimed launches. A full fleet refuses a new launch: use `armada launch <ticket> --when-unblocked` to wait for a slot, or `armada launch <ticket> --over-cap \"<why>\"` for a recorded bypass. Never use relaunch to bypass the cap; it replaces an existing worker. Urgent tickets pass automatically with a recorded reason. Status and re-arm lines show running workers separately from launches waiting for a slot. Without this setting, launches are uncapped; lowering it stops no worker.\n\n## Silence and liveness\n\n- **Silent**: no heartbeat, report or answer for `[policy] silence_minutes` (15 by default). A worker's first allowance adds `launch_grace_minutes` (defaults to `silence_minutes`). Shipping at stage `ci` gets `ci_wait_minutes` (45 by default). Waiting phases (`awaiting-approval`, `blocked`, `awaiting-validation`) are never silent while unanswered.\n- **Conductor sessions are observed**: a session Armada sees working is only called silent past twice the allowance, and the alert says it is still working. A session idle in a working phase for five minutes without a report or answer is `stopped`: nothing will wake it.\n- A silence wakes the watch at its allowance, then at twice, four times and each doubling after.\n- **Quiet**: a live worker without a report for `quiet_minutes` (45 by default) is a note for you only.\n- **Launch failed or uncertain**: `launch-failed` and `launch-uncertain` are recorded immediately for an attempted runtime launch, including deferred launches during merge/drain. The watch wakes on them. Read the reason and run the item’s `Next:` command. Failed launches and recovered but unconfirmed launches exit 1; preflight refusals still exit 2. An uncertain launch retains its token: inspect the worker before retrying creation. The `Launched` line and dry-run plan include the ticket title; JSON includes `title`. Repeated failures rewrite the same open item. It closes on the next claim, a successful launch binding, `armada launch revoke <ticket>`, or `armada answer <id> \"<why>\"`. Recording on Armada is best-effort; a recording warning never turns failure into success.\n- **Not started**: no claim `not_started_minutes` (10 by default) after the launch. An unused token that expired produces one notice, then clears. An open `launch-failed` or `launch-uncertain` item suppresses this notice for its ticket.\n- Claims end by themselves when their ticket is Done or Canceled, their hand-back merged, their session was revoked or their workspace archived.\n\n## Upgrades\n\n`armada status` and `armada inbox` mention a new Armada release at most once a day; ordinary releases leave the watch running. Only a CLI below the server minimum stops either watch mode with a `version` item, worded `Armada <x> required (you run <y>)`. Setup behind gets a separate daily notice in status, inbox and plain watch's final output: “This project's Armada setup is behind <version>: `armada upgrade`, then merge the setup pull request it opens.” Setup drift leaves the watch running. Run `armada upgrade`: it waits for npm, installs the release, checks `armada --version`, and runs `armada init --merge` only when the project's setup is outdated. Workers in flight keep the version their brief pinned.\n\n## Specs\n\nSpecs are direct children of the program root, titled `Spec N — Name` (`Spec N/M — Name` is read too).\n\n- `armada spec add \"<name>\"` appends one with the **In short** template in the root's Linear project and the team's first backlog state (first to-do state if there is no backlog); it prints the project (or `no project`), state and URL. With neither state available, it keeps Linear's default. Earlier titles are untouched. Creation is never retried automatically: check Linear before running the command again after a failure.\n- `armada spec add \"<name>\" --at 5` previews the renames a middle insertion needs; repeat with `--apply` to write them.\n- `armada spec renumber` previews a repair of gaps, duplicates and stale totals; `--apply` writes it.\n- `[tracker] spec_titles = \"N/M\"` keeps totals in every title; appending then needs `--apply` too.\n- Writes are sequential and stop at the first failure, listing what was not confirmed: inspect Linear before retrying.\n\nCheck the printed project and state after creation. Fill in the **In short** template before cutting the spec's tickets, then run `armada lint <ticket>` on each one.\n\nWhen `armada merge` closes a spec's last open ticket, it closes the spec with a summary, unless the team's own parent auto-close does it.\n\n## Secrets\n\nThe secrets workers need (an LLM key, a test database URL) are kept per project in Armada, and workers use them through `armada run -- <command>`.\n\n- `armada secrets` lists the names, never a value. `armada doctor` names those `[secrets] names` expects and Armada lacks.\n- An owner or admin sets one with `armada secrets set <NAME>` (hidden prompt), `--value-stdin`, or `--from-env <VAR>`, which moves a variable without anyone reading it; `--org` sets it for every project. `armada secrets unset <NAME>` removes it.\n- Anyone else asks with `armada secrets request <NAME> --ticket <id> --reason \"<why>\"`: the owner gets a link and types the value into the vault. Repeated requests reuse one link.\n- Never put a value on a command line, in a brief, in notes or in chat. A value pasted anywhere must be rotated.\n\n## Long jobs\n\nLong runs (an evaluation, a backfill, a load test) run on the project's own runner, declared in `[jobs.<name>]` with its start, status and stop commands. Never run them in a session.\n\n- `armada job start <name> --ticket <id>` dispatches one and stores its runner reference; `armada job status` asks the runner, `armada job list` reads stored progress.\n- `armada job stop <id>` stops one on purpose; nothing is stopped automatically, even when its ticket is Done.\n- A runner can push progress with `armada job beat <id> --progress \"40/120\"`, signed in with an organization API key.\n- A running job with progress unchanged past `[jobs.<name>] stall_minutes` (60 by default) shows `stalled` and a `job-stalled` inbox alert. Check it with `armada job status <id>`; use `armada job stop <id>` only when you intend to stop it. Fraction progress (`n/m`) ignores ETA/clock changes; movement clears the alert and a later stall wakes the watch again. Silent jobs take precedence, and jobs without progress are never stalled. This only covers runs tracked through `armada job`; the alert never stops the job.\n- A job without news past its silence limit is a `job-silent` entry; a finished job leaves one `job` notice. Check it, or deliberately leave the notice alone with `armada ack <#id or key> --reason \"<why>\"`.\n- `armada job recover <id> --ref <reference>` attaches a runner reference that a lost answer did not record.\n\n## Shared resources\n\nMigration numbers, ports and other shared names are reserved per ticket through Armada: `armada reserve <key> --next --floor <n>` for numbers, `--value <name>` for names. `armada reserve --list` shows the holders. A release frees a ticket's reservations; a merge keeps them used for good. Declare well-known keys in `[[reservations]]` so briefs list them.\n\n## The owner's channel\n\nOrganization > Notifications (owner or admin) connects one chat webhook. Owner validations, escalated questions and a stopped coordinator with items waiting reach it by themselves, outside quiet hours. Each named coordinator is checked separately, including owner requests and project-wide operational items. A coordinator that keeps running commands also triggers one alert per unanswered plan, question, hand-back, decision or owner request after 3 × `[policy] coordinator_minutes` (30 minutes by default); queued or paused merges are excluded. Finished specs send their Linear link once after the next reading. A merge pause still open after five minutes sends its reason and project link; clearing a recorded pause sends “merges resume”. Short pauses and pre-channel history stay quiet. These milestones are channel-only, follow the alerts toggle, and are retained during quiet hours for the next summary. Act on the inbox rather than relying on command activity to keep these alerts quiet. GitHub and Linear webhook refreshes check alerts even with no live worker or viewer. Digests go out at the times set there; `armada digest --send` posts one now, and `armada digest --lang en|fr` overrides `[tracker] language` for the printed text.\n\n## Waiting launches\n\n`armada launch <ticket> --when-unblocked [--profile <name>] [--runtime conductor|herdr] [--notes <file|->]` remembers a launch until its Linear blockers close or a worker slot frees. `--after <blocker>` asserts an existing Linear relation. Without `--profile`, routing uses the ticket's labels when it starts; an explicit profile stays pinned, with its reason. Runtime and notes text survive until launch; explicit options when firing override the stored values.\n\nRequests expire after seven days. The inbox shows one expiry notice with the renew/decline commands. Repeat `armada launch <ticket> --when-unblocked` to renew the same request for seven more days and reset its attempt budget; omitted options preserve its pin and context. Decline with `armada answer <id> \"<why>\"`. Completed or cancelled tickets close their request automatically. A launched worker waiting to claim is shown quietly in status.\n\nThe running watch starts eligible requests itself, oldest first, at most one per poll, when any blocker closes or a worker slot frees. Successful starts stay quiet in plain watch and appear in status and the next re-arm line; follow prints a `launched` line, respecting `--tickets` and `--kinds` (use `--kinds launched` for starts alone). Merge/drain still fire the tickets that their merge unblocked. Only this coordinator's requests fire, with no cap bypass. Herdr starts on the watch's machine; automatic launches never prompt to install tools.\n\nFire-time admission checks cancellation, expiry and ownership; launch rechecks the request after preflight and fresh Linear readiness, including the ready label. Known failures, including missing runtime tools, arrive as one rewritten `launch-failed` inbox item. Keep/re-arm watch to retry after five minutes, then fifteen minutes, at most three attempts total. The third failure says `gave up after 3 failed launches`; renew or decline deliberately. An uncertain creation keeps its pending launch even after token expiry: inspect and revoke it before another automatic creation. Guided Claude Code profiles stay manual inbox work with `armada brief ... --prompt` for the Agent tool. `coordinator take` transfers the waiting request too. Missing readings or unavailable admission/attempt metadata prevent automatic firing: deploy the dashboard before the CLI.\n\n## Start\n\nAfter Claude compact/resume, follow the Armada brief; see [REFERENCE.md](REFERENCE.md#the-sessionstart-brief).\n\n1. **Sign in.** `armada whoami` says whether this terminal is signed in and to which organization. If not: a person runs `armada login` and approves the code in the browser; a headless coordinator (a cloud workspace, CI) sets `ARMADA_API_KEY` to an organization API key an owner created, or runs `armada login --api-key`. Signed in, Armada gives each command the organization's keys and puts a one-time launch token in every brief, so no worker needs a key. Keys set in the environment still win. `armada doctor` checks the repository and the sign-in together.\n2. **Take your name.** One project can have several coordinators, each with a name. Set `ARMADA_COORDINATOR=<name>` (a cloud workspace) or run `armada coordinator use <name>` (this checkout); without either the name is `default`. A named coordinator sees its own workers and unowned items; `default` sees the whole fleet. `armada coordinator list` shows the names, their sessions and tickets. Status names work stranded under a silent role with the `armada coordinator take … --from <name>` command; use it when you resume that work. See REFERENCE.md before sharing a project.\n3. **Find your coordination ticket**, if the owner gave you one. Read its comments, newest first. A last comment `Agent status: released — <text>` is a hand-over: `<text>` is the state the previous coordinator left. Claim the ticket with your own handle, never the previous one: `armada claim <ticket> --runtime <your runtime> --handle <your handle> --branch <default branch>` (in Conductor, `--runtime conductor --handle \"$CONDUCTOR_WORKSPACE_ID/$CONDUCTOR_SESSION_ID\"`; elsewhere set `ARMADA_COORDINATOR_HANDLE` to the handle you claimed with). Report on it as a worker would, `armada report implementing --ticket <ticket> --message \"<what you found and do next>\"`, and hand over with `armada release --ticket <ticket> --reason \"<state so far and what remains>\"` when you stop before the run ends. Write that reason for a reader with none of your context.\n4. **Run from anywhere.** Commands find the project from the checkout. From another folder, pass `--project <slug>` (this machine's last watched checkout) or set `ARMADA_CONFIG=/path/to/armada.toml`; `--config <path>` wins over both.\n\n## Launch details\n\n6. **Launch** Conductor and herdr workers with one command:\n\n```sh\narmada launch ABC-12 --runtime conductor --profile backend --pre-approve --reason \"CLI and core only; a small follow-up\" --notes notes.md\n```\n\nOne `--reason` explains both the profile choice and the pre-approval. `--runtime conductor|herdr` may be left out when the profile settles it. `--notes <file|->` adds what only you know (the boundary with a parallel worker, a decision not yet on the ticket), up to 16 KB; notes never approve a plan. `--dry-run` checks everything and creates nothing. The command refuses a ticket already launched or claimed, mints the token, starts the worker and prints its handle and link, never the token. For failed or uncertain launches, follow REFERENCE.md. Put worker conventions in `[brief] extra`. For a Claude Code profile, run `armada brief <ticket> --prompt` with the same flags and launch through the Agent tool as its runtime guide says.\n\n## Stop a superseded worker on a Done ticket\n\nWhen another change covered a worker's ticket and it is already Done, run `armada stop ABC-12 --superseded \"<why>\"`. It posts the reason on Linear, releases the exact claim, ends only worker sessions launched by its claim time and archives that runtime workspace. Done stays Done; no workflow-state workaround is needed. A replacement claim refuses cleanup, and herdr still requires a clean, fully pushed worktree. If archival fails after release, retry the same command. `--superseded` requires Done; unfinished tickets use ordinary release and stop. Alternatively, `armada release --ticket ABC-12 --reason \"<why>\"` preserves Done, followed by `armada stop ABC-12` for archival.\n"
|
|
13971
13986
|
},
|
|
13972
13987
|
{
|
|
13973
13988
|
path: "SKILL.md",
|
|
13974
|
-
content: "---\nname: armada-coordinator\ndescription: Coordinating an Armada fleet of coding agents on one project. Use when designated coordinator, or asked to launch workers on ready tickets, answer their questions, merge their green pull requests, or resume a fleet in a new local or cloud session. Reads the fleet with armada status and armada inbox and drives workers through the runtime guide skill.\n---\n\nThe coordinator turns the owner's intent into merged pull requests. Each worker owns one ticket and follows the `armada-worker` skill; the coordinator chooses what runs, answers questions, merges and reports. `armada.toml` names the program root, the label groups and the policy. `AGENTS.md` (or `CLAUDE.md`) holds the repository's own rules, and they win where they are stricter.\n\n**Standing authority.** Unless the owner said otherwise, they delegate reversible technical decisions, plan approval and merging to you: act, then report. Escalate only product decisions, irreversible or outward-facing actions, and anything that spends money.\n\n**Armada does the runtime work.** For Conductor and herdr workers, `armada launch`, `armada answer`, `armada peek`, `armada relaunch` and `armada merge` launch, deliver, observe, replace and archive by themselves. Read the runtime guide (`armada skill armada-runtime-conductor`, `-herdr` or `-claude-code`) only when a command reports a limitation, and for every Claude Code subagent: Armada does none of that for them.\n\nThis file is the loop. [MERGE.md](MERGE.md) covers merging; [REFERENCE.md](REFERENCE.md) covers the watch, reminders, `armada ack`, names, silence, upgrades, specs, secrets and jobs.\n\n## Start\n\nAfter Claude compact/resume, follow the Armada brief; see [REFERENCE.md](REFERENCE.md#the-sessionstart-brief).\n\n1. **Sign in.** `armada whoami` says whether this terminal is signed in and to which organization. If not: a person runs `armada login` and approves the code in the browser; a headless coordinator (a cloud workspace, CI) sets `ARMADA_API_KEY` to an organization API key an owner created, or runs `armada login --api-key`. Signed in, Armada gives each command the organization's keys and puts a one-time launch token in every brief, so no worker needs a key. Keys set in the environment still win. `armada doctor` checks the repository and the sign-in together.\n2. **Take your name.** One project can have several coordinators, each with a name. Set `ARMADA_COORDINATOR=<name>` (a cloud workspace) or run `armada coordinator use <name>` (this checkout); without either the name is `default`. A named coordinator sees its own workers and unowned items; `default` sees the whole fleet. `armada coordinator list` shows the names, their sessions and tickets. Status names work stranded under a silent role with the `armada coordinator take … --from <name>` command; use it when you resume that work. See REFERENCE.md before sharing a project.\n3. **Find your coordination ticket**, if the owner gave you one. Read its comments, newest first. A last comment `Agent status: released — <text>` is a hand-over: `<text>` is the state the previous coordinator left. Claim the ticket with your own handle, never the previous one: `armada claim <ticket> --runtime <your runtime> --handle <your handle> --branch <default branch>` (in Conductor, `--runtime conductor --handle \"$CONDUCTOR_WORKSPACE_ID/$CONDUCTOR_SESSION_ID\"`; elsewhere set `ARMADA_COORDINATOR_HANDLE` to the handle you claimed with). Report on it as a worker would, `armada report implementing --ticket <ticket> --message \"<what you found and do next>\"`, and hand over with `armada release --ticket <ticket> --reason \"<state so far and what remains>\"` when you stop before the run ends. Write that reason for a reader with none of your context.\n4. **Run from anywhere.** Commands find the project from the checkout. From another folder, pass `--project <slug>` (this machine's last watched checkout) or set `ARMADA_CONFIG=/path/to/armada.toml`; `--config <path>` wins over both.\n\n## Loop\n\nRepeat these steps in order. Each ends on a \"done when\".\n\n### 1. Read the fleet\n\n`armada status --mine` and `armada inbox --mine`; without `--mine` they show the whole fleet. Never work from memory: a new session resumes from these two commands. Status lists the tickets in flight with their phases, the frontier of ready tickets, pull requests waiting, pending and deferred launches, open jobs, merge holds and the default branch's health. The inbox lists, oldest first, everything that waits for you; each entry says what to run.\n\nDone when you can name every ticket in flight and its phase, every ready ticket, every pull request waiting and every open inbox entry.\n\n### 2. Keep watching\n\nSee REFERENCE.md for shared results and harness bounds.\n\nYou only learn of something new when a command you run ends. While a worker is in flight, keep `armada watch` running in the background (Claude Code: a Bash call with `run_in_background`). It prints what needs you and exits, waking you. Act on it, then start it again. The last line of `armada inbox`, `watch`, `merge`, `launch` and `brief` says what to do: `2 workers in flight (ABC-1, ABC-2) — keep watching: armada watch`, `armada watch is running (pid …)`, or `nothing to watch`. Follow it.\n\n- Never write your own polling loop, `sleep` loop or transcript poller: `armada watch`, `armada peek` and `armada inbox` replace them.\n- `armada watch --follow` keeps running and prints a line per event; use it only where every output line reaches you (a terminal, a herdr pane, a harness tool such as Claude Code's Monitor) or in a script. Pass `--for <minutes>` below your harness's command limit; it ends with the command that resumes it.\n- `armada status` and `armada inbox` run fine beside a watch. Stop a watch only with `armada watch --stop`, never `pkill`.\n- A runtime that cannot run a background command calls `armada inbox --wait` again and again instead.\n- In Claude Code, inbox/status/merge/launch/watch and `doctor` show the Stop hook as on, installed awaiting confirmation, or NOT on with a reason and fix. Check the banner. `inbox`/`watch`/`brief`/`launch`/`merge` register coordinator sessions; workers never register. The hook holds across checkouts while workers run without a watch. For sessions starting elsewhere, add `armada hook stop 2>/dev/null || true` as a Stop command in `~/.claude/settings.json`; `armada init --merge` only writes repository settings. `ARMADA_STOP_HOOK=off` disables it; report that choice.\n\nDone when a watch runs, or the last line says `nothing to watch`.\n\n### 3. Answer what waits for you\n\nWork through the inbox, oldest first.\n\n- **`question` and `plan`.** Decide, then `armada answer <item> \"<answer>\"`. For Conductor and herdr it delivers the text into the worker's session, posts it on the ticket and resolves the item, in one command; never send it a second time by hand. Unconfirmed keyed answers wait for watch; see [kept deliveries](REFERENCE.md#kept-deliveries). For a plan: read all of it, then `armada answer <item> \"approved\"` or concrete amendments with the reason. A plan item lists the worker's declared paths and their overlaps with other workers; a worker proceeds through overlaps on its own and asks only when it must change a contract another ticket relies on. A Claude Code worker: deliver with the runtime guide's *Message* section first, then `armada answer`.\n- **Notes you start.** `armada answer --note <ticket> \"<message>\"` delivers and records a message the worker did not ask for. It also resolves that ticket's open plan without approving it: answer a waiting plan with `armada answer <item>` instead. A live herdr approval prompt (`runtime-blocked`) has no item id: read the pane with `armada peek`, then `armada answer <ticket> \"<input>\"`.\n- **Product decisions** go to the owner: `armada ask-owner <ticket> \"<question>\" --choices \"<a> | <b>\" [--check \"<check>\"]` puts one question, judged in about a minute, on the owner's Validations page and prints the link to send. Never ask the owner to read a diff. Their pick returns as a `decision` item.\n- **The owner's requests** from the dashboard, signed with their name:\n - `answer-request`: `armada answer <request id> \"<the owner's answer>\"`, which delivers and resolves the question or plan it names.\n - `launch-request`: launch the ticket as in step 5 (the claim resolves it), or decline it with `armada answer <request id> \"<why>\"` when it collides with work in flight.\n - Merge pressed on a pull request handed back at its current head goes straight into the merge queue, queued by the owner; no item arrives, so keep `armada merge --drain` running. A press the dashboard could not queue arrives as a `merge-request`.\n - `merge-request`, `release-request`, `plan-changes`: merge, release or relay the plan changes, then answer the item with what you did.\n - `decision`: an approved merge, `armada merge <pr>`; requested changes or a choice, deliver them with `armada answer`; an approved design ticket, `armada done <ticket>`, then cut the ticket that builds it, blocked by this one.\n- **A missing secret.** A worker asks with `armada ask --secret <NAME>`. Run `armada secrets request <NAME> --ticket <id> --reason \"<why>\"` and send the printed link to an owner or admin, who types the value into the vault. Never ask for a value in chat; a pasted value must be rotated. When the inbox says `<NAME> is set`, tell the worker to re-run through `armada run`.\n- **Other entries**: `hand-back` (step 6), `queue-stalled` (queued pull requests with no drain for 2 minutes: run `armada merge --drain`), `queue-refused` and `linear-pending` (MERGE.md), `hold` and `deploy` (step 7), `job*` and `launch-failed`/`launch-uncertain` (REFERENCE.md), `unblocked` (step 5), `stopped`, `silent` and `not-started` (step 4), `version` (CLI too old: run `armada upgrade`).\n\nDecide reversible choices yourself and prefer the option that keeps behaviour observable. Shared numbers and names (migrations, ports, versions) are never yours to hand out: workers take them with `armada reserve`, and `armada reserve --list` shows the holders.\n\nDone when the inbox shows no open question, plan or request.\n\n### 4. Check stopped, silent and unstarted workers\n\nRun `armada peek <ticket>`: the runtime's state, the worker's last reply, its recent commands, its report and heartbeat ages, its PR checks and open questions. It never writes to the worker.\n\n- **`stopped`** (Armada saw the session idle in a working phase) or **`silent`** (no heartbeat, report or answer within its allowance): read the last reply. A worker that is merely idle gets a nudge with `armada answer --note`. A worker that died, failed or whose workspace is gone is replaced with `armada relaunch <ticket> --reason \"<why>\"`: it releases only the old worker, launches a new one on the same branch and pull request, then archives the old one. `--dry-run` shows the plan first.\n- **`not-started`**: a launched worker that has not claimed. The entry says whether it never used its launch token or signed in and stopped before the claim. A worker stuck on a setup choice gets a note to take the safe option; one that is gone is relaunched, or its launch cancelled with `armada launch revoke <ticket>`.\n\nSilence allowances, grace periods and wake-up levels are in REFERENCE.md.\n\nDone when every worker in flight is working, waiting on someone, or replaced.\n\n### 5. Launch ready tickets\n\nLaunch one at a time; avoid overlaps with work in flight.\n\nCaps: REFERENCE.md.\n\n1. `armada lint --ready` lists readability problems in ready tickets and open specs, each with its fix. Fix them on the ticket, then `armada lint <ticket>` to recheck.\n2. Pick a ticket from the frontier in `armada status`. Read it and its parent spec.\n3. **Choose the profile.** A `[[conductor.routing]]` rule matching the ticket's labels wins. Otherwise, when profiles have `when` rules, match them in plain words to the files and work the ticket will change, and pass `--profile <name> --reason \"<why>\"`. Mixed work goes where most of it is; say so in the reason. Override a label rule only when the labels mislead, with the same flags.\n4. **Judge owner validation** when `armada.toml` has `[[policy.validation]]` rules: `--validation none` for most tickets, or `--validation <n> --validation-reason \"<why>\"` when one applies (a design ticket, a new screen's look).\n5. **Pre-approve the plan** when it needs no review: `--pre-approve --reason \"<why>\"`. Otherwise the worker posts its plan and waits for your answer.\n6. **Launch** Conductor and herdr workers with one command:\n\n```sh\narmada launch ABC-12 --runtime conductor --profile backend --pre-approve --reason \"CLI and core only; a small follow-up\" --notes notes.md\n```\n\nOne `--reason` explains both the profile choice and the pre-approval. `--runtime conductor|herdr` may be left out when the profile settles it. `--notes <file|->` adds what only you know (the boundary with a parallel worker, a decision not yet on the ticket), up to 16 KB; notes never approve a plan. `--dry-run` checks everything and creates nothing. The command refuses a ticket already launched or claimed, mints the token, starts the worker and prints its handle and link, never the token. For failed or uncertain launches, follow REFERENCE.md. Put worker conventions in `[brief] extra`. For a Claude Code profile, run `armada brief <ticket> --prompt` with the same flags and launch through the Agent tool as its runtime guide says.\n\n7. **A ticket blocked by work in flight**: queue it with `armada launch <ticket> --when-unblocked`; watch starts it and failures reach the inbox ([details](REFERENCE.md#waiting-launches)).\n8. **Check the claim** a few minutes later: `armada status` shows the ticket in flight, phase `planning` (then `implementing` once a pre-approved worker posts its plan), with the handle the launch printed. A claim can report the worker `blocked` at once when Git refuses its pushes or commit signing would prompt: fix the access and answer it.\n\nDone when every launched ticket is In Progress with a claim, and a watch runs.\n\n### 6. Merge handed-back pull requests\n\nA hand-back shown as `queued in the merge queue (position N)` or `merging: <drain step>` needs no new action; keep the drain running. A note that sends a worker back to work leaves the hand-back until that worker reports its resumed phase, which clears it; its next `ready-to-merge` report wakes the watch again.\n\nA `hand-back` entry means the worker reported `ready-to-merge` with green CI, resolved review threads and the full head SHA. Merge it with `armada merge <pr>`, following [MERGE.md](MERGE.md). The command checks everything, merges pinned to the handed-back head under the project's merge lock, and then, by itself:\n\n- archives the merged worker's workspace once GitHub confirms the merge (never archive by hand before that; `--no-archive` keeps it);\n- tells the working workers it concerns that main moved: those whose open pull requests share files with what landed, or all of them when `[merge] notify_paths` matched or the file reading was incomplete (never send those notes yourself);\n- closes the ticket, closes its spec when it was the last open ticket, and lists the tickets it unblocked, launching those you deferred when it can;\n- starts the deploy check when `[[deploy.target]]` is set;\n- ends with one `Result:` line. Read it: `Result: merged #N` is done; `Result: not merged (…)` confirmed no merge (if it says `merge unconfirmed`, look at GitHub before retrying); `Linear pending` means run `armada merge --finish <pr>` once Linear answers.\n\nWorkers hand back without chasing main, so a head is often behind: add `--wait` in the background; it updates it on GitHub and waits for its checks (without it, a behind head is refused unless `[gates] local_commands` can test-merge it). Several hand-backs at once: queue them with `armada merge --when-green <pr...>` and run `armada merge --drain` in the background; it merges them one at a time, each retested on fresh main. With `[policy] merge_approval`, judge each pull request and pass `--reason \"<why>\"`, or `--ask-owner --reason \"<why>\"` to send it to the owner first. A hand-back with `--more-prs` keeps its ticket and worker open after the merge; `--keep-open` and `--close` override that.\n\nDone when the pull request is merged, the result line says so, and nothing it printed is left to do.\n\n### 7. Keep main healthy\n\n- **Merge holds** pause merges for every coordinator: `armada hold` lists them, `armada hold add \"<reason>\"` opens one. Merge the fix with `armada merge <pr> --through-hold \"<why>\"`, verify the recovery, then `armada hold clear <id> --reason \"<what was verified>\"`. Never clear a hold just to let a merge through.\n- **Main red.** `armada status` says `main red since #N` with the failing checks, and whether a fix is running. Find the cause with `armada ci why --branch <default branch>`, cut a fix ticket, and hold merges when the breakage would spread.\n- **Deploys.** Follow [MERGE.md](MERGE.md#holds-main-red-and-deploys).\n- **Red checks.** Run `armada ci why <pr>`; follow [MERGE.md](MERGE.md#red-checks-on-a-pull-request).\n\nDone when no hold is open without a ticket that fixes it.\n\n### 8. Turn findings into tickets\n\nA gap a worker reports or a bug you see becomes a ticket under the right spec, with its blocked-by relations, and is launched when ready. No finding lives only in a transcript.\n\nFor creating, placing and repairing specs, see [Specs](REFERENCE.md#specs).\n\n### 9. Report to the owner\n\nStatus reminds you once per 24 hours per project to use the digest; a successful merge without deploy targets reminds you to add `[[deploy.target]]` with a smoke command (`armada doctor` lists it). These hints stay out of JSON and worker output. When the owner asks where things stand, run `armada digest` and paste its text; `--since 4h` sets the window and `--send` posts it through the organization's channel. The summary includes deploy target states and long jobs with reported progress and estimated ends; when work spans several specs, it groups merged, waiting and in-progress tickets by spec with done/total counts. Owner validations and questions also reach that channel by themselves (Organization > Notifications). Report in the owner's language (`[tracker] language`): what merged, what runs, what you decided for them, and the one thing they must do, with its exact place. Outcomes and numbers, no process narration.\n\nThen repeat from step 1.\n\n## Rules of thumb\n\n- Follow [the coordinator guardrails](REFERENCE.md#coordinator-guardrails): keep commands brief, delegate code, run Armada bare.\n- Long runs (an evaluation, a backfill) go through `armada job`, never in your session or a worker's.\n- Parallel workers in one area collide: stagger them, or give each a disjoint area and say the boundary in `--notes`.\n- Evidence for the owner goes through `armada attach <ticket> <files|urls>... --caption \"<what to check>\"`; link the printed URLs. Screenshots stay out of git.\n- Everything that must outlive your session goes to the tracker or the repository.\n- When a command named here is missing from your Armada version (`armada --help`), run `armada upgrade`; if you cannot, do the step by hand with the same protocol and say so in your report.\n"
|
|
13989
|
+
content: "---\nname: armada-coordinator\ndescription: Coordinating an Armada fleet of coding agents on one project. Use when designated coordinator, or asked to launch workers on ready tickets, answer their questions, merge their green pull requests, or resume a fleet in a new local or cloud session. Reads the fleet with armada status and armada inbox and drives workers through the runtime guide skill.\n---\n\nThe coordinator turns the owner's intent into merged pull requests. Each worker owns one ticket and follows the `armada-worker` skill; the coordinator chooses what runs, answers questions, merges and reports. `armada.toml` names the program root, the label groups and the policy. `AGENTS.md` (or `CLAUDE.md`) holds the repository's own rules, and they win where they are stricter.\n\n**Standing authority.** Unless the owner said otherwise, they delegate reversible technical decisions, plan approval and merging to you: act, then report. Escalate only product decisions, irreversible or outward-facing actions, and anything that spends money.\n\n**Armada does the runtime work.** For Conductor and herdr workers, `armada launch`, `armada answer`, `armada peek`, `armada relaunch` and `armada merge` launch, deliver, observe, replace and archive by themselves. Read the runtime guide (`armada skill armada-runtime-conductor`, `-herdr` or `-claude-code`) only when a command reports a limitation, and for every Claude Code subagent: Armada does none of that for them.\n\nThis file is the loop. [MERGE.md](MERGE.md) covers merging; [REFERENCE.md](REFERENCE.md) covers the watch, reminders, `armada ack`, names, silence, upgrades, specs, secrets and jobs.\n\nBefore your first loop, follow [Start](REFERENCE.md#start) for sign-in, your coordinator name and coordination ticket, and selecting the checkout. After compact/resume, follow [the SessionStart brief](REFERENCE.md#the-sessionstart-brief).\n\n## Loop\n\nRepeat these steps in order. Each ends on a \"done when\".\n\n### 1. Read the fleet\n\n`armada status --mine` and `armada inbox --mine`; without `--mine` they show the whole fleet. Never work from memory: a new session resumes from these two commands. Status lists the tickets in flight with their phases, the frontier of ready tickets, pull requests waiting, pending and deferred launches, open jobs, merge holds and the default branch's health. The inbox lists, oldest first, everything that waits for you; each entry says what to run.\n\nDone when you can name every ticket in flight and its phase, every ready ticket, every pull request waiting and every open inbox entry.\n\n### 2. Keep watching\n\nSee REFERENCE.md for shared results and harness bounds.\n\nYou only learn of something new when a command you run ends. While a worker is in flight, keep `armada watch` running in the background (Claude Code: a Bash call with `run_in_background`). It prints what needs you and exits, waking you. Act on it, then start it again. The last line of `armada inbox`, `watch`, `merge`, `launch` and `brief` says what to do: `2 workers in flight (ABC-1, ABC-2) — keep watching: armada watch`, `armada watch is running (pid …)`, or `nothing to watch`. Follow it.\n\n- Never write your own polling loop, `sleep` loop or transcript poller: `armada watch`, `armada peek` and `armada inbox` replace them.\n- `armada watch --follow` keeps running and prints a line per event; use it only where every output line reaches you (a terminal, a herdr pane, a harness tool such as Claude Code's Monitor) or in a script. Pass `--for <minutes>` below your harness's command limit; it ends with the command that resumes it.\n- `armada status` and `armada inbox` run fine beside a watch. Stop a watch only with `armada watch --stop`, never `pkill`.\n- A runtime that cannot run a background command calls `armada inbox --wait` again and again instead.\n- In Claude Code, inbox/status/merge/launch/watch and `doctor` show the Stop hook as on, installed awaiting confirmation, or NOT on with a reason and fix. Check the banner. `inbox`/`watch`/`brief`/`launch`/`merge` register coordinator sessions; workers never register. The hook holds across checkouts while workers run without a watch. For sessions starting elsewhere, add `armada hook stop 2>/dev/null || true` as a Stop command in `~/.claude/settings.json`; `armada init --merge` only writes repository settings. `ARMADA_STOP_HOOK=off` disables it; report that choice.\n\nDone when a watch runs, or the last line says `nothing to watch`.\n\n### 3. Answer what waits for you\n\nWork through the inbox, oldest first.\n\n- **`question` and `plan`.** Decide, then `armada answer <item> \"<answer>\"`. For Conductor and herdr it delivers the text into the worker's session, posts it on the ticket and resolves the item, in one command; never send it a second time by hand. Unconfirmed keyed answers wait for watch; see [kept deliveries](REFERENCE.md#kept-deliveries). For a plan: read all of it, then `armada answer <item> \"approved\"` or concrete amendments with the reason. A plan item lists the worker's declared paths and their overlaps with other workers; a worker proceeds through overlaps on its own and asks only when it must change a contract another ticket relies on. A Claude Code worker: deliver with the runtime guide's *Message* section first, then `armada answer`.\n- **Notes you start.** `armada answer --note <ticket> \"<message>\"` delivers and records a message the worker did not ask for. It also resolves that ticket's open plan without approving it: answer a waiting plan with `armada answer <item>` instead. A live herdr approval prompt (`runtime-blocked`) has no item id: read the pane with `armada peek`, then `armada answer <ticket> \"<input>\"`.\n- **Product decisions** go to the owner: `armada ask-owner <ticket> \"<question>\" --choices \"<a> | <b>\" [--check \"<check>\"]` puts one question, judged in about a minute, on the owner's Validations page and prints the link to send. Never ask the owner to read a diff. Their pick returns as a `decision` item.\n- **The owner's requests** from the dashboard, signed with their name:\n - `answer-request`: `armada answer <request id> \"<the owner's answer>\"`, which delivers and resolves the question or plan it names.\n - `launch-request`: launch the ticket as in step 5 (the claim resolves it), or decline it with `armada answer <request id> \"<why>\"` when it collides with work in flight.\n - Merge pressed on a pull request handed back at its current head goes straight into the merge queue, queued by the owner; no item arrives, so keep `armada merge --drain` running. A press the dashboard could not queue arrives as a `merge-request`.\n - `merge-request`, `release-request`, `plan-changes`: merge, release or relay the plan changes, then answer the item with what you did.\n - `decision`: an approved merge, `armada merge <pr>`; requested changes or a choice, deliver them with `armada answer`; an approved design ticket, `armada done <ticket>`, then cut the ticket that builds it, blocked by this one.\n- **A missing secret.** A worker asks with `armada ask --secret <NAME>`. Run `armada secrets request <NAME> --ticket <id> --reason \"<why>\"` and send the printed link to an owner or admin, who types the value into the vault. Never ask for a value in chat; a pasted value must be rotated. When the inbox says `<NAME> is set`, tell the worker to re-run through `armada run`.\n- **Other entries**: `hand-back` (step 6), `queue-stalled` (queued pull requests with no drain for 2 minutes: run `armada merge --drain`), `queue-refused` and `linear-pending` (MERGE.md), `hold` and `deploy` (step 7), `job*` and `launch-failed`/`launch-uncertain` (REFERENCE.md), `unblocked` (step 5), `stopped`, `silent` and `not-started` (step 4), `version` (CLI too old: run `armada upgrade`).\n\nDecide reversible choices yourself and prefer the option that keeps behaviour observable. Shared numbers and names (migrations, ports, versions) are never yours to hand out: workers take them with `armada reserve`, and `armada reserve --list` shows the holders.\n\nDone when the inbox shows no open question, plan or request.\n\n### 4. Check stopped, silent and unstarted workers\n\nRun `armada peek <ticket>`: the runtime's state, the worker's last reply, its recent commands, its report and heartbeat ages, its PR checks and open questions. It never writes to the worker.\n\n- **`stopped`** (Armada saw the session idle in a working phase) or **`silent`** (no heartbeat, report or answer within its allowance): read the last reply. A worker that is merely idle gets a nudge with `armada answer --note`. A worker that died, failed or whose workspace is gone is replaced with `armada relaunch <ticket> --reason \"<why>\"`: it releases only the old worker, launches a new one on the same branch and pull request, then archives the old one. `--dry-run` shows the plan first.\n- **`not-started`**: a launched worker that has not claimed. The entry says whether it never used its launch token or signed in and stopped before the claim. A worker stuck on a setup choice gets a note to take the safe option; one that is gone is relaunched, or its launch cancelled with `armada launch revoke <ticket>`.\n\nSilence allowances, grace periods and wake-up levels are in REFERENCE.md.\n\nDone when every worker in flight is working, waiting on someone, or replaced.\n\n### 5. Launch ready tickets\n\nLaunch one at a time; avoid overlaps with work in flight.\n\nCaps: REFERENCE.md.\n\n1. `armada lint --ready` lists readability problems in ready tickets and open specs, each with its fix. Fix them on the ticket, then `armada lint <ticket>` to recheck.\n2. Pick a ticket from the frontier in `armada status`. Read it and its parent spec.\n3. **Choose the profile.** A `[[conductor.routing]]` rule matching the ticket's labels wins. Otherwise, when profiles have `when` rules, match them in plain words to the files and work the ticket will change, and pass `--profile <name> --reason \"<why>\"`. Mixed work goes where most of it is; say so in the reason. Override a label rule only when the labels mislead, with the same flags.\n4. **Judge owner validation** when `armada.toml` has `[[policy.validation]]` rules: `--validation none` for most tickets, or `--validation <n> --validation-reason \"<why>\"` when one applies (a design ticket, a new screen's look).\n5. **Pre-approve the plan** when it needs no review: `--pre-approve --reason \"<why>\"`. Otherwise the worker posts its plan and waits for your answer.\n6. **Launch** with `armada launch <ticket>` for Conductor or herdr; use `armada brief <ticket> --prompt` and the runtime guide for Claude Code. Read [launch details](REFERENCE.md#launch-details) for examples, notes, rare flags and failed or uncertain launches.\n\n7. **A ticket blocked by work in flight**: queue it with `armada launch <ticket> --when-unblocked`; watch starts it and failures reach the inbox ([details](REFERENCE.md#waiting-launches)).\n8. **Check the claim** a few minutes later: `armada status` shows the ticket in flight, phase `planning` (then `implementing` once a pre-approved worker posts its plan), with the handle the launch printed. A claim can report the worker `blocked` at once when Git refuses its pushes or commit signing would prompt: fix the access and answer it.\n\nDone when every launched ticket is In Progress with a claim, and a watch runs.\n\n### 6. Merge handed-back pull requests\n\nA `hand-back` means green CI, resolved review threads and a full head SHA. Run `armada merge <pr>` following [MERGE.md](MERGE.md), including [the loop’s hand-back](MERGE.md#the-loops-hand-back) for queued entries, automatic cleanup, behind heads and approval rules. Keep the drain running for queued or merging entries.\n\nDone when the pull request is merged, `Result: merged #N` confirms it, and nothing it printed is left to do.\n\n### 7. Keep main healthy\n\n- **Merge holds** pause merges for every coordinator: `armada hold` lists them, `armada hold add \"<reason>\"` opens one. Merge the fix with `armada merge <pr> --through-hold \"<why>\"`, verify the recovery, then `armada hold clear <id> --reason \"<what was verified>\"`. Never clear a hold just to let a merge through.\n- **Main red.** `armada status` says `main red since #N` with the failing checks, and whether a fix is running. Find the cause with `armada ci why --branch <default branch>`, cut a fix ticket, and hold merges when the breakage would spread.\n- **Deploys.** Follow [MERGE.md](MERGE.md#holds-main-red-and-deploys).\n- **Red checks.** Run `armada ci why <pr>`; follow [MERGE.md](MERGE.md#red-checks-on-a-pull-request).\n\nDone when no hold is open without a ticket that fixes it.\n\n### 8. Turn findings into tickets\n\nA gap a worker reports or a bug you see becomes a ticket under the right spec, with its blocked-by relations, and is launched when ready. No finding lives only in a transcript.\n\nFor creating, placing and repairing specs, see [Specs](REFERENCE.md#specs).\n\n### 9. Report to the owner\n\nStatus reminds you once per 24 hours per project to use the digest; a successful merge without deploy targets reminds you to add `[[deploy.target]]` with a smoke command (`armada doctor` lists it). These hints stay out of JSON and worker output. When the owner asks where things stand, run `armada digest` and paste its text; `--since 4h` sets the window and `--send` posts it through the organization's channel. The summary includes deploy target states and long jobs with reported progress and estimated ends; when work spans several specs, it groups merged, waiting and in-progress tickets by spec with done/total counts. Owner validations and questions also reach that channel by themselves (Organization > Notifications). Report in the owner's language (`[tracker] language`): what merged, what runs, what you decided for them, and the one thing they must do, with its exact place. Outcomes and numbers, no process narration.\n\nThen repeat from step 1.\n\n## Rules of thumb\n\n- Follow [the coordinator guardrails](REFERENCE.md#coordinator-guardrails): keep commands brief, delegate code, run Armada bare.\n- Long runs (an evaluation, a backfill) go through `armada job`, never in your session or a worker's.\n- Parallel workers in one area collide: stagger them, or give each a disjoint area and say the boundary in `--notes`.\n- Evidence for the owner goes through `armada attach <ticket> <files|urls>... --caption \"<what to check>\"`; link the printed URLs. Screenshots stay out of git.\n- Everything that must outlive your session goes to the tracker or the repository.\n- When a command named here is missing from your Armada version (`armada --help`), run `armada upgrade`; if you cannot, do the step by hand with the same protocol and say so in your report.\n"
|
|
13975
13990
|
}
|
|
13976
13991
|
]
|
|
13977
13992
|
},
|
|
@@ -14043,14 +14058,14 @@ You are a worker. You own exactly one ticket, named in your launch brief. You tu
|
|
|
14043
14058
|
- Otherwise: \`armada report awaiting-approval --plan-file -\`, push your branch and end your turn. On approval, report \`implementing\`; on amendments, report \`planning\`, revise and submit again.
|
|
14044
14059
|
5. **Implement**, test-first. A material change to an approved plan needs a new approval.
|
|
14045
14060
|
6. **Show the owner** when your brief has an "Owner validation" block. Produce what it names, then ask one question judged in about a minute: \`armada validate "Does the card read clearly?" --check "The title is legible" --attach card.png --excerpt output.txt:10-40 --details-file context.txt\` (a headline, at most three checks, at most four images, excerpts up to 40 lines; longer context goes in \`--details-file\`). Never ask the owner to read a diff. Your phase becomes \`awaiting-validation\` and the command prints the approval link; end your turn. On "Request changes", revise and run \`armada validate\` again; on approval, report the phase you resume, or stop for a design ticket: the coordinator closes it. Never build what the owner has not approved.
|
|
14046
|
-
7. **Ship.** \`armada report shipping --pr <number> --message "<what is ready>"\`. Use the bundled \`ship-pr-dev\` skill: at its independent review add \`--stage review\`, once that passes \`--stage ci\`, and keep the stage on each later shipping report. If it cannot run, record the exact reason and use the fallback: run the repository's checks, open the pull request with a Commitizen title (\`feat(scope): …\`), and get every required check green. On a red check, start with \`armada ci why <pr>\`: it names the failing tests, first errors and runner problems. \`armada ci why <pr> --rerun\` reruns once only when every failure is a runner problem or a declared known flake, and names each flake's root-cause ticket (mention them in your next report). Fix anything else; never call a failure flaky without a project rule.
|
|
14061
|
+
7. **Ship.** \`armada report shipping --pr <number> --message "<what is ready>"\`. Use the bundled \`ship-pr-dev\` skill: at its independent review add \`--stage review\`, once that passes \`--stage ci\`, and keep the stage on each later shipping report. If it cannot run, record the exact reason and use the fallback: run the repository's checks, open the pull request with a Commitizen title (\`feat(scope): …\`), and get every required check green. On a red check, start with \`armada ci why <pr>\`: it names the failing tests, first errors and runner problems. \`armada ci why <pr> --rerun\` reruns once only when every failure is a runner problem or a declared known flake, and names each flake's root-cause ticket (mention them in your next report). Container pulls in \`Initialize containers\` qualify for explicit Docker rate limits and network/auth timeouts when validated steps show no later project work ran (successful \`Stop containers\` cleanup is allowed); later failures and registry/auth configuration errors stay unsafe. Fix anything else; never call a failure flaky without a project rule.
|
|
14047
14062
|
8. **Get the head ready.** Before handing back:
|
|
14048
14063
|
- **Conflicts only.** Look at GitHub's merge state (\`gh pr view <n> --json mergeStateStatus\`). \`DIRTY\`: bring the default branch in (rebase, or merge it into your branch), resolve, and get CI green again. \`BEHIND\` or \`CLEAN\`: hand back as is; the coordinator's \`armada merge --wait\` (or its queue) brings main in on GitHub and retests it. Never force-push a branch someone else pushed to.
|
|
14049
14064
|
- **Live acceptance.** If your brief has a "Live acceptance" section, run \`armada acceptance run\` on the clean, pushed head (\`--name <name>\` for one check), with \`armada run -- …\` around commands that need secrets. A new head needs a new pass. Each check has a timeout and a run cap; at the cap, ask the coordinator for more runs.
|
|
14050
14065
|
- **Review threads.** Fix or answer every review thread (including bots), then resolve each one.
|
|
14051
|
-
9. **Hand back.** \`armada report ready-to-merge --pr <number> --sha <full 40-character head SHA> --shipped-with "ship-pr-dev"\` (or \`--shipped-with "fallback: <exact reason>"\`). Armada refuses a short SHA, a SHA that is not the head, a red check, an open review thread or a missing acceptance pass. Then reply to the coordinator: how you shipped, the pull request URL, the full SHA, the CI state, your decisions, and what the next tickets need to know. **
|
|
14066
|
+
9. **Hand back.** \`armada report ready-to-merge --pr <number> --sha <full 40-character head SHA> --shipped-with "ship-pr-dev"\` (or \`--shipped-with "fallback: <exact reason>"\`). Armada refuses a short SHA, a SHA that is not the head, a red check, an open review thread or a missing acceptance pass. Then reply to the coordinator: how you shipped, the pull request URL, the full SHA, the CI state, your decisions, and what the next tickets need to know. **Keep a clean hand-back.** A "main moved" notice or a coordinator heads-up with no requested action needs no new report, push or checks; stay \`ready-to-merge\`. Check \`gh pr view <n> --json mergeStateStatus\` when a notice raises a possible conflict. \`CLEAN\` or \`BEHIND\`: do nothing; the coordinator's merge updates a behind branch and retests it. Integrate main only if GitHub says \`DIRTY\`: report the phase you resume, fetch and merge the default branch, resolve conflicts, rerun checks, push, and hand back the new green head. Resume for an explicit requested change too. Reporting another phase clears your existing hand-back, so never report \`shipping\` just to acknowledge an informational note.
|
|
14052
14067
|
|
|
14053
|
-
If you stop without finishing, run \`armada release --reason "<why>"\` so the ticket is free again.
|
|
14068
|
+
If you stop without finishing, run \`armada release --reason "<why>"\` so the ticket is free again. If another change already made the ticket Done, release preserves Done and posts your reason; the coordinator can release and archive your runtime together with \`armada stop ABC-12 --superseded "<why>"\`. Never move a Done ticket back to In Progress just to release it.
|
|
14054
14069
|
|
|
14055
14070
|
## A ticket in several pull requests
|
|
14056
14071
|
|
|
@@ -18404,7 +18419,7 @@ ${attachments.join(`
|
|
|
18404
18419
|
};
|
|
18405
18420
|
}
|
|
18406
18421
|
// package.json
|
|
18407
|
-
var version = "0.2.
|
|
18422
|
+
var version = "0.2.64";
|
|
18408
18423
|
|
|
18409
18424
|
// src/io.ts
|
|
18410
18425
|
class UsageError extends Error {
|
|
@@ -20365,6 +20380,68 @@ async function gitRoot(exec, cwd) {
|
|
|
20365
20380
|
return r && r.code === 0 ? r.stdout.trim() : null;
|
|
20366
20381
|
}
|
|
20367
20382
|
|
|
20383
|
+
// src/toolchain.ts
|
|
20384
|
+
var VERSION = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-([\da-zA-Z-]+(?:\.[\da-zA-Z-]+)*))?(?:\+([\da-zA-Z-]+(?:\.[\da-zA-Z-]+)*))?$/;
|
|
20385
|
+
function versionParts(text) {
|
|
20386
|
+
const parts = VERSION.exec(text);
|
|
20387
|
+
if (parts?.[4]?.split(".").some((id) => /^0\d+$/.test(id)))
|
|
20388
|
+
return null;
|
|
20389
|
+
return parts;
|
|
20390
|
+
}
|
|
20391
|
+
async function packageManagerChecks(view, exec, root, env) {
|
|
20392
|
+
if (!exec)
|
|
20393
|
+
return [];
|
|
20394
|
+
let pin;
|
|
20395
|
+
try {
|
|
20396
|
+
const text = await view.readFile("package.json");
|
|
20397
|
+
pin = text ? JSON.parse(text)?.packageManager : null;
|
|
20398
|
+
} catch {
|
|
20399
|
+
return [];
|
|
20400
|
+
}
|
|
20401
|
+
if (typeof pin !== "string")
|
|
20402
|
+
return [];
|
|
20403
|
+
const match = /^(bun|pnpm|npm|yarn)@(.+)$/.exec(pin);
|
|
20404
|
+
if (!match?.[1] || !match[2])
|
|
20405
|
+
return [];
|
|
20406
|
+
const manager = match[1];
|
|
20407
|
+
const parts = versionParts(match[2]);
|
|
20408
|
+
if (!parts)
|
|
20409
|
+
return [];
|
|
20410
|
+
if (parts[5]) {
|
|
20411
|
+
const hash = /^sha(224|256|384|512)\.([a-fA-F\d]+)$/.exec(parts[5]);
|
|
20412
|
+
if (!hash?.[1] || !hash[2] || hash[2].length !== Number(hash[1]) / 4)
|
|
20413
|
+
return [];
|
|
20414
|
+
}
|
|
20415
|
+
const pinned = match[2].split("+")[0] ?? match[2];
|
|
20416
|
+
const result = await exec(manager, ["--version"], {
|
|
20417
|
+
cwd: root,
|
|
20418
|
+
timeoutMs: 5000,
|
|
20419
|
+
maxOutputBytes: 4096,
|
|
20420
|
+
env: { ...env, COREPACK_ENABLE_NETWORK: "0", COREPACK_ENABLE_DOWNLOAD_PROMPT: "0" }
|
|
20421
|
+
}).catch(() => null);
|
|
20422
|
+
if (result?.code !== 0 || result.timedOut || result.outputExceeded)
|
|
20423
|
+
return [];
|
|
20424
|
+
const local = result.stdout.trim();
|
|
20425
|
+
const version = versionParts(local);
|
|
20426
|
+
if (!version)
|
|
20427
|
+
return [];
|
|
20428
|
+
if (version[1] === parts[1] && version[2] === parts[2])
|
|
20429
|
+
return [];
|
|
20430
|
+
let fix = `npm install -g ${manager}@${pinned}`;
|
|
20431
|
+
if (manager === "bun")
|
|
20432
|
+
fix = `curl -fsSL https://bun.sh/install | bash -s "bun-v${pinned}"`;
|
|
20433
|
+
else if (manager === "yarn")
|
|
20434
|
+
fix = `corepack enable && corepack install --global yarn@${pinned}`;
|
|
20435
|
+
return [
|
|
20436
|
+
{
|
|
20437
|
+
id: "package-manager",
|
|
20438
|
+
level: "warning",
|
|
20439
|
+
message: `package.json pins ${manager}@${pinned}; local ${manager} is ${local} (major/minor differs)`,
|
|
20440
|
+
fix
|
|
20441
|
+
}
|
|
20442
|
+
];
|
|
20443
|
+
}
|
|
20444
|
+
|
|
20368
20445
|
// src/watch.ts
|
|
20369
20446
|
import { dirname as dirname6, join as join5 } from "node:path";
|
|
20370
20447
|
|
|
@@ -24191,6 +24268,7 @@ ${hookStatusLine(hook.status)}`;
|
|
|
24191
24268
|
}
|
|
24192
24269
|
const checks = [
|
|
24193
24270
|
...repositoryChecks,
|
|
24271
|
+
...await packageManagerChecks(view, io.exec, root, io.env),
|
|
24194
24272
|
...config ? optionalFeatures(config) : [],
|
|
24195
24273
|
...signIn,
|
|
24196
24274
|
...versionChecks(hostOf(credentials.armadaApi.url), api, armadaVersion, outdated),
|
|
@@ -25235,15 +25313,22 @@ async function stop(io, config, credentials, args) {
|
|
|
25235
25313
|
const [raw, ...extra] = args.rest;
|
|
25236
25314
|
if (!raw || extra.length)
|
|
25237
25315
|
throw new Refusal("stop needs one ticket: armada stop <ticket>", "armada stop --help");
|
|
25316
|
+
const superseded = args.options.superseded;
|
|
25317
|
+
if (superseded !== undefined && !superseded.trim())
|
|
25318
|
+
throw new Refusal("--superseded needs a reason", "armada stop --help");
|
|
25319
|
+
if (superseded !== undefined && (args.options["merged-pr"] || args.options["claim-key"]))
|
|
25320
|
+
throw new Refusal("--superseded cannot be combined with merge recovery options", "armada stop --help");
|
|
25238
25321
|
requireSignIn(credentials);
|
|
25322
|
+
if (superseded !== undefined && credentials.armadaSignIn?.kind === "worker")
|
|
25323
|
+
throw new Refusal("stop --superseded is coordinator-only", 'armada release --reason "<why>"');
|
|
25239
25324
|
const { fleet } = liveFleet(io, config, credentials);
|
|
25240
25325
|
if (!fleet)
|
|
25241
25326
|
throw new Refusal("stop needs Armada's stored claim", "armada whoami");
|
|
25242
25327
|
const ticket = raw.toUpperCase();
|
|
25243
|
-
|
|
25328
|
+
let h = await fleet.runtimeHandle(ticket);
|
|
25244
25329
|
if (!h)
|
|
25245
25330
|
throw new Refusal(`${ticket} has no runtime claim to stop`, "armada status");
|
|
25246
|
-
|
|
25331
|
+
let target = claimRef(h);
|
|
25247
25332
|
const mergedPr = args.options["merged-pr"];
|
|
25248
25333
|
const claimKey = args.options["claim-key"];
|
|
25249
25334
|
if (claimKey && archiveClaimKey(target) !== claimKey)
|
|
@@ -25256,6 +25341,26 @@ async function stop(io, config, credentials, args) {
|
|
|
25256
25341
|
const adapter = runtimeFor(io, config, h.runtime);
|
|
25257
25342
|
if (!adapter.can.archive)
|
|
25258
25343
|
await adapter.archive(claimRef(h), { reason: "released", whenWorking: "refuse", waitMs: 0 });
|
|
25344
|
+
if (superseded !== undefined) {
|
|
25345
|
+
const mask = await outgoingRedactor(io, config, credentials);
|
|
25346
|
+
const ctx = workerContext(io, config, credentials);
|
|
25347
|
+
ctx.linear = redactLinearWriter(ctx.linear, mask.text);
|
|
25348
|
+
const outcome = await releaseTicket(ctx, {
|
|
25349
|
+
ticket,
|
|
25350
|
+
reason: mask.text(superseded),
|
|
25351
|
+
claim: target,
|
|
25352
|
+
completedOnly: true
|
|
25353
|
+
});
|
|
25354
|
+
for (const warning of outcome.warnings)
|
|
25355
|
+
io.stderr(`armada: warning: ${warning}
|
|
25356
|
+
`);
|
|
25357
|
+
await endWorkerSessions(io, config, credentials, ticket, "released", true, target.claimedAt);
|
|
25358
|
+
const ended = await fleet.runtimeHandle(ticket);
|
|
25359
|
+
if (!ended?.releasedAt || archiveClaimKey({ ...claimRef(ended), releasedAt: target.releasedAt }) !== archiveClaimKey(target))
|
|
25360
|
+
throw new Refusal(`${ticket}'s claim changed during release; left the runtime untouched`, "armada status");
|
|
25361
|
+
h = ended;
|
|
25362
|
+
target = claimRef(ended);
|
|
25363
|
+
}
|
|
25259
25364
|
if (adapter.name === "conductor" && !h.releasedAt)
|
|
25260
25365
|
throw new Refusal(`cannot archive ${ticket} while it holds the ticket; release first`, `armada release --ticket ${ticket} --reason "<why>"`);
|
|
25261
25366
|
const archived = await guarded(fleet, target, h.releasedAt ? "ended" : "active", () => adapter.archive(target, {
|
|
@@ -26947,7 +27052,7 @@ function noticeText(o, workers) {
|
|
|
26947
27052
|
}
|
|
26948
27053
|
if (o.hints.length)
|
|
26949
27054
|
lines.push(`Merge hints: ${o.hints.slice(0, 3).map((h) => oneLine(h).slice(0, 500)).join("; ")}.`);
|
|
26950
|
-
lines.push(`
|
|
27055
|
+
lines.push(`Check your PR with gh pr view <number> --json mergeStateStatus. Integrate ${oneLine(o.pr.base)} only if GitHub reports DIRTY: git fetch origin && git merge ${shellWord(`origin/${o.pr.base}`)}, resolve conflicts, rerun the checks, push, and hand back the new head once CI is green.`, "CLEAN or BEHIND: no action needed; the coordinator's merge updates a behind branch and retests it.", "If already ready-to-merge, keep your phase and hand-back unless there is a conflict or a requested change. A merge notice alone needs no new report.");
|
|
26951
27056
|
return lines.join(`
|
|
26952
27057
|
`);
|
|
26953
27058
|
}
|
|
@@ -27227,7 +27332,7 @@ function ghUpdateBranch(exec, cwd, repository) {
|
|
|
27227
27332
|
]);
|
|
27228
27333
|
}
|
|
27229
27334
|
var escapeRe = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
27230
|
-
function gitRepo(exec, cwd) {
|
|
27335
|
+
function gitRepo(exec, cwd, diagnostics) {
|
|
27231
27336
|
const git = async (args, dir = cwd) => {
|
|
27232
27337
|
const r = await exec("git", args, { cwd: dir });
|
|
27233
27338
|
return r;
|
|
@@ -27299,6 +27404,11 @@ function gitRepo(exec, cwd) {
|
|
|
27299
27404
|
output: tail(`${merged.stdout}
|
|
27300
27405
|
${merged.stderr}`)
|
|
27301
27406
|
};
|
|
27407
|
+
if (commands.length) {
|
|
27408
|
+
for (const check of await packageManagerChecks(fsRepoView(dir), exec, dir, diagnostics?.env ?? {}))
|
|
27409
|
+
diagnostics?.stderr(`armada: warning: ${check.message}; fix: ${check.fix}
|
|
27410
|
+
`);
|
|
27411
|
+
}
|
|
27302
27412
|
for (const command of commands) {
|
|
27303
27413
|
const r = await exec("sh", ["-c", command], { cwd: dir });
|
|
27304
27414
|
if (r.code !== 0)
|
|
@@ -27516,7 +27626,7 @@ async function merge2(io, config, credentials, a, configPath, guards) {
|
|
|
27516
27626
|
preview: (sha) => fetchPreview({ ...gh, sha })
|
|
27517
27627
|
},
|
|
27518
27628
|
appUrl: credentials.armadaSignIn ? credentials.armadaApi.url : null,
|
|
27519
|
-
repo: gitRepo(exec, repoDir),
|
|
27629
|
+
repo: gitRepo(exec, repoDir, { env: io.env, stderr: (text) => io.stderr(mask.text(text)) }),
|
|
27520
27630
|
lockRequired: !!credentials.armadaSignIn,
|
|
27521
27631
|
fleet: async () => {
|
|
27522
27632
|
const fleet = live.fleet;
|
|
@@ -28918,7 +29028,7 @@ async function relaunch(io, config, credentials, args, version, configPath) {
|
|
|
28918
29028
|
const context = workerContext(io, config, credentials);
|
|
28919
29029
|
context.linear = redactLinearWriter(context.linear, mask.text);
|
|
28920
29030
|
context.workerHandle = old.handle;
|
|
28921
|
-
const outcome = await guarded(fleet, old, rule, () => releaseTicket(context, { ticket, reason: `relaunch: ${reason}`, claim: old }));
|
|
29031
|
+
const outcome = await guarded(fleet, old, rule, () => releaseTicket(context, { ticket, reason: `relaunch: ${reason}`, claim: old, requireOpen: true }));
|
|
28922
29032
|
if (outcome.warnings.length)
|
|
28923
29033
|
throw new UsageError("release could not be recorded consistently");
|
|
28924
29034
|
await recheckMutation();
|
|
@@ -29868,7 +29978,7 @@ var COMMAND_HELP = {
|
|
|
29868
29978
|
Prints the ticket's state and what waits in this worker's inbox.
|
|
29869
29979
|
`,
|
|
29870
29980
|
release: ` release --reason <text>
|
|
29871
|
-
Give the ticket back: agent labels removed,
|
|
29981
|
+
Give the ticket back: agent labels removed, started tickets moved back; Done stays Done
|
|
29872
29982
|
`,
|
|
29873
29983
|
ask: ` ask "<question>" [--secret <NAME>] [--options "<a> | <b>"] [--ticket <id>]
|
|
29874
29984
|
Worker: ask the coordinator. The phase becomes blocked, the question
|
|
@@ -29943,8 +30053,9 @@ var COMMAND_HELP = {
|
|
|
29943
30053
|
up to 100), report, heartbeat, PR checks and open inbox in local TZ.
|
|
29944
30054
|
Includes bound launches before claim; runtime is never changed
|
|
29945
30055
|
`,
|
|
29946
|
-
stop: ` stop <ticket> [--merged-pr <url>
|
|
30056
|
+
stop: ` stop <ticket> [--superseded "<why>" | --merged-pr <url> --claim-key <key>]
|
|
29947
30057
|
Archive a Conductor workspace after release or merge. Herdr worktrees must be clean and fully pushed.
|
|
30058
|
+
--superseded: coordinator releases and archives a Done ticket, preserving Done and posting the reason.
|
|
29948
30059
|
Merge recovery prints --merged-pr and --claim-key to protect replacement workers;
|
|
29949
30060
|
copy the complete command. Ordinary stop retains its existing behavior.
|
|
29950
30061
|
`,
|
|
@@ -30242,6 +30353,7 @@ var VALUE_OPTIONS = [
|
|
|
30242
30353
|
"kinds",
|
|
30243
30354
|
"merged-pr",
|
|
30244
30355
|
"claim-key",
|
|
30356
|
+
"superseded",
|
|
30245
30357
|
"at",
|
|
30246
30358
|
"every",
|
|
30247
30359
|
"parent",
|
|
@@ -30365,7 +30477,7 @@ var COMMAND_OPTIONS = {
|
|
|
30365
30477
|
status: ["mine"],
|
|
30366
30478
|
watch: ["stop", "name", "follow", "since", "tickets", "kinds", "mine", "for"],
|
|
30367
30479
|
coordinator: ["from"],
|
|
30368
|
-
stop: ["merged-pr", "claim-key"],
|
|
30480
|
+
stop: ["merged-pr", "claim-key", "superseded"],
|
|
30369
30481
|
answer: ["note", "message", "message-file"],
|
|
30370
30482
|
init: ["program-root", "name", "slug", "no-stop-hook", "merge"],
|
|
30371
30483
|
hold: ["reason"],
|