@feigi/fleet-ctl 3.23.35 → 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,796 +0,0 @@
|
|
|
1
|
-
import { test } from "node:test";
|
|
2
|
-
import assert from "node:assert/strict";
|
|
3
|
-
import { readFileSync } from "node:fs";
|
|
4
|
-
import { join } from "node:path";
|
|
5
|
-
import { between as section, bullet, phrase, stripQuoteGutter } from "./prose-pin.mjs";
|
|
6
|
-
// The board's real parser, imported rather than re-described: the doc example
|
|
7
|
-
// below is fed through it, so a widened/narrowed regex and a reverted example
|
|
8
|
-
// both surface here instead of only in compute-board.test.mjs's own fixtures.
|
|
9
|
-
import { parseRow } from "./compute-board.mjs";
|
|
10
|
-
import { runReview } from "./review-core.mjs";
|
|
11
|
-
import { pipeline, parallel, ARGS, SNAP, review, finding, vote, scriptedHost } from "./review-host-fixture.mjs";
|
|
12
|
-
|
|
13
|
-
// The fleet's default review path is the controller running `review-eval.mjs`
|
|
14
|
-
// itself, via `eval`. Only the controller can: subagents have no `eval`
|
|
15
|
-
// access, so on the hand-dispatch path neither `selectDimensions` nor the
|
|
16
|
-
// severity-budgeted verify pass runs at all — sizing falls back to the
|
|
17
|
-
// reviewer's own judgement and nothing budgets the adversarial refuters.
|
|
18
|
-
// Hand-dispatch also carries no delivery guarantee: a specialist's report
|
|
19
|
-
// surfaces to the CONTROLLER, so the reviewer has to retrieve it from the
|
|
20
|
-
// specialist's output file or be relayed it, and reports have gone missing
|
|
21
|
-
// both ways. On the `eval` path `agent()` returns into the script, so
|
|
22
|
-
// neither problem exists.
|
|
23
|
-
//
|
|
24
|
-
// All of that rots silently. A default demoted back to a preference still reads
|
|
25
|
-
// as documented; relay prose left in the Phase 3 event loop reads as an
|
|
26
|
-
// obligation on every run, including the path where no relay can ever occur.
|
|
27
|
-
// Neither shows up as an error.
|
|
28
|
-
// THE CEILING EVERY PIN IN THIS FILE SHARES. These prove a phrase is PRESENT.
|
|
29
|
-
// None can prove it is not NEGATED — a sentence inserted inside the slice
|
|
30
|
-
// granting the opposite permission leaves every anchor and every pinned phrase
|
|
31
|
-
// intact, and the suite green (verified 2026-08-06). Tightening a regex does
|
|
32
|
-
// not close this; only a different mechanism would. So read the per-assertion
|
|
33
|
-
// comments below as "this pin is not vacuous to *rewording*", never as "this
|
|
34
|
-
// rule cannot be subverted" — the contradiction that shipped on this branch
|
|
35
|
-
// (an absolute `unverified` rule sitting above the `suggestion` exception that
|
|
36
|
-
// contradicted it) was exactly that, and was invisible to all of them.
|
|
37
|
-
const REPO = join(import.meta.dirname, "..");
|
|
38
|
-
const RUN_TEAM = readFileSync(join(REPO, "skills", "run-team", "SKILL.md"), "utf8");
|
|
39
|
-
const REVIEW_AND_FIX = readFileSync(join(REPO, "commands", "review-and-fix.md"), "utf8");
|
|
40
|
-
|
|
41
|
-
// Slice by named anchors, and fail loudly when one moves. SLICE SIZE is what
|
|
42
|
-
// does the work: a regex over a whole section is satisfied by incidental prose
|
|
43
|
-
// somewhere else in it, so each claim gets the smallest slice that can contain
|
|
44
|
-
// it. An unbounded slice is worst of all — it runs to EOF, where the red-flag
|
|
45
|
-
// list restates `relay` and `reconcile`, enough to keep the fallback assertions
|
|
46
|
-
// below green with the fallback section deleted outright.
|
|
47
|
-
// Keys at an object literal's OWN depth, whatever the line layout. A per-line
|
|
48
|
-
// regex (`/^ {2}(\w+)[,:]/gm`) read one field per line and so could not see a
|
|
49
|
-
// field added on a line it SHARES with an existing one — measured in #667: the
|
|
50
|
-
// same added field is caught when it lands on its own line and missed when it
|
|
51
|
-
// shares, decided by nothing but where the newline fell. Depth is tracked so a
|
|
52
|
-
// value's own commas and nested braces never register as fields, and `expectKey`
|
|
53
|
-
// is what separates `head` the key from `head` in `snap.head` — both sit at
|
|
54
|
-
// depth 0, only one follows a `,` or the opening brace.
|
|
55
|
-
// String/template literals are dropped whole before tokenizing, quote and all
|
|
56
|
-
// — a `//` or a bracket inside a field's VALUE (a URL, say) used to be read as
|
|
57
|
-
// a real comment or a real brace, which could desync `expectKey` and silently
|
|
58
|
-
// drop the NEXT field from the list even though that field's own line was
|
|
59
|
-
// never touched. Escapes (`\'`, `\"`, `` \` ``) are honored so the scan can't
|
|
60
|
-
// mistake an escaped quote for the closing one.
|
|
61
|
-
// ponytail: no regex-literal awareness, and a template literal's `${...}`
|
|
62
|
-
// interpolation is dropped along with the string rather than re-entering code
|
|
63
|
-
// mode — a brace/comma inside an interpolation would miscount. Block comments
|
|
64
|
-
// are not stripped either. All upgrades for the day the return grows one.
|
|
65
|
-
function stripStringsAndComments(body) {
|
|
66
|
-
let out = "";
|
|
67
|
-
for (let i = 0; i < body.length; i++) {
|
|
68
|
-
const ch = body[i];
|
|
69
|
-
if (ch === "'" || ch === '"' || ch === "`") {
|
|
70
|
-
const quote = ch;
|
|
71
|
-
for (i++; i < body.length && body[i] !== quote; i++) {
|
|
72
|
-
if (body[i] === "\\") i++;
|
|
73
|
-
}
|
|
74
|
-
continue;
|
|
75
|
-
}
|
|
76
|
-
if (ch === "/" && body[i + 1] === "/") {
|
|
77
|
-
for (; i < body.length && body[i] !== "\n"; i++);
|
|
78
|
-
continue;
|
|
79
|
-
}
|
|
80
|
-
out += ch;
|
|
81
|
-
}
|
|
82
|
-
return out;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
function objectKeys(body) {
|
|
86
|
-
const keys = [];
|
|
87
|
-
let depth = 0;
|
|
88
|
-
let expectKey = true;
|
|
89
|
-
for (const [tok] of stripStringsAndComments(body).matchAll(/\w+|\S/g)) {
|
|
90
|
-
if ("([{".includes(tok)) {
|
|
91
|
-
depth++;
|
|
92
|
-
} else if (")]}".includes(tok)) {
|
|
93
|
-
depth--;
|
|
94
|
-
} else if (depth === 0) {
|
|
95
|
-
if (tok === ",") {
|
|
96
|
-
expectKey = true;
|
|
97
|
-
} else {
|
|
98
|
-
if (expectKey && /^\w+$/.test(tok)) keys.push(tok);
|
|
99
|
-
expectKey = false;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
assert.equal(
|
|
104
|
-
depth,
|
|
105
|
-
0,
|
|
106
|
-
"objectKeys: brace/paren/bracket depth didn't return to 0 — a quote or comment is likely hiding one from the scanner; update this parser",
|
|
107
|
-
);
|
|
108
|
-
return keys;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
test("objectKeys reads fields by depth, not by line, and ignores brackets/commas hiding in string values", () => {
|
|
112
|
-
assert.deepEqual(objectKeys("a, b: f(c, d), e,"), ["a", "b", "e"]);
|
|
113
|
-
// The bug this PR fixes: a nested call's own commas must not register as
|
|
114
|
-
// top-level fields.
|
|
115
|
-
assert.deepEqual(objectKeys("head: snap.head, snapshot: snap.path,"), ["head", "snapshot"]);
|
|
116
|
-
// The SURVIVED finding this PR fixes: a `//` inside a string value used to
|
|
117
|
-
// be read as a line comment, eating the rest of the line — including the
|
|
118
|
-
// trailing comma — and silently dropping the NEXT field.
|
|
119
|
-
assert.deepEqual(
|
|
120
|
-
objectKeys('snapshot: snap.path + "//x", dimensionsRun: d,'),
|
|
121
|
-
["snapshot", "dimensionsRun"],
|
|
122
|
-
);
|
|
123
|
-
// A brace or comma inside a string value must not move `depth` either.
|
|
124
|
-
assert.deepEqual(objectKeys('label: "a, {b}", next: 1,'), ["label", "next"]);
|
|
125
|
-
});
|
|
126
|
-
|
|
127
|
-
const FALLBACK_ANCHOR = "#### Fallback: hand-dispatched reviewer";
|
|
128
|
-
const PROMPT_ANCHOR = "> You are ALREADY in worktree";
|
|
129
|
-
const PROMPT_END = "\n**Put the standing CI facts";
|
|
130
|
-
|
|
131
|
-
const reviewersSection = () => section(RUN_TEAM, "### Reviewers", FALLBACK_ANCHOR, "run-team Reviewers");
|
|
132
|
-
// Sliced out of the Reviewers section, never out of the whole file: `section()`
|
|
133
|
-
// takes the FIRST hit, and the implementer dispatch in Phase 2 opens with the
|
|
134
|
-
// same sentence. Anchored file-wide this silently returns the implementer's
|
|
135
|
-
// prompt, and every assertion below then reports on the wrong agent.
|
|
136
|
-
const fixApplierPrompt = () =>
|
|
137
|
-
section(reviewersSection(), PROMPT_ANCHOR, PROMPT_END, "run-team fix-applier prompt");
|
|
138
|
-
// The lead-in is what SUBSTITUTES the prompt's `<testCmd>` placeholder, so it
|
|
139
|
-
// gets its own slice ending where the prompt begins — deliberately tighter than
|
|
140
|
-
// the Reviewers section. Section-wide, the phrase is satisfied by any mention
|
|
141
|
-
// inside the prompt itself, so the substitution duty could be deleted with the
|
|
142
|
-
// pin still green; that is the whole failure mode being pinned.
|
|
143
|
-
const fixApplierLeadIn = () =>
|
|
144
|
-
section(reviewersSection(), "**Then dispatch a fix-applier**", PROMPT_ANCHOR, "run-team fix-applier lead-in");
|
|
145
|
-
|
|
146
|
-
// Review1816: both `doesNotMatch` guards below were closed enumerations of
|
|
147
|
-
// specific historical bad-phrasings — a syntactically different restatement
|
|
148
|
-
// of the SAME false claim (a transcript/output file does not exist at all,
|
|
149
|
-
// rather than merely being unaddressed) slipped straight through. Measured
|
|
150
|
-
// 2026-09-25: appending "though there is no file for you to personally
|
|
151
|
-
// fetch" to either slice went undetected by the old enumerations. This
|
|
152
|
-
// pattern instead matches the CLASS — a negated transcript/file/output/path
|
|
153
|
-
// noun sharing a clause with an access verb (`fetch`/`read`), the `left no
|
|
154
|
-
// <noun>` and `<noun> ... cannot exist` frames, and the two originals with no
|
|
155
|
-
// paraphrase left to match (`nothing is on disk`, bare `no output file`) —
|
|
156
|
-
// gated to one clause (`[^,.;]`) so it cannot reach across a comma into
|
|
157
|
-
// unrelated prose. Verified both ways against the real slices below: all six
|
|
158
|
-
// original phrasings plus the new mutation form match; the true sentence
|
|
159
|
-
// each guard actually protects — "the result file holds their findings and
|
|
160
|
-
// names no transcript, and nothing on disk indexes a transcript by PR or
|
|
161
|
-
// dimension" — and two benign rewords of it (a synonym swap, a comma
|
|
162
|
-
// reflowed to a period) all stay clear.
|
|
163
|
-
const TRANSCRIPT_NONEXISTENCE_CLAIM = new RegExp(
|
|
164
|
-
[
|
|
165
|
-
String.raw`\bno\b[^,.;]{0,30}\b(?:transcript|output file|file|path)s?\b[^,.;]{0,40}\b(?:fetch|read)\b`,
|
|
166
|
-
String.raw`\bleft no (?:transcript|output file|file|path)s?\b`,
|
|
167
|
-
String.raw`\bnothing is on disk\b`,
|
|
168
|
-
String.raw`\b(?:transcript|output file|file|path)s?\b[^,.;]{0,40}\b(?:cannot|can't|does not|doesn't|do not|don't)\s+exist\b`,
|
|
169
|
-
String.raw`\bno output file\b`,
|
|
170
|
-
].join("|"),
|
|
171
|
-
"i",
|
|
172
|
-
);
|
|
173
|
-
|
|
174
|
-
test("the Reviewers section names the task-member dispatch as the default, ahead of the fallback", () => {
|
|
175
|
-
const dflt = reviewersSection();
|
|
176
|
-
// Loose on the example's punctuation — reordering the args or wrapping
|
|
177
|
-
// after the paren changes no instruction — tight on the dispatch being present.
|
|
178
|
-
assert.match(
|
|
179
|
-
dflt,
|
|
180
|
-
/a `task` member named `review-pr-<pr#>`, agent `fleet-review-runner`/,
|
|
181
|
-
"run-team no longer names the review-pr task-member dispatch on the default path",
|
|
182
|
-
);
|
|
183
|
-
// Pin the SENTENCE, not the word `default`. A bare /default/i over this slice
|
|
184
|
-
// stays green through "that is one option; the fallback below is the default
|
|
185
|
-
// path" — the exact demotion this test exists to catch.
|
|
186
|
-
assert.match(
|
|
187
|
-
dflt,
|
|
188
|
-
/That is the default path/,
|
|
189
|
-
"the task-member dispatch is no longer stated to be THE default review path",
|
|
190
|
-
);
|
|
191
|
-
});
|
|
192
|
-
|
|
193
|
-
test("the fix-applier dispatch is specified: named, apply-only-survived, push, report, exit", () => {
|
|
194
|
-
// `fix-pr-<pr#>` is declared in the lead-in sentence, so it is checked against
|
|
195
|
-
// the section; everything else is checked against the PROMPT ITSELF. Against
|
|
196
|
-
// the whole section these all pass with the entire prompt deleted — every one
|
|
197
|
-
// of these tokens also occurs in the controller prose around it.
|
|
198
|
-
assert.match(reviewersSection(), /fix-pr-<pr#>/, "the fix-applier's member name is unspecified");
|
|
199
|
-
|
|
200
|
-
const prompt = fixApplierPrompt();
|
|
201
|
-
assert.match(
|
|
202
|
-
prompt,
|
|
203
|
-
/\*\*steps 2, 3\s*>?\s*and 5 only\*\*/,
|
|
204
|
-
"the prompt no longer scopes the fix-applier to review-and-fix steps 2/3/5",
|
|
205
|
-
);
|
|
206
|
-
// `suggestion` and `unverified` are no longer one rule. An in-scope suggestion
|
|
207
|
-
// is verified by one refuter and applied; an out-of-scope one is filed; an
|
|
208
|
-
// `unverified` ALWAYS defers, at every severity, because at `critical` it means
|
|
209
|
-
// every refuter crashed.
|
|
210
|
-
//
|
|
211
|
-
// Asserting on the word "suggestion" alone is vacuous — the new rule contains
|
|
212
|
-
// it too. These pin the SPLIT: the in-scope branch, the refuter it requires,
|
|
213
|
-
// and the fact that `unverified` did not inherit the new permission.
|
|
214
|
-
//
|
|
215
|
-
// A loose `/in scope[\s\S]{0,400}?refuter/i` is ALSO vacuous: "refuter" shows
|
|
216
|
-
// up 400 chars later regardless of what the in-scope branch actually says, so
|
|
217
|
-
// "In scope → apply it directly, and never dispatch a refuter" still matches.
|
|
218
|
-
// Tying "dispatch" to sit right after "in scope", with "refuter" close behind
|
|
219
|
-
// IT, pins that dispatching a refuter is the action taken, not just a word
|
|
220
|
-
// that occurs somewhere downstream.
|
|
221
|
-
assert.match(
|
|
222
|
-
prompt,
|
|
223
|
-
/in scope\b[^a-zA-Z]{1,10}dispatch\b[\s\S]{0,20}refuter/i,
|
|
224
|
-
"the prompt no longer ties applying an in-scope suggestion to a refuter pass",
|
|
225
|
-
);
|
|
226
|
-
assert.match(
|
|
227
|
-
prompt,
|
|
228
|
-
/`unverified`[^.]{0,200}always defers/i,
|
|
229
|
-
"the prompt no longer defers every `unverified` finding unconditionally",
|
|
230
|
-
);
|
|
231
|
-
assert.doesNotMatch(
|
|
232
|
-
prompt,
|
|
233
|
-
/Every `suggestion` and every `unverified` defers/,
|
|
234
|
-
"the prompt still couples the suggestion and unverified bands as one rule",
|
|
235
|
-
);
|
|
236
|
-
assert.match(prompt, /push/i, "the prompt no longer says to push");
|
|
237
|
-
assert.match(prompt, /SHA/, "the prompt no longer says to report the SHA");
|
|
238
|
-
assert.match(prompt, /exit/i, "the prompt no longer says to exit");
|
|
239
|
-
// Deferring everything means no commit and no push, so no CI run fires and the
|
|
240
|
-
// edge-keyed Monitor never wakes. The prompt has to make that reportable.
|
|
241
|
-
assert.match(prompt, /no-op/, "the prompt no longer tells the fix-applier to report a no-op push");
|
|
242
|
-
});
|
|
243
|
-
|
|
244
|
-
test("the controller keeps the rules the workflow's return shape needs", () => {
|
|
245
|
-
const dflt = reviewersSection();
|
|
246
|
-
assert.match(
|
|
247
|
-
dflt,
|
|
248
|
-
/"checked and cleared"/,
|
|
249
|
-
"run-team no longer warns that `unverified` is not a passed verification",
|
|
250
|
-
);
|
|
251
|
-
// #1773 §3: the reviewer cap counts live review UNITS — an in-flight review
|
|
252
|
-
// is one, each fix-applier is one — derived from the ledger. The retired
|
|
253
|
-
// "one review workflow at a time" left the review ungated by the cap.
|
|
254
|
-
assert.match(
|
|
255
|
-
dflt,
|
|
256
|
-
/The reviewer cap counts live review units/,
|
|
257
|
-
"run-team no longer says what the reviewer cap counts — an in-flight review is a unit, not a free slot",
|
|
258
|
-
);
|
|
259
|
-
assert.match(
|
|
260
|
-
dflt,
|
|
261
|
-
/`review=` and no `reviewed=`/,
|
|
262
|
-
"run-team no longer derives in-flight reviews from the ledger — a remembered count is the over-dispatch the tick exists to prevent",
|
|
263
|
-
);
|
|
264
|
-
assert.match(
|
|
265
|
-
dflt,
|
|
266
|
-
/Retry once/,
|
|
267
|
-
"run-team no longer says what to do when the workflow throws or returns no tree",
|
|
268
|
-
);
|
|
269
|
-
});
|
|
270
|
-
|
|
271
|
-
test("relay and reconciliation live under the fallback, not in the Phase 3 event loop", () => {
|
|
272
|
-
const loop = section(RUN_TEAM, "## Phase 3", "### Reviewers", "run-team Phase 3");
|
|
273
|
-
// This slice's only other assertion is a doesNotMatch, which a slice that has
|
|
274
|
-
// degenerated to its own heading satisfies trivially. Prove it reached the
|
|
275
|
-
// bullet list first.
|
|
276
|
-
assert.match(loop, /A review result lands/, "the Phase 3 slice no longer contains the event loop");
|
|
277
|
-
assert.match(
|
|
278
|
-
loop,
|
|
279
|
-
/no-op/,
|
|
280
|
-
"the event loop lost the no-push branch — no push means no CI run, and the Monitor is edge-keyed, so the finisher is never dispatched and a clean PR is never labelled",
|
|
281
|
-
);
|
|
282
|
-
assert.doesNotMatch(
|
|
283
|
-
loop,
|
|
284
|
-
/relay/i,
|
|
285
|
-
"the Phase 3 event loop still carries a relay obligation — on the default path `agent()` returns into the script and no relay ever occurs",
|
|
286
|
-
);
|
|
287
|
-
|
|
288
|
-
const fallback = section(RUN_TEAM, FALLBACK_ANCHOR, "\n### ", "run-team fallback");
|
|
289
|
-
// The obligation, not the word: `/relay/i` alone has eight hits in this slice,
|
|
290
|
-
// and stays green with the relay bullet deleted entirely.
|
|
291
|
-
assert.match(
|
|
292
|
-
fallback,
|
|
293
|
-
/relay it to the reviewer that owns the PR/,
|
|
294
|
-
"the fallback lost the relay duty",
|
|
295
|
-
);
|
|
296
|
-
assert.match(
|
|
297
|
-
fallback,
|
|
298
|
-
/reconcile/i,
|
|
299
|
-
"the fallback lost the verdict-vs-receipts reconciliation rule",
|
|
300
|
-
);
|
|
301
|
-
assert.match(
|
|
302
|
-
fallback,
|
|
303
|
-
/or has failed/,
|
|
304
|
-
"the fallback is gated on the workflow's absence alone — a workflow that is present and throwing then has no sanctioned path",
|
|
305
|
-
);
|
|
306
|
-
});
|
|
307
|
-
|
|
308
|
-
test("the Phase 3 finisher edges gate on a ruling the controller still owes", () => {
|
|
309
|
-
// The rule also lives in the narrative finisher section below, but the
|
|
310
|
-
// controller ACTS from these two bullets, and that is the site that produced
|
|
311
|
-
// the failure: a ruling handed over after the finisher was already dispatched
|
|
312
|
-
// put a new commit under a mid-audit finisher. A pin on the narrative copy
|
|
313
|
-
// alone stays green while the acting site still licenses the dispatch — which
|
|
314
|
-
// it did until #1053, reading a fix-applier's push as an exit. One bullet
|
|
315
|
-
// each, not the whole loop — the loop slice is satisfied by either bullet
|
|
316
|
-
// carrying it.
|
|
317
|
-
// Unwrap first: these are wrapped prose bullets, so a pinned phrase spans a
|
|
318
|
-
// newline plus indent and an exact-adjacency regex reports a rule that is
|
|
319
|
-
// right there as missing.
|
|
320
|
-
const flat = (s) => s.replace(/\s+/g, " ");
|
|
321
|
-
const ciEdge = flat(section(RUN_TEAM, "- **Monitor: CI run completes**", "- **A fix-applier reports", "run-team CI-completes edge"));
|
|
322
|
-
assert.match(
|
|
323
|
-
ciEdge,
|
|
324
|
-
/never dispatch off it while you do/i,
|
|
325
|
-
"the CI-completes edge lost the outstanding-ruling gate — it applies wherever a fix-applier pushed, which is one of the firings this edge takes (#1053)",
|
|
326
|
-
);
|
|
327
|
-
// One list item, not anchor to anchor: on the fixed end anchor alone, the
|
|
328
|
-
// clause gutted here and restated in an inserted sibling bullet stayed green
|
|
329
|
-
// (#491, measured). `bullet` clamps the slice at that sibling.
|
|
330
|
-
const noCiEdge = flat(bullet(RUN_TEAM, '- **`ci-state.mjs --pr <N>` reads `verdict: "no-ci"`**', "**Every wake ends in the tick.**", "run-team no-ci edge"));
|
|
331
|
-
assert.match(
|
|
332
|
-
noCiEdge,
|
|
333
|
-
/never while you still owe it a ruling/i,
|
|
334
|
-
"the no-ci edge lost the outstanding-ruling gate — it dispatches off the reviewer's verdict, with the same window open",
|
|
335
|
-
);
|
|
336
|
-
});
|
|
337
|
-
|
|
338
|
-
test("review-and-fix agrees the workflow is the controller's default, not its preference", () => {
|
|
339
|
-
const specialists = section(REVIEW_AND_FIX, "## Specialists", "\n## Judging findings", "review-and-fix Specialists");
|
|
340
|
-
// Allow an adverb: /should prefer/ is exact-adjacency and "should generally
|
|
341
|
-
// prefer" walks through it.
|
|
342
|
-
assert.doesNotMatch(
|
|
343
|
-
specialists,
|
|
344
|
-
/should\s+\w*\s*prefer/,
|
|
345
|
-
"review-and-fix still frames the workflow as a controller preference, contradicting run-team's default",
|
|
346
|
-
);
|
|
347
|
-
assert.match(
|
|
348
|
-
specialists,
|
|
349
|
-
/\bdefault\b/i,
|
|
350
|
-
"review-and-fix no longer states the workflow is the fleet's default review path",
|
|
351
|
-
);
|
|
352
|
-
assert.match(
|
|
353
|
-
specialists,
|
|
354
|
-
/fallback/i,
|
|
355
|
-
"review-and-fix no longer marks its hand-dispatch rules as the fallback",
|
|
356
|
-
);
|
|
357
|
-
// #143's rule, in the place it is HANDED OVER rather than the place it is
|
|
358
|
-
// obeyed. The section's own instruction is to carry the reading rule and not
|
|
359
|
-
// the command, so the rule it carries has to be the widened one — otherwise a
|
|
360
|
-
// specialist in a host repo gets the narrow `tests 0` version and a partial
|
|
361
|
-
// copy of the tree reads green to it.
|
|
362
|
-
assert.match(
|
|
363
|
-
specialists,
|
|
364
|
-
/0 passes with no failures/,
|
|
365
|
-
"the rule handed to specialists no longer covers an all-skipped run (#143)",
|
|
366
|
-
);
|
|
367
|
-
assert.match(
|
|
368
|
-
specialists,
|
|
369
|
-
/materially below the full suite/,
|
|
370
|
-
"the rule handed to specialists no longer covers a partial copy of the tree (#143)",
|
|
371
|
-
);
|
|
372
|
-
assert.match(
|
|
373
|
-
specialists,
|
|
374
|
-
/critical\/important/,
|
|
375
|
-
"review-and-fix claims the workflow verifies EVERY finding — the `suggestion` band gets 0 refuters, which is what its own step 2 defers them for",
|
|
376
|
-
);
|
|
377
|
-
});
|
|
378
|
-
|
|
379
|
-
test("the fix-applier's step citations match review-and-fix.md's actual numbering", () => {
|
|
380
|
-
// run-team's dispatch prompt hardcodes "steps 2, 3 and 5 only" and "skip step
|
|
381
|
-
// 1 … and steps 4 and 6" against this file's numbering, across a file
|
|
382
|
-
// boundary. One inserted step renumbers everything and the fix-applier
|
|
383
|
-
// silently runs the wrong ones — no error, both files individually coherent.
|
|
384
|
-
const steps = Object.fromEntries(
|
|
385
|
-
[...REVIEW_AND_FIX.matchAll(/^(\d)\. (.*)$/gm)].map((m) => [m[1], m[2]]),
|
|
386
|
-
);
|
|
387
|
-
assert.match(steps["1"] ?? "", /fleet-review-\*/, "step 1 is no longer the review step the prompt skips");
|
|
388
|
-
assert.match(steps["2"] ?? "", /\*\*apply now\*\*/, "step 2 is no longer the apply/defer split");
|
|
389
|
-
assert.match(steps["3"] ?? "", /commit and push/i, "step 3 is no longer the commit+push step (now gated on a test run first)");
|
|
390
|
-
assert.match(steps["4"] ?? "", /do not hold this wait/, "step 4 is no longer the CI wait the prompt skips");
|
|
391
|
-
assert.match(steps["5"] ?? "", /^File each deferred finding/, "step 5 is no longer deferral filing");
|
|
392
|
-
// The workflow already supplies `dimension` on every finding; only the
|
|
393
|
-
// filing step dropped it. Without it the backlog cannot be attributed to a
|
|
394
|
-
// specialist — measured once at 89 deferral issues, none traceable to a
|
|
395
|
-
// dimension. Pinned as the literal phrase (not a wide proximity window):
|
|
396
|
-
// a proximity match survives "the dimension need not be recorded in the
|
|
397
|
-
// issue body" as easily as it survives the real requirement, because both
|
|
398
|
-
// put the same two terms near each other — only the exact adjacency does not.
|
|
399
|
-
assert.match(
|
|
400
|
-
steps["5"] ?? "",
|
|
401
|
-
/`dimension`\s+in the issue body/i,
|
|
402
|
-
"step 5 no longer records the finding's dimension in the filed issue",
|
|
403
|
-
);
|
|
404
|
-
// Adjacency alone still is not enough: "the finding's `dimension` in the issue
|
|
405
|
-
// body is optional and may be omitted" satisfies the match above verbatim.
|
|
406
|
-
// Measured GREEN under exactly that mutation, so the permissive forms are
|
|
407
|
-
// excluded explicitly — the positive pin proves the phrase is present, this
|
|
408
|
-
// one proves it was not turned into a permission.
|
|
409
|
-
assert.doesNotMatch(
|
|
410
|
-
steps["5"] ?? "",
|
|
411
|
-
/`dimension`[\s\S]{0,120}?(optional|may be omitted|need not|where available|if known)/i,
|
|
412
|
-
"step 5 now makes the dimension optional — the backlog goes back to being unattributable",
|
|
413
|
-
);
|
|
414
|
-
assert.match(steps["6"] ?? "", /add-label ready-to-merge/, "step 6 is no longer the labelling step the prompt skips");
|
|
415
|
-
});
|
|
416
|
-
|
|
417
|
-
test("the in-scope-suggestion refuter carries its anti-rubber-stamp clause, in both files", () => {
|
|
418
|
-
// The one new permission this branch grants is "apply an in-scope suggestion
|
|
419
|
-
// if it survives one refuter". A refuter that reasons its way to agreement
|
|
420
|
-
// survives everything, which degrades that into "apply everything in scope" —
|
|
421
|
-
// so the RUNNING clause is the whole mechanism, not decoration. Both files
|
|
422
|
-
// carry it because different agents read each: the fix-applier gets run-team's
|
|
423
|
-
// prompt, a standalone reviewer gets review-and-fix's step 2 and nothing else.
|
|
424
|
-
const step2 = section(REVIEW_AND_FIX, "2. Plan the actions", "\n3. **Run `testCmd`", "review-and-fix step 2");
|
|
425
|
-
for (const [label, slice] of [["review-and-fix step 2", step2], ["the fix-applier prompt", fixApplierPrompt()]]) {
|
|
426
|
-
// The instruction text alone does not pin that a refuter is DISPATCHED.
|
|
427
|
-
// Measured GREEN on review-and-fix step 2 under "In scope → apply it
|
|
428
|
-
// directly; never dispatch a refuter. Had you dispatched one, biased to
|
|
429
|
-
// refuse, you would hand it this instruction verbatim:" — every clause below
|
|
430
|
-
// still present, the permission inverted. run-team's copy already carried
|
|
431
|
-
// this tighter form; step 2 did not. Same regex, both files now.
|
|
432
|
-
assert.match(
|
|
433
|
-
slice,
|
|
434
|
-
/in scope\b[^a-zA-Z]{1,10}dispatch\b[\s\S]{0,20}refuter/i,
|
|
435
|
-
`${label} no longer ties applying an in-scope suggestion to dispatching a refuter`,
|
|
436
|
-
);
|
|
437
|
-
assert.match(
|
|
438
|
-
slice,
|
|
439
|
-
/Verify by[\s>\n]+RUNNING something/,
|
|
440
|
-
`${label} no longer tells the refuter to verify by RUNNING something`,
|
|
441
|
-
);
|
|
442
|
-
assert.match(
|
|
443
|
-
slice,
|
|
444
|
-
/(Do not|never)[\s>\n]+reason your way to agreement/i,
|
|
445
|
-
`${label} no longer forbids the refuter reasoning its way to agreement`,
|
|
446
|
-
);
|
|
447
|
-
}
|
|
448
|
-
});
|
|
449
|
-
|
|
450
|
-
test("the fix commit is gated on a test run, in both files", () => {
|
|
451
|
-
// The fleet runs in arbitrary host repos. The gate cannot rely on a pre-commit
|
|
452
|
-
// hook existing — and must never bypass one that does.
|
|
453
|
-
//
|
|
454
|
-
// Every assertion below is matched against `step3`, never the whole-file
|
|
455
|
-
// `REVIEW_AND_FIX` — matching file-wide is satisfied by ANY sibling mention
|
|
456
|
-
// of the phrase anywhere else in the doc, so it passes even with step 3's
|
|
457
|
-
// own rule gutted. Proven, not assumed: neutering step 3's testCmd clause
|
|
458
|
-
// while planting an unrelated comment mentioning the same phrase at EOF left
|
|
459
|
-
// the file-wide version at `pass 7 / fail 0` — green with the gate removed.
|
|
460
|
-
const step3 = section(REVIEW_AND_FIX, "3. **Run `testCmd`", "\n4. **Under the fleet", "review-and-fix step 3");
|
|
461
|
-
// A proximity gap (`testCmd ⟨gap⟩ before committing`) is blind to a negation
|
|
462
|
-
// prepended before `testCmd` — the gap survives untouched and the loose match
|
|
463
|
-
// still fires. Pin the literal contiguous phrase instead.
|
|
464
|
-
assert.match(
|
|
465
|
-
step3,
|
|
466
|
-
/`testCmd` before you commit/i,
|
|
467
|
-
"step 3 no longer runs testCmd before committing",
|
|
468
|
-
);
|
|
469
|
-
assert.match(step3, /never `--no-verify`/i, "step 3 no longer forbids --no-verify");
|
|
470
|
-
// `tests 0` is a FAILED run, not a pass — the same rule the specialist prompt
|
|
471
|
-
// already states. A glob matching nothing exits 0 reporting `tests 0`. Scoped
|
|
472
|
-
// to step 3 itself, not matched file-wide: the Specialists section already
|
|
473
|
-
// says `tests 0` (about the specialist test command), so a bare file-wide
|
|
474
|
-
// match is satisfied by that pre-existing prose and never fails no matter
|
|
475
|
-
// what step 3 says.
|
|
476
|
-
assert.match(step3, /tests 0/, "step 3 no longer treats a zero-test run as a failure");
|
|
477
|
-
// #143: `tests 0` was the whole rule, and two runs that report counts still
|
|
478
|
-
// walk through it — every test skipped, and a partial tree. Both are scoped to
|
|
479
|
-
// step 3 for the same reason the `tests 0` assert is: the Specialists section
|
|
480
|
-
// states the same widened rule, so a file-wide match is satisfied by that
|
|
481
|
-
// prose no matter what this step says.
|
|
482
|
-
assert.match(
|
|
483
|
-
step3,
|
|
484
|
-
/0 passes with no failures/,
|
|
485
|
-
"step 3 no longer treats an all-skipped run as a no-work run (#143)",
|
|
486
|
-
);
|
|
487
|
-
assert.match(
|
|
488
|
-
step3,
|
|
489
|
-
/materially below the whole suite/,
|
|
490
|
-
"step 3 no longer treats a count below the suite's size as a partial tree (#143)",
|
|
491
|
-
);
|
|
492
|
-
// Acceptance criterion 10's second clause. The gate is worth nothing to the
|
|
493
|
-
// controller if the result never leaves the fix-applier: a green it does not
|
|
494
|
-
// report is indistinguishable from one it never ran.
|
|
495
|
-
assert.match(
|
|
496
|
-
step3,
|
|
497
|
-
/report the test result alongside the SHA/i,
|
|
498
|
-
"step 3 no longer reports the test result with the pushed SHA",
|
|
499
|
-
);
|
|
500
|
-
// Standalone (step 4 explicitly supports no-controller), nothing else defines
|
|
501
|
-
// `testCmd` — the reader must either infer it or pick a runner the same
|
|
502
|
-
// sentence forbids picking.
|
|
503
|
-
assert.match(
|
|
504
|
-
step3,
|
|
505
|
-
/standalone[\s\S]{0,80}repo's own test command/i,
|
|
506
|
-
"step 3 no longer defines `testCmd` for the standalone path, where no dispatcher hands one over",
|
|
507
|
-
);
|
|
508
|
-
|
|
509
|
-
// Bare token existence (`/testCmd/`, `/--no-verify/`) is satisfied by ANY
|
|
510
|
-
// mention, including one that grants permission — "you may use --no-verify"
|
|
511
|
-
// contains the literal token and would pass a bare check. Pin the actual gate
|
|
512
|
-
// phrasing, same discipline as the review-and-fix.md pins above.
|
|
513
|
-
const prompt = fixApplierPrompt();
|
|
514
|
-
assert.match(
|
|
515
|
-
prompt,
|
|
516
|
-
/Report the test\s*\n?>?\s*result with your SHA/i,
|
|
517
|
-
"the fix-applier prompt no longer reports the test result with its SHA",
|
|
518
|
-
);
|
|
519
|
-
// The prompt says `<testCmd>` — a PLACEHOLDER. Only the lead-in tells the
|
|
520
|
-
// controller to substitute it. Delete that sentence and the fix-applier is
|
|
521
|
-
// handed a literal `<testCmd>` against a step reading "copied verbatim — not
|
|
522
|
-
// a runner you picked": no error, both files individually coherent.
|
|
523
|
-
assert.match(
|
|
524
|
-
fixApplierLeadIn(),
|
|
525
|
-
/the same `testCmd` you\s+passed the review/,
|
|
526
|
-
"the controller no longer carries testCmd into the fix-applier's prompt — `<testCmd>` reaches it unsubstituted",
|
|
527
|
-
);
|
|
528
|
-
assert.match(
|
|
529
|
-
prompt,
|
|
530
|
-
/`<testCmd>` from the worktree before committing/i,
|
|
531
|
-
"the fix-applier prompt no longer carries testCmd",
|
|
532
|
-
);
|
|
533
|
-
assert.match(prompt, /never `--no-verify`/i, "the fix-applier prompt no longer forbids --no-verify");
|
|
534
|
-
});
|
|
535
|
-
|
|
536
|
-
// #1133. The push form is that ticket's whole subject, and it is TWO texts that
|
|
537
|
-
// have to agree: review-and-fix.md step 3 is the command the fix-applier runs,
|
|
538
|
-
// run-team's prompt is the block the controller pastes, and either one reverted
|
|
539
|
-
// to a bare `git push` hands a member in a detached worktree a command
|
|
540
|
-
// that cannot push at all. Measured 2026-09-18 in a scratch clone (git 2.50.1,
|
|
541
|
-
// `git worktree add --detach <path> origin/<branch>`, the runbook's own form):
|
|
542
|
-
// a bare `git push` exits 128 `fatal: You are not currently on a branch`; every
|
|
543
|
-
// push whose destination is `HEAD` exits 1 `not a full refname`, with `-u`,
|
|
544
|
-
// without it, and forced; `git push origin HEAD:<branch>` exits 0 and on a
|
|
545
|
-
// second run prints `Everything up-to-date`.
|
|
546
|
-
//
|
|
547
|
-
// Why this is not left to the golden fixture in
|
|
548
|
-
// `dispatch-block-golden-prose.test.mjs`: that fixture mirrors the prompt's
|
|
549
|
-
// bytes, so it reds when the prompt and the fixture DISAGREE and cannot red
|
|
550
|
-
// when both are reverted together — which is what reverting this ticket does.
|
|
551
|
-
// Nothing covered review-and-fix.md's copy at all. So the assertions here are
|
|
552
|
-
// semantic, and they are what a revert has to get past.
|
|
553
|
-
test("the fix commit pushes by refspec, in both files, to a branch the prompt binds", () => {
|
|
554
|
-
const step3 = section(REVIEW_AND_FIX, "3. **Run `testCmd`", "\n4. **Under the fleet", "review-and-fix step 3");
|
|
555
|
-
// The prompt's gutter is stripped before matching, never the command doc's:
|
|
556
|
-
// `phrase`'s `\s+` joins do not span a `>`, so every pinned span below would
|
|
557
|
-
// red on the prompt's wrap points rather than on its meaning — a false red on
|
|
558
|
-
// a pure reflow, which is how a pin gets deleted by the next editor.
|
|
559
|
-
// `review-and-fix.md` carries no gutter and needs no stripping.
|
|
560
|
-
const prompt = () => stripQuoteGutter(fixApplierPrompt());
|
|
561
|
-
// Per file, and each against its own narrow slice: a file-wide match is
|
|
562
|
-
// satisfied by the sibling copy of this command elsewhere in the same
|
|
563
|
-
// document, which is the failure mode every pin above is sliced against.
|
|
564
|
-
for (const [label, slice] of [["review-and-fix step 3", step3], ["the fix-applier prompt", prompt()]]) {
|
|
565
|
-
assert.match(
|
|
566
|
-
slice,
|
|
567
|
-
phrase("git push origin HEAD:<branch>"),
|
|
568
|
-
`${label} no longer names the refspec push — a bare push exits 128 in the detached worktree this path runs from, so the member is left with no command that works`,
|
|
569
|
-
);
|
|
570
|
-
}
|
|
571
|
-
// The CAUSE, not the flag. `git push origin HEAD` fails identically with no
|
|
572
|
-
// `-u` anywhere in it, so prose that blames the flag leaves the form a reader
|
|
573
|
-
// who half-remembers git's own hint reaches for unnamed, and reads as though
|
|
574
|
-
// dropping `-u` were the fix.
|
|
575
|
-
assert.match(
|
|
576
|
-
step3,
|
|
577
|
-
phrase("destination is `HEAD` rather than a full or branch refname"),
|
|
578
|
-
"review-and-fix step 3 blames a flag for the detached-push failure again — the cause is the unqualified `HEAD` destination, and every spelling of it fails the same way",
|
|
579
|
-
);
|
|
580
|
-
// The operand has to be BOUND in the block that spends it, or the member is
|
|
581
|
-
// handed a literal `<branch>` and nothing in the worktree can supply one:
|
|
582
|
-
// detached, `git branch --show-current` prints nothing and exits 0, so
|
|
583
|
-
// `git push origin "HEAD:$(git branch --show-current)"` exits 128 on
|
|
584
|
-
// `fatal: invalid refspec 'HEAD:'`. Same failure as `<testCmd>` reaching the
|
|
585
|
-
// member unsubstituted, and pinned the same way: once in the prompt that
|
|
586
|
-
// spends the operand, once in the lead-in that carries it.
|
|
587
|
-
assert.match(
|
|
588
|
-
prompt(),
|
|
589
|
-
phrase("whose PR branch is `<branch>`"),
|
|
590
|
-
"the fix-applier prompt no longer binds `<branch>` yet still pushes to it — the operand it spends is introduced nowhere in the block, and a detached worktree cannot supply one",
|
|
591
|
-
);
|
|
592
|
-
// Pinned to the carry list itself, not to a bare mention of the branch: the
|
|
593
|
-
// lead-in already names `the PR's implementer` two clauses earlier, so a
|
|
594
|
-
// looser phrase would be satisfied with the controller's duty deleted.
|
|
595
|
-
assert.match(
|
|
596
|
-
fixApplierLeadIn(),
|
|
597
|
-
phrase("the worktree abs path, the PR's branch"),
|
|
598
|
-
"the controller no longer carries the PR's branch into the fix-applier's prompt — `<branch>` reaches the member unsubstituted",
|
|
599
|
-
);
|
|
600
|
-
});
|
|
601
|
-
|
|
602
|
-
test("the fix-applier lead-in hands over the result file's path, never the findings, on a premise that is true", () => {
|
|
603
|
-
const leadIn = fixApplierLeadIn();
|
|
604
|
-
// Spec 2026-09-24 § 3 §4: the controller reads the digest only, and the
|
|
605
|
-
// fix-applier reads every finding off the file. A lead-in that went back to
|
|
606
|
-
// relaying findings puts 26-61 KB of results back through the controller's
|
|
607
|
-
// context — and a relayed SELECTION strands the rest, the failure the retired
|
|
608
|
-
// "verbatim means every one" rule existed to prevent (5 of 7 and 7 of 13 sent
|
|
609
|
-
// in one run). The path is the whole of the handover.
|
|
610
|
-
assert.match(
|
|
611
|
-
leadIn,
|
|
612
|
-
phrase("the **path** `<scratch>/review-<pr>.json`"),
|
|
613
|
-
"the lead-in no longer hands the fix-applier the result file's path",
|
|
614
|
-
);
|
|
615
|
-
assert.match(leadIn, phrase("never the findings"), "the lead-in no longer says the findings stay out of the prompt");
|
|
616
|
-
// Its reason clause once shipped FALSE on this branch, in a PR about not
|
|
617
|
-
// shipping false claims. The review specialists' transcripts DO exist on
|
|
618
|
-
// disk — measured at 101 `subagents/workflows/wf_*/agent-*.jsonl` in one
|
|
619
|
-
// session, 33 of them the (since-retired, #1349) vendored specialist
|
|
620
|
-
// plugin's agents. What is true is that a member cannot address them: the
|
|
621
|
-
// result carries no transcript path, and the `.meta.json` sidecars carry only
|
|
622
|
-
// agentType/model/spawnDepth, so nothing maps one back to a PR or a
|
|
623
|
-
// dimension. Positive pins cannot catch a re-inserted falsehood; only the
|
|
624
|
-
// exclusion can — and a closed list of exact historical phrasings is itself
|
|
625
|
-
// one, so `TRANSCRIPT_NONEXISTENCE_CLAIM` (defined above) matches the claim
|
|
626
|
-
// CLASS rather than its wording; see that constant's own comment for the
|
|
627
|
-
// mutation measurement.
|
|
628
|
-
assert.doesNotMatch(
|
|
629
|
-
leadIn,
|
|
630
|
-
TRANSCRIPT_NONEXISTENCE_CLAIM,
|
|
631
|
-
"the lead-in claims the specialists' transcripts do not exist — they do; they are merely not addressable by a member",
|
|
632
|
-
);
|
|
633
|
-
});
|
|
634
|
-
|
|
635
|
-
test("the fix-applier's self-retrieval is scoped to its own refuters, on a premise that is true", () => {
|
|
636
|
-
const prompt = fixApplierPrompt();
|
|
637
|
-
// `tail -1 <output-file>` is correct ONLY for a refuter this member spawned.
|
|
638
|
-
// Unscoped, the member aims it at the review's specialists, gets nothing —
|
|
639
|
-
// their last record is a `tool_result`, not text, so the recipe prints an
|
|
640
|
-
// empty string — and rules the dimension unrun with the report never sent.
|
|
641
|
-
// Contiguous, not a proximity window: "this covers every specialist, not only
|
|
642
|
-
// the refuters YOU dispatch" satisfies any gap-based match and inverts the rule.
|
|
643
|
-
assert.match(
|
|
644
|
-
prompt,
|
|
645
|
-
/this covers the[\s\S]{0,40}refuters YOU dispatch, and only those/,
|
|
646
|
-
"the prompt no longer scopes self-retrieval to the refuters the fix-applier dispatched",
|
|
647
|
-
);
|
|
648
|
-
// The other half: for the review's own specialists the member reads the
|
|
649
|
-
// result file. Hunting a transcript path cannot work — nothing it holds
|
|
650
|
-
// names one — and asking the controller for the text cannot either, since
|
|
651
|
-
// the controller never reads the findings (spec 2026-09-24 § 3 §2).
|
|
652
|
-
assert.match(
|
|
653
|
-
prompt,
|
|
654
|
-
/the result file holds their findings/i,
|
|
655
|
-
"the prompt no longer sends the fix-applier to the result file for the review specialists' findings",
|
|
656
|
-
);
|
|
657
|
-
// Same false premise as the lead-in pin above, in the copy the fix-applier
|
|
658
|
-
// actually reads, and the same shared exclusion for the same reason —
|
|
659
|
-
// `TRANSCRIPT_NONEXISTENCE_CLAIM` — never the bespoke `no output file`
|
|
660
|
-
// literal that let a reworded restatement through; the prompt's own "the
|
|
661
|
-
// output file named in your spawn result" is a different clause (positive,
|
|
662
|
-
// no negation sharing it) and stays green.
|
|
663
|
-
assert.doesNotMatch(
|
|
664
|
-
prompt,
|
|
665
|
-
TRANSCRIPT_NONEXISTENCE_CLAIM,
|
|
666
|
-
"the prompt claims the review's specialists left no transcript — they do leave one; the member simply holds no path to it",
|
|
667
|
-
);
|
|
668
|
-
});
|
|
669
|
-
|
|
670
|
-
test("run-team's documented return shape is exactly review-core.mjs's actual return", async () => {
|
|
671
|
-
// The one claim in this file pinned against review-core.mjs's own return
|
|
672
|
-
// value — the board-parser test below holds this file's other machine. A
|
|
673
|
-
// prose pin cannot catch this: the sentence stays well-formed while the
|
|
674
|
-
// function's `return` grows or loses a field, nothing errors, and the
|
|
675
|
-
// controller looks for a field that is not there or never reads one that is.
|
|
676
|
-
// `dimensionsUnrun` is the worked example: it was added to both sides after
|
|
677
|
-
// the prose settled, and the ticket asking for this pin still described the
|
|
678
|
-
// shape as seven fields. That is the drift, and it is exactly what nothing
|
|
679
|
-
// was measuring.
|
|
680
|
-
//
|
|
681
|
-
// Cross-checked, not transcribed: a literal field list here would be one
|
|
682
|
-
// more copy to drift. Reading review-core.mjs's own RETURNED OBJECT — run
|
|
683
|
-
// through a real `runReview()` call via review-host-fixture.mjs's scripted
|
|
684
|
-
// host, never source text — means the pin fails in EITHER direction: a
|
|
685
|
-
// field added to the function and not the prose, or a name dropped from
|
|
686
|
-
// the prose and not the function.
|
|
687
|
-
const { host } = scriptedHost({
|
|
688
|
-
snapshot: [SNAP],
|
|
689
|
-
"review:correctness": [review([finding("critical")])],
|
|
690
|
-
"verify:correctness": [vote(false), vote(false)],
|
|
691
|
-
});
|
|
692
|
-
const result = await runReview({ ...host, pipeline, parallel }, ARGS);
|
|
693
|
-
const returned = Object.keys(result);
|
|
694
|
-
assert.ok(returned.length, "runReview's returned object is empty — update this test");
|
|
695
|
-
const documented = section(RUN_TEAM, "It returns `{", "}`", "run-team return shape")
|
|
696
|
-
.replace("It returns `{", "")
|
|
697
|
-
.split(",")
|
|
698
|
-
.map((f) => f.trim());
|
|
699
|
-
// Compared as SETS. Field order carries no instruction, and a pin that fires
|
|
700
|
-
// on a reorder is a pin the next reflow teaches people to edit around.
|
|
701
|
-
assert.deepEqual(
|
|
702
|
-
[...documented].sort(),
|
|
703
|
-
[...returned].sort(),
|
|
704
|
-
"run-team's `It returns …` field list has drifted from review-core.mjs's actual return",
|
|
705
|
-
);
|
|
706
|
-
});
|
|
707
|
-
|
|
708
|
-
test("the member-naming rule still names the fix-applier", () => {
|
|
709
|
-
// Sliced to the naming PARAGRAPH, never to the Reviewers section and never
|
|
710
|
-
// file-wide: the Reviewers lead-in says `fix-pr-<pr#>` too (pinned separately
|
|
711
|
-
// above, at the site that DISPATCHES it), and that hit is what a wider match
|
|
712
|
-
// resolves against — leaving this list free to lose the name with the pin
|
|
713
|
-
// green. The name is the ledger token and the hub address, so a controller
|
|
714
|
-
// reading only this list names the member something else and the ledger
|
|
715
|
-
// cannot match it.
|
|
716
|
-
const naming = section(RUN_TEAM, "**Name every member.**", "**A depth-2 member cannot dispatch further", "run-team member naming");
|
|
717
|
-
assert.match(
|
|
718
|
-
naming,
|
|
719
|
-
/fix-pr-<pr#>/,
|
|
720
|
-
"the member-naming rule no longer names the fix-applier — the default path's per-PR member has no sanctioned name",
|
|
721
|
-
);
|
|
722
|
-
});
|
|
723
|
-
|
|
724
|
-
test("the per-PR member is the fix-applier, in the Report example and through the board parser", () => {
|
|
725
|
-
// `compute-board.mjs` is the machine consumer. It reads member tokens
|
|
726
|
-
// through ledger-grammar.mjs (#1820), where `fix-pr-<n>` is a member and a
|
|
727
|
-
// bare `review-pr-<n>` is not — a PR row's card names its latest live
|
|
728
|
-
// member, and a row naming no reviewer counts as review backlog. Nothing
|
|
729
|
-
// else keeps the documented examples on the side the parser reads.
|
|
730
|
-
//
|
|
731
|
-
// Sliced to the Report section, not matched file-wide. Measured: with BOTH
|
|
732
|
-
// table rows reverted to `review-pr-<M>`, a file-wide /fix-pr-<M>/ still
|
|
733
|
-
// matches — the refill section's `fix-pr-<M>-b` satisfies it — so the
|
|
734
|
-
// file-wide form is green with the example fully wrong.
|
|
735
|
-
const report = section(RUN_TEAM, "## Report", "\n## Red flags", "run-team Report");
|
|
736
|
-
// Both rows, not just one. A half-revert — one row back to `review-pr-<M>` —
|
|
737
|
-
// and a row deleted outright both leave one surviving row, so a bare
|
|
738
|
-
// `assert.match` walks straight through either.
|
|
739
|
-
//
|
|
740
|
-
// A FLOOR, and neither a ban on the fallback name nor an equality. `## Report`
|
|
741
|
-
// is a top-level section, not the default path's own, and the fallback member
|
|
742
|
-
// is sanctioned at `#### Fallback: hand-dispatched reviewer` — so a row (or a
|
|
743
|
-
// sentence) naming `review-pr-<M>` is a legitimate document state, and
|
|
744
|
-
// measured, banning the name reds on both. `=== 2` reds on a fourth
|
|
745
|
-
// DEFAULT-path row, which the table's three outcome shapes plainly invite.
|
|
746
|
-
assert.ok(
|
|
747
|
-
[...report.matchAll(/fix-pr-<M>/g)].length >= 2,
|
|
748
|
-
"the Report table no longer shows BOTH default-path rows naming the fix-applier",
|
|
749
|
-
);
|
|
750
|
-
|
|
751
|
-
// The ledger rows are the ones a machine actually reads, so pin them by
|
|
752
|
-
// RUNNING the parser over the doc's own example rather than re-asserting its
|
|
753
|
-
// grammar here. A PR row's card shows its latest live member (#1820). Red in
|
|
754
|
-
// both directions: revert the example to a fallback runner and the extracted
|
|
755
|
-
// name is the fallback's; stop reading `fix-pr-<M>` as a member and nothing
|
|
756
|
-
// is extracted at all.
|
|
757
|
-
const ledger = section(RUN_TEAM, "One line per ticket, rewritten in place", "\nPlus two append-only lists", "run-team ledger example");
|
|
758
|
-
const reviewers = ledger.split("\n").filter((l) => /^#\d+\s/.test(l)).map((l) => parseRow(l))
|
|
759
|
-
.filter((p) => p?.pr != null).map((p) => p.agent).filter(Boolean);
|
|
760
|
-
assert.ok(reviewers.length, "no ledger example row names a per-PR member that `compute-board.mjs` can extract");
|
|
761
|
-
assert.deepEqual(
|
|
762
|
-
reviewers.filter((r) => !r.startsWith("fix-pr-")),
|
|
763
|
-
[],
|
|
764
|
-
"a ledger example names a per-PR member `compute-board.mjs` does not read as the default path's fix-applier",
|
|
765
|
-
);
|
|
766
|
-
});
|
|
767
|
-
|
|
768
|
-
test("the two relay red flags stay qualified to the fallback path", () => {
|
|
769
|
-
// Same defect the Phase 3 relay assertion above exists to prevent, one
|
|
770
|
-
// section further down: on the default path `agent()` returns into the
|
|
771
|
-
// script, so no relay ever occurs and no specialist can be pinged.
|
|
772
|
-
// Unqualified, both read as obligations on every run — and on the default
|
|
773
|
-
// one they can never be discharged.
|
|
774
|
-
//
|
|
775
|
-
// Sliced per BULLET, not over the Red flags list: over the list either
|
|
776
|
-
// qualifier satisfies a match for both, so one could be stripped outright
|
|
777
|
-
// with the pin still green. Measured — strip only the ping bullet's
|
|
778
|
-
// qualifier and a list-wide match still fires on the relay bullet's.
|
|
779
|
-
// Each bullet ends where the next one begins.
|
|
780
|
-
//
|
|
781
|
-
// Unwrap the slice, as :207 already does: `(fallback path)` carries a literal
|
|
782
|
-
// space, so a pinned phrase that wraps splits and an exact-adjacency regex
|
|
783
|
-
// reports a qualifier that is right there as missing. Measured — reflowing
|
|
784
|
-
// the Red flags list at width 55 or 60, words byte-identical, reds this pin.
|
|
785
|
-
// Flatten the RESULT and keep the slicing raw; the anchors need real text.
|
|
786
|
-
const flat = (s) => s.replace(/\s+/g, " ");
|
|
787
|
-
const ping = flat(section(RUN_TEAM, '- "Tell the reviewer to ping its specialists"', '- "I relayed it', "run-team ping red flag"));
|
|
788
|
-
const relayed = flat(section(RUN_TEAM, '- "I relayed it', '- "It reported the SHA', "run-team relay red flag"));
|
|
789
|
-
for (const [label, bullet] of [["the ping-your-specialists", ping], ["the I-relayed-it", relayed]]) {
|
|
790
|
-
assert.match(
|
|
791
|
-
bullet,
|
|
792
|
-
/\(fallback path\)/,
|
|
793
|
-
`${label} red flag is no longer scoped to the fallback — it reads as universal, and on the default path it is an obligation that can never be discharged`,
|
|
794
|
-
);
|
|
795
|
-
}
|
|
796
|
-
});
|