@the-vibe-company/armada 0.2.64 → 0.2.66
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 +3 -2
- package/dist/armada.js +169 -48
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -80,7 +80,7 @@ Each problem is an error or a warning, with its fix. A missing skill, or a CLI o
|
|
|
80
80
|
|
|
81
81
|
After the one-time pointer conversion, instruction-only Armada releases need no setup PR or project CI run. Doctor and status compare pointers, so only a discovery description change (or a missing or edited pointer) needs a setup update. The source link keeps its recorded tag until the pointer changes. Workers install the brief's pinned version before reading their skill; if `armada skill` is missing, install that version first. The command works offline, without sign-in or a checkout.
|
|
82
82
|
|
|
83
|
-
New releases leave the coordinator's watch running. `armada status` and `armada inbox` announce them at most once per 24 hours per machine, across release versions; the dashboard's coordinator card shows update availability. Setup behind gets a separate daily notice in status, inbox and plain watch's final output
|
|
83
|
+
New releases leave the coordinator's watch running. `armada status` and `armada inbox` announce them at most once per 24 hours per machine, across release versions; the dashboard's coordinator card shows update availability. Setup behind gets a separate daily notice in status, inbox and plain watch's final output; `armada upgrade` refreshes it through the normal setup merge checks. Only a CLI below the server minimum produces a `version` item and stops either watch mode. Plain watch lists other coordinators' items with their owner, but wakes only for new own and unowned items, even with `--all`. Reading inbox preserves the watch's shown history; a narrower `--mine` read cannot prune a broader `--all` read. Run `armada upgrade`: it waits up to five checks over about two minutes for npm to serve the exact target, installs it, verifies `armada --version`, then uses the installed doctor to check setup. It runs `armada init --merge` for any setup gap the upgraded doctor marks as repairable by init (including missing hooks), through the normal setup-only merge checks. Upgrade requires the selected checkout's `armada.toml` at its Git root. If signing may wait for a person, upgrade prints a one-line fix before init; it never disables signing automatically. Init merges setup on the default branch: update this checkout from it and run `armada doctor`. Workers keep their brief's pinned version.
|
|
84
84
|
|
|
85
85
|
|
|
86
86
|
The shipping skills include every helper, reference, eval, companion manifest and license.
|
|
@@ -224,7 +224,7 @@ armada answer --note ABC-12 "PR #12 is DIRTY: resolve conflicts and hand back th
|
|
|
224
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.
|
|
225
225
|
|
|
226
226
|
|
|
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.
|
|
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. Status and `armada merge queue` hide refusals once the PR is known merged or a newer queue attempt supersedes them; the latest unresolved refusal remains visible. Without GitHub evidence, a refusal stays shown.
|
|
228
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`.
|
|
229
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.
|
|
230
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.
|
|
@@ -275,6 +275,7 @@ armada merge 35 --no-ticket # a pull request no ticket owns: armada init's, a re
|
|
|
275
275
|
```
|
|
276
276
|
|
|
277
277
|
- The checklist names every failure and exits 1: the ticket carries `ready-to-merge` and its newest `Agent status: ready-to-merge — PR #34, head <sha>` comment names this pull request with the full 40-character SHA of its current head; the pull request is open, not a draft, titled in Commitizen format and `CLEAN` for GitHub; every `[gates] required_checks` check is green on the head; no review thread is unresolved.
|
|
278
|
+
- CI is judged on the newest run of each GitHub Actions workflow for the exact head (workflow identity, run number and attempt), shared by the checklist, `--wait` and queue drain. Superseded cancelled runs do not block; running replacements are waited for. A newest cancelled check blocks as `cancelled`, and refusals include its run ID and attempt. Independent workflows, external statuses and checks without workflow metadata still count; incomplete GitHub check readings refuse the merge.
|
|
278
279
|
- A head that lacks commits of its base branch is refused, unless `[gates] local_commands` is set: then the head is merged into the base in a throwaway `git worktree`, the commands run there, and the worktree is removed.
|
|
279
280
|
- `--wait [--timeout <min>]` (30 minutes by default) keeps going until the pull request merges or a real refusal. A head behind its base that GitHub says merges cleanly is updated with GitHub's "update branch" (a merge commit, no force-push), and every required check is waited for on the new head; when the base does not require heads up to date and `[gates] local_commands` is set, it is test-merged instead. A red check, a conflict, any other refused rule, or GitHub refusing the update (a protected branch) or not applying it within 3 minutes stops it and says which. The merge lock is held only while merging, never while waiting; signed in with Armada down, it refuses before touching the branch.
|
|
280
281
|
- A head that is the handed-back SHA followed only by merge commits of the base still counts as the hand-back: each merge commit's first parent is the commit before it, its second parent is on the base branch, and its tree is the clean merge of the two (`git merge-tree`). The merged comment then names both heads (`head <new>, the handed-back <old> updated with main`).
|
package/dist/armada.js
CHANGED
|
@@ -6141,23 +6141,28 @@ function handBackProblems({ pr, repository, sha, requiredChecks }) {
|
|
|
6141
6141
|
problems.push(`the head of pull request #${pr.number} could not be read from GitHub`);
|
|
6142
6142
|
else if (sha && FULL_SHA.test(sha) && pr.headSha !== sha)
|
|
6143
6143
|
problems.push(`${sha} is not the head of pull request #${pr.number} (head is ${pr.headSha}); push, then report`);
|
|
6144
|
+
if (pr.checksComplete === false)
|
|
6145
|
+
problems.push("GitHub CI reading is incomplete; cannot verify the head checks");
|
|
6144
6146
|
problems.push(...checkProblems(pr.checks ?? [], requiredChecks));
|
|
6145
6147
|
return problems;
|
|
6146
6148
|
}
|
|
6147
6149
|
function checkIssues(checks, requiredChecks) {
|
|
6148
6150
|
const issues = [];
|
|
6149
|
-
const of = (
|
|
6150
|
-
text: `${required ? "required " : ""}check "${name}" is ${state}`,
|
|
6151
|
-
pending: state !== "failure"
|
|
6151
|
+
const of = (check, required) => ({
|
|
6152
|
+
text: `${required ? "required " : ""}check "${check.name}" is ${check.conclusion === "cancelled" ? "cancelled" : check.state}${check.runId !== undefined ? ` (run ${check.runId}, attempt ${check.runAttempt ?? "unknown"})` : ""}`,
|
|
6153
|
+
pending: check.state !== "failure"
|
|
6152
6154
|
});
|
|
6153
6155
|
if (requiredChecks.length) {
|
|
6156
|
+
for (const check of checks)
|
|
6157
|
+
if (check.workflow && check.state !== "success")
|
|
6158
|
+
issues.push(of(check, false));
|
|
6154
6159
|
for (const name of requiredChecks) {
|
|
6155
6160
|
const runs = checks.filter((c) => c.name === name);
|
|
6156
6161
|
const bad = runs.find((c) => c.state === "failure") ?? runs.find((c) => c.state !== "success");
|
|
6157
6162
|
if (!runs.length)
|
|
6158
6163
|
issues.push({ text: `required check "${name}" has not reported on the head yet`, pending: true });
|
|
6159
6164
|
else if (bad)
|
|
6160
|
-
issues.push(of(
|
|
6165
|
+
issues.push(of(bad, true));
|
|
6161
6166
|
}
|
|
6162
6167
|
} else if (!checks.length) {
|
|
6163
6168
|
issues.push({
|
|
@@ -6167,7 +6172,7 @@ function checkIssues(checks, requiredChecks) {
|
|
|
6167
6172
|
} else {
|
|
6168
6173
|
for (const c of checks)
|
|
6169
6174
|
if (c.state !== "success")
|
|
6170
|
-
issues.push(of(c
|
|
6175
|
+
issues.push(of(c, false));
|
|
6171
6176
|
}
|
|
6172
6177
|
return issues;
|
|
6173
6178
|
}
|
|
@@ -8722,14 +8727,17 @@ function normalizeMain(branch) {
|
|
|
8722
8727
|
}));
|
|
8723
8728
|
}
|
|
8724
8729
|
function normalizePull(raw, repo) {
|
|
8725
|
-
const
|
|
8726
|
-
const
|
|
8730
|
+
const commit = raw.commits.nodes[0]?.commit;
|
|
8731
|
+
const status = commit?.statusCheckRollup ?? null;
|
|
8732
|
+
const checks = headChecks(status?.contexts.nodes ?? [], commit?.checkSuites?.nodes ?? [], raw.headRefOid);
|
|
8733
|
+
const incomplete = status?.contexts.pageInfo?.hasNextPage === true || commit?.checkSuites?.pageInfo.hasNextPage === true;
|
|
8734
|
+
const ci = rollup(checks.map((c) => c.state));
|
|
8727
8735
|
return {
|
|
8728
8736
|
files: raw.files?.nodes ?? null,
|
|
8729
8737
|
additions: raw.additions ?? null,
|
|
8730
8738
|
deletions: raw.deletions ?? null,
|
|
8731
8739
|
filesComplete: !!raw.files && !raw.files.pageInfo.hasNextPage,
|
|
8732
|
-
checksComplete: !status || status.contexts.pageInfo?.hasNextPage === false,
|
|
8740
|
+
checksComplete: (!status || status.contexts.pageInfo?.hasNextPage === false) && commit?.checkSuites?.pageInfo.hasNextPage !== true,
|
|
8733
8741
|
mergeability: raw.mergeable === "CONFLICTING" || raw.mergeStateStatus === "DIRTY" ? "conflicting" : raw.mergeStateStatus === "BEHIND" ? "behind" : raw.mergeable === "MERGEABLE" ? "clean" : "unknown",
|
|
8734
8742
|
url: raw.url,
|
|
8735
8743
|
number: raw.number,
|
|
@@ -8737,8 +8745,8 @@ function normalizePull(raw, repo) {
|
|
|
8737
8745
|
title: raw.title,
|
|
8738
8746
|
state: raw.state === "OPEN" ? "open" : raw.state === "MERGED" ? "merged" : "closed",
|
|
8739
8747
|
draft: raw.isDraft,
|
|
8740
|
-
ci:
|
|
8741
|
-
checks
|
|
8748
|
+
ci: incomplete ? ci === "failure" || status?.state === "FAILURE" ? "failure" : "pending" : ci,
|
|
8749
|
+
checks,
|
|
8742
8750
|
mergeable: raw.mergeable,
|
|
8743
8751
|
headRef: raw.headRefName,
|
|
8744
8752
|
headSha: raw.headRefOid,
|
|
@@ -8747,13 +8755,71 @@ function normalizePull(raw, repo) {
|
|
|
8747
8755
|
mergedAt: raw.mergedAt
|
|
8748
8756
|
};
|
|
8749
8757
|
}
|
|
8758
|
+
function headChecks(contexts, suites, head) {
|
|
8759
|
+
const latest = new Map;
|
|
8760
|
+
const workflowRun = (suite) => suite?.commit.oid === head ? suite.workflowRun : null;
|
|
8761
|
+
for (const suite of [
|
|
8762
|
+
...suites,
|
|
8763
|
+
...contexts.flatMap((c) => c.__typename === "CheckRun" && c.checkSuite ? [c.checkSuite] : [])
|
|
8764
|
+
]) {
|
|
8765
|
+
const run = workflowRun(suite);
|
|
8766
|
+
if (!run)
|
|
8767
|
+
continue;
|
|
8768
|
+
const previous = latest.get(run.workflow.id)?.workflowRun;
|
|
8769
|
+
if (!previous || run.runNumber > previous.runNumber || run.runNumber === previous.runNumber && run.runAttempt > previous.runAttempt)
|
|
8770
|
+
latest.set(run.workflow.id, suite);
|
|
8771
|
+
}
|
|
8772
|
+
const checks = [];
|
|
8773
|
+
const represented = new Set;
|
|
8774
|
+
for (const c of contexts) {
|
|
8775
|
+
if (c.__typename === "StatusContext") {
|
|
8776
|
+
checks.push({ name: c.context, state: checkState("", c.state) });
|
|
8777
|
+
continue;
|
|
8778
|
+
}
|
|
8779
|
+
const run = workflowRun(c.checkSuite);
|
|
8780
|
+
const newestSuite = run && latest.get(run.workflow.id);
|
|
8781
|
+
const newest = newestSuite?.workflowRun;
|
|
8782
|
+
if (run && newest && (run.runNumber < newest.runNumber || run.runNumber === newest.runNumber && run.runAttempt < newest.runAttempt))
|
|
8783
|
+
continue;
|
|
8784
|
+
if (run)
|
|
8785
|
+
represented.add(run.workflow.id);
|
|
8786
|
+
const suiteCancelled = newestSuite?.status === "COMPLETED" && newestSuite.conclusion === "CANCELLED";
|
|
8787
|
+
checks.push({
|
|
8788
|
+
name: c.name,
|
|
8789
|
+
state: suiteCancelled ? "failure" : checkState(c.status, c.conclusion),
|
|
8790
|
+
...suiteCancelled || c.conclusion === "CANCELLED" ? { conclusion: "cancelled" } : {},
|
|
8791
|
+
...run?.databaseId != null ? { runId: run.databaseId, runAttempt: run.runAttempt } : {}
|
|
8792
|
+
});
|
|
8793
|
+
}
|
|
8794
|
+
for (const [id, suite] of latest) {
|
|
8795
|
+
const run = suite.workflowRun;
|
|
8796
|
+
if (!run)
|
|
8797
|
+
continue;
|
|
8798
|
+
const cancelled = suite.status === "COMPLETED" && suite.conclusion === "CANCELLED";
|
|
8799
|
+
const state = checkState(suite.status, suite.conclusion);
|
|
8800
|
+
const hasProblem = checks.some((check) => check.runId === run.databaseId && check.state !== "success");
|
|
8801
|
+
if (cancelled || !represented.has(id) && state !== "success" || suite.status && state !== "success" && !hasProblem) {
|
|
8802
|
+
checks.push({
|
|
8803
|
+
name: `workflow run ${run.databaseId ?? run.runNumber}`,
|
|
8804
|
+
state,
|
|
8805
|
+
workflow: true,
|
|
8806
|
+
...cancelled ? { conclusion: "cancelled" } : {},
|
|
8807
|
+
...run.databaseId != null ? { runId: run.databaseId, runAttempt: run.runAttempt } : {}
|
|
8808
|
+
});
|
|
8809
|
+
}
|
|
8810
|
+
}
|
|
8811
|
+
return checks;
|
|
8812
|
+
}
|
|
8813
|
+
var WORKFLOW_RUN_FIELDS = `status conclusion commit { oid } workflowRun { databaseId runNumber runAttempt workflow { id } }`;
|
|
8750
8814
|
var PULL_FIELDS = `
|
|
8751
8815
|
fragment P on PullRequest {
|
|
8752
8816
|
number title url state isDraft mergeable mergeStateStatus headRefName headRefOid createdAt updatedAt mergedAt additions deletions
|
|
8753
8817
|
files(first: 100) { nodes { path additions deletions changeType } pageInfo { hasNextPage } }
|
|
8754
|
-
commits(last: 1) { nodes { commit {
|
|
8818
|
+
commits(last: 1) { nodes { commit {
|
|
8819
|
+
checkSuites(first: 50) { nodes { ${WORKFLOW_RUN_FIELDS} } pageInfo { hasNextPage } }
|
|
8820
|
+
statusCheckRollup { state contexts(first: 50) { pageInfo { hasNextPage } nodes {
|
|
8755
8821
|
__typename
|
|
8756
|
-
... on CheckRun { name status conclusion }
|
|
8822
|
+
... on CheckRun { name status conclusion checkSuite { ${WORKFLOW_RUN_FIELDS} } }
|
|
8757
8823
|
... on StatusContext { context state }
|
|
8758
8824
|
} } } } } }
|
|
8759
8825
|
}`;
|
|
@@ -8845,7 +8911,8 @@ async function fetchForge(opts) {
|
|
|
8845
8911
|
...repo.open.pageInfo?.hasNextPage ? ["more than 100 open pull requests; the least recently updated are ignored"] : [],
|
|
8846
8912
|
...repo.open.nodes.flatMap((pr) => [
|
|
8847
8913
|
...pr.files?.pageInfo.hasNextPage ? [`PR #${pr.number}: changed files are incomplete (first 100)`] : [],
|
|
8848
|
-
...pr.commits.nodes[0]?.commit.statusCheckRollup?.contexts.pageInfo?.hasNextPage ? [`PR #${pr.number}: checks are incomplete (first 50)`] : []
|
|
8914
|
+
...pr.commits.nodes[0]?.commit.statusCheckRollup?.contexts.pageInfo?.hasNextPage ? [`PR #${pr.number}: checks are incomplete (first 50)`] : [],
|
|
8915
|
+
...pr.commits.nodes[0]?.commit.checkSuites?.pageInfo.hasNextPage ? [`PR #${pr.number}: workflow suites are incomplete (first 50)`] : []
|
|
8849
8916
|
])
|
|
8850
8917
|
]
|
|
8851
8918
|
};
|
|
@@ -8927,6 +8994,9 @@ async function fetchMergePull(opts) {
|
|
|
8927
8994
|
const raw = json.data?.repository?.pullRequest;
|
|
8928
8995
|
if (!raw)
|
|
8929
8996
|
return null;
|
|
8997
|
+
const commit = raw.commits.nodes[0]?.commit;
|
|
8998
|
+
if (raw.state === "OPEN" && (commit?.checkSuites?.pageInfo.hasNextPage || commit?.statusCheckRollup?.contexts.pageInfo?.hasNextPage))
|
|
8999
|
+
throw new GithubError("GitHub: merge CI reading is incomplete (first 50 check suites or contexts); nothing was merged");
|
|
8930
9000
|
const pr = normalizePull(raw, opts.repository);
|
|
8931
9001
|
const threads = raw.reviewThreads.nodes;
|
|
8932
9002
|
return {
|
|
@@ -9328,10 +9398,10 @@ var MERGE_QUEUE_LEASE = "merge-queue";
|
|
|
9328
9398
|
var QUEUE_STALL_MS = 2 * 60000;
|
|
9329
9399
|
var queueOpen = (e) => e.state === "queued" || e.state === "merging";
|
|
9330
9400
|
var REFUSED_SHOWN_MS = 24 * 60 * 60000;
|
|
9331
|
-
function shownQueue(entries, now) {
|
|
9401
|
+
function shownQueue(entries, now, mergedPrs = []) {
|
|
9332
9402
|
const open = entries.filter(queueOpen).sort((a, b) => Number(b.state === "merging") - Number(a.state === "merging") || a.queuedAt.localeCompare(b.queuedAt) || a.id - b.id);
|
|
9333
9403
|
const since = now.getTime() - REFUSED_SHOWN_MS;
|
|
9334
|
-
const refused = entries.filter((e) => e.state === "refused" && Date.parse(e.finishedAt ?? e.updatedAt) >= since && !entries.some((o) => o.pr === e.pr && o.id > e.id)).sort((a, b) => (b.finishedAt ?? "").localeCompare(a.finishedAt ?? "") || b.id - a.id);
|
|
9404
|
+
const refused = entries.filter((e) => e.state === "refused" && !mergedPrs.includes(e.pr) && Date.parse(e.finishedAt ?? e.updatedAt) >= since && !entries.some((o) => o.pr === e.pr && o.id > e.id)).sort((a, b) => (b.finishedAt ?? "").localeCompare(a.finishedAt ?? "") || b.id - a.id);
|
|
9335
9405
|
return [...open, ...refused];
|
|
9336
9406
|
}
|
|
9337
9407
|
|
|
@@ -13978,11 +14048,11 @@ var skills_generated_default = [
|
|
|
13978
14048
|
files: [
|
|
13979
14049
|
{
|
|
13980
14050
|
path: "MERGE.md",
|
|
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"
|
|
14051
|
+
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\nThe checklist, `--wait` and queue drain judge the newest run of each GitHub Actions workflow on the exact head, by workflow identity and run number/attempt. A cancelled older run replaced on that head does not block; a running replacement is waited for. A newest cancelled check still blocks as `cancelled`, with its run ID and attempt in the refusal. Checks without workflow metadata and external statuses remain independent; incomplete GitHub check readings refuse the merge. This does not rerun CI or change the pinned-SHA merge.\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. Refusals disappear from it and status once GitHub reports the PR merged or a newer queue attempt supersedes them; the newest unresolved refusal stays visible. If GitHub is unavailable, refusals remain until a later successful read; `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"
|
|
13982
14052
|
},
|
|
13983
14053
|
{
|
|
13984
14054
|
path: "REFERENCE.md",
|
|
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"
|
|
14055
|
+
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; `armada upgrade` refreshes it through the normal setup merge checks. Setup drift leaves the watch running. Run `armada upgrade`: it waits for npm, installs the release, checks `armada --version`, and runs `armada init --merge` when the upgraded doctor finds a setup gap init can repair, including a missing hook. If signing may wait for a person, upgrade prints a one-line fix before init; it never disables signing automatically. Update this checkout from the default branch after the setup merge and run `armada doctor`. 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"
|
|
13986
14056
|
},
|
|
13987
14057
|
{
|
|
13988
14058
|
path: "SKILL.md",
|
|
@@ -17406,6 +17476,14 @@ var bad = (id, level, message, fix) => ({
|
|
|
17406
17476
|
message,
|
|
17407
17477
|
fix
|
|
17408
17478
|
});
|
|
17479
|
+
var manualGap = (id, level, message, fix) => ({
|
|
17480
|
+
...bad(id, level, message, fix),
|
|
17481
|
+
repair: "manual"
|
|
17482
|
+
});
|
|
17483
|
+
var initGap = (id, level, message, fix) => ({
|
|
17484
|
+
...bad(id, level, message, fix),
|
|
17485
|
+
repair: "init"
|
|
17486
|
+
});
|
|
17409
17487
|
function optionalFeatures(config) {
|
|
17410
17488
|
const checks = [];
|
|
17411
17489
|
const info = (id, message) => checks.push({ id: `optional:${id}`, level: "info", message, fix: null });
|
|
@@ -17550,18 +17628,18 @@ async function checkRepository(view, armadaVersion, stopHookInstalledIn, session
|
|
|
17550
17628
|
const checks = [];
|
|
17551
17629
|
const configText = await view.readFile(CONFIG_FILE);
|
|
17552
17630
|
if (configText === null)
|
|
17553
|
-
checks.push(
|
|
17631
|
+
checks.push(initGap("config", "error", `${CONFIG_FILE} is missing`, "run `armada init --program-root <ISSUE-ID>` to open a pull request that adds it"));
|
|
17554
17632
|
else
|
|
17555
17633
|
try {
|
|
17556
17634
|
const config = parseConfig(configText, CONFIG_FILE);
|
|
17557
17635
|
checks.push(ok("config", `${CONFIG_FILE} is valid (project ${config.project.slug})`));
|
|
17558
17636
|
const extra = config.brief.extra;
|
|
17559
17637
|
if (extra)
|
|
17560
|
-
checks.push(await view.readFile(extra) === null ?
|
|
17638
|
+
checks.push(await view.readFile(extra) === null ? manualGap("brief-extra", "warning", `[brief] extra names ${extra}, which is missing: briefs go out without the project conventions`, `add ${extra}, or fix the path in ${CONFIG_FILE}`) : ok("brief-extra", `${extra} goes into every brief as the project conventions`));
|
|
17561
17639
|
} catch (err) {
|
|
17562
17640
|
if (!(err instanceof ConfigError))
|
|
17563
17641
|
throw err;
|
|
17564
|
-
checks.push(
|
|
17642
|
+
checks.push(manualGap("config", "error", err.message, `fix the keys listed above in ${CONFIG_FILE}`));
|
|
17565
17643
|
}
|
|
17566
17644
|
let lock = null;
|
|
17567
17645
|
let lockError = null;
|
|
@@ -17573,7 +17651,7 @@ async function checkRepository(view, armadaVersion, stopHookInstalledIn, session
|
|
|
17573
17651
|
lockError = err.message;
|
|
17574
17652
|
}
|
|
17575
17653
|
if (lockError)
|
|
17576
|
-
checks.push(
|
|
17654
|
+
checks.push(manualGap("skills-lock", "error", lockError, `repair or delete ${SKILLS_LOCK_FILE}`));
|
|
17577
17655
|
const wholeDir = await linksWholeDir(view);
|
|
17578
17656
|
const differing = [];
|
|
17579
17657
|
let present = 0;
|
|
@@ -17581,13 +17659,13 @@ async function checkRepository(view, armadaVersion, stopHookInstalledIn, session
|
|
|
17581
17659
|
const installed = await installedHash(view, skill.name);
|
|
17582
17660
|
const id = `skill:${skill.name}`;
|
|
17583
17661
|
if (installed === null) {
|
|
17584
|
-
checks.push(
|
|
17662
|
+
checks.push(initGap(id, "error", `skill ${skill.name} is missing from ${AGENTS_SKILLS_DIR}`, "run `armada init`"));
|
|
17585
17663
|
continue;
|
|
17586
17664
|
}
|
|
17587
17665
|
present++;
|
|
17588
17666
|
if (installed !== deliveredHash(skill, skillRef(lock?.skills[skill.name]))) {
|
|
17589
17667
|
differing.push(skill.name);
|
|
17590
|
-
checks.push(
|
|
17668
|
+
checks.push(initGap(id, "warning", `skill ${skill.name} differs from the version in Armada ${armadaVersion}`, "run `armada init` to open a pull request that updates it"));
|
|
17591
17669
|
} else
|
|
17592
17670
|
checks.push(ok(id, `skill ${skill.name} is up to date`));
|
|
17593
17671
|
const target = await view.readLink(linkPath(skill.name));
|
|
@@ -17597,39 +17675,44 @@ async function checkRepository(view, armadaVersion, stopHookInstalledIn, session
|
|
|
17597
17675
|
else if (target === skillLinkTarget(skill.name))
|
|
17598
17676
|
checks.push(ok(linkId, `${linkPath(skill.name)} links to ${skillDir(skill.name)}`));
|
|
17599
17677
|
else
|
|
17600
|
-
checks.push(
|
|
17678
|
+
checks.push(initGap(linkId, "error", target === null ? `${linkPath(skill.name)} is not a link to ${skillDir(skill.name)}, so Claude Code does not see the skill` : `${linkPath(skill.name)} links to ${target} instead of ${skillLinkTarget(skill.name)}`, "run `armada init`"));
|
|
17601
17679
|
if (lockError)
|
|
17602
17680
|
continue;
|
|
17603
17681
|
const entry = lock?.skills[skill.name];
|
|
17604
17682
|
const lockId = `skill-lock:${skill.name}`;
|
|
17605
17683
|
if (!entry)
|
|
17606
|
-
checks.push(
|
|
17684
|
+
checks.push(initGap(lockId, "error", `${SKILLS_LOCK_FILE} does not record ${skill.name}`, "run `armada init`"));
|
|
17607
17685
|
else if (entry.sourceType !== (skill.delivery === "pointer" ? "armada-cli" : "github"))
|
|
17608
|
-
checks.push(
|
|
17686
|
+
checks.push(initGap(lockId, "warning", `${SKILLS_LOCK_FILE} records the wrong delivery for ${skill.name}`, "run `armada init`"));
|
|
17609
17687
|
else if (installed !== null && entry.computedHash !== installed)
|
|
17610
|
-
checks.push(
|
|
17688
|
+
checks.push(initGap(lockId, "warning", `${SKILLS_LOCK_FILE} records a different content for ${skill.name} than ${skillDir(skill.name)}`, "run `armada init`"));
|
|
17611
17689
|
else
|
|
17612
17690
|
checks.push(ok(lockId, `${SKILLS_LOCK_FILE} records ${skill.name}`));
|
|
17613
17691
|
}
|
|
17614
17692
|
const behind = behindOf(lock, differing);
|
|
17615
17693
|
if (behind)
|
|
17616
|
-
checks.push(
|
|
17694
|
+
checks.push((ahead(behind, armadaVersion) ? manualGap : initGap)("skills-version", "warning", skillsBehindMessage(behind, armadaVersion), skillsBehindFix(behind, armadaVersion)));
|
|
17617
17695
|
else if (present)
|
|
17618
17696
|
checks.push(ok("skills-version", `this project's Armada skills match Armada ${armadaVersion}'s`));
|
|
17619
17697
|
const settings = await view.readFile(CONDUCTOR_SETTINGS);
|
|
17620
17698
|
if (settings === null)
|
|
17621
|
-
checks.push(
|
|
17699
|
+
checks.push(initGap("conductor", "error", `${CONDUCTOR_SETTINGS} is missing`, "run `armada init` to add it with a setup script"));
|
|
17622
17700
|
else
|
|
17623
17701
|
try {
|
|
17624
|
-
|
|
17702
|
+
if (conductorSetup(settings))
|
|
17703
|
+
checks.push(ok("conductor", `${CONDUCTOR_SETTINGS} has a setup script`));
|
|
17704
|
+
else {
|
|
17705
|
+
withSetup(settings, await guessSetupCommand(view));
|
|
17706
|
+
checks.push(initGap("conductor", "error", `${CONDUCTOR_SETTINGS} has no [scripts] setup`, "run `armada init`, or add a setup command under [scripts]"));
|
|
17707
|
+
}
|
|
17625
17708
|
} catch (err) {
|
|
17626
17709
|
if (!(err instanceof SetupError))
|
|
17627
17710
|
throw err;
|
|
17628
|
-
checks.push(
|
|
17711
|
+
checks.push(manualGap("conductor", "error", err.message, `fix ${CONDUCTOR_SETTINGS}`));
|
|
17629
17712
|
}
|
|
17630
17713
|
checks.push(await stopHookCheck(view, stopHookInstalledIn));
|
|
17631
17714
|
checks.push(await sessionStartHookCheck(view, sessionStartHookInstalledIn));
|
|
17632
|
-
checks.push(ignoresShipArtifacts(await view.readFile(GITIGNORE)) ? ok("gitignore", `${GITIGNORE} ignores ${SHIP_ARTIFACTS}`) :
|
|
17715
|
+
checks.push(ignoresShipArtifacts(await view.readFile(GITIGNORE)) ? ok("gitignore", `${GITIGNORE} ignores ${SHIP_ARTIFACTS}`) : initGap("gitignore", "warning", `${GITIGNORE} does not ignore ${SHIP_ARTIFACTS}, so the ship-pr-dev skill refuses to start`, "run `armada init`"));
|
|
17633
17716
|
return checks;
|
|
17634
17717
|
}
|
|
17635
17718
|
var isObject = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
|
|
@@ -17725,11 +17808,13 @@ async function sessionStartHookCheck(view, installedIn) {
|
|
|
17725
17808
|
if (installedIn)
|
|
17726
17809
|
return ok(id, `${installedIn} has Armada’s session-start hook: briefs coordinators after compact or resume`);
|
|
17727
17810
|
try {
|
|
17728
|
-
|
|
17811
|
+
const text = await view.readFile(CLAUDE_SETTINGS);
|
|
17812
|
+
withArmadaHooks(text);
|
|
17813
|
+
return hasSessionStartHook(claudeSettings(text)) ? ok(id, `${CLAUDE_SETTINGS} has Armada's session-start hook: briefs coordinators after compact or resume`) : initGap(id, "warning", `${CLAUDE_SETTINGS} has no Armada session-start hook, so compact or resume can lose the coordinator's watch context`, "run `armada init` and accept the hooks (this repository’s settings only, never your user settings)");
|
|
17729
17814
|
} catch (err) {
|
|
17730
17815
|
if (!(err instanceof SetupError))
|
|
17731
17816
|
throw err;
|
|
17732
|
-
return
|
|
17817
|
+
return manualGap(id, "warning", `Claude Code session-start hook not checked: ${err.message}`, `fix ${CLAUDE_SETTINGS}`);
|
|
17733
17818
|
}
|
|
17734
17819
|
}
|
|
17735
17820
|
async function stopHookCheck(view, installedIn) {
|
|
@@ -17738,13 +17823,15 @@ async function stopHookCheck(view, installedIn) {
|
|
|
17738
17823
|
return ok(id, `${installedIn} has Armada's stop hook (ARMADA_STOP_HOOK=off turns it off)`);
|
|
17739
17824
|
let settings;
|
|
17740
17825
|
try {
|
|
17741
|
-
|
|
17826
|
+
const text = await view.readFile(CLAUDE_SETTINGS);
|
|
17827
|
+
withArmadaHooks(text);
|
|
17828
|
+
settings = claudeSettings(text);
|
|
17742
17829
|
} catch (err) {
|
|
17743
17830
|
if (!(err instanceof SetupError))
|
|
17744
17831
|
throw err;
|
|
17745
|
-
return
|
|
17832
|
+
return manualGap(id, "warning", `Claude Code stop hook not checked: ${err.message}`, `fix ${CLAUDE_SETTINGS}`);
|
|
17746
17833
|
}
|
|
17747
|
-
return hasStopHook(settings) ? ok(id, `${CLAUDE_SETTINGS} has Armada's stop hook: a Claude Code coordinator cannot end its turn while workers are in flight and no armada watch runs (ARMADA_STOP_HOOK=off turns it off)`) :
|
|
17834
|
+
return hasStopHook(settings) ? ok(id, `${CLAUDE_SETTINGS} has Armada's stop hook: a Claude Code coordinator cannot end its turn while workers are in flight and no armada watch runs (ARMADA_STOP_HOOK=off turns it off)`) : initGap(id, "warning", `${CLAUDE_SETTINGS} has no Armada stop hook, so a Claude Code coordinator can stop watching its fleet without noticing`, "run `armada init` and accept the stop hook (this repository's settings only, never your user settings)");
|
|
17748
17835
|
}
|
|
17749
17836
|
async function guessSetupCommand(view) {
|
|
17750
17837
|
const has = async (p) => await view.readFile(p) !== null;
|
|
@@ -18033,7 +18120,7 @@ function buildStatus({
|
|
|
18033
18120
|
...launchWhenUnblocked ? { launchWhenUnblocked } : {},
|
|
18034
18121
|
...slots ? { slots } : {},
|
|
18035
18122
|
...holds ? { holds } : {},
|
|
18036
|
-
...queue ? { queue: shownQueue(queue, now) } : {},
|
|
18123
|
+
...queue ? { queue: shownQueue(queue, now, forge?.prs.filter((p) => p.state === "merged").map((p) => p.number) ?? []) } : {},
|
|
18037
18124
|
main: forge?.main ? mainHealth(forge.main, config.gates.requiredChecks, forge.mainComplete) : null,
|
|
18038
18125
|
progress: {
|
|
18039
18126
|
done: m.program.filter((ticket) => m.isLeaf(ticket) && isDone(ticket)).length,
|
|
@@ -18419,7 +18506,7 @@ ${attachments.join(`
|
|
|
18419
18506
|
};
|
|
18420
18507
|
}
|
|
18421
18508
|
// package.json
|
|
18422
|
-
var version = "0.2.
|
|
18509
|
+
var version = "0.2.66";
|
|
18423
18510
|
|
|
18424
18511
|
// src/io.ts
|
|
18425
18512
|
class UsageError extends Error {
|
|
@@ -27517,7 +27604,31 @@ async function merge2(io, config, credentials, a, configPath, guards) {
|
|
|
27517
27604
|
}
|
|
27518
27605
|
if (a.rest.length !== 1)
|
|
27519
27606
|
throw new UsageError("use armada merge queue [--json] or armada merge queue remove <pr>");
|
|
27520
|
-
const
|
|
27607
|
+
const history = await fleet.queueList();
|
|
27608
|
+
const now = (io.now ?? (() => new Date))();
|
|
27609
|
+
const candidates = shownQueue(history, now).filter((entry) => entry.state === "refused");
|
|
27610
|
+
const merged = [];
|
|
27611
|
+
if (credentials.githubToken) {
|
|
27612
|
+
const token = credentials.githubToken;
|
|
27613
|
+
const results = await Promise.allSettled(candidates.map((entry) => fetchPullRequest({
|
|
27614
|
+
token,
|
|
27615
|
+
repository: config.github.repository,
|
|
27616
|
+
number: entry.pr,
|
|
27617
|
+
...httpOptions(io)
|
|
27618
|
+
})));
|
|
27619
|
+
for (const result of results) {
|
|
27620
|
+
if (result.status === "fulfilled" && result.value?.state === "merged")
|
|
27621
|
+
merged.push(result.value.number);
|
|
27622
|
+
}
|
|
27623
|
+
if (results.some((result) => result.status === "rejected"))
|
|
27624
|
+
io.stderr(`Warning: GitHub could not be read for some refused PRs; their refusals remain shown.
|
|
27625
|
+
`);
|
|
27626
|
+
} else if (candidates.length) {
|
|
27627
|
+
io.stderr(`Warning: GitHub was not read (no token); unresolved refusals remain shown.
|
|
27628
|
+
`);
|
|
27629
|
+
}
|
|
27630
|
+
const visible = new Set(shownQueue(history, now, merged).map((entry) => entry.id));
|
|
27631
|
+
const entries = history.filter((entry) => entry.state !== "refused" || visible.has(entry.id));
|
|
27521
27632
|
const watch = await queueWatch();
|
|
27522
27633
|
io.stdout(a.json ? `${JSON.stringify({ entries, holds: [], watch, result: "Result: not merged (queue listed; nothing was merged)" }, null, 2)}
|
|
27523
27634
|
` : entries.length ? `${queueLines(entries).join(`
|
|
@@ -29633,7 +29744,6 @@ ${created.url}
|
|
|
29633
29744
|
// src/upgrade.ts
|
|
29634
29745
|
var ATTEMPTS = 5;
|
|
29635
29746
|
var WAIT_MS = 30000;
|
|
29636
|
-
var SETUP_CHECK = /^(skill:|skill-link:|skill-lock:|skills-version$|skills-lock$|conductor$|stop-hook$|gitignore$)/;
|
|
29637
29747
|
async function targetVersion(io) {
|
|
29638
29748
|
const fetch2 = io.fetch ?? globalThis.fetch;
|
|
29639
29749
|
const server = heard(io).server;
|
|
@@ -29694,18 +29804,29 @@ async function upgrade(io, running, root) {
|
|
|
29694
29804
|
} catch {}
|
|
29695
29805
|
if (doctor.timedOut || doctor.code !== 0 && doctor.code !== 1 || report?.schemaVersion !== 1 || report.armadaVersion !== target || report.root !== root || !Array.isArray(report.checks) || !report.checks.length || report.checks.some((check) => !check || typeof check.id !== "string" || !["ok", "info", "warning", "error"].includes(check.level)))
|
|
29696
29806
|
throw new CommandError("the upgraded doctor could not check setup; run armada doctor before refreshing it");
|
|
29697
|
-
const
|
|
29807
|
+
const manualGaps = report.checks.some((check) => check.repair === "manual" && ["warning", "error"].includes(check.level));
|
|
29808
|
+
const setupBehind = report.checks.some((check) => check.repair === "init" && ["warning", "error"].includes(check.level));
|
|
29698
29809
|
if (report.checks.some((check) => check.id === "skills-version" && check.level !== "ok" && check.fix?.includes("update the CLI")))
|
|
29699
29810
|
throw new CommandError(`this project's skills require a CLI newer than Armada ${target}; retry after npm serves it`);
|
|
29700
29811
|
if (setupBehind) {
|
|
29701
|
-
io.stdout(`Armada ${target} verified;
|
|
29812
|
+
io.stdout(`Armada ${target} verified; repairing setup gaps with armada init --merge.
|
|
29813
|
+
`);
|
|
29814
|
+
if (manualGaps)
|
|
29815
|
+
io.stderr(`armada: doctor also found setup gaps needing manual repair; run armada doctor for the fixes.
|
|
29816
|
+
`);
|
|
29817
|
+
const signing = report.checks.find((check) => check.id === "git-signing" && check.level === "warning");
|
|
29818
|
+
if (signing)
|
|
29819
|
+
io.stderr(`armada: setup commit signing: ${signing.message.replace(/\s+/g, " ")}; fix: ${signing.fix?.replace(/\s+/g, " ") ?? "run armada doctor"}; if branch rules allow unsigned commits, retry with GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0=commit.gpgsign GIT_CONFIG_VALUE_0=false armada init --merge.
|
|
29702
29820
|
`);
|
|
29703
29821
|
const init = await exec("armada", ["init", "--merge"], { cwd: root, timeoutMs: 20 * 60000 });
|
|
29704
29822
|
if (init.code !== 0 || init.timedOut)
|
|
29705
29823
|
throw new CommandError(`Armada ${target} is installed, but setup refresh did not finish; run armada init --merge to resume`);
|
|
29706
|
-
io.stdout(`Armada ${target} installed; setup refresh completed.
|
|
29824
|
+
io.stdout(`Armada ${target} installed; setup refresh completed on the default branch; update this checkout from it and run armada doctor.
|
|
29707
29825
|
`);
|
|
29708
|
-
} else
|
|
29826
|
+
} else if (manualGaps)
|
|
29827
|
+
io.stdout(`Armada ${target} installed; setup needs manual repair; run armada doctor for the fixes.
|
|
29828
|
+
`);
|
|
29829
|
+
else
|
|
29709
29830
|
io.stdout(`Armada ${target} installed; setup is up to date.
|
|
29710
29831
|
`);
|
|
29711
29832
|
return 0;
|
|
@@ -29933,9 +30054,9 @@ var COMMAND_HELP = {
|
|
|
29933
30054
|
`,
|
|
29934
30055
|
upgrade: ` upgrade Install the newest Armada npm serves, verify armada --version,
|
|
29935
30056
|
then check setup with the upgraded doctor. Waits up to five publication
|
|
29936
|
-
checks over about two minutes. Runs armada init --merge
|
|
29937
|
-
|
|
29938
|
-
workers keep their launch's pinned version
|
|
30057
|
+
checks over about two minutes. Runs armada init --merge for
|
|
30058
|
+
setup gaps the upgraded doctor marks as repairable by init.
|
|
30059
|
+
Requires armada.toml at the selected Git root; workers keep their launch's pinned version
|
|
29939
30060
|
`,
|
|
29940
30061
|
init: ` init [--program-root <ISSUE-ID>] [--name <name>] [--slug <slug>] [--no-stop-hook] [--merge]
|
|
29941
30062
|
Open one pull request that installs or updates it all, create the
|