@feigi/fleet-ctl 3.23.36 → 3.23.38
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 +1 -1
- package/scripts/cell-readout.mjs +38 -11
- package/scripts/main-checkout.mjs +1 -1
- package/scripts/member-write-guard.mjs +1 -1
- package/scripts/repo-root.mjs +1 -1
- package/skills/run-team/references/reaping.md +1 -1
- package/scripts/agent-test-dir-prose.test.mjs +0 -59
- package/scripts/agent-test.test.mjs +0 -1640
- package/scripts/ambient-git-vars-mjs-prose.test.mjs +0 -397
- package/scripts/ambient-git-vars-prose.test.mjs +0 -192
- package/scripts/ancestry-check-position-prose.test.mjs +0 -175
- package/scripts/apply-ruleset.test.mjs +0 -421
- package/scripts/arg-header-probes-prose.test.mjs +0 -394
- package/scripts/arg.test.mjs +0 -1354
- package/scripts/board-cli.test.mjs +0 -710
- package/scripts/board-identity.test.mjs +0 -429
- package/scripts/board-liveness-banner.test.mjs +0 -119
- package/scripts/board-prev-shape.test.mjs +0 -228
- package/scripts/board-tryparse-null.test.mjs +0 -119
- package/scripts/board.test.mjs +0 -3121
- package/scripts/brief-after-cut-prose.test.mjs +0 -53
- package/scripts/candidates-exit3-prose.test.mjs +0 -302
- package/scripts/candidates.test.mjs +0 -2312
- package/scripts/caveat-unification-prose.test.mjs +0 -98
- package/scripts/cell-readout.test.mjs +0 -615
- package/scripts/ci-comment-rot-prose.test.mjs +0 -2025
- package/scripts/ci-completes-premise-prose.test.mjs +0 -257
- package/scripts/ci-state-prose.test.mjs +0 -113
- package/scripts/ci-state.test.mjs +0 -1933
- package/scripts/ci-vacuous-green.test.mjs +0 -368
- package/scripts/citation-sweep-prose.test.mjs +0 -1712
- package/scripts/claim-lifecycle.test.mjs +0 -187
- package/scripts/claim-ticket.test.mjs +0 -1122
- package/scripts/closing-keyword-prose.test.mjs +0 -193
- package/scripts/cockpit-launch-idempotent-prose.test.mjs +0 -165
- package/scripts/cockpit-tick-nonblocking.test.mjs +0 -210
- package/scripts/compute-board.test.mjs +0 -1214
- package/scripts/compute-spend.test.mjs +0 -517
- package/scripts/consumer-technology-prose.test.mjs +0 -126
- package/scripts/cross-repo-citation-prose.test.mjs +0 -155
- package/scripts/cwd-isolation-pins.mjs +0 -83
- package/scripts/dedupe-guard-prose.test.mjs +0 -243
- package/scripts/delete-merged-branch.test.mjs +0 -576
- package/scripts/derive-testcmd.test.mjs +0 -595
- package/scripts/diff-stats.test.mjs +0 -404
- package/scripts/dispatch-block-golden-prose.test.mjs +0 -1130
- package/scripts/dispatch-block-pins-prose.test.mjs +0 -615
- package/scripts/dispositions-check.test.mjs +0 -936
- package/scripts/dispositions-gate-prose.test.mjs +0 -129
- package/scripts/drop-merged-label.test.mjs +0 -479
- package/scripts/exec-stub.mjs +0 -93
- package/scripts/exec-stub.test.mjs +0 -69
- package/scripts/expected-jobs-prose.test.mjs +0 -80
- package/scripts/fan-out-authorization-prose.test.mjs +0 -80
- package/scripts/filing-bar-seat-prose.test.mjs +0 -242
- package/scripts/filing-claim-bar-prose.test.mjs +0 -166
- package/scripts/finisher-died-prose.test.mjs +0 -31
- package/scripts/finisher-dispatch-premise-prose.test.mjs +0 -312
- package/scripts/finisher-halt-prose.test.mjs +0 -106
- package/scripts/finisher-name-prose.test.mjs +0 -134
- package/scripts/finisher-own-tree-prose.test.mjs +0 -299
- package/scripts/finisher-pin-race-prose.test.mjs +0 -339
- package/scripts/finisher-test-verdict-prose.test.mjs +0 -102
- package/scripts/fix-applier-correction-rules-prose.test.mjs +0 -202
- package/scripts/fix-applier-result-file-prose.test.mjs +0 -149
- package/scripts/fleet-bootstrap.test.mjs +0 -75
- package/scripts/fleet-heartbeat.test.mjs +0 -450
- package/scripts/fleet-provenance.test.mjs +0 -138
- package/scripts/fleet-run.test.mjs +0 -90
- package/scripts/fleet-state.test.mjs +0 -460
- package/scripts/fleet-tick-prose.test.mjs +0 -300
- package/scripts/fleet-tick.test.mjs +0 -2444
- package/scripts/force-with-lease-reason-prose.test.mjs +0 -184
- package/scripts/frontmatter-check.test.mjs +0 -436
- package/scripts/git-env.test.mjs +0 -149
- package/scripts/git-status-untracked-mode-sweep.test.mjs +0 -216
- package/scripts/gone-walk.test.mjs +0 -213
- package/scripts/gp-sep-invariant-prose.test.mjs +0 -188
- package/scripts/head-moved-after-label-prose.test.mjs +0 -233
- package/scripts/immutable-body-claim-prose.test.mjs +0 -204
- package/scripts/implementer-model-tier.test.mjs +0 -235
- package/scripts/inflight-citation-prose.test.mjs +0 -144
- package/scripts/inflight-exit2-prose.test.mjs +0 -81
- package/scripts/inflight-probe-guard-prose.test.mjs +0 -109
- package/scripts/inflight-scan-scope-prose.test.mjs +0 -57
- package/scripts/inflight.test.mjs +0 -2882
- package/scripts/injection-control-prose.test.mjs +0 -404
- package/scripts/install-root-audit.test.mjs +0 -464
- package/scripts/instrument-check-prose.test.mjs +0 -235
- package/scripts/instruments.test.mjs +0 -787
- package/scripts/is-cli.test.mjs +0 -99
- package/scripts/issue-tracker-prose.test.mjs +0 -71
- package/scripts/json.test.mjs +0 -364
- package/scripts/ledger-dispatch.test.mjs +0 -927
- package/scripts/ledger-grammar.test.mjs +0 -227
- package/scripts/ledger-read-require-file.test.mjs +0 -197
- package/scripts/ledger-rotate.test.mjs +0 -142
- package/scripts/ledger.test.mjs +0 -3436
- package/scripts/line-distance-prose.test.mjs +0 -245
- package/scripts/liveness-rationale-prose.test.mjs +0 -83
- package/scripts/locale-pin-prose.test.mjs +0 -189
- package/scripts/main-checkout.test.mjs +0 -332
- package/scripts/member-outcome-prose.test.mjs +0 -167
- package/scripts/member-outcomes-header.test.mjs +0 -129
- package/scripts/member-outcomes-prose.test.mjs +0 -63
- package/scripts/member-outcomes.test.mjs +0 -638
- package/scripts/member-prompt-prose.test.mjs +0 -165
- package/scripts/member-record.test.mjs +0 -541
- package/scripts/member-write-guard.test.mjs +0 -214
- package/scripts/merge-commit-probe-prose.test.mjs +0 -122
- package/scripts/merge-gate.test.mjs +0 -613
- package/scripts/muted-git-guard-sweep.test.mjs +0 -493
- package/scripts/net-ssh-precedence-prose.test.mjs +0 -91
- package/scripts/net-watchdog-prose.test.mjs +0 -79
- package/scripts/net.test.mjs +0 -211
- package/scripts/no-ci-gate-prose.test.mjs +0 -108
- package/scripts/no-undo-audit.test.mjs +0 -3961
- package/scripts/no-wave.test.mjs +0 -138
- package/scripts/node-floor-sweep.test.mjs +0 -611
- package/scripts/pointer-target-prose.test.mjs +0 -186
- package/scripts/pr-cost.test.mjs +0 -521
- package/scripts/pr-overlap.test.mjs +0 -692
- package/scripts/printf-die-sweep.test.mjs +0 -384
- package/scripts/prompt-renderer.mjs +0 -40
- package/scripts/prompt-renderer.test.mjs +0 -68
- package/scripts/prose-pin.mjs +0 -807
- package/scripts/prose-pin.test.mjs +0 -1034
- package/scripts/prove-merge.test.mjs +0 -995
- package/scripts/pull-table-relabel-prose.test.mjs +0 -60
- package/scripts/quiet-payload-prose.test.mjs +0 -222
- package/scripts/reap-cherry-check-prose.test.mjs +0 -80
- package/scripts/reap.test.mjs +0 -4432
- package/scripts/reaping-prose.test.mjs +0 -239
- package/scripts/reaping-reap-authorizers-prose.test.mjs +0 -112
- package/scripts/reaping-release-authorizers-prose.test.mjs +0 -85
- package/scripts/recipe-derivation-prose.test.mjs +0 -112
- package/scripts/recipe-prove.test.mjs +0 -1042
- package/scripts/refuter-scratch-prose.test.mjs +0 -135
- package/scripts/release-label-required-prose.test.mjs +0 -71
- package/scripts/release-label-split-prose.test.mjs +0 -184
- package/scripts/release-ticket-reap-pairing-prose.test.mjs +0 -63
- package/scripts/release-ticket.test.mjs +0 -5099
- package/scripts/renovate-release-contract.test.mjs +0 -379
- package/scripts/repo-root.test.mjs +0 -873
- package/scripts/reporter-output-rule-prose.test.mjs +0 -208
- package/scripts/review-agent-report-only.test.mjs +0 -49
- package/scripts/review-core-booking.test.mjs +0 -35
- package/scripts/review-core-cwd-isolation.test.mjs +0 -374
- package/scripts/review-core-reads.test.mjs +0 -478
- package/scripts/review-core-refuter-scratch.test.mjs +0 -148
- package/scripts/review-core-scratch-refusal.test.mjs +0 -64
- package/scripts/review-core-shared-test-run.test.mjs +0 -275
- package/scripts/review-core-snapshot-path.test.mjs +0 -830
- package/scripts/review-core-specialist-scratch.test.mjs +0 -191
- package/scripts/review-core-testcmd.test.mjs +0 -335
- package/scripts/review-core-unrun.test.mjs +0 -566
- package/scripts/review-core-unverified-discriminant.test.mjs +0 -208
- package/scripts/review-eval-resolver-path.test.mjs +0 -55
- package/scripts/review-host-fixture.mjs +0 -89
- package/scripts/review-in-run-retry.test.mjs +0 -211
- package/scripts/review-no-vendor-dispatch.test.mjs +0 -45
- package/scripts/review-path-default.test.mjs +0 -796
- package/scripts/review-runner-spawns.test.mjs +0 -95
- package/scripts/review-runner.test.mjs +0 -166
- package/scripts/review-tier-audit.test.mjs +0 -140
- package/scripts/run-artifact-pr-prose.test.mjs +0 -341
- package/scripts/run-merge-bot-prose.test.mjs +0 -1413
- package/scripts/run-team-local-hook.test.mjs +0 -442
- package/scripts/scratch-partition-invariant-prose.test.mjs +0 -74
- package/scripts/scripts-path-citation-sweep.test.mjs +0 -73
- package/scripts/section-between-guard-prose.test.mjs +0 -379
- package/scripts/select-dimensions.test.mjs +0 -674
- package/scripts/shared-refusal.test.mjs +0 -388
- package/scripts/shell-traps-prose.test.mjs +0 -504
- package/scripts/shortlist.test.mjs +0 -380
- package/scripts/slow-transport.mjs +0 -72
- package/scripts/snapshot-repo.test.mjs +0 -1006
- package/scripts/snapshot-runner-audience-prose.test.mjs +0 -130
- package/scripts/spend-view.test.mjs +0 -312
- package/scripts/staleness-qualifier-prose.test.mjs +0 -251
- package/scripts/staleness-verdict-prose.test.mjs +0 -142
- package/scripts/staleness.test.mjs +0 -893
- package/scripts/stalled-member-liveness-prose.test.mjs +0 -219
- package/scripts/stash-prohibition-prose.test.mjs +0 -313
- package/scripts/strip-comments.mjs +0 -44
- package/scripts/temp-dir.mjs +0 -47
- package/scripts/ticket-router.test.mjs +0 -981
- package/scripts/tier-check.test.mjs +0 -828
- package/scripts/tier-outcomes-header.test.mjs +0 -518
- package/scripts/tier-outcomes.test.mjs +0 -572
- package/scripts/tier-roles.test.mjs +0 -535
- package/scripts/tracker-block-copy-prose.test.mjs +0 -288
- package/scripts/triage-labels-gloss-prose.test.mjs +0 -97
- package/scripts/unattended-git-sweep.test.mjs +0 -142
- package/scripts/verify-sha-exit2-prose.test.mjs +0 -269
- package/scripts/verify-sha.test.mjs +0 -692
- package/scripts/watcher-degraded-block.test.mjs +0 -369
- package/scripts/watcher-key-prose.test.mjs +0 -106
- package/scripts/within-run-pair-prose.test.mjs +0 -212
- package/scripts/worktree-audit.test.mjs +0 -1408
- package/scripts/worktree-head-prose.test.mjs +0 -276
- package/scripts/worktree-listing-sweep.test.mjs +0 -217
- package/scripts/worktree-model-prose.test.mjs +0 -216
- package/scripts/worktree-porcelain.mjs +0 -35
- package/scripts/worktree-porcelain.test.mjs +0 -102
|
@@ -1,219 +0,0 @@
|
|
|
1
|
-
// #1045, the residue of #503. The guidance a controller reads to judge whether
|
|
2
|
-
// a member has died offered the transcript as the evidence, and the transcript
|
|
3
|
-
// cannot answer: a member wedged on a blocked tool call emits the dead
|
|
4
|
-
// member's whole signature — record counts unchanged from one poll to the
|
|
5
|
-
// next. Settled against `origin/main` before this landed:
|
|
6
|
-
//
|
|
7
|
-
// git show origin/main:plugin/skills/run-team/SKILL.md \
|
|
8
|
-
// | grep -ciE 'mtime|blocked tool call|frozen transcript' -> 0
|
|
9
|
-
//
|
|
10
|
-
// #503's own "Also worth pinning" item names the discriminator and the
|
|
11
|
-
// measurement behind it: its refuter sat forever on
|
|
12
|
-
// `until grep -q "^# fail" mut_a.txt` while `node --test` wrote the `ℹ`
|
|
13
|
-
// prefix, "record counts were unchanged across two polls while `pin.log` /
|
|
14
|
-
// `mut2.txt` / `base.log` all carried fresh mtimes". PR #1043 closed #503
|
|
15
|
-
// carrying only the refuter's observation rule, so this half survived nowhere
|
|
16
|
-
// but the tracker.
|
|
17
|
-
//
|
|
18
|
-
// WHERE IT GOES, and that is half the ticket. The clause sits in `## Failure
|
|
19
|
-
// handling`, between the table row that acts on a dead member and the
|
|
20
|
-
// Settle/liveness pair that says how to ask each harness — not in Phase 3's
|
|
21
|
-
// narrative, which is about reacting to artifacts rather than judging death.
|
|
22
|
-
// The killed row itself carries the gate in one clause, because a controller
|
|
23
|
-
// scanning the table acts off the row.
|
|
24
|
-
//
|
|
25
|
-
// THE SPAN IS ONE JOIN, not four assertions. The instruction runs from "does
|
|
26
|
-
// not establish" through the two verdicts, the carve-out, and the measurement
|
|
27
|
-
// that produced it, and a `\s+`-joined span has nowhere for a splice to land;
|
|
28
|
-
// split into separate matches, a sentence reinstating a transcript-only
|
|
29
|
-
// verdict fits between any two of them and every match stays green. The
|
|
30
|
-
// why-prose after it — the filenames, the cost asymmetry, the symmetry with
|
|
31
|
-
// #1043's own rule — is deliberately NOT pinned, so it stays rewordable.
|
|
32
|
-
//
|
|
33
|
-
// THE CEILING. A deliberate reword of the instruction reds this, and the fix
|
|
34
|
-
// is to re-anchor the phrase here, never to drop a half. A rewrap is a no-op
|
|
35
|
-
// by construction (`phrase()` joins on `\s+`). An emphasis move inside the
|
|
36
|
-
// span reds it too: the `**` markers around the verdict pair are matched
|
|
37
|
-
// literally, because moving them moves which half a reader sees as the rule.
|
|
38
|
-
import { test } from "node:test";
|
|
39
|
-
import assert from "node:assert/strict";
|
|
40
|
-
import { readFileSync } from "node:fs";
|
|
41
|
-
import { join } from "node:path";
|
|
42
|
-
import { between, paragraph, phrase } from "./prose-pin.mjs";
|
|
43
|
-
|
|
44
|
-
const SKILL = "skills/run-team/SKILL.md";
|
|
45
|
-
const read = () => readFileSync(join(import.meta.dirname, "..", ...SKILL.split("/")), "utf8");
|
|
46
|
-
|
|
47
|
-
// The paragraph carrying the rule, and no more of the file than that — the
|
|
48
|
-
// shared bound, which also asserts the anchor occurs exactly once. This
|
|
49
|
-
// document says "transcript", "scratch" and "mtime" in several other places
|
|
50
|
-
// (`board.mjs`'s ranking is discussed nowhere near here, but the dispatch
|
|
51
|
-
// prompts' own scratch-partition rule is), so an unbounded match is
|
|
52
|
-
// satisfiable from outside the clause it guards.
|
|
53
|
-
const ANCHOR = "**A frozen transcript does not establish that a member is dead";
|
|
54
|
-
const clause = () => paragraph(read(), ANCHOR, `${SKILL}'s stalled-member liveness clause`);
|
|
55
|
-
|
|
56
|
-
// One span: the epistemic rule, the discriminator, BOTH verdicts, the
|
|
57
|
-
// carve-out that keeps the second verdict from licensing a false kill, and the
|
|
58
|
-
// #503 measurement. #1150 made the read RECURSIVE — files anywhere under the
|
|
59
|
-
// assigned directory, with the command that reads them that way — because a
|
|
60
|
-
// member waiting on a child it dispatched writes nothing itself while the
|
|
61
|
-
// child writes below it, so a direct-children-only read shows that live parent
|
|
62
|
-
// the dead signature.
|
|
63
|
-
const INSTRUCTION = `A frozen transcript does not establish that a member is dead — the
|
|
64
|
-
discriminator is its scratch dir.** A member wedged on a blocked tool call
|
|
65
|
-
emits the whole signature of a dead one: record counts unchanged from one poll
|
|
66
|
-
of its transcript to the next. So read the mtimes of the files anywhere under
|
|
67
|
-
the scratch directory its own dispatch prompt assigned it, subdirectories
|
|
68
|
-
included — \`<scratch>/impl-<N>/\` for an implementer, that member's own
|
|
69
|
-
run-scoped subdirectory under \`<scratch>/pr<N>/\` on the review side, never
|
|
70
|
-
the bare \`pr<N>/\` tree those siblings share — since a member waiting on a
|
|
71
|
-
child it dispatched writes
|
|
72
|
-
nothing itself while that child writes below it. Read them at two observations
|
|
73
|
-
a poll apart — \`touch\` a marker file outside that directory at the first, and
|
|
74
|
-
\`find <dir> -type f -newer <marker>\` at the second lists every file that
|
|
75
|
-
moved: **mtimes that moved between the two mean BLOCKED, a live member
|
|
76
|
-
still holding its claim and its worktree, so the killed row above does not
|
|
77
|
-
apply to it; mtimes unchanged at both are the dead signature.** Only the first
|
|
78
|
-
of those two verdicts is conclusive — a member wedged on a call that writes
|
|
79
|
-
nothing freezes its scratch dir too — so settle the dead one on the liveness
|
|
80
|
-
read below, never on the two listings alone. Measured on #503: a refuter
|
|
81
|
-
wedged forever on \`until grep -q\` for a marker \`node --test\` never writes, its
|
|
82
|
-
transcript's record counts unchanged across two polls while its own scratch
|
|
83
|
-
files carried fresh mtimes throughout — alive the entire time it read as dead.`;
|
|
84
|
-
|
|
85
|
-
test("the stalled-member guidance says a frozen transcript does not establish death, and names the mtime discriminator with both its verdicts", () => {
|
|
86
|
-
assert.match(
|
|
87
|
-
clause(),
|
|
88
|
-
phrase(INSTRUCTION),
|
|
89
|
-
`${SKILL}'s stalled-member clause no longer carries the whole instruction. One of these went, or a sentence was spliced between them: (1) a frozen transcript does not establish death; (2) the signature it shares with a blocked tool call; (3) the discriminator — the mtimes of the files anywhere under the member's own scratch directory, subdirectories included, read at TWO observations a poll apart with the command that reads them recursively; (4) moved mtimes mean BLOCKED, unchanged mtimes are the dead signature; (5) only the blocked verdict is conclusive, because a call that writes nothing freezes the scratch dir too; (6) the #503 measurement it was derived from. Without (3) and (4) the controller is back to judging death off the transcript, which is #503's own residue; a (3) that stops at the directory's direct children reads a member waiting on its own child as dead; without (5) the clause licenses killing a live member wedged on a network read. Re-anchor this span against the reworded paragraph rather than dropping a half.`,
|
|
90
|
-
);
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
// The mutation a presence pin cannot see, and the one this ticket names: the
|
|
94
|
-
// clause left intact with a contradiction appended BESIDE it — "a transcript
|
|
95
|
-
// frozen across three polls is enough", "where the scratch dir is empty, treat
|
|
96
|
-
// the member as dead". That contradiction does not have to land inside the
|
|
97
|
-
// clause's own paragraph to be a carve-out: it lands just as easily as a new
|
|
98
|
-
// paragraph immediately after the clause, tacked onto the paragraph
|
|
99
|
-
// immediately above it ("A red PR never silently becomes `ready-to-merge`."),
|
|
100
|
-
// or as a new row in the failure table below. A ban scoped to only the
|
|
101
|
-
// clause's own paragraph is blind to all three, so it scans the whole
|
|
102
|
-
// neighbourhood the clause sits in instead — see NEIGHBOURHOOD below — plus a
|
|
103
|
-
// second, narrower ban over the failure table for the row case.
|
|
104
|
-
//
|
|
105
|
-
// The ban is the paragraph's own subject vocabulary, over what is left once
|
|
106
|
-
// the pinned span is removed from that neighbourhood. A carve-out that
|
|
107
|
-
// reuses at least one of the things the rule is about — the transcript, the
|
|
108
|
-
// scratch dir, the mtimes, the record counts, or the two verdicts themselves
|
|
109
|
-
// — is caught outside the span. A carve-out phrased to avoid every word in
|
|
110
|
-
// this list is NOT caught: this is a ban on the paragraph's literal
|
|
111
|
-
// vocabulary, not a semantic detector that catches a carve-out at any
|
|
112
|
-
// wording — closing that fully would need no finite list. The unpinned
|
|
113
|
-
// why-prose is written to carry none of them: it talks about filenames,
|
|
114
|
-
// listings, cost and the fleet, and the "A red PR never..." / "Settle
|
|
115
|
-
// outcome..." sentences that bound the neighbourhood carry none of them
|
|
116
|
-
// either. `replace` is deliberately non-global — a SECOND copy of the
|
|
117
|
-
// instruction is itself drift, and it lands in the residue where the ban
|
|
118
|
-
// catches it.
|
|
119
|
-
//
|
|
120
|
-
// The strip is REQUIRED to find something first, and that is not
|
|
121
|
-
// belt-and-braces. Measured on this pin: with the instruction deleted or
|
|
122
|
-
// half-deleted, an unguarded `replace` removes nothing, the whole mutated
|
|
123
|
-
// neighbourhood becomes the residue, and this test reds telling the reader a
|
|
124
|
-
// carve-out was appended beside a clause that is in fact missing — the wrong
|
|
125
|
-
// repair, pointed at the wrong sentence. A probe that could not look says so
|
|
126
|
-
// instead and leaves the presence pin above to name the real defect. It never
|
|
127
|
-
// goes green on that case: a vacuous pass here is what would let a deletion
|
|
128
|
-
// and a carve-out land together with only one of them reported.
|
|
129
|
-
//
|
|
130
|
-
// Binding the neighbourhood to the surrounding prose (below) rather than to
|
|
131
|
-
// the clause's own anchor has a second effect, free of an extra assertion:
|
|
132
|
-
// if the whole clause paragraph is moved elsewhere in the file, INSTRUCTION
|
|
133
|
-
// no longer appears between the two fixed sentences NEIGHBOURHOOD is bounded
|
|
134
|
-
// by, and the `assert.ok(span, ...)` in the test below reds — this also
|
|
135
|
-
// catches the clause moving out of its place in `## Failure handling`, not
|
|
136
|
-
// only a carve-out landing beside it where it stays.
|
|
137
|
-
const SUBJECT_VOCABULARY = /\b(?:transcripts?|mtimes?|record\s+counts?|scratch|frozen|dead|blocked)\b/i;
|
|
138
|
-
|
|
139
|
-
// The region a carve-out beside the clause can land in: from the sentence
|
|
140
|
-
// immediately above the clause through to the paragraph immediately below
|
|
141
|
-
// it, not just the clause's own paragraph. Bounded at both ends for
|
|
142
|
-
// `between`'s own reason (prose-pin.mjs) — an unbounded scan is satisfiable
|
|
143
|
-
// from outside the clause it guards.
|
|
144
|
-
const NEIGHBOURHOOD = () =>
|
|
145
|
-
between(
|
|
146
|
-
read(),
|
|
147
|
-
"A red PR never silently becomes",
|
|
148
|
-
"Settle outcome and liveness are different facts",
|
|
149
|
-
`${SKILL}'s stalled-member clause neighbourhood`,
|
|
150
|
-
);
|
|
151
|
-
|
|
152
|
-
test("nothing beside the clause carves an exception out of it", () => {
|
|
153
|
-
const whole = NEIGHBOURHOOD();
|
|
154
|
-
const span = whole.match(phrase(INSTRUCTION));
|
|
155
|
-
assert.ok(
|
|
156
|
-
span,
|
|
157
|
-
`${SKILL}'s stalled-member instruction does not match inside its neighbourhood (between "A red PR never silently becomes" and "Settle outcome and liveness are different facts") — read the presence pin above first: if it is green, the instruction is intact but the whole clause moved out of this neighbourhood, which this pin also treats as a failure.`,
|
|
158
|
-
);
|
|
159
|
-
const residue = whole.replace(span[0], "");
|
|
160
|
-
assert.doesNotMatch(
|
|
161
|
-
residue,
|
|
162
|
-
SUBJECT_VOCABULARY,
|
|
163
|
-
`${SKILL}'s stalled-member neighbourhood says something about the transcript, the scratch dir, the mtimes or the verdicts OUTSIDE the pinned instruction — in the paragraph above it, the paragraph below it, or appended to the clause's own paragraph. That is either a carve-out — the mutation this pin exists to catch, since the instruction itself survives it intact — or an unpinned restatement, which drifts from the pinned copy and becomes a contradiction. Fold the sentence into the span this file pins, or delete it.`,
|
|
164
|
-
);
|
|
165
|
-
});
|
|
166
|
-
|
|
167
|
-
// Cross-slice, same hazard the file's other table pins name: the table is the
|
|
168
|
-
// controller's index, and the killed row is where it acts on a death it has
|
|
169
|
-
// concluded. A gate stated only two paragraphs below is a gate a row-scanner
|
|
170
|
-
// never reads.
|
|
171
|
-
//
|
|
172
|
-
// BOTH halves of the row in one span, for opposite reasons. Dropping the gate
|
|
173
|
-
// puts the row back to answering a frozen transcript. Dropping the response
|
|
174
|
-
// leaves the gate with nothing behind it — a controller that has confirmed a
|
|
175
|
-
// death and has no row authorizing the replacement, which is the direction
|
|
176
|
-
// this clause could wrongly REFUSE in, and the one a suite that only ever
|
|
177
|
-
// feeds it a live member never tests.
|
|
178
|
-
const failureTable = () =>
|
|
179
|
-
between(read(), "## Failure handling", "A red PR never silently becomes", `${SKILL}'s failure table`);
|
|
180
|
-
|
|
181
|
-
test("the killed row gates on confirming death, not on a frozen transcript", () => {
|
|
182
|
-
assert.match(
|
|
183
|
-
failureTable(),
|
|
184
|
-
phrase("| Member **killed** (spend limit, API error, crash) | Confirm it is dead first — a frozen transcript does not establish that; see below — then new member, new name, prompt carries inherited state |"),
|
|
185
|
-
`${SKILL}'s killed row lost a half. The GATE half — confirm it is dead first, a frozen transcript does not establish that — is what keeps the row from answering a frozen transcript, where the controller replaces a member it never established was gone, discarding work in flight and colliding with its own claim and worktree. The RESPONSE half — new member, new name, prompt carries inherited state — is what a CONFIRMED death must still reach; a gate with no response behind it strands the case this clause exists to let through.`,
|
|
186
|
-
);
|
|
187
|
-
});
|
|
188
|
-
|
|
189
|
-
// The row-shaped carve-out the neighbourhood ban above cannot see: a new
|
|
190
|
-
// table row naming the transcript lands above "A red PR never silently
|
|
191
|
-
// becomes", outside that ban's start bound, in the same table this file
|
|
192
|
-
// already slices via `failureTable()`. Narrower than SUBJECT_VOCABULARY on
|
|
193
|
-
// purpose — "blocked" is ordinary vocabulary elsewhere in this same table
|
|
194
|
-
// (the "Implementer blocked or ambiguous *mid-implementation*" row), so the
|
|
195
|
-
// full list would false-positive there; "transcript" is not used by any
|
|
196
|
-
// other row today (`git show origin/main:plugin/skills/run-team/SKILL.md |
|
|
197
|
-
// grep -c transcript` inside the table is 1, the killed row itself), so this
|
|
198
|
-
// narrower ban is satisfiable without also banning words the table already
|
|
199
|
-
// uses for unrelated failures.
|
|
200
|
-
const CARVEOUT_TABLE_VOCABULARY = /transcript/i;
|
|
201
|
-
|
|
202
|
-
test("nothing in the failure table beside the killed row's own gate mentions the transcript", () => {
|
|
203
|
-
const table = failureTable();
|
|
204
|
-
const killedRow = table.match(
|
|
205
|
-
phrase(
|
|
206
|
-
"| Member **killed** (spend limit, API error, crash) | Confirm it is dead first — a frozen transcript does not establish that; see below — then new member, new name, prompt carries inherited state |",
|
|
207
|
-
),
|
|
208
|
-
);
|
|
209
|
-
assert.ok(
|
|
210
|
-
killedRow,
|
|
211
|
-
`${SKILL}'s killed row does not match — read the presence pin above, which names which half of the row went. Nothing here is a verdict on a carve-out row until that row is restored.`,
|
|
212
|
-
);
|
|
213
|
-
const residue = table.replace(killedRow[0], "");
|
|
214
|
-
assert.doesNotMatch(
|
|
215
|
-
residue,
|
|
216
|
-
CARVEOUT_TABLE_VOCABULARY,
|
|
217
|
-
`${SKILL}'s failure table mentions the transcript in a row OTHER than the killed row's own gate. A row claiming a frozen transcript settles death on its own is the carve-out this clause exists to prevent — fold it into the killed row's gate, or delete it.`,
|
|
218
|
-
);
|
|
219
|
-
});
|
|
@@ -1,313 +0,0 @@
|
|
|
1
|
-
// #1148. The git stash stack is a property of the REPOSITORY, not of a
|
|
2
|
-
// worktree or a session: every fleet worktree, the main checkout, and every
|
|
3
|
-
// concurrent member share the one `refs/stash`. A bare `git stash pop` takes
|
|
4
|
-
// whichever entry is on top regardless of which worktree pushed it — silently
|
|
5
|
-
// (rc 0) when the receiving tree is clean on the affected paths, which is
|
|
6
|
-
// exactly when a victim would assume it is safe, and loudly (rc 1) only when
|
|
7
|
-
// that tree is already dirty there. A bare `git stash` (push) does NOT reach
|
|
8
|
-
// into a sibling's tree — that half is unfounded, measured separately in the
|
|
9
|
-
// ticket's Agent Brief — so the hazard is entirely on the pop side.
|
|
10
|
-
//
|
|
11
|
-
// Before this ticket the prohibition lived only in the controller's own
|
|
12
|
-
// never-force-a-rebase guard (SKILL.md's "Never force a rebase to start", the
|
|
13
|
-
// `git stash` mention run-merge-bot-prose.test.mjs and no-undo-audit.test.mjs
|
|
14
|
-
// already pin) and in member-lifecycle.md's refill-recovery checklist. Neither
|
|
15
|
-
// reaches the members who actually reach for `git stash` in practice —
|
|
16
|
-
// implementers and fix-appliers isolating a mutation-testing pass — because
|
|
17
|
-
// neither is copied into a dispatch prompt. This file pins the two new
|
|
18
|
-
// paragraphs that close that gap: one in phase 2's implementer block, beside
|
|
19
|
-
// the commit-incrementally rule it extends, one in the Reviewers section's
|
|
20
|
-
// fix-applier block, beside the commit-before-you-mutate rule it extends.
|
|
21
|
-
//
|
|
22
|
-
// Measured against this tree before either paragraph existed (i.e. against
|
|
23
|
-
// `origin/main`): neither `skills/run-team/SKILL.md`'s phase-2 member prompt
|
|
24
|
-
// nor its fix-applier prompt mentioned `git stash` at all —
|
|
25
|
-
// `awk 'NR==849,NR==955' skills/run-team/SKILL.md | grep -i stash` and
|
|
26
|
-
// `awk 'NR==1483,NR==1642' skills/run-team/SKILL.md | grep -i stash` both hit
|
|
27
|
-
// nothing. No test in `*prose*.test.mjs` mentioned `WIP commit` either. This
|
|
28
|
-
// file's two anchors are unique file-wide (verified: each of
|
|
29
|
-
// "**Never `git stash` or `git stash pop` to shelve" and
|
|
30
|
-
// "**Never `git stash` or `git stash pop` here either" occurs exactly once),
|
|
31
|
-
// so each block is sliced directly with `between()`, without first narrowing
|
|
32
|
-
// through a parent section the way files whose anchor text repeats have to.
|
|
33
|
-
//
|
|
34
|
-
// SHAPE, matching this suite's convention (`dispatch-block-pins-prose.test.mjs`
|
|
35
|
-
// header): each block is its OWN slice, bounded by the neighbouring block's
|
|
36
|
-
// opening words on both ends, and a fact that lives in the JOIN between two
|
|
37
|
-
// clauses — the pop's silence on a clean tree paired with its refusal on a
|
|
38
|
-
// dirty one — is pinned as ONE contiguous span, never two independent
|
|
39
|
-
// presence checks that a swap of "clean" and "dirty" between the clauses
|
|
40
|
-
// could satisfy separately (`finisher-pin-race-prose.test.mjs`'s "exception
|
|
41
|
-
// clause splice" rule: N independent matches pin N facts, never the relation
|
|
42
|
-
// between them).
|
|
43
|
-
//
|
|
44
|
-
// MUTATION-VERIFIED both ways on an isolated scratch copy of this tree
|
|
45
|
-
// (method: `dispatch-block-pins-prose.test.mjs`'s own comment, and the
|
|
46
|
-
// project's own prose-pin discipline — copy, mutate, run, restore). All four
|
|
47
|
-
// mutations below were run against both the implementer AND the fix-applier
|
|
48
|
-
// block, independently, restoring the clean file between each:
|
|
49
|
-
// - Deleting either new paragraph outright (the whole `> **Never \`git
|
|
50
|
-
// stash\`...` through the sentence before the next block's opener) reds
|
|
51
|
-
// every test below that reads that block, via `between()`'s own "no
|
|
52
|
-
// longer contains" throw — 6 of this file's 12 tests (5 pins + the
|
|
53
|
-
// block's own rewrap check), 0 elsewhere in this file or in
|
|
54
|
-
// `dispatch-block-pins-prose.test.mjs` / `fix-applier-correction-rules-
|
|
55
|
-
// prose.test.mjs` (their anchors are untouched by this deletion).
|
|
56
|
-
// - Swapping the substitute back out for a bare stash mention — rewriting
|
|
57
|
-
// "take a WIP commit instead: `git commit -m wip`, then amend it or
|
|
58
|
-
// `git reset --soft HEAD^` once you have something real to commit." to
|
|
59
|
-
// "stash it instead: `git stash push -u -m wip`, then `git stash pop`
|
|
60
|
-
// once you are ready to make a real commit." (prohibition wording left
|
|
61
|
-
// intact, so the block's own `between()` anchor still resolves) — reds
|
|
62
|
-
// exactly 2 of 12: the mutated block's "names a WIP commit as the
|
|
63
|
-
// substitute" test and its own rewrap check. The other 10, including
|
|
64
|
-
// that same pair in the untouched block, stay green, because they pin
|
|
65
|
-
// the mechanism paragraph the substitution never touches. This is the
|
|
66
|
-
// correct discrimination: the substitute-naming test is the one whose
|
|
67
|
-
// whole job is catching this mutation, not a side effect of a looser one.
|
|
68
|
-
// - Swapping "clean"/"dirty" between the two halves of the pop-mechanism
|
|
69
|
-
// sentence (silent-when-dirty / refuses-when-clean, the inverted claim)
|
|
70
|
-
// also reds exactly 2 of 12 — the mutated block's single-span
|
|
71
|
-
// pop-mechanism test and its rewrap check — because the contiguous
|
|
72
|
-
// phrase no longer occurs verbatim; two independent presence checks on
|
|
73
|
-
// "clean" and "dirty" separately would NOT have caught this, since both
|
|
74
|
-
// words remain present somewhere in the slice.
|
|
75
|
-
// - The two `rewrapped …` tests below are the accept-side control: on the
|
|
76
|
-
// unmutated file both pass, proving the pins hold the words, not today's
|
|
77
|
-
// line breaks.
|
|
78
|
-
//
|
|
79
|
-
// THE CEILING these pins have: they are pins on text being PRESENT and
|
|
80
|
-
// adjacent. A sentence appended after a pinned span that carves an exception
|
|
81
|
-
// into it touches no pinned fragment and stays green.
|
|
82
|
-
//
|
|
83
|
-
// Both blocks this file pins are covered against that by #1002's whole-block
|
|
84
|
-
// golden fixtures in `dispatch-block-golden-prose.test.mjs` — the implementer's
|
|
85
|
-
// block as one of phase 2's, the fix-applier's inside the fix-applier prompt —
|
|
86
|
-
// so an appended carve-out reds there on the equality while staying invisible
|
|
87
|
-
// here. Measured: appending "A bare pop is fine when no sibling is running." to
|
|
88
|
-
// the implementer block left every pre-existing prose pin green, including all
|
|
89
|
-
// of this file's, and red the golden. The two are complementary — the golden
|
|
90
|
-
// says the block changed, and a red HERE says which of the two stash rules lost
|
|
91
|
-
// its WIP-commit substitute.
|
|
92
|
-
import { test } from "node:test";
|
|
93
|
-
import assert from "node:assert/strict";
|
|
94
|
-
import { readFileSync } from "node:fs";
|
|
95
|
-
import { join } from "node:path";
|
|
96
|
-
import { between, phrase } from "./prose-pin.mjs";
|
|
97
|
-
|
|
98
|
-
const REPO = join(import.meta.dirname, "..");
|
|
99
|
-
const RUN_TEAM = readFileSync(join(REPO, "skills", "run-team", "SKILL.md"), "utf8");
|
|
100
|
-
// The implementer's copy lives in the implementer agent body since #1804 (spec
|
|
101
|
-
// 2026-09-24 § 2 Decision 2): the body is what each harness injects as the
|
|
102
|
-
// member's system prompt, and SKILL.md's phase 2 no longer re-pastes it. The
|
|
103
|
-
// fix-applier's copy is still a quote block in SKILL.md's Reviewers section.
|
|
104
|
-
const IMPLEMENTER_BODY = readFileSync(join(REPO, "agents", "fleet-implementer-slow-high.agent.md"), "utf8").split("---").slice(2).join("---");
|
|
105
|
-
|
|
106
|
-
// `>` gutter and `**` emphasis stripped, whitespace collapsed — mirrors
|
|
107
|
-
// `dispatch-block-pins-prose.test.mjs`'s `flatten`, so a pin here survives the
|
|
108
|
-
// same rewrap/bold-move classes that file's does. Backticks are left alone:
|
|
109
|
-
// every pinned span below quotes real code (`` `git stash` ``, `` `refs/stash` ``)
|
|
110
|
-
// and no `**` occurs inside one of those spans (verified), so nothing here
|
|
111
|
-
// needs to learn about a backtick-wrapped `**`.
|
|
112
|
-
const flatten = (s) =>
|
|
113
|
-
s
|
|
114
|
-
.split("\n")
|
|
115
|
-
.map((l) => l.replace(/^\s*>?\s?/, ""))
|
|
116
|
-
.join(" ")
|
|
117
|
-
.replace(/\*\*/g, "")
|
|
118
|
-
.split(/\s+/)
|
|
119
|
-
.join(" ")
|
|
120
|
-
.trim();
|
|
121
|
-
|
|
122
|
-
// Bounded by the new rule's own opening words and the NEXT block's opening
|
|
123
|
-
// words — the same two-sided bound every block in `dispatch-block-pins-
|
|
124
|
-
// prose.test.mjs` uses, and for the same reason: an unbounded end lets the
|
|
125
|
-
// scratch-discipline block's own vocabulary ("scratch root", "sibling")
|
|
126
|
-
// satisfy an assertion with this block's real text gone.
|
|
127
|
-
const implementerStashBlock = () =>
|
|
128
|
-
flatten(
|
|
129
|
-
between(
|
|
130
|
-
IMPLEMENTER_BODY,
|
|
131
|
-
"**Never `git stash` or `git stash pop` to shelve",
|
|
132
|
-
"**Every scratch file",
|
|
133
|
-
"the implementer body's stash-prohibition block",
|
|
134
|
-
),
|
|
135
|
-
);
|
|
136
|
-
|
|
137
|
-
const fixApplierStashBlock = () =>
|
|
138
|
-
flatten(
|
|
139
|
-
between(
|
|
140
|
-
RUN_TEAM,
|
|
141
|
-
"**Never `git stash` or `git stash pop` here either",
|
|
142
|
-
"**Report LAST",
|
|
143
|
-
"the fix-applier's stash-prohibition block",
|
|
144
|
-
),
|
|
145
|
-
);
|
|
146
|
-
|
|
147
|
-
test("the implementer's stash rule forbids a bare stash/pop and names a WIP commit as the substitute", () => {
|
|
148
|
-
const b = implementerStashBlock();
|
|
149
|
-
assert.match(
|
|
150
|
-
b,
|
|
151
|
-
phrase(
|
|
152
|
-
"Never `git stash` or `git stash pop` to shelve your own progress — take a WIP commit instead: `git commit -m wip`, then amend it or `git reset --soft HEAD^` once you have something real to commit.",
|
|
153
|
-
),
|
|
154
|
-
"the implementer block no longer forbids a bare stash/pop with the WIP-commit substitute bound to it",
|
|
155
|
-
);
|
|
156
|
-
});
|
|
157
|
-
|
|
158
|
-
test("the implementer's stash rule states the stack is repo-global, shared by every worktree and session", () => {
|
|
159
|
-
const b = implementerStashBlock();
|
|
160
|
-
assert.match(
|
|
161
|
-
b,
|
|
162
|
-
phrase(
|
|
163
|
-
"The stash stack is repo-global, not per-worktree or per-session — the same `refs/stash` is shared by every worktree, the main checkout, and every concurrent member.",
|
|
164
|
-
),
|
|
165
|
-
"the implementer block no longer states the stash stack is repo-global and shared by every worktree/session",
|
|
166
|
-
);
|
|
167
|
-
});
|
|
168
|
-
|
|
169
|
-
// ONE contiguous span, not two presence checks — see the header's mutation
|
|
170
|
-
// note. Independent `clean` / `dirty` checks would both stay green under a
|
|
171
|
-
// swap of which state is silent and which refuses.
|
|
172
|
-
test("the implementer's stash rule binds the pop's silence on a clean tree to its refusal on a dirty one", () => {
|
|
173
|
-
const b = implementerStashBlock();
|
|
174
|
-
assert.match(
|
|
175
|
-
b,
|
|
176
|
-
phrase(
|
|
177
|
-
"A bare pop takes whichever entry is on top, from any worktree, and it is silent about it — rc 0, no error — exactly when the tree receiving it is clean on the affected paths, which is the moment you would assume it is safe; it refuses loudly only when that tree is already dirty on them.",
|
|
178
|
-
),
|
|
179
|
-
"the implementer block no longer binds the pop's clean-tree silence to its dirty-tree refusal in one span",
|
|
180
|
-
);
|
|
181
|
-
});
|
|
182
|
-
|
|
183
|
-
test("the implementer's stash rule states a bare push does not reach into a sibling worktree", () => {
|
|
184
|
-
const b = implementerStashBlock();
|
|
185
|
-
assert.match(
|
|
186
|
-
b,
|
|
187
|
-
phrase(
|
|
188
|
-
"A bare `git stash` (push) does not reach into a sibling worktree's uncommitted work — that half is unfounded, it acts on your own tree only — so the hazard is entirely on the pop side",
|
|
189
|
-
),
|
|
190
|
-
"the implementer block no longer states that a bare stash push does not reach a sibling's tree",
|
|
191
|
-
);
|
|
192
|
-
});
|
|
193
|
-
|
|
194
|
-
test("the implementer's stash rule says nothing partitions the stack, so the prohibition is the whole protection", () => {
|
|
195
|
-
const b = implementerStashBlock();
|
|
196
|
-
assert.match(
|
|
197
|
-
b,
|
|
198
|
-
phrase(
|
|
199
|
-
"Nothing partitions the stack the way the scratch root below is partitioned — one `refs/stash` per repository, with no per-member address for it — so this prohibition is the whole of the protection, not a stopgap standing in for one.",
|
|
200
|
-
),
|
|
201
|
-
"the implementer block no longer says nothing partitions the stack or drops the whole-protection close",
|
|
202
|
-
);
|
|
203
|
-
});
|
|
204
|
-
|
|
205
|
-
test("the fix-applier's stash rule forbids a bare stash/pop and names a WIP commit as the substitute", () => {
|
|
206
|
-
const b = fixApplierStashBlock();
|
|
207
|
-
assert.match(
|
|
208
|
-
b,
|
|
209
|
-
phrase(
|
|
210
|
-
"Never `git stash` or `git stash pop` here either — a WIP commit is the substitute, not a second scratch mechanism: `git commit -m wip`, then restore or amend once you're back to real work.",
|
|
211
|
-
),
|
|
212
|
-
"the fix-applier block no longer forbids a bare stash/pop with the WIP-commit substitute bound to it",
|
|
213
|
-
);
|
|
214
|
-
});
|
|
215
|
-
|
|
216
|
-
test("the fix-applier's stash rule states the stack is repo-global, shared by every worktree and session", () => {
|
|
217
|
-
const b = fixApplierStashBlock();
|
|
218
|
-
assert.match(
|
|
219
|
-
b,
|
|
220
|
-
phrase(
|
|
221
|
-
"The stash stack is repo-global too, not per-worktree or per-session — the same `refs/stash` every concurrent member and the main checkout share, not partitioned the way `<scratch>/pr<N>/mutate/` above is.",
|
|
222
|
-
),
|
|
223
|
-
"the fix-applier block no longer states the stash stack is repo-global and shared by every worktree/session",
|
|
224
|
-
);
|
|
225
|
-
});
|
|
226
|
-
|
|
227
|
-
test("the fix-applier's stash rule binds the pop's silence on a clean tree to its refusal on a dirty one", () => {
|
|
228
|
-
const b = fixApplierStashBlock();
|
|
229
|
-
assert.match(
|
|
230
|
-
b,
|
|
231
|
-
phrase(
|
|
232
|
-
"A bare pop takes whichever entry is on top, from any worktree, silently — rc 0, no error — when the tree receiving it is clean on the affected paths, and refuses only when that tree is already dirty there.",
|
|
233
|
-
),
|
|
234
|
-
"the fix-applier block no longer binds the pop's clean-tree silence to its dirty-tree refusal in one span",
|
|
235
|
-
);
|
|
236
|
-
});
|
|
237
|
-
|
|
238
|
-
test("the fix-applier's stash rule states a bare push does not reach into a sibling's tree", () => {
|
|
239
|
-
const b = fixApplierStashBlock();
|
|
240
|
-
assert.match(
|
|
241
|
-
b,
|
|
242
|
-
phrase(
|
|
243
|
-
"A bare `git stash` (push) does not reach into a sibling's tree, so that half is not the risk — the pop is.",
|
|
244
|
-
),
|
|
245
|
-
"the fix-applier block no longer states that a bare stash push does not reach a sibling's tree",
|
|
246
|
-
);
|
|
247
|
-
});
|
|
248
|
-
|
|
249
|
-
test("the fix-applier's stash rule says nothing partitions the stack, so the prohibition is the whole protection", () => {
|
|
250
|
-
const b = fixApplierStashBlock();
|
|
251
|
-
assert.match(
|
|
252
|
-
b,
|
|
253
|
-
phrase("Nothing partitions the stack; this prohibition is the whole of the protection."),
|
|
254
|
-
"the fix-applier block no longer says nothing partitions the stack or drops the whole-protection close",
|
|
255
|
-
);
|
|
256
|
-
});
|
|
257
|
-
|
|
258
|
-
// ACCEPT side, mirroring `dispatch-block-pins-prose.test.mjs`'s own rewrap
|
|
259
|
-
// test: re-wrapping either paragraph at a column width nothing here assumes
|
|
260
|
-
// must not red a single assertion above. The fixture is DERIVED from the live
|
|
261
|
-
// block, never a quoted line, so a future reword of the surrounding prose is
|
|
262
|
-
// not what this test measures. Flattening `narrow` directly (rather than
|
|
263
|
-
// splicing it back into RUN_TEAM and re-locating it with `between()`) sidesteps
|
|
264
|
-
// a real bug the first draft of this helper hit: this block's own opening
|
|
265
|
-
// anchor is 9 words / ~50 characters, longer than the 45-character rewrap
|
|
266
|
-
// width, so a `between()` search for it against the SPLICED file broke across
|
|
267
|
-
// the very line break the rewrap introduced. `narrow` already IS the
|
|
268
|
-
// rewrapped block; there is nothing left to re-locate.
|
|
269
|
-
function assertSurvivesRewrap(source, startAnchor, endAnchor, what, assertions) {
|
|
270
|
-
const raw = between(source, startAnchor, endAnchor, what);
|
|
271
|
-
const body = raw.replace(/\n*>?\s*$/, "");
|
|
272
|
-
const words = body.replace(/\n>\s?/g, " ").split(/\s+/).filter(Boolean);
|
|
273
|
-
const lines = words.reduce((acc, w) => {
|
|
274
|
-
const last = acc[acc.length - 1];
|
|
275
|
-
if (last && `${last} ${w}`.length <= 45) acc[acc.length - 1] = `${last} ${w}`;
|
|
276
|
-
else acc.push(w);
|
|
277
|
-
return acc;
|
|
278
|
-
}, []);
|
|
279
|
-
const narrow = lines.join("\n> ");
|
|
280
|
-
assert.notEqual(narrow, raw, `${what}: the rewrap fixture no longer changes the block's wrapping — update it`);
|
|
281
|
-
const rewrapped = flatten(narrow);
|
|
282
|
-
for (const a of assertions) assert.match(rewrapped, a);
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
test("a rewrapped implementer stash block still matches every pin above — these pins refuse drift, not reflow", () => {
|
|
286
|
-
assertSurvivesRewrap(
|
|
287
|
-
IMPLEMENTER_BODY,
|
|
288
|
-
"**Never `git stash` or `git stash pop` to shelve",
|
|
289
|
-
"**Every scratch file",
|
|
290
|
-
"the implementer body's stash-prohibition block",
|
|
291
|
-
[
|
|
292
|
-
phrase("Never `git stash` or `git stash pop` to shelve your own progress — take a WIP commit instead"),
|
|
293
|
-
phrase("The stash stack is repo-global, not per-worktree or per-session"),
|
|
294
|
-
phrase("it refuses loudly only when that tree is already dirty on them"),
|
|
295
|
-
phrase("Nothing partitions the stack the way the scratch root below is partitioned"),
|
|
296
|
-
],
|
|
297
|
-
);
|
|
298
|
-
});
|
|
299
|
-
|
|
300
|
-
test("a rewrapped fix-applier stash block still matches every pin above — these pins refuse drift, not reflow", () => {
|
|
301
|
-
assertSurvivesRewrap(
|
|
302
|
-
RUN_TEAM,
|
|
303
|
-
"**Never `git stash` or `git stash pop` here either",
|
|
304
|
-
"**Report LAST",
|
|
305
|
-
"the fix-applier's stash-prohibition block",
|
|
306
|
-
[
|
|
307
|
-
phrase("Never `git stash` or `git stash pop` here either — a WIP commit is the substitute"),
|
|
308
|
-
phrase("The stash stack is repo-global too, not per-worktree or per-session"),
|
|
309
|
-
phrase("refuses only when that tree is already dirty there"),
|
|
310
|
-
phrase("Nothing partitions the stack; this prohibition is the whole of the protection"),
|
|
311
|
-
],
|
|
312
|
-
);
|
|
313
|
-
});
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
// Blank out a JS file's comments so a source-text assertion cannot be
|
|
2
|
-
// satisfied by a declaration or a paragraph a reader's eye skips.
|
|
3
|
-
//
|
|
4
|
-
// Both escapes were MEASURED green pre-cutover, on this repo's then-retired
|
|
5
|
-
// review workflow script, before this existed: the three diff schema fields
|
|
6
|
-
// wrapped in `/* */` (the schema drops
|
|
7
|
-
// them, `usableDiff` returns null forever, 12 pass / 0 fail), and the snapshot
|
|
8
|
-
// agent's `Report \`diffPath\`` paragraph deleted and re-inserted inside a
|
|
9
|
-
// block comment (same, 12 pass / 0 fail). A `^(?!\s*//)` anchor closes
|
|
10
|
-
// neither: the commented-out line starts with `/*`, and per-assertion anchors
|
|
11
|
-
// have to be remembered once per pin.
|
|
12
|
-
//
|
|
13
|
-
// It lives here rather than inline in one test file because remembering it is
|
|
14
|
-
// exactly what fails. `review-core-reads.test.mjs` carried a private copy;
|
|
15
|
-
// `review-core-testcmd.test.mjs` was then written against raw source and its
|
|
16
|
-
// schema-declaration pin was vacuous against a block-commented `testCmd:
|
|
17
|
-
// { type: "string" },` — 9 pass / 0 fail with the field genuinely dead under
|
|
18
|
-
// `additionalProperties: false` (#142 review, measured).
|
|
19
|
-
//
|
|
20
|
-
// Line-based on purpose. A regex stripper (`/\*[\s\S]*?\*\//`) would open a
|
|
21
|
-
// comment at `"node --test plugin/scripts/*.test.mjs"` — a glob inside a
|
|
22
|
-
// string literal — and swallow real code up to the next `*/`. Blank lines
|
|
23
|
-
// rather than deleted ones, so offsets stay line-aligned with the file.
|
|
24
|
-
//
|
|
25
|
-
// Known ceiling: whole-line comments only. A TRAILING `code; // note` keeps
|
|
26
|
-
// its comment text, and `//` inside a string literal (a URL, a glob) is left
|
|
27
|
-
// alone — which is the point, since blanking those would delete real code.
|
|
28
|
-
// Neither form can hide a declaration from a pin, which is what this is for.
|
|
29
|
-
export function stripComments(source) {
|
|
30
|
-
const out = [];
|
|
31
|
-
let inBlock = false;
|
|
32
|
-
for (const line of source.split("\n")) {
|
|
33
|
-
if (inBlock) {
|
|
34
|
-
if (line.includes("*/")) inBlock = false;
|
|
35
|
-
out.push("");
|
|
36
|
-
} else if (/^\s*\/\*/.test(line)) {
|
|
37
|
-
if (!line.includes("*/")) inBlock = true;
|
|
38
|
-
out.push("");
|
|
39
|
-
} else {
|
|
40
|
-
out.push(/^\s*\/\//.test(line) ? "" : line);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
return out.join("\n");
|
|
44
|
-
}
|
package/scripts/temp-dir.mjs
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
// Temp directories for test fixtures that are removed when the process exits.
|
|
2
|
-
//
|
|
3
|
-
// A fixture builder deep inside a helper often has no node:test context to
|
|
4
|
-
// hang a `t.after()` on, and a bare `mkdtempSync(join(tmpdir(), …))` there
|
|
5
|
-
// leaves its directory behind for good: across the suite that was hundreds of
|
|
6
|
-
// directories per run. Each one made here is recorded and removed at process
|
|
7
|
-
// exit instead — one process per test file under `node --test`, so the
|
|
8
|
-
// directories live exactly as long as the file that made them.
|
|
9
|
-
//
|
|
10
|
-
// Removal restores owner permissions first when a plain remove fails: a
|
|
11
|
-
// fixture that chmods a directory unsearchable and then fails before its own
|
|
12
|
-
// restore would otherwise make `rmSync` throw and the directory survive.
|
|
13
|
-
//
|
|
14
|
-
// Deliberately not a `.test.mjs`, so `node --test` never loads it as a suite.
|
|
15
|
-
|
|
16
|
-
import { spawnSync } from "node:child_process";
|
|
17
|
-
import { mkdtempSync, rmSync } from "node:fs";
|
|
18
|
-
import { tmpdir } from "node:os";
|
|
19
|
-
import { join } from "node:path";
|
|
20
|
-
|
|
21
|
-
const made = [];
|
|
22
|
-
|
|
23
|
-
function remove(dir) {
|
|
24
|
-
try {
|
|
25
|
-
rmSync(dir, { recursive: true, force: true });
|
|
26
|
-
} catch {
|
|
27
|
-
spawnSync("chmod", ["-R", "u+rwX", dir]);
|
|
28
|
-
try {
|
|
29
|
-
rmSync(dir, { recursive: true, force: true });
|
|
30
|
-
} catch (e) {
|
|
31
|
-
// An exception thrown from an exit handler would replace the run's own
|
|
32
|
-
// exit status, so a directory that still cannot go is reported instead.
|
|
33
|
-
process.stderr.write(`temp-dir: could not remove ${dir}: ${e.message}\n`);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
process.on("exit", () => {
|
|
39
|
-
for (const dir of made) remove(dir);
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
/** `mkdtempSync(join(tmpdir(), prefix))`, removed when this process exits. */
|
|
43
|
-
export function tempDir(prefix) {
|
|
44
|
-
const dir = mkdtempSync(join(tmpdir(), prefix));
|
|
45
|
-
made.push(dir);
|
|
46
|
-
return dir;
|
|
47
|
-
}
|