@soleur/opencode 3.357.15 → 3.357.16

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soleur/opencode",
3
- "version": "3.357.15",
3
+ "version": "3.357.16",
4
4
  "description": "Soleur AI organization plugin for OpenCode",
5
5
  "type": "module",
6
6
  "bin": {
@@ -0,0 +1,141 @@
1
+ #!/usr/bin/env bash
2
+ # collision-precheck.sh -- before plan or review work starts on issue <N>,
3
+ # report live work that may already be doing the same change:
4
+ #
5
+ # probe 1: gh pr list --state open --search "<N>" open PRs naming the issue
6
+ # probe 2: lib/proc.sh list_runs <basename> foreign-owned process rows
7
+ # (a sibling session's live
8
+ # gate in another worktree)
9
+ #
10
+ # A hit is REPORTED, never resolved: this script is read-only -- it never
11
+ # comments on, edits, closes or pushes to anyone's change. The caller surfaces
12
+ # every hit to the operator before work starts. The measured failure was two
13
+ # sessions of the same operator converting the same file for the same issue
14
+ # (#10320 / #10322; issue #10333) -- discovered only at the end of review,
15
+ # through a foreign worktree's test run and `gh pr list --head`.
16
+ #
17
+ # Usage:
18
+ # collision-precheck.sh <issue-number> [<proc-basename>...]
19
+ #
20
+ # <issue-number> digits only
21
+ # <proc-basename> process basenames for the proc.sh half (default:
22
+ # test-all.sh). proc.sh matches on BASENAME and refuses any
23
+ # pattern containing '/', so pass e.g. test-all.sh, never a
24
+ # path.
25
+ #
26
+ # Output: one plain-language line per finding (and per probe that could not
27
+ # run), then ONE machine line:
28
+ # SOLEUR_COLLISION exit=<code> prs=<csv|none|unchecked> foreign=<csv|none|unchecked>
29
+ #
30
+ # Exit codes:
31
+ # 0 clear -- both probes ran and found nothing
32
+ # 10 hit -- >=1 open PR names the issue, or >=1 foreign process row
33
+ # 2 could not check -- a probe failed AND the other found nothing; a check
34
+ # that could not run never reads as clear
35
+ # 64 usage error
36
+ #
37
+ # `set -uo pipefail`, deliberately NOT `-e`: the probes' failures are inputs,
38
+ # never aborts. Portable to bash 3.2 (no associative arrays, no mapfile).
39
+
40
+ set -uo pipefail
41
+ export LC_ALL=C
42
+
43
+ SELF_DIR="$(cd -P "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)"
44
+ PROC_SH="$SELF_DIR/lib/proc.sh"
45
+
46
+ usage() {
47
+ echo "usage: $0 <issue-number> [<proc-basename>...]" >&2
48
+ echo " reports open PRs naming the issue and foreign proc.sh list_runs rows; read-only." >&2
49
+ }
50
+
51
+ ISSUE="${1:-}"
52
+ case "$ISSUE" in
53
+ *[!0-9]* | "")
54
+ echo "collision-precheck: issue number must be digits only (got: '${ISSUE:-<empty>}')" >&2
55
+ usage
56
+ exit 64
57
+ ;;
58
+ esac
59
+ shift
60
+
61
+ PATS=()
62
+ while (($#)); do
63
+ case "$1" in
64
+ */* | "")
65
+ echo "collision-precheck: proc pattern '$1' is not a bare basename (proc.sh rejects '/')." >&2
66
+ exit 64
67
+ ;;
68
+ esac
69
+ PATS+=("$1")
70
+ shift
71
+ done
72
+ if [[ ${#PATS[@]} -eq 0 ]]; then PATS=(test-all.sh); fi
73
+
74
+ say() { printf '%s\n' "$*"; }
75
+
76
+ PRS=""
77
+ PR_STATE=unchecked
78
+ FGN=""
79
+ FGN_STATE=unchecked
80
+
81
+ # --- probe 1: open PRs naming the issue -------------------------------------
82
+ if ! command -v gh >/dev/null 2>&1; then
83
+ say "I could not check open PRs for #$ISSUE (gh is not installed)."
84
+ elif ! rows="$(gh pr list --state open --search "$ISSUE" -L 100 \
85
+ --json number,url --jq '.[] | "\(.number)\t\(.url)"' 2>/dev/null)"; then
86
+ say "I could not check open PRs for #$ISSUE (gh pr list failed -- auth, network or API error)."
87
+ else
88
+ PR_STATE=none
89
+ while IFS=$'\t' read -r _n _u; do
90
+ [[ -n "$_n" ]] || continue
91
+ PR_STATE=csv
92
+ PRS="${PRS:+$PRS,}$_n"
93
+ say "An open change names #$ISSUE: PR #$_n -- $_u"
94
+ done <<< "$rows"
95
+ fi
96
+
97
+ # --- probe 2: foreign proc.sh rows ------------------------------------------
98
+ if [[ ! -f "$PROC_SH" ]]; then
99
+ say "I could not check sibling-session processes ($PROC_SH is missing)."
100
+ else
101
+ _ok=0
102
+ _failed=0
103
+ for _pat in ${PATS[@]+"${PATS[@]}"}; do
104
+ _out="$(bash "$PROC_SH" list_runs "$_pat" 2>/dev/null)"
105
+ _rc=$?
106
+ if ((_rc == 0)); then
107
+ _ok=$((_ok + 1))
108
+ while IFS=$'\t' read -r _pid _owner _cwd; do
109
+ [[ "$_owner" == "foreign" ]] || continue
110
+ FGN="${FGN:+$FGN,}$_pid"
111
+ say "A running process matching '$_pat' is owned by another worktree: pid $_pid ($_cwd)"
112
+ done <<< "$_out"
113
+ else
114
+ _failed=$((_failed + 1))
115
+ say "I could not check sibling-session processes for '$_pat' (proc.sh exited $_rc)."
116
+ fi
117
+ done
118
+ if [[ -n "$FGN" ]]; then
119
+ FGN_STATE=csv
120
+ elif ((_ok > 0 && _failed == 0)); then
121
+ FGN_STATE=none
122
+ fi
123
+ fi
124
+
125
+ # --- verdict ----------------------------------------------------------------
126
+ if [[ -z "$PRS" && -z "$FGN" && "$PR_STATE" == "none" && "$FGN_STATE" == "none" ]]; then
127
+ say "No open change names #$ISSUE and no foreign gate process is running."
128
+ printf 'SOLEUR_COLLISION exit=0 prs=none foreign=none\n'
129
+ exit 0
130
+ fi
131
+
132
+ if [[ -n "$PRS" || -n "$FGN" ]]; then
133
+ say "Report the hit(s) above before work starts -- never silently continue on a live duplicate."
134
+ printf 'SOLEUR_COLLISION exit=10 prs=%s foreign=%s\n' \
135
+ "${PRS:-$PR_STATE}" "${FGN:-$FGN_STATE}"
136
+ exit 10
137
+ fi
138
+
139
+ say "The collision pre-check could not fully run; that is not a clear result."
140
+ printf 'SOLEUR_COLLISION exit=2 prs=%s foreign=%s\n' "$PR_STATE" "$FGN_STATE"
141
+ exit 2
@@ -127,20 +127,22 @@ Refine the idea through collaborative dialogue using the **AskUserQuestion tool*
127
127
 
128
128
  ### 0.6. Pre-Research Premise Validation (Always)
129
129
 
130
- Run BEFORE spawning any research (Phase 1) — research and downstream phases are expensive, and building a plan atop a stale premise wastes all of it. `brainstorm` Phase 1.1 does this validation when a brainstorm precedes plan, but `plan` is frequently entered directly (including the one-shot → plan path that skips brainstorm), so the cheap probe must also live here. This is distinct from Phase 1.7 reconciliation (which checks spec claims AFTER research returns) — this gate fires before research is even dispatched.
130
+ Run BEFORE spawning any research (Phase 1) — a plan atop a stale premise wastes the fan-out. `brainstorm` Phase 1.1 does this when a brainstorm precedes plan, but `plan` is frequently entered directly (including the one-shot → plan path that skips brainstorm), so the cheap probe must live here. This is distinct from Phase 1.7 reconciliation (spec claims AFTER research returns) — it fires before research is dispatched.
131
131
 
132
- This also covers your **own** option-bounding capability claims — not just cited references. Before asserting that a repo tool/skill/script "only does X" or "can't do Y" to bound the plan's options, grep/read it first or phrase it as a question (`hr-verify-repo-capability-claim-before-assert`).
132
+ This also covers your **own** capability claims — not just cited references. Before asserting that a repo tool/skill/script "only does X" or "can't do Y", grep/read it or ask (`hr-verify-repo-capability-claim-before-assert`).
133
133
 
134
134
  For every issue, blocker, dependency, or prior-art artifact the feature description **cites by reference**, verify it still holds:
135
135
 
136
136
  1. **Cited GitHub issues / PRs** (`#N`, `Closes #N`, "blocked by #N", "follow-up to #N"): run `gh issue view <N> --json state,title,closedByPullRequestsReferences` and `gh pr view <N> --json state,merged` where applicable. If a blocker is already `closed`/`merged`, or the issue this plan targets is already closed by a merged PR, **the premise is stale** — surface via **AskUserQuestion** ("Issue #N appears already resolved by PR #M. Re-scope, or close as done?") rather than planning against it.
137
- 2. **Cited file/symbol/migration paths** (a function, route, component, or migration the plan assumes exists): confirm with `git show origin/main:<path>` or `git grep -n "<symbol>" origin/main`. If the cited artifact does not exist on `origin/main`, the premise ("fix the bug in X") may really be "X was never built" — flag it; the plan's shape changes from *fix* to *build*.
138
- 3. **"UI exists but is broken" claims**: distinguish *broken behavior* from *never-built*. If the description asserts a UI/endpoint misbehaves, confirm the route/component is actually present (`git grep`) before planning a behavioral fix — a silently-absent feature needs a build plan, not a patch.
137
+ 2. **Cited file/symbol/migration paths** (a function, route, component, or migration the plan assumes exists): confirm with `git show origin/main:<path>` or `git grep -n "<symbol>" origin/main`. If the artifact is absent on `origin/main`, the premise ("fix the bug in X") may really be "X was never built" — flag it; the plan's shape changes from *fix* to *build*.
138
+ 3. **"UI exists but is broken" claims**: distinguish *broken* from *never-built* — confirm the route/component exists (`git grep`) before planning a fix; a silently-absent feature needs a build plan, not a patch.
139
139
  4. **Proposed *mechanism* vs. the ADR corpus** (the feature names HOW to do it — a frontmatter flip, a new table, a polling cron, a config tier): grep `knowledge-base/engineering/architecture/decisions/` for the mechanism's keywords (not the cited issue number — issues don't know what an ADR decided) and read any hit's `## Decision` + `## Alternatives Considered`. A mechanism sitting in an ADR's rejected-alternatives table is not an unconsidered idea — it is an explicitly-rejected one; re-scope to "did the ADR leave a gap this still addresses?" rather than planning the rejected approach. Corollary: when the feature pins an *absolute* value (a fixed model/tier/limit), check its interaction with the *most capable* end of the range, not just the cheap end (an absolute `opus` reviewer pin is a downgrade on a Fable session). **Why:** #5087 — the issue's frontmatter-tiering approach matched the exact alternative ADR-053 rejected the day before (#5096); caught only at deepen-plan, three phases deep. See `knowledge-base/project/learnings/2026-06-11-brainstorm-grep-adr-corpus-for-proposed-mechanism-not-just-issue-refs.md`.
140
140
 
141
141
  5. **The set that must do Y is whoever the Y-enforcing mechanism reaches — grep its call sites, not a nearby inventory; a shape rule over that set is a claim about every member — read each member's prescribed strings before writing it; and before designing a side channel out of a spawned CLI, run it once with `--output-format json` and read the result event.** **Why:** #8076 — the brainstorm's population (`TASK_INVENTORY`, five) was the heartbeat's liveness subset; the filing population was the nine `resolveOutputAwareOk` callers (the first missed cron fired two days after merge); a `[Scheduled]`-prefixed title rule would have broken campaign-calendar's `[Content] Overdue:` filings; a hook-written deny log plus nine caller edits dissolved once `permission_denials[]` was probed. See `knowledge-base/project/learnings/2026-09-11-a-filer-with-no-honest-exit-takes-the-free-one-at-any-price.md`.
142
142
 
143
- Emit a one-paragraph **Premise Validation** note (what was checked, what held, what was stale) into the research-insights scratch so Phase 1.7 and the plan's "Research Reconciliation" section can carry it forward. If nothing is cited by reference, state "no external premises to validate" and proceed.
143
+ 6. **Collision pre-check:** run `bash "${CLAUDE_PLUGIN_ROOT}/scripts/collision-precheck.sh" <N>` for each cited issue — open PRs naming it (`gh pr list --state open --search "<N>" -L 100`) plus foreign `proc.sh list_runs` rows; report every hit before work starts (#10333).
144
+
145
+ Emit a one-paragraph **Premise Validation** note (what was checked, what held, what was stale) into the research-insights scratch so Phase 1.7 and the plan's "Research Reconciliation" section can carry it forward. If nothing is cited, state "no external premises to validate" and proceed.
144
146
 
145
147
  ### 0.6b. Mechanism Minimality Gate (Always)
146
148
 
@@ -29,7 +29,6 @@ Review here means this agent pipeline (`rf-never-skip-qa-review-before-merging`,
29
29
 
30
30
  <requirements>
31
31
  - Git repository with GitHub CLI (`gh`) installed and authenticated
32
- - Clean main/master branch
33
32
  - Proper permissions to create worktrees and access the repository
34
33
  - For document reviews: Path to a markdown file or document
35
34
  </requirements>
@@ -46,8 +45,6 @@ if [[ -f "CLAUDE.md" ]]; then
46
45
  fi
47
46
  ```
48
47
 
49
- Read `CLAUDE.md` if it exists - apply project conventions during review.
50
-
51
48
  **A FIX COMMIT IS THE LEAST-AUDITED SURFACE IN THE DIFF — GRADE IT AS ITS OWN CHANGE.** When a commit's subject says it closes a defect class, read its NEW code for that same class before reading anything else, and check whether the fix was applied to the INSTANCE or to the CLASS (grep every other consumer of the same input). For an anchor assertion, "anchored on a call-form a comment cannot produce" is necessary and NOT sufficient: also require the haystack to be comment-STRIPPED, SCOPED to the region under test, and the match UNIQUE within it — and never accept a `grep -c … -ge N` as a placement claim, because a count is evidence about a file, never about a branch. **Why:** #7695 — `cq-assert-anchor-not-bare-token` recurred three times on one branch, twice inside the commits fixing it (one arm sat a single function below the reference implementation that comment-strips); separately, a `"actions": []` fix applied at two addresses left ~10 sibling counters blind, so three destroys of sole-copy volumes scored a clean plan with `destroy_count` 0. `T1.9c` asserted "both refusals exit non-zero" via `grep -c '^exit 1$' -ge 3` against a file containing nine, and printed `ok` with both refusals flipped to `exit 0`. See `knowledge-base/project/learnings/2026-09-04-every-fix-reintroduced-the-class-it-was-fixing.md`.
52
49
 
53
50
  **WHEN A ROW CARRIES ONE FREE-TEXT FIELD, EVERY OTHER FIELD IN IT IS A TRUSTED FIELD — READ WHERE
@@ -88,10 +85,6 @@ copy is the impoverished one. See
88
85
 
89
86
  <review_target> #$ARGUMENTS </review_target>
90
87
 
91
- <thinking>
92
- First, I need to determine the review target type and set up the code for analysis.
93
- </thinking>
94
-
95
88
  #### Immediate Actions:
96
89
 
97
90
  <task_list>
@@ -103,20 +96,19 @@ First, I need to determine the review target type and set up the code for analys
103
96
  - [ ] If ALREADY on the target branch (PR branch, requested branch name, or the branch already checked out for review) → proceed with analysis on current branch
104
97
  - [ ] If DIFFERENT branch than the review target → offer to use worktree: "Use git-worktree skill for isolated Call `skill: git-worktree` with branch name
105
98
  - [ ] Fetch PR metadata using `gh pr view --json` for title, body, files, linked issues
99
+ - [ ] Collision pre-check: `bash "${CLAUDE_PLUGIN_ROOT}/scripts/collision-precheck.sh" <N>` per linked issue — open PRs + foreign `proc.sh list_runs` rows; report hits before the panel (#10333)
106
100
  - [ ] `git fetch origin main && git merge-tree --write-tree origin/main HEAD >/dev/null; echo rc=$?` — a non-zero rc is a conflict with `main`; rebase BEFORE spawning the panel. A conflict found by a seat costs a rebase plus a second fix→CI round (PR #8052: `PROMOTED_FILES` collided with a sibling promotion, found by the code-quality seat).
107
101
  - [ ] Read `gh pr view --json mergeable,mergeStateStatus` BEFORE reading the check set as a verdict. GitHub cannot build a merge ref for a `CONFLICTING`/`DIRTY` PR, and **every `pull_request`-triggered workflow is then suppressed** — so the checks that do report (CodeQL, CLA, `push`-triggered jobs) are all green and the PR looks clean while the suites that would judge the diff never ran. An ABSENT check is not a passing one, and nothing on the PR page says so. **Why:** #8209/PR #8563 — a branch sat green-but-incomplete for a day; merging `origin/main` took the run from 4 checks to 57, two of which were red.
108
- - [ ] Set up language-specific analysis tools
109
- - [ ] Prepare security scanning environment
110
- - [ ] Make sure we are on the branch we are reviewing. Use gh pr checkout to switch to the branch or manually checkout the branch.
111
- - [ ] Push the branch before spawning the panel (`git push -u origin $(git branch --show-current)`; agents read remote state [rf-before-spawning-review-agents-push-the]) after running ship's `prepush-secret-scan.sh` (Bash `timeout: 400000`; 0/43 continue, else STOP); `incr ci_cycles` after the push.
102
+ - [ ] Use `gh pr checkout` or a manual checkout so the reviewed branch is current
103
+ - [ ] Push the branch before spawning the panel (`git push -u origin $(git branch --show-current)`; review agents read remote state [rf-before-spawning-review-agents-push-the]) after running ship's `prepush-secret-scan.sh` (Bash `timeout: 400000`; 0/43 continue, else STOP). That push drives a CI cycle — `incr ci_cycles` after it (ship's convention).
112
104
 
113
- Ensure that the code is ready for analysis (either in worktree or on current branch). ONLY then proceed to the next step.
105
+ Proceed once the tree is ready (worktree or current branch).
114
106
 
115
107
  </task_list>
116
108
 
117
109
  #### Change Classification Gate
118
110
 
119
- Before spawning review agents, classify the PR to avoid spawning agents whose expertise is irrelevant to the change.
111
+ Before spawning review agents, classify the PR to right-size the panel.
120
112
 
121
113
  1. Run `git diff --name-only origin/main...HEAD | head -n 200` to get the list of changed files. Also capture status letters and line counts. Use `git rev-parse --git-dir` to resolve a writable tmp path that works in both regular checkouts and worktrees: in a worktree `.git` is a file (gitdir pointer), not a directory, so `> .git/review-*.txt` fails with `Not a directory (os error 20)`. The resolver returns the worktree's actual gitdir (e.g., `<bare>/worktrees/<name>/`):
122
114
 
@@ -198,8 +190,10 @@ Before spawning review agents, classify the PR to avoid spawning agents whose ex
198
190
  Spawned agents run only the suites targeting the files they were given — mechanically,
199
191
  `bash "${CLAUDE_PLUGIN_ROOT}/scripts/affected-tests.sh"` — it delegates `--affected`
200
192
  to a capability-positive [runner](../../../../scripts/test-all.sh) when present, else its
201
- stack adapters select; the founder-repo runner-side equivalent is
202
- `TEST_GROUP=affected bash scripts/test-all.sh`. No hand-derived suite list is needed.
193
+ stack adapters select. A spawned agent handed an EXPLICIT file list may instead run
194
+ `TEST_GROUP=affected bash scripts/test-all.sh` — a DIFFERENT, heuristic selector (#8591)
195
+ that prints `[affected] MODE=full` and runs nearly everything on an undecidable diff
196
+ (2026-10-15 `apps/web-platform/infra/`: ran >1h).
203
197
  **`SOLEUR_SUBAGENT=1` is a
204
198
  convention a lead MAY export before spawning — the harness does not set it** (measured 2026-08-19:
205
199
  UNSET inside spawned agents). When it IS exported, a plain `test-all.sh` invocation exits 4 while `affected`
@@ -207,7 +201,12 @@ proceeds. Agents must not run the runner unscoped,
207
201
  `apps/web-platform/infra/run-registered-suites.sh`, or any other full-gate runner: this panel is
208
202
  the densest concurrency in the whole pipeline, and concurrent full-gate runs inflate each other's
209
203
  timings and corrupt the measurement (860→1675 s, 2026-08-11). The lead runs the gate ONCE after the
210
- panel returns — `bash "${CLAUDE_PLUGIN_ROOT}/scripts/affected-tests.sh"` ([contract](${CLAUDE_PLUGIN_ROOT}/skills/ship/references/affected-gate-contract.md)); absent a [runner](../../../../scripts/test-all.sh) it is the sole scope. Two backstops:
204
+ panel returns — the bounded default `bash scripts/test-all.sh` (bare resolves `--affected`;
205
+ plugin-portable: `bash "${CLAUDE_PLUGIN_ROOT}/scripts/affected-tests.sh"`, sole scope absent a
206
+ [runner](../../../../scripts/test-all.sh) — [contract](${CLAUDE_PLUGIN_ROOT}/skills/ship/references/affected-gate-contract.md)),
207
+ previewed by `bash scripts/test-all.sh --print-selection` and reported with the `selected N of M`:
208
+ "every covering suite ran" is the printed selection vs the run's per-suite results, not memory
209
+ (#10333). Two backstops:
211
210
  [scripts/test-all.sh](../../../../scripts/test-all.sh) exits 4 when it MEASURES a sibling full-gate run already in flight
212
211
  (#7553) — `affected` is exempt from that too — and `tc_acquire`'s advisory lock (ADR-133)
213
212
  serialises whatever gets past that. The
@@ -255,13 +254,13 @@ Record `PANEL_SHA=$(git rev-parse HEAD)` before dispatch — fix rounds diff aga
255
254
 
256
255
  </parallel_tasks>
257
256
 
258
- **Note:** The conditional agents block below (agents 9-14: Rails reviewers, migration experts, soleur:engineering:review:test-design-reviewer, semgrep) is **unaffected** by the classification gate. Both gates run independently — the classification controls only the always-on agents above.
257
+ **Note:** the conditional agents below (9-14) are unaffected by the classification gate — it controls only the always-on agents above.
259
258
 
260
259
  #### Conditional Agents (Run if applicable):
261
260
 
262
261
  <conditional_agents>
263
262
 
264
- These agents are run ONLY when the PR matches specific criteria. Check the PR files list and project structure to determine if they apply:
263
+ These agents run ONLY when the PR matches the criteria below:
265
264
 
266
265
  **If project is a Rails app (Gemfile AND config/routes.rb exist at repo root):**
267
266
 
@@ -361,7 +361,8 @@ Then run the affected-suite gate — the plugin entry point, wired the same in
361
361
  repo the gate capability-probes and delegates [scripts/test-all.sh](../../../../scripts/test-all.sh), so the
362
362
  always-on fast tier (#9763), ADR-262's PR-gated mutation batteries, and the
363
363
  infra consumed edge still apply — and a docs-only diff returns
364
- `NO_TESTS_AFFECTED`, which is not coverage.
364
+ `NO_TESTS_AFFECTED`, which is not coverage. Preview with
365
+ `bash scripts/test-all.sh --print-selection`, stating `selected N of M` (#10333).
365
366
 
366
367
  **Probe capacity first (#7545).** An affected run can still DEGRADE to the
367
368
  full battery (undecidable diff, runner/index touched, FORCE_ALL), so spend ~3 s
@@ -372,8 +373,8 @@ bash scripts/test-all.sh --capacity
372
373
  ```
373
374
 
374
375
  It prints one verdict — `CAPACITY_OK` / `CAPACITY_CONTENDED reason=…` / `CAPACITY_UNKNOWN reason=…`,
375
- each with the measured value and the threshold — plus the pid, worktree and elapsed time of every
376
- sibling run. It takes no lock, runs no suite and always exits 0.
376
+ each with the measured value and threshold — plus pid, worktree and elapsed time per sibling run.
377
+ It takes no lock, runs no suite and always exits 0.
377
378
 
378
379
  **It does not gate this phase and must never be treated as permission to skip it.** A
379
380
  `CAPACITY_CONTENDED` verdict changes what a RED below is *worth* (apply
@@ -397,8 +398,8 @@ from a `pull_request` run — which GitHub builds against `refs/pull/N/merge`. C
397
398
  therefore verified `merge(HEAD, base)`, not the HEAD tree the local battery would
398
399
  run, and those are the same tree only when `origin/main` is already an ancestor of
399
400
  HEAD. The gate refuses when it is not, so "CI already verified this exact tree" is
400
- a claim it establishes rather than one it assumes. The practical consequence: to
401
- get the saving on a re-run, sync with `main` first.
401
+ a claim it establishes rather than assumes. Re-run savings need `main` synced
402
+ first.
402
403
 
403
404
  Branch on the exit code, never on the prose:
404
405
 
@@ -349,11 +349,11 @@ Run these checks before proceeding to Phase 1. A FAIL blocks execution with a re
349
349
 
350
350
  ### Phase 2: Execute
351
351
 
352
- **Output discipline (all tiers).** Long execution phases blow the response-token ceiling and truncate mid-pipeline, losing the thread. Keep inline output bounded: when a command's output is large (full diffs, build logs, test dumps), write it to a file and reference the path rather than pasting it — never echo a diff over ~200 lines inline (`d="$(mktemp -d -t soleur-run.$$.XXXXXXXX)/d"; git diff > "$d"; echo "DIFF=$d"` then summarize, citing the path). After each task or logical unit, emit a one-line `## Work Phase <N> complete` checkpoint marker so an interrupted run has a clear resume point. This complements hard rule `hr-never-run-commands-with-unbounded-output` (which forbids unbounded *commands*); this is about bounding your own *narration* of them.
352
+ **Output discipline (all tiers).** Long execution phases blow the response-token ceiling and truncate mid-pipeline, losing the thread. Keep inline output bounded: when a command's output is large (full diffs, build logs, test dumps), write it to a file and reference the path rather than pasting it — never echo a diff over ~200 lines inline (`d="$(mktemp -d -t soleur-run.$$.XXXXXXXX)/d"; git diff > "$d"; echo "DIFF=$d"` then summarize, citing the path). After each task or logical unit, emit a one-line `## Work Phase <N> complete` checkpoint marker so an interrupted run has a clear resume point. This bounds your *narration* of commands; `hr-never-run-commands-with-unbounded-output` bounds the commands.
353
353
 
354
354
  1. **Execution Mode Selection** (HARD GATE — must complete before executing ANY task)
355
355
 
356
- **Do NOT execute any task before completing this analysis.** Analyze independence first, select the execution tier, then begin. Starting sequential execution "because the first tasks feel simple" is a workflow violation — it forfeits parallelization savings on the remaining tasks.
356
+ **Analyze independence first, select the tier, then begin** — sequential-by-default because "the first tasks feel simple" forfeits the remaining tasks' parallelization savings.
357
357
 
358
358
  Before starting the sequential task loop, check for parallelization opportunities:
359
359
 
@@ -365,7 +365,7 @@ Run these checks before proceeding to Phase 1. A FAIL blocks execution with a re
365
365
  - If yes (pipeline mode): auto-select Tier 0 without prompting
366
366
  - If declined or ineligible: fall through to Step 1 below
367
367
 
368
- **Read `plugins/soleur/skills/work/references/work-lifecycle-parallel.md` now** for the full Tier 0 protocol (offer/auto-select, generate contract, spawn 2 agents, collect/commit, test-fix-loop, docs). If Tier 0 executes, proceed directly to Phase 3 after completing Step 06 of the protocol. If declined, fall through to Step 1.
368
+ **Read `plugins/soleur/skills/work/references/work-lifecycle-parallel.md` now** for the Tier 0 protocol; on execute go to Phase 3 after its Step 06, on decline fall through to Step 1.
369
369
 
370
370
  ---
371
371
 
@@ -373,16 +373,20 @@ Run these checks before proceeding to Phase 1. A FAIL blocks execution with a re
373
373
 
374
374
  **Standing constraint for EVERY tier — a spawned agent never runs the FULL gate.**
375
375
  Spawned agents run only the suites targeting the files they were given — mechanically,
376
- either scoped form works: `test-all.sh --affected` (the #8322 declared-edge gate) or
377
- `TEST_GROUP=affected bash scripts/test-all.sh` (the #8591 heuristic selector). Both register
378
- every suite and decline those the diff cannot reach, both are exempt from both refusal arms,
379
- so the spawn prompt needs no hand-derived suite list. What a spawned agent must not run is a
376
+ `test-all.sh --affected` (the #8322 declared-edge gate); one handed an EXPLICIT file list
377
+ may instead run `TEST_GROUP=affected bash scripts/test-all.sh` (the #8591 heuristic
378
+ selector — a DIFFERENT selector: an undecidable diff prints `[affected] MODE=full` and
379
+ runs nearly everything, 2026-10-15 on `apps/web-platform/infra/` still running after an
380
+ hour). Both are exempt from both refusal arms, so the spawn prompt needs no hand-derived
381
+ suite list. What a spawned agent must not run is a
380
382
  full-gate-shaped invocation: `test-all.sh --full`,
381
383
  `apps/web-platform/infra/run-registered-suites.sh`, or any other full-battery runner —
382
384
  concurrent full-gate runs inflate each other's timings and corrupt the measurement. Measured
383
385
  2026-08-11 — three agents running lints and suites at once turned an 860 s battery into 1675 s,
384
386
  and that 1.9x figure was then nearly used as the suite's cost budget. The lead runs the gate
385
- ONCE, after collecting fan-out work. Two mechanical backstops exist, and neither depends on an
387
+ ONCE, after collecting fan-out work — the bounded default `bash scripts/test-all.sh` (bare
388
+ resolves `--affected`), previewed by `bash scripts/test-all.sh --print-selection` and
389
+ reported with the `selected N of M`. Two mechanical backstops exist, and neither depends on an
386
390
  agent volunteering anything: a `--full` or degraded-full [scripts/test-all.sh](../../../../scripts/test-all.sh)
387
391
  exits 4 when it MEASURES a sibling full-gate run already in flight (#7553), and `tc_acquire`'s
388
392
  advisory lock (ADR-133) serialises whatever gets past that. **`SOLEUR_SUBAGENT=1` is a convention
@@ -409,21 +413,19 @@ Run these checks before proceeding to Phase 1. A FAIL blocks execution with a re
409
413
 
410
414
  **Tier A: Agent Teams** (highest capability, ~7x token cost)
411
415
 
412
- **Read `plugins/soleur/skills/work/references/work-agent-teams.md` now** for the full Agent Teams protocol (offer, activate, spawn teammates, monitor/commit/shutdown). If declined or failed, fall through to Tier B.
416
+ **Read `plugins/soleur/skills/work/references/work-agent-teams.md` now** for the Agent Teams protocol; on decline or failure fall through to Tier B.
413
417
 
414
418
  ---
415
419
 
416
420
  **Tier B: Subagent Fan-Out** (fire-and-gather, moderate cost)
417
421
 
418
- **Read `plugins/soleur/skills/work/references/work-subagent-fanout.md` now** for the full Subagent Fan-Out protocol (offer, group/spawn, collect/integrate). If declined **or failed**, fall through to Tier C.
422
+ **Read `plugins/soleur/skills/work/references/work-subagent-fanout.md` now** for the Subagent Fan-Out protocol; on decline **or failure** fall through to Tier C.
419
423
 
420
424
  The `or failed` is load-bearing and was missing: Tier 0 and Tier A both read "If
421
- declined **or failed**, fall through", so a spawn FAILURE at those tiers has a defined
422
- next step. Tier B said only "If declined" — leaving a spawn failure (agent tool
423
- withheld, `529 Overloaded`, headless run with no agent surface) with no prescribed
424
- behavior at the LAST tier that can degrade. Tier C is always available because it is
425
- sequential execution in the main context, so the fall-through costs nothing and closes
426
- the gap. When it fires, say so: "Tier B fan-out unavailable (<reason>) — executing
425
+ declined **or failed**, fall through", so a spawn FAILURE has a defined next step.
426
+ Tier B said only "If declined" — leaving a spawn failure (agent tool withheld, `529
427
+ Overloaded`, headless run with no agent surface) undefined at the LAST tier that can
428
+ degrade. When it fires, say so: "Tier B fan-out unavailable (<reason>) — executing
427
429
  sequentially" rather than silently running Tier C as though it were the chosen tier.
428
430
 
429
431
  ---
@@ -434,15 +436,9 @@ Run these checks before proceeding to Phase 1. A FAIL blocks execution with a re
434
436
 
435
437
  2. **Task Execution Loop**
436
438
 
437
- **Design Artifact Gate (before first UI task):** If `DESIGN_ARTIFACTS` was set in Phase 0.5, spawn the `soleur:product:design:ux-design-lead` agent with the artifact paths and ask it to produce an **implementation brief** (see soleur:product:design:ux-design-lead "Wireframe-to-Implementation Handoff" workflow). The brief is a structured description of every section, its content, and its layout — this becomes the binding input for all UI tasks. Do not write any markup until the brief is received.
439
+ **Design Artifact Gate (before first UI task):** If `DESIGN_ARTIFACTS` was set in Phase 0.5, spawn the `soleur:product:design:ux-design-lead` agent with the artifact paths for an **implementation brief** (its "Wireframe-to-Implementation Handoff" workflow) — the binding input for all UI tasks. Do not write markup before it arrives.
438
440
 
439
- **UX artifact commit checkpoint (after Design Artifact Gate):** After the implementation brief is received, commit before proceeding to UI tasks:
440
-
441
- 1. Run `git status --short` to discover the implementation brief and any generated design files
442
- 2. Stage output files: `git add <discovered files>`
443
- 3. Commit: `git commit -m "wip: UX implementation brief for <feature-name>"`
444
-
445
- This checkpoint ensures the implementation brief survives session crashes.
441
+ **UX artifact commit checkpoint (after Design Artifact Gate):** commit the brief and any generated design files (`git add` them, `git commit -m "wip: UX implementation brief for <feature-name>"`) so it survives session crashes.
446
442
 
447
443
  For each task in priority order:
448
444
 
@@ -1046,7 +1042,7 @@ State plainly which axes your battery did NOT edit. Two mechanical companions: r
1046
1042
 
1047
1043
  The gate's rc contract (0/1/4/6/7), the `.soleur-test-gate.json` override schema, and per-rc actions live in [affected-gate-contract.md](${CLAUDE_PLUGIN_ROOT}/skills/ship/references/affected-gate-contract.md). In THIS repo it capability-probes and delegates [scripts/test-all.sh](../../../../scripts/test-all.sh) --affected — selection fails toward coverage (`AFFECTED_FALLBACK reason=…` on an undecidable diff or a touched runner/index); preview it via `bash scripts/test-all.sh --print-selection` (repo-local). A green affected run is the diff's coverage, not a full-coverage claim; CI's sharded battery is the backstop. A refusal (rc 4) names its cause and prints a `remedy:` line — never retry it blindly.
1048
1044
 
1049
- A second, heuristic scoped selector also exists (#8591): `TEST_GROUP=affected bash scripts/test-all.sh` — chokepoint declines on argv paths, content references, stems, and an always-run census backstop, with no declared index to maintain. It is the substitute both rc=4 refusals prescribe; an undeterminable diff runs everything. `TEST_GROUP=affected --affected` refuses rc=2. Both are scoped evidence, not the ship gate.
1045
+ A second, heuristic scoped selector also exists (#8591): `TEST_GROUP=affected bash scripts/test-all.sh` — chokepoint declines on argv paths, content references, stems, and an always-run census backstop, with no declared index to maintain. It is the substitute both rc=4 refusals prescribe, and the spawned-agent-with-explicit-file-list form; an undeterminable diff prints `[affected] MODE=full` and runs everything (2026-10-15 on `apps/web-platform/infra/`: still running after an hour), so never the lead's gate. `TEST_GROUP=affected --affected` refuses rc=2. Both are scoped evidence, not the ship gate.
1050
1046
 
1051
1047
  **`TEST_GROUP=<g>` remains as an explicit cross-cut, not the default.** `TEST_GROUP=bun|scripts|scripts-heavy|webplat|infra bash scripts/test-all.sh` restricts the run to that group's registrations under the same affected-selection rules — a non-`all` ask force-selects its group. Use it to re-run one shard in isolation; it is no longer how the Phase 2 exit picks coverage — the affected index derives a finer set.
1052
1048
 
@@ -1054,7 +1050,7 @@ State plainly which axes your battery did NOT edit. Two mechanical companions: r
1054
1050
 
1055
1051
  **The full battery is not the gate here — CI owns it, and `soleur:ship` Phase 4 runs the same affected gate.** The MERGE gate is CI's required `test` context, which still runs the FULL battery on the PR head (bar ADR-262's PR-gated five); no local run is the merge gate, and calling one that is the over-claim that would license a future PR to shard it. This ordering is [ADR-183](../../../../knowledge-base/engineering/architecture/decisions/ADR-183-full-suite-runs-at-ship-not-at-implementation-exit.md); do not re-add a full local run at this position without reading it.
1056
1052
 
1057
- **A run's summary is not a completeness claim — read the BREAKDOWN line.** Since ADR-181 a suite may DECLINE (relevance-gated), and since #8322 it may also be `not-affected` (selection-gated); both are counted in the denominator, so `N/N` is not the ordinary local green spelling: a healthy affected run commonly reads `N-k/N`. A shard narrows coverage a second way the runner does NOT announce (the coverage NOTE exists for `infra` only). **State which mode and which shards ran when you report the gate green** — an affected run is the diff's coverage, not the battery's. This is the definite-article trap #6969 named, one level down: a green `test-all.sh` was read as the exit gate for a diff half of which it never executed.
1053
+ **A run's summary is not a completeness claim — read the BREAKDOWN line.** Since ADR-181 a suite may DECLINE (relevance-gated), and since #8322 it may also be `not-affected` (selection-gated); both are counted in the denominator, so `N/N` is not the ordinary local green spelling: a healthy affected run commonly reads `N-k/N`. A shard narrows coverage a second way the runner does NOT announce (the coverage NOTE exists for `infra` only). **State which mode and which shards ran when you report the gate green** — an affected run is the diff's coverage, not the battery's. This is the definite-article trap #6969 named, one level down: a green `test-all.sh` was read as the exit gate for a diff half of which it never executed. And never write "all covering suites ran" without the `--print-selection` output AND the run's per-suite result list — compare the two; a hand-picked list omits the meta-guards that react to file SHAPE (`guard-vacuity-floor`, `test-all-weight-drift`), which is exactly what reddened on #10322.
1058
1054
 
1059
1055
  **Ask before you launch: `bash scripts/test-all.sh --capacity`.** It answers "can this box
1060
1056
  absorb another full gate?" in **~3 s** (measured p50, 16 cores / ~640 pids — it walks `/proc`