@soleur/opencode 3.400.1 → 3.400.3
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/package.json
CHANGED
package/skills/merge-pr/SKILL.md
CHANGED
|
@@ -331,9 +331,9 @@ Announce the PR URL.
|
|
|
331
331
|
|
|
332
332
|
### 5.1 Queue Auto-Merge
|
|
333
333
|
|
|
334
|
-
**A draft PR is readied first, with a user token (`GITHUB_TOKEN` cannot ready a PR), and armed only after its ready run exists (ADR-276 S3):** `K=$(bash "${CLAUDE_PLUGIN_ROOT}/scripts/ci-head-verdict.sh" ready-count <number>) && gh pr ready <number> && bash "${CLAUDE_PLUGIN_ROOT}/scripts/ci-head-verdict.sh" wait-ready-run <number> --before-count "$K"`. Run it as one Bash call with `timeout: 420000` and
|
|
334
|
+
**A draft PR is readied first, with a user token (`GITHUB_TOKEN` cannot ready a PR), and armed only after its ready run exists (ADR-276 S3):** `K=$(bash "${CLAUDE_PLUGIN_ROOT}/scripts/ci-head-verdict.sh" ready-count <number>) && gh pr ready <number> && bash "${CLAUDE_PLUGIN_ROOT}/scripts/ci-head-verdict.sh" wait-ready-run <number> --before-count "$K"`. Run it as one Bash call with `timeout: 420000` and arm through the arm check below ONLY on exit 0; otherwise report "readied but unarmed" with the last stdout line and follow [ready-run-wait.md](${CLAUDE_PLUGIN_ROOT}/skills/ship/references/ready-run-wait.md) (a failed `ready-count` or an `api-error` needs no undo). The 5.2 poll reads a red `test` through the same resolver (`ready_unarmed` stops it).
|
|
335
335
|
|
|
336
|
-
**Merge gate.** Arm only
|
|
336
|
+
**Merge gate.** Arm only through the arm check in [review-evidence-comment.md](${CLAUDE_PLUGIN_ROOT}/skills/review/references/review-evidence-comment.md#arm-check), which arms when the latest `Review-Evidence:` comment (posted by `soleur:review`) says `coverage=full` and `unresolved-P1-P2=0` and covers every non-merge commit on the PR head. Run its first statement, then the lock block below, in one Bash call; on refusal run `soleur:review`, then the check again. The gate text and the domain seats: the same file.
|
|
337
337
|
|
|
338
338
|
**Never arm (enqueue) a cross-repository (fork) PR, or one touching `.github/**`, without explicit operator confirmation.** `merge_group` runs the candidate's workflows in the base-repo context with repo secrets, so a pre-queue-green fork or workflow edit can exfiltrate them before anyone reads a run. Check first: `gh pr view <number> --json isCrossRepository --jq .isCrossRepository` and `gh api repos/{owner}/{repo}/pulls/<number>/files --paginate --jq '.[].filename | select(startswith(".github/"))'` (not `gh pr view --json files`: it stops at 100 files); a `true` or any output means stop and ask.
|
|
339
339
|
|
|
@@ -341,12 +341,12 @@ Announce the PR URL.
|
|
|
341
341
|
SS_LIB="${CLAUDE_PLUGIN_ROOT}/scripts/lib/session-state.sh"
|
|
342
342
|
if [[ -r "$SS_LIB" ]] && command -v flock >/dev/null 2>&1; then
|
|
343
343
|
bash "$SS_LIB" with_lock merge-main 600 -- \
|
|
344
|
-
gh pr merge <number> --squash --auto
|
|
344
|
+
gh pr merge <number> --squash --auto --match-head-commit "${H:?run the arm check in this call}"
|
|
345
345
|
rc=$?
|
|
346
346
|
else
|
|
347
347
|
# Degrade open, loudly — the lock is advisory (ADR-178 §5).
|
|
348
348
|
echo "SOLEUR_SESSION_STATE_UNAVAILABLE path=$SS_LIB reason=running-unlocked"
|
|
349
|
-
gh pr merge <number> --squash --auto
|
|
349
|
+
gh pr merge <number> --squash --auto --match-head-commit "${H:?run the arm check in this call}"
|
|
350
350
|
rc=$?
|
|
351
351
|
fi
|
|
352
352
|
# rc=99 comes only from `with_lock` — but it means "the lock could not be
|
|
@@ -32,5 +32,57 @@ gh pr comment <number> --body "Review-Evidence: head=<short sha reviewed>; soleu
|
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
This is a self-attestation by the reviewing agent, not tamper-proof: anyone with comment access can post the same
|
|
35
|
-
text and it survives later pushes.
|
|
36
|
-
|
|
35
|
+
text and it survives later pushes. A `coverage` other than `full`, a nonzero `unresolved-P1-P2`, or a fix commit
|
|
36
|
+
after the head it names is not a pass; the arm check below enforces all three.
|
|
37
|
+
|
|
38
|
+
Under a merge queue, the head the comment covers must be the head that enters the queue: a fix commit pushed after
|
|
39
|
+
the comment and left unreviewed rides the queue, and this repo's queue builds one entry at a time
|
|
40
|
+
(`max_entries_to_build = 1`), so pulling the PR out and re-entering puts it at the back. Re-review the new commits
|
|
41
|
+
and post a fresh comment before arming or re-arming `gh pr merge --squash --auto`; when auto-merge is already armed,
|
|
42
|
+
run `gh pr merge <number> --disable-auto` before pushing a fix. **Why:** #12518 — four CI-guard fix commits entered
|
|
43
|
+
the queue past the evidence head, and their P3 findings had to be fixed forward in #12633.
|
|
44
|
+
|
|
45
|
+
## Arm check
|
|
46
|
+
|
|
47
|
+
Ship's arm and CI-fix re-arm and merge-pr's merge gate run this one check; it is the only copy. It takes the
|
|
48
|
+
latest `Review-Evidence:` comment, requires its first line to say `coverage=full` and `unresolved-P1-P2=0` (each
|
|
49
|
+
field exactly once), requires its `head=` to be an ancestor of the PR head, and requires that no non-merge commit
|
|
50
|
+
sits on the branch's first-parent line between the two. The first statement is the check and exits 1 on refusal;
|
|
51
|
+
the second is the arm:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
EV=$(gh pr view PR_NUMBER --json comments --jq '[.comments[].body|select(test("^\\s*review-evidence:";"i"))]|last // ""|split("\n")[0]|select(test("; coverage=full[; ]") and test("; unresolved-P1-P2=0([; ]|$)") and ([scan("coverage=")]|length==1) and ([scan("unresolved-P1-P2=")]|length==1))|capture("^Review-Evidence: head=(?<h>[0-9a-f]{7,40})[; ]").h') \
|
|
55
|
+
&& H=$(gh pr view PR_NUMBER --json headRefOid --jq .headRefOid) \
|
|
56
|
+
&& git merge-base --is-ancestor "$EV" "$H" \
|
|
57
|
+
&& R=$(git rev-list --first-parent --no-merges "$EV..$H") && [ -z "$R" ] \
|
|
58
|
+
|| { echo "ARM_CHECK refused: no passing evidence covers the PR head"; exit 1; }
|
|
59
|
+
gh pr merge PR_NUMBER --squash --auto --match-head-commit "${H:?run the arm check in this call}"
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Where a skill wraps the merge in the merge-main lock, run the first statement and then the lock block in place of
|
|
63
|
+
the second, all in one Bash call: the `exit 1` stops the call before the lock block, and the lock block's
|
|
64
|
+
`${H:?…}` aborts if it runs without the check. On refusal, run `soleur:review`, which posts fresh evidence, then
|
|
65
|
+
run the check again; never arm around it.
|
|
66
|
+
`git rev-list --first-parent --no-merges "$EV..$H"` names the unreviewed commits.
|
|
67
|
+
|
|
68
|
+
- A main-sync merge (`git merge origin/main`, or GitHub's update-branch) passes: `--first-parent` keeps main's
|
|
69
|
+
commits, which arrive through the merge's second parent, out of the range. Without it every synced PR refuses.
|
|
70
|
+
- No qualifying comment leaves `EV` empty and `merge-base` errors, so the check fails closed. So do a rebase or
|
|
71
|
+
force-push that drops the reviewed commit and a PR head missing from the local object store (`git fetch` first).
|
|
72
|
+
- Only the latest comment counts: a re-review that finds P1s, or one that ran degraded, refuses until a later
|
|
73
|
+
`coverage=full` comment with `unresolved-P1-P2=0` replaces it. An older passing comment never re-qualifies.
|
|
74
|
+
- `--match-head-commit "$H"` (gh: "Commit SHA that the pull request head must match to allow merge") ties the arm
|
|
75
|
+
to the head the check read. It is not a substitute for `--disable-auto` before a later push (merge-queue
|
|
76
|
+
paragraph above).
|
|
77
|
+
- Not covered: a merge of any branch, not only main, passes, because `--no-merges` drops the merge commit and
|
|
78
|
+
`--first-parent` drops what its second parent brought; so does code changed while resolving a conflict inside a
|
|
79
|
+
merge commit. Review both before arming.
|
|
80
|
+
- The check proves which commits the evidence covers, not who wrote it (see the self-attestation note above).
|
|
81
|
+
- It depends on the comment's wording: `head=` first, then `; coverage=full` and `; unresolved-P1-P2=0`. Whoever
|
|
82
|
+
edits the template above updates this check in the same change, or every arm refuses.
|
|
83
|
+
|
|
84
|
+
**Why:** #12619 merged at 7d20e7c1a6, a P1 review-fix commit pushed after its only evidence comment
|
|
85
|
+
(`head=0127b5dc45`); the old check only counted `Review-Evidence:` comments. Dry run of this check (without the
|
|
86
|
+
merge): #12619 refuses naming 7d20e7c1a6, and #12518 arms (evidence 1af1ec063d is its head). On #12518's
|
|
87
|
+
main-sync merge 829f5c6777, `4778bd5058..829f5c6777` lists one main commit without `--first-parent` and none with
|
|
88
|
+
it. CTO ruling, 2026-11-11.
|
|
@@ -85,6 +85,7 @@ Two lessons from #9448 belong in every fix-agent and review-seat brief (full acc
|
|
|
85
85
|
- **Verify the lead's own fix edits the way you verify a seat's.** After any splice or prune of a test file, run `git diff origin/main --numstat` and read the DELETED lines unfiltered (a `grep '^[-+]'` hides the context lines an enclosing marker-to-marker splice also removes, and a floor that moves by less than its itemisation is the tell). When a change adds a call inside an extracted unit, `grep -rln` every extractor of that unit by sentinel and by function name before writing "no edit expected". **Why:** #10210 — a splice deleted an unchanged job-budget arm that three seats then found, and a sibling loopback suite extracting the same unit lacked the new helper. See `knowledge-base/project/learnings/2026-10-13-my-review-fix-spliced-away-a-guard-i-never-read-and-a-wait-claimed-300-seconds-it-did-not-wait.md`.
|
|
86
86
|
- **A diff under `docs/legal/` or `knowledge-base/legal/` has no seat arm in `fix-round-seats.sh`, and a legal-wording fix needs the CLO agent, not a vote.** Add `soleur:legal:legal-compliance-auditor` to the panel and to every fix round by hand (the script prints `unknown-seat:` for it), brief the history seat to check published-baseline claims against `origin/main` rather than the panel SHA (a fix round that re-dates an entry reads as an overwrite against the panel SHA), and send every wording doubt to the CLO agent as one batched spawn with the seat reports attached. **Why:** PR #10326 -- see `knowledge-base/project/learnings/2026-10-15-my-correction-pr-wrote-only-and-no-where-the-code-read-showed-more.md`.
|
|
87
87
|
- **A seat's "simulate an inherited `GIT_DIR`" experiment must target a throwaway repo, never the live worktree.** On #12198 a seat exported `GIT_DIR`/`GIT_INDEX_FILE` at the live worktree and ran a suite whose fixtures do not unset them: a stray commit landed on local `main`, HEAD was repointed, and `user.name`/`user.email` were written into the shared `.git/config` (every later commit would have authored as `Test User`). Brief seats to build the repo for that experiment inside their own sandbox, and after the panel returns check `git rev-parse HEAD`, `main`'s reflog and `git config --local --list | grep '^user'`. See `knowledge-base/project/learnings/2026-11-05-a-review-seat-simulating-an-inherited-git-dir-wrote-into-the-live-repo-and-the-shared-config.md`.
|
|
88
|
+
- **The lead does not edit the live tree while a fix-round seat may run suites on it — or the seats run suites only on a `git archive` of the pinned SHA.** On #12655 the lead had an uncommitted fix-round regex in the live tree that briefly refused production's `--update-shallow`. Two seats running the live suite saw 4 red rows, and one recorded an unattributed failure. Brief seats to allocate `SBX=$(bash "$ROOT/scripts/soleur-sandbox.sh" new <seat> --link-node-modules)` (review/SKILL.md, the mutating-seat sandbox rule), then run `git archive <pinned> | tar -x -C "$SBX"` so the archive overwrites the copied live edit, and run suites there; add `git init -q && git add -A` in `$SBX` when a suite reads the repo's own git state (an archive tree is not a repo). Or hold edits until the seats return. See `knowledge-base/project/learnings/test-failures/2026-11-11-the-fake-transport-raced-the-push-and-the-guard-rows-sampled-one-push.md`.
|
|
88
89
|
- **Seats share the session scratchpad, so a fixed-name pointer file (`sbx`, `mut.py`) is a collision.** On #10514 one seat overwrote another's sandbox pointer and ran its probes, including a hash-pinned `pip install`, inside the other seat's sandbox. Brief every seat to keep its sandbox path in its own shell variable or a seat-unique file name, and to re-run any result it measured after a pointer changed. See `knowledge-base/project/learnings/2026-10-19-a-newest-wins-reference-picked-my-own-unpushed-work-and-a-filtered-test-run-hid-an-import-error.md`.
|
|
89
90
|
|
|
90
91
|
- **A fix agent's "suite green" covers only the files it was given; brief it on the repo-global ratchets by name, and run the combined-tree gate BEFORE the fix-round panel.** Editing a floor means running `scripts/guard-vacuity-floor.test.sh` (its floor detector parses only `-lt|-le|-ge`, so a `-ne` rewrite drops the file from the promoted set); adding a test that reads outside `apps/web-platform` means registering it in `test/repo-wide-suites.ts` (`repo-wide-containment.test.ts`); refactoring a symbol another test pins as source text means `git grep` of the old literal across `test/`. The lead then runs the affected gate or those suites by name on the COMBINED tree before spawning seats, so the panel reviews a tree that already passes; an affected gate that prints `ran=- of=-` / `budget-deferred` (queued behind sibling runs) is no verdict. **Why:** #10892 — three disjoint-scope fix agents each reported green and together broke all three gates; two panel seats found them by running suites nobody had touched. See `knowledge-base/project/learnings/2026-10-23-fix-round-agents-reported-green-on-their-own-files-and-broke-three-repo-global-gates.md`.
|
|
@@ -94,6 +95,7 @@ Two lessons from #9448 belong in every fix-agent and review-seat brief (full acc
|
|
|
94
95
|
|
|
95
96
|
- **The Workflow tool needs the user's own request; the review skill's "opt-in Workflow port" pointer is not that.** Spawn fix-round seats with the Agent tool unless the user asked for a workflow in their own words. On #12515 a fix round was launched through the Workflow tool, noticed, stopped and respawned.
|
|
96
97
|
- **A floor that counts a conditional row adds it only when its precondition held.** A UTF-8 locale row counted in an unconditional projection floor would go red on a minimal CI image with a correct tree (found by the verifier seat on #12515); count the conditional rows separately and add them to the floor when they ran. See `knowledge-base/project/learnings/2026-11-10-a-fix-rounds-new-gates-and-rows-repeated-the-class-they-closed.md`.
|
|
98
|
+
- **A fix-round seat runs no full battery or mutation run; the lead does (as above), and a seat's single named repro goes under `timeout`.** A seat inside a long tool call delivers nothing and sends no notice until that call exits, and it cannot act on a `SendMessage` meanwhile. Name what to read and give a tool-call cap (about 25). If a seat's last transcript block (read with `jq`, as SKILL.md says) is an old `tool_use`, stop it (TaskStop) and respawn it with a read-only brief. **Why:** #12518 — a seat briefed to "verify with the battery" hung about 3 h in a mutation run; the respawn with a read-only brief reported in under 2 minutes. See `knowledge-base/project/learnings/2026-11-11-a-deferred-battery-and-a-draft-light-ci-left-the-repo-wide-guards-for-the-ready-run.md`.
|
|
97
99
|
|
|
98
100
|
## Dedup-before-fixing ledger
|
|
99
101
|
|
package/skills/ship/SKILL.md
CHANGED
|
@@ -2172,9 +2172,9 @@ K=$(bash "${CLAUDE_PLUGIN_ROOT}/scripts/ci-head-verdict.sh" ready-count PR_NUMBE
|
|
|
2172
2172
|
&& bash "${CLAUDE_PLUGIN_ROOT}/scripts/ci-head-verdict.sh" wait-ready-run PR_NUMBER --before-count "$K"
|
|
2173
2173
|
```
|
|
2174
2174
|
|
|
2175
|
-
**Arm only
|
|
2175
|
+
**Arm only through the arm check** in [review-evidence-comment.md](${CLAUDE_PLUGIN_ROOT}/skills/review/references/review-evidence-comment.md#arm-check) (also gate text, domain seats): run its first statement, then the lock block below, in one Bash call; on refusal, `soleur:review` first.
|
|
2176
2176
|
|
|
2177
|
-
Arm
|
|
2177
|
+
Arm through the arm check ONLY on exit 0; else report "readied but unarmed" with the last stdout line and follow [ready-run-wait.md](${CLAUDE_PLUGIN_ROOT}/skills/ship/references/ready-run-wait.md) (a failed `ready-count` or `api-error` needs no undo). A non-draft PR goes straight to the arm.
|
|
2178
2178
|
|
|
2179
2179
|
If `bash "${CLAUDE_PLUGIN_ROOT}/scripts/changed-paths.sh" --match '^\.github/(workflows|actions)/' origin/main...HEAD` prints anything or exits 2/127, tell the operator in chat now: auto-merge is queued and polled as usual, but this PR has no agent `--admin` fallback (`UNTRUSTED-CI`), so if a BEHIND livelock sets in they will be asked to merge it. See [settle-then-admin-merge.md](${CLAUDE_PLUGIN_ROOT}/skills/ship/references/settle-then-admin-merge.md). **Why:** #8611.
|
|
2180
2180
|
|
|
@@ -2184,12 +2184,12 @@ Wrap the `gh pr merge` call in the merge-main lock so parallel sessions don't qu
|
|
|
2184
2184
|
SS_LIB="${CLAUDE_PLUGIN_ROOT}/scripts/lib/session-state.sh"
|
|
2185
2185
|
if [[ -r "$SS_LIB" ]] && command -v flock >/dev/null 2>&1; then
|
|
2186
2186
|
bash "$SS_LIB" with_lock merge-main 600 -- \
|
|
2187
|
-
gh pr merge <number> --squash --auto
|
|
2187
|
+
gh pr merge <number> --squash --auto --match-head-commit "${H:?run the arm check in this call}"
|
|
2188
2188
|
rc=$?
|
|
2189
2189
|
else
|
|
2190
2190
|
# Degrade open, loudly — the lock is advisory (ADR-178 §5).
|
|
2191
2191
|
echo "SOLEUR_SESSION_STATE_UNAVAILABLE path=$SS_LIB reason=running-unlocked"
|
|
2192
|
-
gh pr merge <number> --squash --auto
|
|
2192
|
+
gh pr merge <number> --squash --auto --match-head-commit "${H:?run the arm check in this call}"
|
|
2193
2193
|
rc=$?
|
|
2194
2194
|
fi
|
|
2195
2195
|
# rc=99 comes only from `with_lock` — but it means "the lock could not be
|
|
@@ -2604,9 +2604,10 @@ The agent maintains a `fix_attempt_count` counter (agent-level state, not a bash
|
|
|
2604
2604
|
# Phase 6 secret scan first
|
|
2605
2605
|
git push && bash "${CLAUDE_PLUGIN_ROOT}/scripts/pipeline-tally.sh" incr ci_cycles
|
|
2606
2606
|
# + `incr ci_wall_s <s>` (Phase-6 recipe; skip unreadable)
|
|
2607
|
-
gh pr merge <number> --squash --auto
|
|
2608
2607
|
```
|
|
2609
2608
|
|
|
2609
|
+
Re-arm only through the arm check in [review-evidence-comment.md](${CLAUDE_PLUGIN_ROOT}/skills/review/references/review-evidence-comment.md#arm-check): the fix commit needs `soleur:review` first. **Why:** #12619.
|
|
2610
|
+
|
|
2610
2611
|
Note: `gh pr reopen` is NOT needed — when auto-merge is cancelled due to CI failure, the PR remains OPEN. Re-queuing auto-merge is sufficient.
|
|
2611
2612
|
|
|
2612
2613
|
b. If the failure is in a flaky or unrelated check (not reproducible locally): **Headless mode:** abort. **Interactive mode:** ask whether to wait for a re-run or abort.
|
|
@@ -4,6 +4,25 @@
|
|
|
4
4
|
|
|
5
5
|
Read this when a draft PR is readied (ship Phase 6.5 CI Status Check, merge-pr 5.1, drain-prs), or when the ship Phase 7 poll loop, `monitor-pr-checks.sh` or `triage-prs.sh` reports a ready run that is `stalled`, `no-run` or `awaiting-approval`, or a red `test` persists on a PR readied more than 120 minutes ago with no STALLED message, or when the verdict is `full-decided`, auto-merge is armed and the PR still never enters the merge queue (the last section; `monitor-pr-checks.sh` prints that read itself on a `CHECKS GREEN BUT BLOCKED` ending, and the ship Phase 7 poll and merge-pr 5.2's mirror of it print it through `required-set-report.sh` on a `[ship.phase7.required_set]` line). The resolver is `plugins/soleur/scripts/ci-head-verdict.sh`; `--help` prints its contract.
|
|
6
6
|
|
|
7
|
+
## Before `gh pr ready`: the repo-wide guards
|
|
8
|
+
|
|
9
|
+
When the local battery was deferred or refused (rc 4 or 6) and CI is draft-light, no full battery has run before ready. Some guards walk every tracked file rather than the diff, so a PR that adds a new file family (a new test tree, probe directory or script language) trips them first on the ready run, each costing a CI cycle. Before readying:
|
|
10
|
+
|
|
11
|
+
- Read every red job on the draft run other than `test`. `lint-bot-statuses` runs on drafts and carries the orphan-suite lint (`scripts/lint-orphan-test-suites.sh`) and the Supabase-endpoint lint (`scripts/lint-supabase-deprecated-endpoints.sh`); its red is easy to miss next to a `test` that is red by design.
|
|
12
|
+
- Run the heavy guards by name from the repo root (in a worktree without `node_modules`, use `bunx`):
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
bash "${CLAUDE_PLUGIN_ROOT}/test/fixture-relative-assert.test.sh"
|
|
16
|
+
bash "${CLAUDE_PLUGIN_ROOT}/test/fixture-env-adoption.test.sh"
|
|
17
|
+
bash .claude/hooks/grep-q-pipe-guard.test.sh
|
|
18
|
+
python3 "${CLAUDE_PLUGIN_ROOT}/scripts/lint-ratchet.py" ruff --check
|
|
19
|
+
(cd apps/web-platform && bunx tsc --noEmit && bunx vitest run test/repo-wide-containment.test.ts)
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
- Read CodeQL's open alerts even though it is not a required check: `gh api --paginate 'repos/{owner}/{repo}/code-scanning/alerts?ref=refs/pull/PR_NUMBER/merge&state=open&per_page=100' --jq '.[] | "\(.number) \(.rule.id) \(.most_recent_instance.location.path)"'` (no output: none open).
|
|
23
|
+
|
|
24
|
+
**Why:** #12518 — eight repo-wide guards fired on a new spike tree, the orphan-suite lint had been red on two draft runs unread, and four red heads followed ready. See `knowledge-base/project/learnings/2026-11-11-a-deferred-battery-and-a-draft-light-ci-left-the-repo-wide-guards-for-the-ready-run.md`.
|
|
25
|
+
|
|
7
26
|
## Why
|
|
8
27
|
|
|
9
28
|
With `CI_DRAFT_LIGHT` on, a draft PR's `test` check is red on purpose (`draft: full battery owed at ready`): the full battery runs on `ready_for_review`. Arming auto-merge before that ready run exists is the silent-forever case, so the order is fixed: read the ready-event count `K`, mark ready, wait for a ci.yml run created after the ready event, and only then arm. The block is one shell command so `K` is read before the ready call and a failed read readies nothing.
|
|
@@ -19,7 +38,7 @@ Run it as one Bash call with `timeout: 420000`: the wait budget is 300 s of poll
|
|
|
19
38
|
|
|
20
39
|
| Outcome | Meaning | Do |
|
|
21
40
|
|---|---|---|
|
|
22
|
-
| exit 0, `run-created` | a ready run exists | arm
|
|
41
|
+
| exit 0, `run-created` | a ready run exists | arm through the arm check in [review-evidence-comment.md](${CLAUDE_PLUGIN_ROOT}/skills/review/references/review-evidence-comment.md#arm-check) |
|
|
23
42
|
| exit 0, `not-applicable` | this repo has no `draft-light` job in its default-branch ci.yml | arm, exactly as before S3 |
|
|
24
43
|
| `ready-count` exits 3 (no number) | nothing was readied; the PR is still a draft | fix the read (rate limit?) and re-run the whole block; never `--undo` |
|
|
25
44
|
| exit 1, `no-ready-event` | the ready event was not visible within the budget | `gh pr view PR_NUMBER --json isDraft`: still a draft, re-run the whole block; readied, run `ci-head-verdict.sh verdict PR_NUMBER` |
|
|
@@ -27,7 +46,7 @@ Run it as one Bash call with `timeout: 420000`: the wait budget is 300 s of poll
|
|
|
27
46
|
| exit 1, `awaiting-approval` | a fork's run needs a maintainer to click "Approve and run" in the Actions tab | approve it, then run `ci-head-verdict.sh verdict PR_NUMBER`; `--undo` and ready again do not clear an approval gate |
|
|
28
47
|
| exit 3, `api-error` | a read failed on the last poll: the ready state is UNKNOWN | run `ci-head-verdict.sh verdict PR_NUMBER`; do not undo anything on a guess |
|
|
29
48
|
|
|
30
|
-
Never arm on the wait's own non-zero outcome: report "readied but unarmed" with the marker line. After a recovery step, the way back to arming is the verdict, not the wait: `ci-head-verdict.sh verdict PR_NUMBER` answering `pending-full` or `full-decided` means a ready run exists, and only then
|
|
49
|
+
Never arm on the wait's own non-zero outcome: report "readied but unarmed" with the marker line. After a recovery step, the way back to arming is the verdict, not the wait: `ci-head-verdict.sh verdict PR_NUMBER` answering `pending-full` or `full-decided` means a ready run exists, and only then arm, through the same arm check. `no-run` or `stalled` goes back to the `--undo` row, `awaiting-approval` back to the approval row, and `state=error` (exit 3) with reason `api-error` means retry later; with reason `no-check-suites` CI never saw this head, so retrying never converges and the fix loop has nothing to inspect: recover as for `stalled` (the `--undo` row, user token; no suite exists, so nothing in flight can be cancelled and the Actions-tab check below does not apply). A `no-run` that is only minutes old may belong to another session still inside its own wait: look before undoing.
|
|
31
50
|
|
|
32
51
|
## Reading a ready PR's red `test` (Phase 7 poll, monitor, triage, admin-merge)
|
|
33
52
|
|