@feigi/fleet-ctl 3.30.4 → 3.30.6
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/commands/review-and-fix.md +1 -1
- package/commands/run-merge-bot.md +18 -22
- package/package.json +1 -1
- package/scripts/reap.sh +4 -3
- package/scripts/release-ticket.sh +3 -2
- package/scripts/worktree.sh +11 -3
- package/skills/run-team/SKILL.md +9 -5
|
@@ -15,7 +15,7 @@ argument-hint: [pr-number]
|
|
|
15
15
|
5. File each deferred finding: `gh issue create --label <ready-for-agent|needs-triage>` with the finding, `file:line`, why deferred, `Deferred from PR #<pr> review`, and **the finding's `dimension` in the issue body** — the review returns it on every finding, and a backlog that does not carry it cannot be attributed to the specialist that generated it. **The label follows the finding's state, not this step** — but it is never omitted; an unlabelled issue is invisible to both `candidates.mjs --require-label` and the cockpit's pool query, reachable only by a human. **The bar here is whether the DEFECT is confirmed — never whether the remedy is settled.** Confirmed defect with the remedy still open → `ready-for-agent`, and say in the body that the remedy is open. Torn → `needs-triage`, narrowed: torn means **unsure anything is broken**, not unsure how to fix it. **A finding a refuter CHECKED and did not survive is neither** — it is not a confirmed defect, and you are not unsure whether anything is broken: you measured that nothing is. Refutations go as **one issue per review, titled `PR #<pr> review: the suggestion band, checked`, labelled `wontfix`, and CLOSED** — a run that files them open instead has to be corrected afterwards, as one was on 2026-08-27. Left open they read as queued agent work and rot into filing artifacts; a measured triage pass found a quarter of its `needs-triage` backlog was refuted records, bulk-closable by title shape. Closed is still a durable home — `check` reads the tracker at `--state all`, so a future run re-deriving the finding lands on the evidence rather than re-litigating it. Split the band only where an entry is **not** a refutation: a residual the refuter surfaced, or a finding refused as out of scope and never checked, is real deferred work — and real deferred work earns its own open issue only past a second bar. **Worth a claim: a finding whose own claim is that correct code could be shaped better — style, naming, layout, redundancy, a micro-simplification — never gets its own open issue.** Its only open question is "is this worth doing?", which answers itself under the repriced triage bar: measured 2026-08-15→31, 133 issues were triage-closed `wontfix` in sixteen days, 121 of them review deferrals, mostly this shape. Append it to the same closed record issue under a `Below the claim bar` heading — `file:line`, dimension, the claim, and a re-open trigger per entry. Closed is a durable home for these too: `check` reads `--state all`, so a run re-deriving the finding lands on the record instead of re-filing — and a later review returning the same finding as `survived`, or a maintainer hitting it, is the promotion signal: file it open then, citing the record. **An in-scope rediscovery step 2 applied is that same promotion signal, and it files nothing** — so the record carries no mark unless you write one: run `check` over each finding step 2 applied as well, and where its tracker rows put one on a `Below the claim bar` entry, comment on that record issue, opening `Promoted — applied, not filed`, and name the entry, that its refuter let it through, and the commit carrying the fix. That comment is the promotion mark this path leaves, and it is **not** a cross-reference — measured on this tracker, a comment mints `cross-referenced` on the issue its own text *names*, never on the issue it sits under (a comment citing a second issue landed on that issue's timeline and nowhere else), so the fixed opening is what carries the signal instead. **The bar reads the finding's claim, never its review band** — a finding that alleges wrong behavior, whatever band it sat in, `unverified`-with-crashed-refuters included, is above this bar and files open under the confirmed/torn split, which is why a band cannot carry this decision. Do **not** reach for phase 0's **decided?** test here. That is a *consumption* gate, priced for a seat where implementer divergence costs a claim, a worktree and a dispatch; at filing time divergence costs one PR review the maintainer already runs. Same test, two seats, opposite correct answers — and reading it in this seat took `needs-triage` from 11 to 135 before it was repriced (ruled 2026-08-18). **Dedupe through `~/.fleet/bin/fleet-run ledger.mjs check "<subject>"`, never a bare `gh issue list --search`** — the duplicate class that guard exists to catch was filed from *here*: the ledger row for the finding rediscovered five times in one measured run carries a reviewer's own source tag, `(review-pr-108)`. `check` reads this run's filed list *and* the tracker at `--state all`, so a closed duplicate still counts. Exit **1** is already filed in this run; exit **3** is a clean ledger with matching tracker rows that score against the subject — read the ones it prints and comment on the existing follow-up rather than filing a second issue. **Exit 0 is not automatically "safe to file"**: it covers `clean`, `soft-hit` and `unverified` alike, and an unreachable `gh` degrades to a ledger-only answer that says `TRACKER NOT CHECKED`, so read the stdout `verdict` to tell a tracker that was searched and clean from one nobody read — under `unverified`, search it yourself before filing — or, for the applied-promotion comment above, before treating a tracker nobody could read as a reason to skip it. **`soft-hit` is the answer that costs most to misread**: it means related rows were found and none of them was established as a duplicate — a near-miss above the floor, or tracker rows the scorer rates 0.00 — so read the rows it printed and decide, and never treat that exit 0 as permission. Exit **2** is a usage error, meaning nothing was checked at all: fix the invocation and re-run, never read it as a duplicate. Full exit-code and `verdict` semantics live in `$(~/.fleet/bin/fleet-run --root)/skills/run-team/SKILL.md`'s **Run ledger** section — read them there rather than restating them here. **The guard dedupes, it never drops:** a duplicate becomes a comment on the issue that already covers it, never a dropped finding. **Record every issue you create, at once:** immediately after each `gh issue create`, run `~/.fleet/bin/fleet-run ledger.mjs filed <N> "<subject>"` — `<N>` the number `gh issue create` printed, and **the same subject string you passed to `check`**, so the next `check` for that finding meets it in the filed list instead of scoring a rewording. Without it the guard's ledger half never holds a row, and its exit **1** can never fire. If `filed` fails, retry it once; if it fails again, leave the issue alone — it exists and is correct — and report it as `unrecorded: #N <subject>`, so the controller runs `filed` for it. Report `filed: #N <subject>` for every issue you created — under the fleet, in your report to the controller. **The one window the guard cannot see:** `check` → `gh issue create` → `filed` is three commands, and the ledger's lock covers each alone, so two filers can both read `clean` in the seconds before either records. That gap is accepted, never a reason to skip `filed`. Post the numbers as one PR comment.
|
|
16
16
|
**A duplicate that should hold an open deferral is relabelled up, never down.** Where the guard lands a finding whose home is an open issue on an existing one that is open and labelled `needs-triage` while the finding's state calls for `ready-for-agent` — a defect its refuters confirmed — relabel it with `gh issue edit <N> --remove-label needs-triage --add-label ready-for-agent`, and cite the refuters' verdict in the comment you leave there. Never relabel `ready-for-agent` down to `needs-triage`: a `ready-for-agent` issue already holds a `needs-triage` finding, and a later run's crashed refuters are no reason to send a confirmed defect back to triage. A closed one cannot hold it: file a new open issue citing it, as the promotion rule above does for the closed record.
|
|
17
17
|
**Name where each deferral went, in the disposition record.** Every entry you defer carries `issue`: the number of the issue you filed it to, commented it onto, or appended it to — the closed `PR #<pr> review: the suggestion band, checked` record included. An in-scope `suggestion`'s entry — an `unverified` finding with `refutersDispatched` of zero — also carries `verdictPath`, applied or deferred: the absolute path of a file holding its refuter's verdict as JSON, `{"refuted": <boolean>, "reason": "<string>"}`, under your own `<scratch>/pr<N>/fix-XXXXXXXX/<finding>/` run root. `dispositions-check.mjs` reads each named issue back through `gh issue view --json labels,state,title` and each verdict file off disk; a mismatch names the row of its filing table the entry broke, so move or relabel that filing to the home the row names and run the check again. With `gh` unreachable, or an issue it cannot read, that filing goes unchecked: with nothing else broken the verdict is `unchecked` — never `ok`, and it exits 1 — so run the check again once `gh` answers.
|
|
18
|
-
6. Diff-check green (run-bound per `ci-state.mjs`; under staleness see **`skipped` is not `passed`** for what the label then rests on) **and** deferrals filed **and** the PR carrying exactly one release label (`patch`/`minor`/`major`, counting only those three; **required on every PR** — `release-label.yml` auto-adds `patch` when none is present and hard-fails on more than one, so this never needs to check whether the repo defines the gate at all, and `gh label list` settles nothing here any more) **and** `dispositions-check.mjs --member fix-pr-<pr> --scratch <scratch>` run over your own record exiting 0 (standalone that is yours to run, from the worktree, after step 2 writes `<scratch>/dispositions-<pr>.json`; it reads the review file beside it, which you write yourself from the findings step 1 collected, in the shape **The review result file** describes — `pr`, `head`, `snapshot`, `counts` and the `survived`, `refuted` and `unverified` buckets; standalone you pass `--no-ledger`, so it writes no token and the exit status is the verdict — a `.fleet/ledger.md` the repository already holds is a previous run's, and without the flag it exits 2 for a ledger with no row for you; under the fleet `ledger.mjs dispatch` has already refused a finisher without it) → `gh pr edit <pr> --add-label ready-to-merge`. Do not merge. A non-zero dispositions exit halts you before the label, and you report the violations it printed. Zero or more than one release label halts you before the label, naming which you found — a timed-out `gh pr create` opens the PR with its `--label` unapplied and no exit status to react to, and nothing after this step re-derives the release label. **Under the fleet a finisher does this** — a fresh small agent the controller dispatches (after your final verdict, never on your bare idle). Gate it on the diff-validating **`check`** job, **not** on `ci-state --quiet` exit 0, which a behind PR — the normal case once any sibling merges — never reaches: a `rebase-check` red or heavy jobs `skipped` off the behind-count hold it short of full green, so an exit-0 gate strands every behind PR unlabelled. Label when `check` is present and green **and no heavy job (the diff-validating suites — *not* the `rebase-check` currency gate) is in `failure`** — a `skipped` heavy job is behind-count staleness and fine — **solely** off that count, which is a condition to establish rather than infer, see the five-condition note in `$(~/.fleet/bin/fleet-run --root)/skills/run-team/SKILL.md`'s fix-applier prompt block. A `failure` is the diff's own fault and blocks the label, else a genuinely broken PR gets labelled off a green `check` and burns a merge-bot rebase+CI cycle before the failure resurfaces. Read per-job state for this: run `ci-state.mjs` **without** `--quiet`, or read its `jobs` — the `--quiet` payload drops the per-job `jobs`/`missing` and the `dropped` list, keeping `reasons` (which still distinguishes `is failure` from `is skipped`). You reach step 6 yourself only when green is already in hand at push time.
|
|
18
|
+
6. Diff-check green (run-bound per `ci-state.mjs`; under staleness see **`skipped` is not `passed`** for what the label then rests on) **and** deferrals filed **and** the PR carrying exactly one release label (`patch`/`minor`/`major`, counting only those three; **required on every PR** — `release-label.yml` auto-adds `patch` when none is present and hard-fails on more than one, so this never needs to check whether the repo defines the gate at all, and `gh label list` settles nothing here any more) **and** `dispositions-check.mjs --member fix-pr-<pr> --scratch <scratch>` run over your own record exiting 0 (standalone that is yours to run, from the worktree, after step 2 writes `<scratch>/dispositions-<pr>.json`; it reads the review file beside it, which you write yourself from the findings step 1 collected, in the shape **The review result file** describes — `pr`, `head`, `snapshot`, `counts` and the `survived`, `refuted` and `unverified` buckets; standalone you pass `--no-ledger`, so it writes no token and the exit status is the verdict — a `.fleet/ledger.md` the repository already holds is a previous run's, and without the flag it exits 2 for a ledger with no row for you; under the fleet `ledger.mjs dispatch` has already refused a finisher without it) → `gh pr comment <pr> --body "ready-to-merge-head: <prHead>"`, `prHead` being the full SHA your green `ci-state.mjs` reading reported, which the merge bot reads as the head the label was applied to, then `gh pr edit <pr> --add-label ready-to-merge`. Do not merge. A non-zero dispositions exit halts you before the label, and you report the violations it printed. Zero or more than one release label halts you before the label, naming which you found — a timed-out `gh pr create` opens the PR with its `--label` unapplied and no exit status to react to, and nothing after this step re-derives the release label. **Under the fleet a finisher does this** — a fresh small agent the controller dispatches (after your final verdict, never on your bare idle). Gate it on the diff-validating **`check`** job, **not** on `ci-state --quiet` exit 0, which a behind PR — the normal case once any sibling merges — never reaches: a `rebase-check` red or heavy jobs `skipped` off the behind-count hold it short of full green, so an exit-0 gate strands every behind PR unlabelled. Label when `check` is present and green **and no heavy job (the diff-validating suites — *not* the `rebase-check` currency gate) is in `failure`** — a `skipped` heavy job is behind-count staleness and fine — **solely** off that count, which is a condition to establish rather than infer, see the five-condition note in `$(~/.fleet/bin/fleet-run --root)/skills/run-team/SKILL.md`'s fix-applier prompt block. A `failure` is the diff's own fault and blocks the label, else a genuinely broken PR gets labelled off a green `check` and burns a merge-bot rebase+CI cycle before the failure resurfaces. Read per-job state for this: run `ci-state.mjs` **without** `--quiet`, or read its `jobs` — the `--quiet` payload drops the per-job `jobs`/`missing` and the `dropped` list, keeping `reasons` (which still distinguishes `is failure` from `is skipped`). You reach step 6 yourself only when green is already in hand at push time.
|
|
19
19
|
|
|
20
20
|
**`verdict: "no-ci"` — this repo has no `check` job to gate on at all**, and that is a different state from red or unknown, not a third way to skip the wait. Label off step 3's own green `testCmd` run instead of a `check` job that will never exist — and only once `ci-state.mjs` reads `no-ci` **without** the flag, since a repo whose CI is merely misconfigured exits 2 there rather than reading no-ci. `--declare-no-ci` is your caller-side declaration that step 3's run **is** this repo's gate: it flips the exit code and echoes itself into `reasons`, so finding it in the payload confirms only that you passed it, never that anyone verified anything. **No green `testCmd` run on record → do not label.** Say in your verdict that the repo has no CI configured and no declaration, and stop — inferring a pass from silence here is exactly the misconfigured-CI case the declaration exists to rule out. See `ci-state.mjs --pr <n> --declare-no-ci` below.
|
|
21
21
|
|
|
@@ -50,40 +50,36 @@ Obeying a fired signal blindly stalls the queue on a non-conflict; ignoring one
|
|
|
50
50
|
|
|
51
51
|
## The labelled head
|
|
52
52
|
|
|
53
|
-
`ready-to-merge` is a finisher's verdict on one tree, and it does not expire when that tree does. **A GitHub label does not follow the branch** — one merged PR's timeline
|
|
53
|
+
`ready-to-merge` is a finisher's verdict on one tree, and it does not expire when that tree does. **A GitHub label does not follow the branch** — one merged PR's timeline shows it, read with the timeline query below: `labeled ready-to-merge`, then commits and a `head_ref_force_pushed`, then `merged`, with no `unlabeled` anywhere between. The label stayed put while the head moved out from under it. Every other guard in this chain — the finisher's dispatch pin, the halt on a moved head, the worktree audit — runs *before* the label exists, so none of them is watching this window. You are the last gate, and **re-deriving the head is a requirement here, not bot discretion**: merge only a head that still carries the audit the label stands for.
|
|
54
54
|
|
|
55
|
-
**
|
|
55
|
+
**The labelled head is the head its labeller recorded.** Whoever adds `ready-to-merge` — a finisher, or `review-and-fix` run standalone — posts a PR comment whose whole body is `ready-to-merge-head: <sha>`, naming the head it audited, immediately before the label. Read the newest one before `gh pr update-branch` and before anything else that can move the head:
|
|
56
56
|
|
|
57
57
|
```bash
|
|
58
|
-
gh
|
|
59
|
-
-q '.[] |
|
|
60
|
-
|
|
61
|
-
| .event + " " + (.sha // .label.name // "")'
|
|
58
|
+
gh pr view <pr> --json comments \
|
|
59
|
+
-q '[.comments[] | {createdAt, sha: (.body | capture("\\Aready-to-merge-head: (?<sha>[0-9a-f]{40})\\s*\\z").sha)}]
|
|
60
|
+
| sort_by(.createdAt) | last | .sha // ""'
|
|
62
61
|
```
|
|
63
62
|
|
|
64
|
-
|
|
63
|
+
Nothing else names that head. A commit's dates are when it was made, not when it was pushed, so a commit made before the label and pushed after it carries no date after the label; and a plain push that a force-push then orphans leaves no line on the PR's timeline at all.
|
|
64
|
+
|
|
65
|
+
**A recorded head that is the current head (`gh pr view <pr> --json headRefOid -q .headRefOid`) is the normal case, and it proceeds untouched** — label applied, head unchanged, merge goes ahead exactly as it did before this gate existed.
|
|
65
66
|
|
|
66
|
-
**A
|
|
67
|
+
**A recorded head that is not the current head is not refused on sight — it may be a rebase-carry, and the merge gate decides.** The label binds to the change the finisher audited, not to one SHA: a rewrite that leaves the PR's net change byte-identical — a conflict-free rebase onto a newer `main` — keeps it, and anything a push adds, drops or edits does not, whenever it was pushed and however its commits are dated. So, in the main checkout after a plain `git fetch origin`, run step 3's gate now, before step 1, with `--pre <labelled head>` and no `--post`. **`rebaseCarry` null → refuse:** report `head-moved-after-label-#<pr>` and stop on that PR. Leave the label where it is — you audited nothing and removing another member's verdict is not yours to do. What clears it is a **fresh** finisher against the new head; the first audit does not transfer, because it verified a different tree. Non-null → the current head carries the labelled head's change: `--pre` stays the labelled head on every later gate run, step 1's `pre` must read `rebaseCarry.accepted` (any other head is a push since the proof — refuse with `head-moved-after-label-#<pr>`), and your report names the carry as `rebase-carry-#<pr>` with both SHAs.
|
|
68
|
+
|
|
69
|
+
**No record — a hand-added label, or one applied before its labeller recorded a head — falls back to the timeline, which can refuse a moved head but never name the labelled one.** Read it before `gh pr update-branch` too: your own rebase lands commits after the label by construction, so once you have rebased this read can no longer tell your commits from someone else's:
|
|
67
70
|
|
|
68
71
|
```bash
|
|
69
|
-
gh api
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
__typename
|
|
74
|
-
... on LabeledEvent { createdAt label { name } }
|
|
75
|
-
... on HeadRefForcePushedEvent { createdAt beforeCommit { oid } } } } } } }' \
|
|
76
|
-
-q '.data.repository.pullRequest.timelineItems.nodes[]
|
|
77
|
-
| select(.__typename == "HeadRefForcePushedEvent" or .label.name == "ready-to-merge")
|
|
78
|
-
| "\(.createdAt | fromdateiso8601) " + (if .__typename == "LabeledEvent" then "labeled"
|
|
79
|
-
else "force-pushed \(.beforeCommit.oid // "unknown")" end)'
|
|
72
|
+
gh api "repos/{owner}/{repo}/issues/<pr>/timeline?per_page=100" --paginate \
|
|
73
|
+
-q '.[] | select((.event == "labeled" and .label.name == "ready-to-merge")
|
|
74
|
+
or .event == "committed" or .event == "head_ref_force_pushed")
|
|
75
|
+
| .event + " " + (.sha // .label.name // "")'
|
|
80
76
|
```
|
|
81
77
|
|
|
82
|
-
|
|
78
|
+
A `committed` or `head_ref_force_pushed` line after the last `labeled ready-to-merge` means the head moved after the audit. **With no record, refuse:** report `head-moved-after-label-#<pr>` and stop on that PR, the label left where it is — nothing names a head the label was applied to, so no carry can be proven. **Nothing after that label line is the normal case, and it proceeds untouched.**
|
|
83
79
|
|
|
84
|
-
|
|
80
|
+
Record the head before you rebase — `gh pr view <pr> --json headRefOid -q .headRefOid` — because step 3 hands it to the merge gate as `--pre` and nothing later can reconstruct it. Where step 1 runs, that is its `pre`; on an already-current PR it is simply the head you merge. After a carry, `--pre` is the labelled head instead.
|
|
85
81
|
|
|
86
|
-
What this gate deliberately does not answer. It does not ask *who* audited — a hand-added `ready-to-merge` with no finisher behind it reads clean here, and the reviewer-only rule in `run-team/SKILL.md` is what owns that — nor who force-pushed. A head rebased after the label by an **earlier, abandoned pass of this command** is judged like any other
|
|
82
|
+
What this gate deliberately does not answer. It does not ask *who* audited — a hand-added `ready-to-merge` with no finisher behind it reads clean here, and the reviewer-only rule in `run-team/SKILL.md` is what owns that — nor who posted the record or who force-pushed. A head rebased after the label by an **earlier, abandoned pass of this command** is judged like any other moved head: with a record, carried when its net change is the labelled head's, refused when it is not; without one, refused.
|
|
87
83
|
|
|
88
84
|
## Per-PR sequence
|
|
89
85
|
|
package/package.json
CHANGED
package/scripts/reap.sh
CHANGED
|
@@ -1108,9 +1108,10 @@ for b in $gone_branches; do
|
|
|
1108
1108
|
# along, the same cwd deletion this guard exists for, one path further
|
|
1109
1109
|
# out — even though `$wt` itself never equals `$self_wt` in that shape.
|
|
1110
1110
|
# worktree.sh's `wt_holds_cwd` carries the match and why it is on the
|
|
1111
|
-
# directory, not only the string
|
|
1111
|
+
# directory, not only the string; a compare it could not make comes back
|
|
1112
|
+
# in `$wt_why`, reported in place of the match this wording claims.
|
|
1112
1113
|
if wt_holds_cwd "$wt" "$self_wt"; then
|
|
1113
|
-
keep "$b" "worktree $wt holds the working directory this run was started in — removing it would delete the cwd every git call after it needs; rerun from outside it"
|
|
1114
|
+
keep "$b" "${wt_why:-worktree $wt holds the working directory this run was started in — removing it would delete the cwd every git call after it needs; rerun from outside it}"
|
|
1114
1115
|
continue
|
|
1115
1116
|
fi
|
|
1116
1117
|
|
|
@@ -1550,7 +1551,7 @@ else
|
|
|
1550
1551
|
# sweep's copy of this guard: a worktree nested inside `$wt` is removed
|
|
1551
1552
|
# along with it even though `$wt` never equals `$self_wt` in that shape.
|
|
1552
1553
|
if wt_holds_cwd "$wt" "$self_wt"; then
|
|
1553
|
-
keep "" "worktree $wt holds the working directory this run was started in — removing it would delete the cwd every git call after it needs; rerun from outside it"
|
|
1554
|
+
keep "" "${wt_why:-worktree $wt holds the working directory this run was started in — removing it would delete the cwd every git call after it needs; rerun from outside it}"
|
|
1554
1555
|
continue
|
|
1555
1556
|
fi
|
|
1556
1557
|
|
|
@@ -1182,7 +1182,8 @@ fi
|
|
|
1182
1182
|
# under it, after which every git call dies with `fatal: Unable to read current
|
|
1183
1183
|
# working directory` (measured on reap.sh, whose sweeps refuse the same path).
|
|
1184
1184
|
# Asked of the directory, not the string, by worktree.sh's `wt_holds_cwd`,
|
|
1185
|
-
# which also answers true when `[` cannot evaluate the compare
|
|
1185
|
+
# which also answers true when `[` cannot evaluate the compare, naming that
|
|
1186
|
+
# fault in `$wt_why`, reported in place of the match. `pwd -P`, not
|
|
1186
1187
|
# `$PWD`: an inherited `PWD` naming some other directory is one POSIX leaves
|
|
1187
1188
|
# the shell free to keep. The sentinel keeps a trailing newline in the path.
|
|
1188
1189
|
# A blocker, not a die: what stands in the way is known, and one `cd` away.
|
|
@@ -1191,7 +1192,7 @@ if [ -n "$wt" ]; then
|
|
|
1191
1192
|
die "cannot read the working directory this run was started in, so whether releasing $wt would delete it is unknown"
|
|
1192
1193
|
rt_cwd=${rt_cwd%?x}
|
|
1193
1194
|
if wt_holds_cwd "$wt" "$rt_cwd"; then
|
|
1194
|
-
block "worktree $wt holds the working directory this run was started in — removing it would delete the cwd every git call after it needs; rerun from outside it"
|
|
1195
|
+
block "${wt_why:-worktree $wt holds the working directory this run was started in — removing it would delete the cwd every git call after it needs; rerun from outside it}"
|
|
1195
1196
|
fi
|
|
1196
1197
|
fi
|
|
1197
1198
|
|
package/scripts/worktree.sh
CHANGED
|
@@ -994,14 +994,22 @@ EOF
|
|
|
994
994
|
# Nothing downstream of this guard re-checks the directory it protects, so
|
|
995
995
|
# reading that rc as "not this one" would disable the guard silently.
|
|
996
996
|
#
|
|
997
|
-
# Returns 0 or 1 only, and
|
|
998
|
-
# because only the caller knows whose cwd $2 is.
|
|
997
|
+
# Returns 0 or 1 only. A match, and every 1, leave `$wt_why` empty: the caller
|
|
998
|
+
# names that refusal, because only the caller knows whose cwd $2 is. The
|
|
999
|
+
# fail-closed 0 instead sets `$wt_why` to the compare that could not be made,
|
|
1000
|
+
# and the caller reports that in place of its own wording, which would claim
|
|
1001
|
+
# a match nothing established. Cleared on entry, so a reason left by an
|
|
1002
|
+
# earlier probe never stands in for a match.
|
|
999
1003
|
wt_holds_cwd() {
|
|
1004
|
+
wt_why=
|
|
1000
1005
|
wt_hc_d=$2
|
|
1001
1006
|
while :; do
|
|
1002
1007
|
# shellcheck disable=SC3013,SC2319 # -ef as in wt_linkage; the else's $? is the `[ -ef ]` test's own rc, read before anything else runs, to fail closed on rc>=2
|
|
1003
1008
|
if [ "$wt_hc_d" -ef "$1" ]; then return 0; else wt_hc_rc=$?; fi
|
|
1004
|
-
[ "$wt_hc_rc" -
|
|
1009
|
+
if [ "$wt_hc_rc" -ge 2 ]; then
|
|
1010
|
+
wt_why="could not compare $wt_hc_d with $1 (test -ef exited $wt_hc_rc), so whether removing $1 would delete the working directory is unknown"
|
|
1011
|
+
return 0
|
|
1012
|
+
fi
|
|
1005
1013
|
case "$wt_hc_d" in
|
|
1006
1014
|
*/*) wt_hc_d=${wt_hc_d%/*} ;;
|
|
1007
1015
|
*) return 1 ;;
|
package/skills/run-team/SKILL.md
CHANGED
|
@@ -2698,9 +2698,12 @@ a minute apart showed *different* mutants, so a member's report and any single
|
|
|
2698
2698
|
wearing one release label beside them passes unchanged. A repo that
|
|
2699
2699
|
defines none of the three does not gate on one — `gh label list` settles
|
|
2700
2700
|
that, and it is no licence to skip the read where they exist.
|
|
2701
|
-
- **(b) Add the label:**
|
|
2702
|
-
|
|
2703
|
-
|
|
2701
|
+
- **(b) Add the label:** record the head you audited first —
|
|
2702
|
+
`gh pr comment <pr> --body "ready-to-merge-head: <your dispatch pin>"`,
|
|
2703
|
+
the full SHA, which the merge bot reads as the head the label was applied
|
|
2704
|
+
to — then `gh pr edit <pr> --add-label ready-to-merge`. (a)
|
|
2705
|
+
passing labels nothing — it is the precondition, and these commands are
|
|
2706
|
+
the duty. Two finishers in one run stopped at (a) and reported
|
|
2704
2707
|
`labelled` on PRs that sat out of the merge queue.
|
|
2705
2708
|
4. Report you the label (its post-add read-back: `gh pr view <pr> --json labels`
|
|
2706
2709
|
run after 3(b), output as printed), the deferral issue numbers — a
|
|
@@ -2788,8 +2791,9 @@ whole duty and reported `labelled` on a PR that never got the label:
|
|
|
2788
2791
|
> `patch`/`minor`/`major`. Zero or more than one halts you before the label:
|
|
2789
2792
|
> name which you found. A repo whose `gh label list` defines none of the three
|
|
2790
2793
|
> does not gate on one.
|
|
2791
|
-
> (b) `gh pr
|
|
2792
|
-
>
|
|
2794
|
+
> (b) `gh pr comment <M> --body "ready-to-merge-head: <your dispatch pin>"`
|
|
2795
|
+
> (the full SHA), then `gh pr edit <M> --add-label ready-to-merge`. Step (a)
|
|
2796
|
+
> passing labels nothing; these commands are the duty.
|
|
2793
2797
|
> Then run `gh pr view <M> --json labels` once more and put its output in your
|
|
2794
2798
|
> report: that read-back is what tells the controller the label is on.
|
|
2795
2799
|
|