@feigi/fleet-ctl 3.23.36 → 3.23.37
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/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,166 +0,0 @@
|
|
|
1
|
-
// ADR 0002. Step 5 gained a second, earlier bar: a finding whose own claim is
|
|
2
|
-
// that correct code could be shaped better never gets its own open issue — it
|
|
3
|
-
// goes into the per-review closed record under `Below the claim bar`, with a
|
|
4
|
-
// promotion path back out. Measured basis: 2026-08-15→31, 133 triage-closed
|
|
5
|
-
// `wontfix` in sixteen days, 121 of them review deferrals, mostly this shape.
|
|
6
|
-
//
|
|
7
|
-
// What this pins is the bar's KEY — the finding's claim, never its review
|
|
8
|
-
// band. #591 is why the distinction is load-bearing: `unverified` conflates
|
|
9
|
-
// policy-skipped suggestions with crashed-refuter criticals, so a band-keyed
|
|
10
|
-
// rule silently drops findings nobody looked at. A revert of the band sentence
|
|
11
|
-
// alone would leave a bar that reads as a severity floor, which is the exact
|
|
12
|
-
// shelved option ADR 0001 gated behind #591.
|
|
13
|
-
//
|
|
14
|
-
// Slices are flattened, same class defect as filing-bar-seat-prose.test.mjs:
|
|
15
|
-
// step 5 is one long line today, the ADR hard-wraps, and reflow must not red.
|
|
16
|
-
//
|
|
17
|
-
// CEILING: presence and adjacency over bounded slices. These prove the bar,
|
|
18
|
-
// its routing, and its band-exclusion are stated; they cannot prove a later
|
|
19
|
-
// sentence in the same slice does not carve out an exception.
|
|
20
|
-
//
|
|
21
|
-
// Measured as of this commit, on the working tree with restore after each: six
|
|
22
|
-
// mutations — the bar sentence deleted, its verdict inverted (never → keeps),
|
|
23
|
-
// the record routing redirected to an own open issue, the band-exclusion
|
|
24
|
-
// sentence deleted, the ADR pointer renamed in the prose, and the ADR's guard
|
|
25
|
-
// floor retuned 20 → 50 — each reddened its own pin and no other. Controls: an
|
|
26
|
-
// unpinned step-5 sentence reworded and the ADR's guard bullets rewrapped both
|
|
27
|
-
// stayed green.
|
|
28
|
-
//
|
|
29
|
-
// #1113 added the applied-promotion pin. Trigger A counts entries "promoted",
|
|
30
|
-
// and the filed path leaves a citation on the record while the fix-applier's
|
|
31
|
-
// apply path files nothing at all — so the promotion the trigger most needs to
|
|
32
|
-
// see left no mark on the record. Step 5 now writes one under a fixed opening
|
|
33
|
-
// and the ADR's guard names the same string; the pin compares the two by
|
|
34
|
-
// EQUALITY, because a search for one inside the other passes on a narrowing
|
|
35
|
-
// rename. Measured on the working tree with restore after each: five mutations
|
|
36
|
-
// — step 5's apply-path verdict inverted (files nothing → files its own issue),
|
|
37
|
-
// step 5's marker narrowed, the ADR's marker narrowed, the ADR's
|
|
38
|
-
// promotion-signal definition reworded down to the filed path alone, and step
|
|
39
|
-
// 5's marker unquoted — each reddened this pin and no other, while retuning
|
|
40
|
-
// Trigger A's 5 reddened only the older guard pin. Controls: the ADR's Trigger
|
|
41
|
-
// A bullet reflowed onto one line and an unpinned step-5 sentence reworded both
|
|
42
|
-
// stayed green.
|
|
43
|
-
import { test } from "node:test";
|
|
44
|
-
import assert from "node:assert/strict";
|
|
45
|
-
import { existsSync, readFileSync } from "node:fs";
|
|
46
|
-
import { join } from "node:path";
|
|
47
|
-
import { between, phrase } from "./prose-pin.mjs";
|
|
48
|
-
|
|
49
|
-
const REPO = join(import.meta.dirname, "..");
|
|
50
|
-
const read = (...p) => readFileSync(join(REPO, ...p), "utf8");
|
|
51
|
-
const REVIEW_AND_FIX = read("commands", "review-and-fix.md");
|
|
52
|
-
const ROOT = join(import.meta.dirname, "..", "..");
|
|
53
|
-
|
|
54
|
-
const flat = (s) => s.replace(/\s+/g, " ");
|
|
55
|
-
|
|
56
|
-
const step5 = () => flat(between(REVIEW_AND_FIX, "5. File each deferred finding", "\n6. Diff-check green", "review-and-fix step 5"));
|
|
57
|
-
|
|
58
|
-
test("step 5 states the claim bar: shaped-better findings never get their own open issue", () => {
|
|
59
|
-
// The bar and its verdict as ONE span. Pinning "Worth a claim" apart from
|
|
60
|
-
// "never gets its own open issue" leaves the join open — a clause spliced
|
|
61
|
-
// between them reverses the rule and satisfies both.
|
|
62
|
-
assert.match(
|
|
63
|
-
step5(),
|
|
64
|
-
phrase(
|
|
65
|
-
"**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.**",
|
|
66
|
-
),
|
|
67
|
-
"step 5 lost the worth-a-claim bar — shaped-better findings are back to one open issue each",
|
|
68
|
-
);
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
test("step 5 routes below-bar findings into the closed record, with a promotion path out", () => {
|
|
72
|
-
const s = step5();
|
|
73
|
-
assert.match(
|
|
74
|
-
s,
|
|
75
|
-
phrase("Append it to the same closed record issue under a `Below the claim bar` heading"),
|
|
76
|
-
"step 5 no longer routes a below-bar finding into the per-review closed record issue",
|
|
77
|
-
);
|
|
78
|
-
assert.match(
|
|
79
|
-
s,
|
|
80
|
-
phrase("is the promotion signal: file it open then, citing the record"),
|
|
81
|
-
"step 5 lost the promotion path — a below-bar finding rediscovered as real has no way back to its own issue",
|
|
82
|
-
);
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
test("step 5 keys the bar on the finding's claim, never its review band", () => {
|
|
86
|
-
// Contiguous through the confirmed/torn hand-off: the exclusion is only
|
|
87
|
-
// meaningful bound to where an above-bar finding goes instead.
|
|
88
|
-
assert.match(
|
|
89
|
-
step5(),
|
|
90
|
-
phrase(
|
|
91
|
-
"**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",
|
|
92
|
-
),
|
|
93
|
-
"step 5 no longer excludes wrong-behavior findings from the claim bar — a band-keyed reading drops crashed-refuter criticals (#591)",
|
|
94
|
-
);
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
test("step 5 points at an ADR that exists, and the ADR keeps its pre-chosen guard", () => {
|
|
98
|
-
// Read the path out of the prose rather than restating it, so a rename that
|
|
99
|
-
// updates only one side reds.
|
|
100
|
-
const [, adrPath] = step5().match(/\(`(docs\/adr\/0002[^`]+)`\)/) ?? [];
|
|
101
|
-
assert.ok(adrPath, "step 5 no longer cites an ADR 0002 path under `docs/adr/`");
|
|
102
|
-
assert.ok(existsSync(join(ROOT, adrPath)), `step 5 points at \`${adrPath}\`, which does not exist`);
|
|
103
|
-
|
|
104
|
-
const adr = flat(readFileSync(join(ROOT, adrPath), "utf8"));
|
|
105
|
-
// Floor and both triggers as one span, 0001's precedent: chosen before any
|
|
106
|
-
// data, and separate pins would let any one be retuned alone.
|
|
107
|
-
assert.match(
|
|
108
|
-
adr,
|
|
109
|
-
phrase(
|
|
110
|
-
"**Floor:** 20 below-bar entries across at least 3 distinct run dates. - **Trigger A — bar too wide:** 5 or more of those entries promoted",
|
|
111
|
-
),
|
|
112
|
-
"the ADR's guard floor or promotion trigger moved — a pre-chosen guard that is retuned later is not a guard",
|
|
113
|
-
);
|
|
114
|
-
assert.match(
|
|
115
|
-
adr,
|
|
116
|
-
phrase("**Trigger B — bar missed the load:** non-record `wontfix` closes still above half of all closes"),
|
|
117
|
-
"the ADR lost trigger B — nothing detects the clause missing the volume it was priced against",
|
|
118
|
-
);
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
test("the applied promotion path is stated in step 5 and read by the ADR's guard", () => {
|
|
122
|
-
const s = step5();
|
|
123
|
-
// The path and its consequence as ONE span. "is that same promotion signal"
|
|
124
|
-
// pinned apart from "it files nothing" leaves the join open, and the second
|
|
125
|
-
// half is the whole reason the first needs writing down: this path leaves no
|
|
126
|
-
// filed issue behind, so nothing lands on the record by itself.
|
|
127
|
-
assert.match(
|
|
128
|
-
s,
|
|
129
|
-
phrase("**An in-scope rediscovery step 2 applied is that same promotion signal, and it files nothing**"),
|
|
130
|
-
"step 5 no longer treats an applied below-bar rediscovery as a promotion — the entry re-derived, checked and worth fixing goes unrecorded",
|
|
131
|
-
);
|
|
132
|
-
// Read the comment's fixed opening out of each file's own prose and compare
|
|
133
|
-
// the two, rather than restating the string here. A rename on one side alone
|
|
134
|
-
// leaves Trigger A counting a mark nothing writes, and neither file is wrong
|
|
135
|
-
// on its own after it. Equality, never a match of one inside the other:
|
|
136
|
-
// measured, shortening step 5's opening to `Promoted — applied` stays green
|
|
137
|
-
// under a `phrase(marker)` search of the ADR, because the ADR's longer string
|
|
138
|
-
// contains it.
|
|
139
|
-
const [, marker] = s.match(/comment on that record issue, opening `([^`]+)`/) ?? [];
|
|
140
|
-
assert.ok(marker, "step 5 no longer gives the applied-promotion comment a fixed opening, so the guard has no mark to count");
|
|
141
|
-
const [, adrPath] = s.match(/\(`(docs\/adr\/0002[^`]+)`\)/) ?? [];
|
|
142
|
-
assert.ok(adrPath, "step 5 no longer cites an ADR 0002 path under `docs/adr/`");
|
|
143
|
-
const adr = flat(readFileSync(join(ROOT, adrPath), "utf8"));
|
|
144
|
-
// Scoped to the Trigger A bullet, not the whole flattened ADR — an
|
|
145
|
-
// unscoped search matches whichever `X` comment on it` substring appears
|
|
146
|
-
// FIRST in the file, so narrowing Trigger A's own marker while an earlier
|
|
147
|
-
// sentence still carries the old string stays green. `between` throws if
|
|
148
|
-
// the bullet's own bounds go missing, for the same reason a missing
|
|
149
|
-
// anchor elsewhere in this file throws rather than widening.
|
|
150
|
-
const triggerA = between(adr, "- **Trigger A — bar too wide:**", "- **Trigger B", "ADR 0002 Trigger A");
|
|
151
|
-
const [, adrMarker] = triggerA.match(/`([^`]+)` comment on it/) ?? [];
|
|
152
|
-
assert.equal(
|
|
153
|
-
adrMarker,
|
|
154
|
-
marker,
|
|
155
|
-
`ADR 0002's guard counts \`${adrMarker}\` while step 5 writes \`${marker}\` — the trigger reads a mark nothing leaves`,
|
|
156
|
-
);
|
|
157
|
-
// The definition itself, not just the marker: a guard whose input is
|
|
158
|
-
// undefined is not a guard, and the filed path alone is the half that
|
|
159
|
-
// systematically undercounts. Checked against the same Trigger A slice,
|
|
160
|
-
// for the same scoping reason as the marker above.
|
|
161
|
-
assert.match(
|
|
162
|
-
triggerA,
|
|
163
|
-
phrase("**Promotion signal — two marks, both on the record issue:** an open issue citing the record, and a"),
|
|
164
|
-
"ADR 0002's Trigger A no longer defines what counts as a promotion, so the filed path is the only one an evaluator can see",
|
|
165
|
-
);
|
|
166
|
-
});
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
// A finisher settled `failed` or `killed` leaves its PR without
|
|
2
|
-
// `ready-to-merge` and nothing dispatches for it. The ruling: flag only — the
|
|
3
|
-
// cockpit raises one severity-4 token per outcome and the controller resolves
|
|
4
|
-
// it by hand, never an automatic retry and never the label itself. Each pin is
|
|
5
|
-
// sliced to the paragraph or table row carrying its claim.
|
|
6
|
-
|
|
7
|
-
import { test } from "node:test";
|
|
8
|
-
import assert from "node:assert/strict";
|
|
9
|
-
import { readFileSync } from "node:fs";
|
|
10
|
-
import { join } from "node:path";
|
|
11
|
-
import { paragraph } from "./prose-pin.mjs";
|
|
12
|
-
|
|
13
|
-
const RUN_TEAM = readFileSync(join(import.meta.dirname, "..", "skills", "run-team", "SKILL.md"), "utf8");
|
|
14
|
-
const flat = (s) => s.replace(/\s+/g, " ");
|
|
15
|
-
|
|
16
|
-
test("a finisher that died is flagged by the cockpit and resolved by hand — no automatic retry, no label from the controller", () => {
|
|
17
|
-
const para = flat(paragraph(RUN_TEAM, "**Resolving a finisher that died.**", "died-finisher resolution"));
|
|
18
|
-
assert.match(para, /`finisher:failed` or `finisher:killed` at severity 4/);
|
|
19
|
-
assert.match(para, /neither the implementer's bare `killed` flag nor `unlabelled`/);
|
|
20
|
-
assert.match(para, /the tick dispatches no finisher for it/);
|
|
21
|
-
assert.match(para, /You resolve it by hand: investigate why the finisher died, or dispatch the next-suffix finisher after the finisher gate/);
|
|
22
|
-
assert.match(para, /You never add the label yourself, and the tick does not retry\./);
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
test("the finisher-report wake row records failed and killed and points at the by-hand resolution", () => {
|
|
26
|
-
const row = flat(RUN_TEAM.split("\n").find((l) => l.startsWith("| Finisher report (failed / killed) |")) ?? "");
|
|
27
|
-
assert.match(row, /settle finisher-pr-<M>=failed` for a finisher that crashed or gave up, `=killed` for one that was killed/);
|
|
28
|
-
assert.match(row, /the tick prints no dispatch for it/);
|
|
29
|
-
assert.match(row, /`finisher:failed` \/ `finisher:killed` at severity 4/);
|
|
30
|
-
assert.match(row, /\*\*Resolving a finisher that died\*\*/);
|
|
31
|
-
});
|
|
@@ -1,312 +0,0 @@
|
|
|
1
|
-
// #1499. #1053 corrected one falsified premise — that the finisher edge fires
|
|
2
|
-
// on the fix-applier's own push, so green alone licenses a dispatch — at three
|
|
3
|
-
// sites. Two are pinned by `ci-completes-premise-prose.test.mjs` (the phase-3
|
|
4
|
-
// **Monitor: CI run completes** bullet and the narrative finisher paragraph,
|
|
5
|
-
// both in `skills/run-team/SKILL.md`). The third is this file's subject:
|
|
6
|
-
// `commands/review-and-fix.md` step 4, the copy a fix-applier actually reads.
|
|
7
|
-
// That sibling's own comment already says its slices do not reach here, and
|
|
8
|
-
// nothing else did either — the premise closed at two sites and stayed open at
|
|
9
|
-
// the third, which is the exact shape of the loophole #1053 was filed for.
|
|
10
|
-
//
|
|
11
|
-
// THE CLASS, enumerated. `dispatch(es) a finisher` occurs at four prose sites
|
|
12
|
-
// besides the two already pinned:
|
|
13
|
-
// - `commands/review-and-fix.md` step 4 — the dispatch GATE. COVERED here.
|
|
14
|
-
// - `skills/run-team/SKILL.md` "which dispatches a finisher against" (inside
|
|
15
|
-
// the quoted fix-applier dispatch block) — a SHA-pinning instruction, not
|
|
16
|
-
// the green gate; already held byte-for-byte by
|
|
17
|
-
// `dispatch-block-golden-prose.test.mjs`'s golden fixture. Left.
|
|
18
|
-
// - `skills/run-team/SKILL.md` "a tree to dispatch a finisher against" —
|
|
19
|
-
// worktree lifetime, a different claim entirely. Left.
|
|
20
|
-
// - `head-moved-after-label-prose.test.mjs`'s own comment — a test comment,
|
|
21
|
-
// not instruction prose. Left.
|
|
22
|
-
// Re-pinning the two sibling sites is out of scope (#1499 says so); this file
|
|
23
|
-
// adds the third guard and touches neither.
|
|
24
|
-
//
|
|
25
|
-
// WHY ONE CONTIGUOUS SPAN, not two presence checks. Both halves of the gate are
|
|
26
|
-
// load-bearing — the report having arrived, and CI being green — and the rule
|
|
27
|
-
// lives in their JOIN. Pinning the halves separately stays green on a mutant
|
|
28
|
-
// that keeps both phrases and swaps the conjunction ("arrived OR CI is green"),
|
|
29
|
-
// which is the pre-#1053 defect restored with more words. One exact span refuses
|
|
30
|
-
// all four mutations below, so that is the shape used, with the reflow control
|
|
31
|
-
// alongside it as the proof it is not thereby over-tight.
|
|
32
|
-
//
|
|
33
|
-
// Mutation-tested by hand, 2026-09-18, against a scratch copy of
|
|
34
|
-
// `commands/review-and-fix.md` under `/tmp/fleet-scratch/impl-1499/` (never the
|
|
35
|
-
// real checkout), each substitution asserted to have applied before the run was
|
|
36
|
-
// believed. Family = `plugin/scripts/*prose*.test.mjs` + `prose-pin.test.mjs`.
|
|
37
|
-
//
|
|
38
|
-
// BEFORE this file, 601/601 green on every one of:
|
|
39
|
-
// (M1) the clause reverted to the pre-#1053 "dispatches a finisher on green"
|
|
40
|
-
// (M2) only the report-arrival half dropped ("once CI is green")
|
|
41
|
-
// (M3) only the CI half dropped ("once your report has arrived")
|
|
42
|
-
// Nothing reddened — the reversion was invisible to the whole family, which is
|
|
43
|
-
// the defect this file exists to remove. (Triage measured the same on a
|
|
44
|
-
// 570-test family; it has grown to 601 since, same result.)
|
|
45
|
-
//
|
|
46
|
-
// AFTER this file, 606/606 green clean, and each mutation reds exactly the pins
|
|
47
|
-
// that own it, by test NAME — never a raw failure count, which `node --test`
|
|
48
|
-
// prints twice per red:
|
|
49
|
-
// (M1) "dispatches a finisher on green" → 3 red: span pin, reverted-
|
|
50
|
-
// wording pin, reflow control
|
|
51
|
-
// (M2) "once CI is green" → 2 red: span pin, reflow control
|
|
52
|
-
// (M3) "once your report has arrived" → 2 red: span pin, reflow control
|
|
53
|
-
// (M4) "...has arrived OR CI is green" → 2 red: span pin, reflow control
|
|
54
|
-
// — the mutant half-pins miss
|
|
55
|
-
// (C1) step 4 rewrapped at 53 cols, meaning identical → every pin in this
|
|
56
|
-
// file green
|
|
57
|
-
// M2/M3 reddening on their own is what proves each half is separately
|
|
58
|
-
// load-bearing; only M1 additionally trips the reverted-wording pin, which is
|
|
59
|
-
// that pin owning exactly its one claim. The reflow control reds alongside the
|
|
60
|
-
// span pin on all four because it is derived from the LIVE slice rather than a
|
|
61
|
-
// quoted copy of today's line — the property that makes it a reflow control and
|
|
62
|
-
// not a second fixture to keep in sync.
|
|
63
|
-
//
|
|
64
|
-
// C1 used to also redden ONE pin outside this file — `pointer-target-prose.
|
|
65
|
-
// test.mjs`'s "every pointer clause in the document is still recognised",
|
|
66
|
-
// which extracted `see **…**` clauses per PHYSICAL line and found 3 instead
|
|
67
|
-
// of 5 once step 4 wraps. That was pre-existing brittleness in another
|
|
68
|
-
// file's pin, not fallout from this one, and #1609 is what closed it: that
|
|
69
|
-
// pin's scan now reads the document's LOGICAL lines, so the same C1 rewrap
|
|
70
|
-
// no longer loses any pointer (measured on this branch: 5 before and after).
|
|
71
|
-
// Nothing here needed to change — #1499 scoped this ticket to the third
|
|
72
|
-
// site's guard and explicitly out of migrating anything else.
|
|
73
|
-
//
|
|
74
|
-
// THE CEILING: a prose pin. It proves the two-condition gate is STATED where a
|
|
75
|
-
// fix-applier reads it, bounded to the step that states it. It cannot prove a
|
|
76
|
-
// controller obeys it, nothing here calls `gh`, and — matching the sibling pins'
|
|
77
|
-
// strictness rather than exceeding it — the span is matched against raw bytes,
|
|
78
|
-
// so a `**` moved INTO the pinned words would red it. No emphasis sits inside
|
|
79
|
-
// that span today and `#1465`/`#1492`'s helper migrations are explicitly not
|
|
80
|
-
// this ticket's to make.
|
|
81
|
-
import { test } from "node:test";
|
|
82
|
-
import assert from "node:assert/strict";
|
|
83
|
-
import { readFileSync } from "node:fs";
|
|
84
|
-
import { join } from "node:path";
|
|
85
|
-
import { betweenPhrases, phrase, unemphasized } from "./prose-pin.mjs";
|
|
86
|
-
|
|
87
|
-
const REPO = join(import.meta.dirname, "..");
|
|
88
|
-
const DOC = "commands/review-and-fix.md";
|
|
89
|
-
const reviewAndFix = () => readFileSync(join(REPO, ...DOC.split("/")), "utf8");
|
|
90
|
-
|
|
91
|
-
// The slice. Not `paragraph()`: this document writes one long line per numbered
|
|
92
|
-
// step with no blank line between them, so the next `\n[ \t]*\n` after step 4
|
|
93
|
-
// sits below step 6 — a blank-line bound would hand back three steps, and a pin
|
|
94
|
-
// on the gate would then be satisfiable from step 6's own green/label prose.
|
|
95
|
-
//
|
|
96
|
-
// Bounded instead by two landmarks NEITHER half of the gate owns: step 4's own
|
|
97
|
-
// opening imperative, and the instruction the premise justifies. Both sit
|
|
98
|
-
// OUTSIDE every mutation above by construction — a mutant that rewrote a bound
|
|
99
|
-
// would make `anchorAt` throw instead of the pin reddening, which is the harness
|
|
100
|
-
// losing its footing rather than a pin discriminating. Both go through
|
|
101
|
-
// `phrase()` (`anchorAt` does it for the start, `betweenPhrases` for the
|
|
102
|
-
// end), so a reflow moves neither, and both are single-hit in this file:
|
|
103
|
-
// grep -cF "Under the fleet, do not hold this wait" → 1
|
|
104
|
-
// grep -cF "so push, then report to the controller a" → 1
|
|
105
|
-
const STEP4_FROM = "Under the fleet, do not hold this wait";
|
|
106
|
-
const STEP4_TO = "so push, then report to the controller a";
|
|
107
|
-
const WHAT = `${DOC} step 4 finisher-dispatch premise`;
|
|
108
|
-
|
|
109
|
-
// Throws rather than widening at BOTH ends. The start half is `anchorAt`'s
|
|
110
|
-
// own exactly-once count. The end half cannot be a bare exactly-once count
|
|
111
|
-
// over the rest of the document: if step 4's own closing instruction is
|
|
112
|
-
// reworded away, the LAST thing left matching `STEP4_TO` is whatever comes
|
|
113
|
-
// after it — a single, unambiguous, and entirely wrong match, so a raw count
|
|
114
|
-
// would see exactly 1 and let it through.
|
|
115
|
-
//
|
|
116
|
-
// Bounded instead to step 4's own markdown list item — up to the next
|
|
117
|
-
// ordered-list marker at column 0 (`\n5. `, never indented — the ACCEPT SIDE
|
|
118
|
-
// reflow fixture below and C1 in the header both continue a wrapped line
|
|
119
|
-
// with `\n` plus INDENT, so neither is mistaken for the next item). A decoy
|
|
120
|
-
// ADDED on any later step, real closing instruction left untouched, can
|
|
121
|
-
// never enter the count — the search never reaches past this item's own
|
|
122
|
-
// boundary to find it. A decoy ADDED on step 4's own item, real closing
|
|
123
|
-
// instruction left untouched, still trips the same exactly-once check
|
|
124
|
-
// `betweenPhrases` uses for the end (mirroring `anchorAt`'s for the start).
|
|
125
|
-
//
|
|
126
|
-
// Not covered, by either end, and not a new gap this bound opens: rewording
|
|
127
|
-
// the true anchor AWAY in the same edit that plants its exact replacement
|
|
128
|
-
// text once, elsewhere, leaves exactly one match — indistinguishable from a
|
|
129
|
-
// legitimate reflow-driven re-anchor. `anchorAt` has this same limitation on
|
|
130
|
-
// the start side already; matching it on the end side is parity, not
|
|
131
|
-
// exceeding what a phrase anchor can promise. Silently falling back to the
|
|
132
|
-
// whole document, or binding past this slice's true end to an ADDED decoy
|
|
133
|
-
// on a later step, is the false green this bound exists to deny, and the
|
|
134
|
-
// bound-integrity test at the bottom holds every half of that claim.
|
|
135
|
-
const dispatchPremise = (text = reviewAndFix()) =>
|
|
136
|
-
betweenPhrases(text, STEP4_FROM, STEP4_TO, WHAT, { bound: /\n\d+\.\s/ });
|
|
137
|
-
|
|
138
|
-
// The gate, as ONE span: the dispatch, the report having arrived, and CI being
|
|
139
|
-
// green, in the order and with the conjunction the corrected prose uses.
|
|
140
|
-
const GATE = "dispatches a finisher once your report has arrived and CI is green";
|
|
141
|
-
|
|
142
|
-
// The pre-#1053 wording, verbatim from the commit that removed it (1be2080).
|
|
143
|
-
// Narrow on purpose: it must not match the corrected clause, whose "finisher"
|
|
144
|
-
// is followed by "once", not "on".
|
|
145
|
-
const REVERTED = "dispatches a finisher on green";
|
|
146
|
-
|
|
147
|
-
// Deliberately RAW BYTES, never `unemphasized()` — unlike the whole-document
|
|
148
|
-
// negative below. A `**` moved INTO this span (bolding part of the gate for
|
|
149
|
-
// emphasis) reds this test on purpose: it matches the sibling pins'
|
|
150
|
-
// strictness (see THE CEILING in the header) rather than exceeding OR
|
|
151
|
-
// loosening it, and this file's own #1499 scope excludes migrating this span
|
|
152
|
-
// pin onto an emphasis-tolerant helper. The negative below normalizes
|
|
153
|
-
// emphasis for a different reason — it is a coverage backstop over the WHOLE
|
|
154
|
-
// document, not a claim about this span's own bytes — so the two are not in
|
|
155
|
-
// tension: one enforces exact wording where a fix-applier reads it, the
|
|
156
|
-
// other refuses to let the pre-#1053 defect hide behind formatting anywhere
|
|
157
|
-
// else.
|
|
158
|
-
test("review-and-fix.md step 4 gates the finisher on the member's report AND CI, never on green alone", () => {
|
|
159
|
-
assert.match(
|
|
160
|
-
dispatchPremise(),
|
|
161
|
-
phrase(GATE),
|
|
162
|
-
`${DOC} step 4 no longer says "${GATE}". This is the sentence every fix-applier reads before pushing: with either half dropped it licenses a dispatch onto a SHA the member may still move, or onto a PR whose report has not arrived — the falsified premise #1053 corrected at two other sites.`,
|
|
163
|
-
);
|
|
164
|
-
});
|
|
165
|
-
|
|
166
|
-
// The negative, deliberately at the WIDEST scope this file owns — the whole
|
|
167
|
-
// document, not the slice. A copy of the pre-#1053 premise surviving anywhere in
|
|
168
|
-
// the member-facing command is the defect back, whether or not it sits in step
|
|
169
|
-
// 4 — and whether or not it is typed with `**` around part of it: bolding
|
|
170
|
-
// "green" for emphasis changes nothing about what the sentence licenses, so
|
|
171
|
-
// this check runs on `unemphasized(live)`, never on raw bytes (contrast the
|
|
172
|
-
// span pin above, which is deliberately raw-byte strict — see THE CEILING).
|
|
173
|
-
// The positive companion on the same normalized text is what keeps this from
|
|
174
|
-
// passing vacuously: alone, a `doesNotMatch` is satisfied by a document that
|
|
175
|
-
// has degenerated to nothing, and this one would then pass while the sentence
|
|
176
|
-
// was gone. The companion is deliberately the DISPATCH CLAUSE only, never the
|
|
177
|
-
// whole gate — pinning the gate here too would red this test on every
|
|
178
|
-
// mutation that drops a half, duplicating the span pin above and destroying
|
|
179
|
-
// the per-pin discrimination the mutation evidence in the header reports.
|
|
180
|
-
// This test owns exactly one claim: the pre-#1053 wording is not back, under
|
|
181
|
-
// any emphasis.
|
|
182
|
-
test("no sentence anywhere in review-and-fix.md licenses a finisher on green alone", () => {
|
|
183
|
-
const live = unemphasized(reviewAndFix());
|
|
184
|
-
assert.match(live, phrase("dispatches a finisher"), `${DOC} no longer says "dispatches a finisher" at all — the negative below would pass on a document that had lost the sentence entirely`);
|
|
185
|
-
assert.doesNotMatch(
|
|
186
|
-
live,
|
|
187
|
-
phrase(REVERTED),
|
|
188
|
-
`${DOC} says "${REVERTED}" again — that is the #1053 defect verbatim, whether or not it is typed with emphasis. The implementer's own push fires the CI edge first for every PR, so green arrives before any review has returned and this wording dispatches a finisher into it.`,
|
|
189
|
-
);
|
|
190
|
-
});
|
|
191
|
-
|
|
192
|
-
// The slice is step 4's own sentence and cannot reach its neighbours below it.
|
|
193
|
-
// Without this, a drifted end bound would let the gate pin above be satisfied
|
|
194
|
-
// from step 5 or step 6 — both of which talk about green, labels and
|
|
195
|
-
// reporting — and the pin would go on passing with step 4's premise reverted.
|
|
196
|
-
// (No equivalent check runs backward into step 3: the slice starts AT step
|
|
197
|
-
// 4's own anchor, so it can never reach step 3 regardless of how far the end
|
|
198
|
-
// bound drifts forward — that assert would be unfalsifiable by construction,
|
|
199
|
-
// never the guard the two below actually are.)
|
|
200
|
-
test("the pinned span is bounded to step 4 — neither neighbouring step is inside it", () => {
|
|
201
|
-
const slice = dispatchPremise();
|
|
202
|
-
assert.doesNotMatch(slice, phrase("File each deferred finding"), `${WHAT}: the slice runs forward into step 5`);
|
|
203
|
-
assert.doesNotMatch(slice, phrase("Diff-check green"), `${WHAT}: the slice runs forward into step 6`);
|
|
204
|
-
});
|
|
205
|
-
|
|
206
|
-
// ACCEPT SIDE — reflow. Derived from the LIVE slice, never a quoted copy of
|
|
207
|
-
// today's line, so a reword of neighbouring prose is not what this measures.
|
|
208
|
-
// Re-wrapped at a width nothing here assumes and rejoined with the newline plus
|
|
209
|
-
// list indent a markdown wrap actually produces: the span pin must still hold,
|
|
210
|
-
// because what it refuses is drift in the gate, not where the lines break. The
|
|
211
|
-
// inequality assert first — a fixture that has stopped changing the wrapping
|
|
212
|
-
// proves nothing and must be updated rather than left passing.
|
|
213
|
-
test("a rewrapped step 4 is ACCEPTED — the gate pin refuses drift, not line breaks", () => {
|
|
214
|
-
const live = dispatchPremise();
|
|
215
|
-
const rewrapped = live
|
|
216
|
-
.split(/\s+/)
|
|
217
|
-
.filter(Boolean)
|
|
218
|
-
.reduce((acc, w) => {
|
|
219
|
-
const last = acc[acc.length - 1];
|
|
220
|
-
if (last && `${last} ${w}`.length <= 41) acc[acc.length - 1] = `${last} ${w}`;
|
|
221
|
-
else acc.push(w);
|
|
222
|
-
return acc;
|
|
223
|
-
}, [])
|
|
224
|
-
.join("\n ");
|
|
225
|
-
assert.notEqual(rewrapped, live, "the rewrap fixture no longer changes the wrapping — update it");
|
|
226
|
-
assert.match(rewrapped, phrase(GATE), "the gate pin reds on a pure reflow — it is over-tight, not strict");
|
|
227
|
-
assert.doesNotMatch(rewrapped, phrase(REVERTED));
|
|
228
|
-
});
|
|
229
|
-
|
|
230
|
-
// The bound's failure mode, asserted rather than assumed. #1499's own acceptance
|
|
231
|
-
// criterion: if an anchor moves, this slicer must THROW — a slicer that fell
|
|
232
|
-
// back to the whole document would leave the gate pin passing off step 6's
|
|
233
|
-
// prose, which is the vacuous green every bound in this directory exists to
|
|
234
|
-
// prevent. Both ends get the SAME two failure directions: a start anchor that
|
|
235
|
-
// is gone (`anchorAt`), one that occurs twice (a restatement above the real
|
|
236
|
-
// one would otherwise bind the pin to the wrong copy), an end anchor that is
|
|
237
|
-
// gone (moved), and one that occurs twice (a restatement below the real one
|
|
238
|
-
// would otherwise bind the pin to the later copy, widening the slice into
|
|
239
|
-
// whatever follows it — the shape measured in this file's own header fixes).
|
|
240
|
-
//
|
|
241
|
-
// Each fixture is cut with a `phrase()` REGEX, never a literal `replace()`, and
|
|
242
|
-
// every one is asserted to have changed the document before it is believed.
|
|
243
|
-
// Measured, and the reason this is not a style preference: with literal
|
|
244
|
-
// substrings here, the end-anchor fixture silently no-ops the moment step 4 is
|
|
245
|
-
// rewrapped — the words are still there, just with a newline among them — so
|
|
246
|
-
// `dispatchPremise` does not throw, and the assertion fails claiming the BOUND
|
|
247
|
-
// is broken when only the fixture was. A no-op fixture that reports as a
|
|
248
|
-
// finding is worse than one that reds honestly.
|
|
249
|
-
const cut = (text, target, replacement, label) => {
|
|
250
|
-
const mutant = text.replace(phrase(target), replacement);
|
|
251
|
-
assert.notEqual(mutant, text, `the ${label} fixture no longer changes the document — update it, do not trust a result measured against it`);
|
|
252
|
-
return mutant;
|
|
253
|
-
};
|
|
254
|
-
|
|
255
|
-
test("the slice bound throws rather than widening when an anchor moves", () => {
|
|
256
|
-
const live = reviewAndFix();
|
|
257
|
-
assert.throws(
|
|
258
|
-
() => dispatchPremise(cut(live, STEP4_FROM, "Under the fleet, do not sit on this wait", "vanished start anchor")),
|
|
259
|
-
/slice anchor .* moved — re-anchor this test, never widen it/,
|
|
260
|
-
"a vanished start anchor widened the slice instead of throwing",
|
|
261
|
-
);
|
|
262
|
-
assert.throws(
|
|
263
|
-
() => dispatchPremise(`${live}\n\n${STEP4_FROM} — a restatement below.\n`),
|
|
264
|
-
/occurs 2 times/,
|
|
265
|
-
"a duplicated start anchor bound the pin to one copy instead of throwing",
|
|
266
|
-
);
|
|
267
|
-
assert.throws(
|
|
268
|
-
() => dispatchPremise(cut(live, "so push, then report to the controller a", "so push and then report a", "moved end anchor")),
|
|
269
|
-
/slice end anchor .* moved — re-anchor this test, never widen it/,
|
|
270
|
-
"a moved end anchor ran the slice past step 4 instead of throwing",
|
|
271
|
-
);
|
|
272
|
-
assert.throws(
|
|
273
|
-
() =>
|
|
274
|
-
dispatchPremise(
|
|
275
|
-
cut(
|
|
276
|
-
live,
|
|
277
|
-
STEP4_FROM,
|
|
278
|
-
`${STEP4_FROM} — so push, then report to the controller a decoy, restated further on`,
|
|
279
|
-
"duplicated end anchor onto step 4's own line",
|
|
280
|
-
),
|
|
281
|
-
),
|
|
282
|
-
/occurs 2 times/,
|
|
283
|
-
"a duplicated end anchor on step 4's own line bound the pin to one copy instead of throwing",
|
|
284
|
-
);
|
|
285
|
-
// The scenario a bare exactly-once count over the rest of the document
|
|
286
|
-
// would miss: step 4's real closing instruction reworded away, with the
|
|
287
|
-
// only remaining match sitting on a LATER line (step 5's). A count over
|
|
288
|
-
// the rest of the document sees exactly 1 hit and lets it through,
|
|
289
|
-
// silently binding the slice to the decoy and widening it into step 5.
|
|
290
|
-
// Bounding the search to step 4's own item excludes that decoy from the
|
|
291
|
-
// count entirely, so this still throws rather than silently widening — with
|
|
292
|
-
// the past-the-bound message, since the decoy is a copy of the end anchor
|
|
293
|
-
// sitting beyond the bound. Both mutations go through `cut()`, never a
|
|
294
|
-
// literal `.replace()`: a literal target here breaks the same way the
|
|
295
|
-
// header already warns for step 4, and the same mechanism applies here to
|
|
296
|
-
// step 5.
|
|
297
|
-
const decoyDoc = cut(
|
|
298
|
-
cut(live, "so push, then report to the controller a", "so push and then report a", "moved end anchor"),
|
|
299
|
-
"File each deferred finding",
|
|
300
|
-
"so push, then report to the controller a decoy on step 5's own line. File each deferred finding",
|
|
301
|
-
"later-line decoy",
|
|
302
|
-
);
|
|
303
|
-
const decoyAt = decoyDoc.indexOf("so push, then report to the controller a decoy");
|
|
304
|
-
const decoyLineNo = decoyDoc.slice(0, decoyDoc.lastIndexOf("\n", decoyAt) + 1).split("\n").length;
|
|
305
|
-
assert.throws(
|
|
306
|
-
() => dispatchPremise(decoyDoc),
|
|
307
|
-
new RegExp(
|
|
308
|
-
`slice end anchor .* lies past the end bound, which first matched at line ${decoyLineNo} \\("5\\. so push, then report to the controller a decoy`,
|
|
309
|
-
),
|
|
310
|
-
"a reworded end anchor with a same-text decoy on a LATER line silently widened the slice instead of throwing",
|
|
311
|
-
);
|
|
312
|
-
});
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
// #2083. A finisher halt had no record rule and no resolution rule, so every
|
|
2
|
-
// halt parked its PR until a human read the report. The ruling: a halt is its
|
|
3
|
-
// own outcome (`finisher-pr-M=halted:<cause>`), it escalates on the PR itself
|
|
4
|
-
// (cockpit flag + `gh pr comment`, no label), and each cause has one
|
|
5
|
-
// resolution — two automatic, every other one escalated.
|
|
6
|
-
//
|
|
7
|
-
// Each pin is sliced to the one table row, sentence or bullet carrying its
|
|
8
|
-
// claim, never the whole section: the causes' names recur all over it, so a
|
|
9
|
-
// section-wide match would stay green with a resolution swapped between rows.
|
|
10
|
-
// The cause vocabulary itself is read from ledger-grammar.mjs, the one parser
|
|
11
|
-
// that accepts or refuses a settle — the prose and the grammar naming
|
|
12
|
-
// different causes is exactly a halt the ledger refuses to record.
|
|
13
|
-
|
|
14
|
-
import { test } from "node:test";
|
|
15
|
-
import assert from "node:assert/strict";
|
|
16
|
-
import { readFileSync } from "node:fs";
|
|
17
|
-
import { join } from "node:path";
|
|
18
|
-
import { between, paragraph, phrase, sentences } from "./prose-pin.mjs";
|
|
19
|
-
import { HALT_CAUSES } from "./ledger-grammar.mjs";
|
|
20
|
-
|
|
21
|
-
const RUN_TEAM = readFileSync(join(import.meta.dirname, "..", "skills", "run-team", "SKILL.md"), "utf8");
|
|
22
|
-
const flat = (s) => s.replace(/\s+/g, " ");
|
|
23
|
-
|
|
24
|
-
const RESOLVING = "**Resolving a finisher halt.**";
|
|
25
|
-
const resolutionRows = () => {
|
|
26
|
-
const table = between(RUN_TEAM, "| Cause | Resolution |", "\n\n", "halt resolution table");
|
|
27
|
-
return table.split("\n").filter((l) => l.startsWith("| `"));
|
|
28
|
-
};
|
|
29
|
-
// A row's first-cell backticked causes, in order — shared by rowFor's
|
|
30
|
-
// lookup and the coverage test below so the two cannot read the table's
|
|
31
|
-
// cells differently.
|
|
32
|
-
const causesIn = (row) => [...row.split("|")[1].matchAll(/`([^`]+)`/g)].map((m) => m[1]);
|
|
33
|
-
// The row whose first cell names exactly these causes.
|
|
34
|
-
const rowFor = (causes) => {
|
|
35
|
-
const rows = resolutionRows().filter((r) => causesIn(r).join(",") === causes.join(","));
|
|
36
|
-
assert.equal(rows.length, 1, `the resolution table has ${rows.length} rows for ${causes.join(", ")}`);
|
|
37
|
-
return rows[0].split("|")[2];
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
test("the resolution table resolves every cause the grammar accepts, each exactly once", () => {
|
|
41
|
-
// HALT_CAUSES is the exported, shared array parseToken's own grammar
|
|
42
|
-
// validates against — copy it before sorting, since sort mutates in
|
|
43
|
-
// place. resolutionRows().flatMap(causesIn) is a fresh array every call,
|
|
44
|
-
// needing no copy of its own.
|
|
45
|
-
assert.deepEqual(resolutionRows().flatMap(causesIn).sort(), [...HALT_CAUSES].sort());
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
test("live-editor resolves automatically: ask the member by name, wait, re-finish at the current head — past-pin if it moved", () => {
|
|
49
|
-
const r = rowFor(["live-editor"]);
|
|
50
|
-
assert.match(r, /^\s*\*\*Automatic\.\*\*/);
|
|
51
|
-
assert.match(r, /Ask the live member \*\*by name\*\* for its report, wait for it, then dispatch `finisher-pr-<M>-b` at the current head\./);
|
|
52
|
-
assert.match(r, /If the head moved in the meantime, resolve it as `past-pin` instead\./);
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
test("past-pin resolves automatically through the tick, as a re-review", () => {
|
|
56
|
-
const r = rowFor(["past-pin"]);
|
|
57
|
-
assert.match(r, /^\s*\*\*Automatic, through the tick: re-review\.\*\*/);
|
|
58
|
-
assert.match(r, /The tick prints `DISPATCH review PR#<M>` for a PR whose latest finisher is `halted:past-pin` and whose latest `reviewed=<head>` is not its current head/);
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
test("rebase escalates with the git cherry read, and has no automatic rule yet", () => {
|
|
62
|
-
const r = rowFor(["rebase"]);
|
|
63
|
-
assert.match(r, /^\s*\*\*Escalate\*\* — comment and flag, nothing more\./);
|
|
64
|
-
assert.match(r, /only `-` lines is a clean rebase, and a `\+` line is a conflict resolution that changed content or a commit past the pin/);
|
|
65
|
-
assert.match(r, /`git cherry <pin> HEAD origin\/main`/);
|
|
66
|
-
assert.match(r, /No automatic rule until a live halt shows the case recurring\./);
|
|
67
|
-
assert.doesNotMatch(r, /Automatic\./);
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
test("unreadable, missing, absent and other escalate with no automatic retry", () => {
|
|
71
|
-
const r = rowFor(["unreadable", "missing", "absent", "other"]);
|
|
72
|
-
assert.match(r, /^\s*\*\*Escalate\*\* — comment and flag, no automatic retry\.\s*$/);
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
test("every halt escalates on the PR itself — a comment that outlives the run — and never by label", () => {
|
|
76
|
-
const para = flat(paragraph(RUN_TEAM, RESOLVING, "halt resolution lead-in"));
|
|
77
|
-
const s = sentences(para);
|
|
78
|
-
const settle = s.find((x) => x.includes("Record it"));
|
|
79
|
-
assert.match(settle ?? "", /Record it `ledger\.mjs settle finisher-pr-<M>=halted:<cause>`/);
|
|
80
|
-
assert.match(para, /so it is never `failed`, which stays for a finisher that crashed or gave up\./);
|
|
81
|
-
assert.match(
|
|
82
|
-
para,
|
|
83
|
-
/Every halt escalates two ways: the cockpit flags the PR `halted:<cause>` at severity 4 off that token, and you post the finisher's halt report — cause and evidence — with `gh pr comment <M>`, so it outlives the run\./,
|
|
84
|
-
);
|
|
85
|
-
assert.match(para, /\*\*No label\*\*: the missing `ready-to-merge` already keeps the PR out of the merge queue\./);
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
test("the tick paragraph says why past-pin cannot use the dead-review path, and that a fix-applier push stays not due", () => {
|
|
89
|
-
const para = flat(paragraph(RUN_TEAM, "`past-pin` needs the tick because", "past-pin tick rationale"));
|
|
90
|
-
assert.match(para, /settling that review `=failed` re-queues nothing — that path covers only a review that died before returning\./);
|
|
91
|
-
assert.match(para, /A head that moved past `reviewed=` with no such halt — a fix-applier's push — stays not due: duty 2 verifies what it applied\./);
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
test("finisher duty 4 names the cause in the ledger's vocabulary, and a rebase report carries git cherry", () => {
|
|
95
|
-
const duty = flat(between(RUN_TEAM, "4. Report you the label", "\n\n", "finisher duty 4"));
|
|
96
|
-
const vocab = sentences(duty).find((x) => x.includes("vocabulary")) ?? "";
|
|
97
|
-
for (const c of HALT_CAUSES) assert.match(vocab, new RegExp(`\`${c}\``), `duty 4 no longer names \`${c}\``);
|
|
98
|
-
assert.match(vocab, /`other` for every other halt/);
|
|
99
|
-
assert.match(duty, /A `rebase` halt's report carries the output of `git cherry <pin> HEAD origin\/main`, run in the worktree\./);
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
test("the settle grammar summary lists halted:<cause> with the grammar's own causes", () => {
|
|
103
|
-
const bulletText = flat(between(RUN_TEAM, "- **`ledger.mjs settle <member> <outcome>`**", "\n- **", "settle summary"));
|
|
104
|
-
assert.match(bulletText, phrase("`finisher-pr-M` = `labelled | failed | killed | halted:<cause>`"));
|
|
105
|
-
assert.match(bulletText, phrase(`\`<cause>\` one of \`${HALT_CAUSES.join(" | ")}\``));
|
|
106
|
-
});
|