@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,339 +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, paragraph } from "./prose-pin.mjs";
|
|
6
|
-
|
|
7
|
-
// #144. The finisher is dispatched pinned to a SHA the reviewer already left
|
|
8
|
-
// behind: the reviewer composes a verdict once it has enough, then keeps
|
|
9
|
-
// applying late-arriving specialist relays and pushes again. The pin going
|
|
10
|
-
// stale isn't the defect — the halt-on-moved-head rule already catches it,
|
|
11
|
-
// correctly, every time. The defect is that (a) the controller dispatches
|
|
12
|
-
// before every specialist report is relayed, when it holds the receipts to
|
|
13
|
-
// know better, and (b) a halt reads only "SHA differs from pin" and gives
|
|
14
|
-
// the controller nothing to act on without a fresh audit.
|
|
15
|
-
//
|
|
16
|
-
// Slice-scoped, not whole-file: a bare presence check anywhere in this
|
|
17
|
-
// 1200+ line SKILL.md would stay green even if the text moved somewhere
|
|
18
|
-
// that never reaches its reader (measured before, in this same file —
|
|
19
|
-
// member-prompt-prose.test.mjs #172). Two different readers here: the
|
|
20
|
-
// dispatch gate is controller-facing and lives in the Fallback section, the
|
|
21
|
-
// cause-block evidence is finisher-facing and must sit inside a `>` block the
|
|
22
|
-
// controller carries verbatim.
|
|
23
|
-
const REPO = join(import.meta.dirname, "..");
|
|
24
|
-
const RUN_TEAM = readFileSync(join(REPO, "skills", "run-team", "SKILL.md"), "utf8");
|
|
25
|
-
|
|
26
|
-
const FALLBACK_START = "#### Fallback: hand-dispatched reviewer member";
|
|
27
|
-
const FALLBACK_END = "### Merge bot";
|
|
28
|
-
|
|
29
|
-
// #753: proven output-identical to `between()` on the real SKILL.md text —
|
|
30
|
-
// FALLBACK_END never occurs inside FALLBACK_START's own text, so searching
|
|
31
|
-
// from `at` instead of `at + FALLBACK_START.length` never changes the match.
|
|
32
|
-
const fallbackSection = () => between(RUN_TEAM, FALLBACK_START, FALLBACK_END, "run-team fallback section");
|
|
33
|
-
|
|
34
|
-
const CAUSE_BLOCK_START = "instead of asking anyone:";
|
|
35
|
-
// The controller-facing resolution table (#2083) follows the block directly;
|
|
36
|
-
// it is no part of what the finisher is handed.
|
|
37
|
-
const CAUSE_BLOCK_END = "**Resolving a finisher halt.**";
|
|
38
|
-
|
|
39
|
-
// Raw slice: keeps the `>` prefixes, needed by the structural (every-line-quoted)
|
|
40
|
-
// test below.
|
|
41
|
-
function causeBlock() {
|
|
42
|
-
const at = RUN_TEAM.indexOf(CAUSE_BLOCK_START);
|
|
43
|
-
assert.notEqual(at, -1, `cause-block anchor ('${CAUSE_BLOCK_START}') moved — update this test`);
|
|
44
|
-
const end = RUN_TEAM.indexOf(CAUSE_BLOCK_END, at);
|
|
45
|
-
assert.notEqual(end, -1, `the resolution paragraph that follows ('${CAUSE_BLOCK_END}') moved — update this test`);
|
|
46
|
-
return RUN_TEAM.slice(at + CAUSE_BLOCK_START.length, end);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
// Flattened: markdown hard-wraps a `>` block at ~80 columns, so a phrase can
|
|
50
|
-
// split across a line with a literal `>` re-injected at the wrap point. A
|
|
51
|
-
// phrase match needs the wrap invisible; the structural test needs it intact,
|
|
52
|
-
// hence two helpers instead of one.
|
|
53
|
-
function causeText() {
|
|
54
|
-
return causeBlock().replace(/\n>?[ \t]*/g, " ");
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
// #997. The lead-in that introduces the list sits OUTSIDE the `>` block, so
|
|
58
|
-
// `causeText()` cannot see it — and the count word this ticket removes lived
|
|
59
|
-
// there, not in the block. Anchored on the surviving half of that sentence and
|
|
60
|
-
// bounded by its own paragraph: `anchorAt` refuses a duplicated or missing
|
|
61
|
-
// anchor rather than widening to the whole file, which is the only way a
|
|
62
|
-
// "no closed count anywhere" assertion could pass by looking at nothing.
|
|
63
|
-
const LEAD_ANCHOR = "A halt at step 1 reads identical from a bare SHA mismatch";
|
|
64
|
-
const leadIn = () => paragraph(RUN_TEAM, LEAD_ANCHOR, "run-team halt-cause lead-in");
|
|
65
|
-
|
|
66
|
-
test("finisher dispatch is gated on outstanding specialist relays, in the section that owns relay receipts", () => {
|
|
67
|
-
const section = fallbackSection();
|
|
68
|
-
assert.match(
|
|
69
|
-
section,
|
|
70
|
-
/receipts gate the finisher dispatch/i,
|
|
71
|
-
"the fallback section no longer gates finisher dispatch on relay receipts — a late relay can again land after dispatch with nothing checking for it",
|
|
72
|
-
);
|
|
73
|
-
assert.match(
|
|
74
|
-
section,
|
|
75
|
-
/unrelayed/,
|
|
76
|
-
"the gate no longer names an unrelayed report as the blocking condition",
|
|
77
|
-
);
|
|
78
|
-
// The scope boundary matters as much as the rule: the workflow path has no
|
|
79
|
-
// async relay at all (`agent()` returns synchronously), so a gate that reads
|
|
80
|
-
// as universal would strand controllers into believing a wait is needed
|
|
81
|
-
// where none exists.
|
|
82
|
-
assert.match(
|
|
83
|
-
section,
|
|
84
|
-
/workflow path/i,
|
|
85
|
-
"the gate doesn't say it's a no-op on the workflow path — a controller reading only this rule may wait on a relay that can never arrive there",
|
|
86
|
-
);
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
test("the cause evidence sits inside a quote block, not only in controller narrative", () => {
|
|
90
|
-
const block = causeBlock();
|
|
91
|
-
const lines = block.split("\n").filter((l) => l.trim() !== "");
|
|
92
|
-
assert.ok(lines.length > 0, "the cause block is empty");
|
|
93
|
-
const stray = lines.filter((l) => !l.startsWith(">"));
|
|
94
|
-
assert.deepEqual(
|
|
95
|
-
stray,
|
|
96
|
-
[],
|
|
97
|
-
"cause text sits outside the `>` block — a finisher only receives this if the controller paraphrases it, same failure #172 already fixed once in this file for the implementer",
|
|
98
|
-
);
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
test("the live-editor and rebase causes are named, with evidence a finisher can gather without asking anyone", () => {
|
|
102
|
-
const text = causeText();
|
|
103
|
-
|
|
104
|
-
assert.match(text, /\*\*Live editor\.\*\*/, "the live-editor cause is no longer named");
|
|
105
|
-
assert.match(
|
|
106
|
-
text,
|
|
107
|
-
/git status --porcelain.*dirty/,
|
|
108
|
-
"live editor is no longer tied to a dirty worktree, checkable with a plain git command",
|
|
109
|
-
);
|
|
110
|
-
assert.match(
|
|
111
|
-
text,
|
|
112
|
-
/git diff --stat.*\bapart\b/,
|
|
113
|
-
"the growth check (two samples apart) is missing — a single dirty read can't distinguish a live editor from a one-off leftover",
|
|
114
|
-
);
|
|
115
|
-
|
|
116
|
-
assert.match(text, /\*\*Rebase\.\*\*/, "the rebase cause is no longer named");
|
|
117
|
-
assert.match(
|
|
118
|
-
text,
|
|
119
|
-
/git reflog/,
|
|
120
|
-
"the rebase cause no longer points at git reflog — without it a finisher has no self-checkable way to tell a rebase from a live edit on a clean tree",
|
|
121
|
-
);
|
|
122
|
-
});
|
|
123
|
-
|
|
124
|
-
// #997, measured 2026-08-28 on #983: the working tree was clean (sampled twice
|
|
125
|
-
// a minute apart, empty diffstat both times), the reflog head was a plain
|
|
126
|
-
// `commit` past the dispatch pin, and the `reset`/rebase entries sat BEHIND the
|
|
127
|
-
// pin — the implementer's own pre-push replay, which the block already excuses
|
|
128
|
-
// as provenance. So it matched neither named cause, and the block's own count
|
|
129
|
-
// word said that was impossible. The finisher halted on its own judgement,
|
|
130
|
-
// which is luck: the block's whole purpose is that an unattended finisher
|
|
131
|
-
// DERIVES the cause, and the block itself calls a bare "head moved" an
|
|
132
|
-
// inadequate report — so a closed list that excludes the live case leaves
|
|
133
|
-
// "unexplained" as the only remaining output, and that is the state where
|
|
134
|
-
// labelling over a moved head starts looking reasonable.
|
|
135
|
-
test("the commit-past-the-pin cause is named, with a discriminator neither other cause matches", () => {
|
|
136
|
-
const text = causeText();
|
|
137
|
-
assert.match(
|
|
138
|
-
text,
|
|
139
|
-
/\*\*Work past the pin\.\*\*/,
|
|
140
|
-
"the commit-past-the-pin cause is no longer named — a finisher meeting a clean tree with a plain `commit` past its pin is back to a list that excludes the thing it is looking at",
|
|
141
|
-
);
|
|
142
|
-
// ONE contiguous span, because the discriminator IS the join. The rebase
|
|
143
|
-
// bullet opens on the same clean-tree-and-head-differs read and is told apart
|
|
144
|
-
// only by what the reflog says at the move, so a bare `/plain `commit`/`
|
|
145
|
-
// matches the rebase bullet's own "not a plain `commit`" exclusion and buys
|
|
146
|
-
// the green with this cause deleted.
|
|
147
|
-
assert.match(
|
|
148
|
-
text,
|
|
149
|
-
/`git status --porcelain -unormal` is clean, head still differs from your pin, and `git reflog` in the worktree reads a plain `commit` at the move/,
|
|
150
|
-
"the discriminator no longer separates this cause from the rebase one — either the clean-tree-and-head-differs read went, or the reflog test stopped keying on a plain `commit` at the move",
|
|
151
|
-
);
|
|
152
|
-
// The provenance carve-out the block already grants rebase entries at or
|
|
153
|
-
// behind the pin has to stay attached to THIS cause too, or a finisher that
|
|
154
|
-
// sees any rebase entry in the reflog routes back to `rebase` and reports the
|
|
155
|
-
// replay instead of the commit that actually moved the head.
|
|
156
|
-
assert.match(
|
|
157
|
-
text,
|
|
158
|
-
/no `reset`\/rebase entry there, any of those sitting at or behind the pin as provenance/,
|
|
159
|
-
"the reflog entries behind the pin are no longer excused inside this cause — a stale rebase entry anywhere in the reflog sends the finisher back to `rebase` and the commit past the pin goes unreported",
|
|
160
|
-
);
|
|
161
|
-
});
|
|
162
|
-
|
|
163
|
-
test("the commit-past-the-pin report names the commit and whether it is pushed, unpushed, or unknown", () => {
|
|
164
|
-
const text = causeText();
|
|
165
|
-
// Pushed, unpushed, and unknown need different controller moves, so a report
|
|
166
|
-
// shape that collapses any two of them is a report of a different cause.
|
|
167
|
-
// Contiguous: the report verb, the cause's own name, and the three facts it
|
|
168
|
-
// owes travel together, and splitting them lets a mutant keep the halt
|
|
169
|
-
// while dropping what the halt is worth.
|
|
170
|
-
assert.match(
|
|
171
|
-
text,
|
|
172
|
-
/Halt, name `past-pin`, and report \*\*the commit, and whether it is pushed, unpushed, or unknown\*\*/,
|
|
173
|
-
"the report shape no longer owes all three facts — a halt naming the commit without saying pushed/unpushed/unknown leaves the controller unable to tell an unreviewed push from a commit no reviewer can even fetch, or from a check that never got an answer",
|
|
174
|
-
);
|
|
175
|
-
// Both commands, because "whether it is pushed" is only self-checkable if the
|
|
176
|
-
// block says what to run. The remote read is `ls-remote`, not the PR object's
|
|
177
|
-
// head: that field lags a ref move, which is why `run-merge-bot.md` refuses
|
|
178
|
-
// to poll it, and a lagging read answers "unpushed" for a commit that is
|
|
179
|
-
// already on the branch.
|
|
180
|
-
assert.match(
|
|
181
|
-
text,
|
|
182
|
-
/`git log -1 --format='%h %s'` names it/,
|
|
183
|
-
"the commit is no longer named by a command the finisher can run — a report shape that owes a SHA and a subject with no way to read them is a request, not an instruction",
|
|
184
|
-
);
|
|
185
|
-
assert.match(
|
|
186
|
-
text,
|
|
187
|
-
/`git ls-remote origin <branch>` answers the rest/,
|
|
188
|
-
"the pushed read is gone or moved off `git ls-remote` — the PR object's head lags a ref move, so asking it reports an already-pushed commit as local-only",
|
|
189
|
-
);
|
|
190
|
-
// #997 finding: a FAILED `git ls-remote` (unreachable origin, non-zero exit)
|
|
191
|
-
// used to read as "anything else" — the same shape as a genuinely absent
|
|
192
|
-
// ref — which folds an unknown answer into "unpushed" and reports an
|
|
193
|
-
// already-pushed commit as local-only. This is the unknown-answer-as-a-"no"
|
|
194
|
-
// hole `release-ticket.sh` (1157-1179) and `reaping.md` (56) both forbid;
|
|
195
|
-
// pinning that this bullet now matches them.
|
|
196
|
-
assert.match(
|
|
197
|
-
text,
|
|
198
|
-
/a non-zero exit or any other failed read is \*\*unknown\*\*, never folded into "unpushed"/,
|
|
199
|
-
"a failed `ls-remote` (unreachable origin, non-zero exit) no longer names a third, unknown answer — it reads as indistinguishable from a successful read finding no matching ref, reporting an unreachable-origin failure as 'unpushed'",
|
|
200
|
-
);
|
|
201
|
-
// The consequence, in all three directions. Without it the answers read as
|
|
202
|
-
// trivia and the next reader deletes one of them as redundant.
|
|
203
|
-
assert.match(
|
|
204
|
-
text,
|
|
205
|
-
/Only a successful read settles pushed vs not: equal to that commit means pushed, and a fresh finisher can audit it; a successful read that comes back without it means the commit exists only in that worktree, where no reviewer can reach it/,
|
|
206
|
-
"the pushed/unpushed answers no longer say what each one means for the controller, or no longer require a successful read to reach either — the distinction survives as a fact nobody can act on, or a failed read can satisfy the unpushed branch again",
|
|
207
|
-
);
|
|
208
|
-
});
|
|
209
|
-
|
|
210
|
-
test("the cause list is open — no count is asserted, and an unmatched cause is named rather than called unexplained", () => {
|
|
211
|
-
const lead = leadIn();
|
|
212
|
-
const text = causeText();
|
|
213
|
-
|
|
214
|
-
// Generic over the number word, in both slices that carried one. A count
|
|
215
|
-
// that has been wrong once will be wrong again, so a rewrite to "exactly
|
|
216
|
-
// three causes" is this defect again and not a fix of it — that is why
|
|
217
|
-
// these pins do not name `two`.
|
|
218
|
-
//
|
|
219
|
-
// Wide, not `exactly \w+ causes`: that narrower gap only forbade the literal
|
|
220
|
-
// word "exactly" immediately before the count, so restoring a closed count
|
|
221
|
-
// as "the three causes below" (no "exactly", one extra word before "causes")
|
|
222
|
-
// passed it clean — measured, mutate.py M4. `(?:\s+\w+){0,3}` spans the
|
|
223
|
-
// count word forward to "causes"/"things" through up to three filler words,
|
|
224
|
-
// which is what both slices' surrounding prose needs room for.
|
|
225
|
-
assert.doesNotMatch(
|
|
226
|
-
lead,
|
|
227
|
-
/\b(two|three|four|five|\d+)\b(?:\s+\w+){0,3}\s+causes\b/i,
|
|
228
|
-
"the lead-in asserts a fixed number of causes again — the enumeration is closed, and the cause that is not on the list reads as impossible to the finisher deriving it",
|
|
229
|
-
);
|
|
230
|
-
assert.match(
|
|
231
|
-
lead,
|
|
232
|
-
/not a closed list/,
|
|
233
|
-
"the lead-in no longer says the list is open — silence there is the closed reading restored, since a list with no disclaimer is read as complete",
|
|
234
|
-
);
|
|
235
|
-
// Same widening, same reason: `which of \w+ things happened` only forbids a
|
|
236
|
-
// single word between "of" and "things", so "which of the three things
|
|
237
|
-
// happened" (two words: "the three") passed it clean — measured, mutate.py
|
|
238
|
-
// M3.
|
|
239
|
-
assert.doesNotMatch(
|
|
240
|
-
text,
|
|
241
|
-
/\b(two|three|four|five|\d+)\b(?:\s+\w+){0,3}\s+things\b/i,
|
|
242
|
-
"the block the finisher reads counts the causes again — the count word inside the `>` block is the one that reaches the finisher verbatim",
|
|
243
|
-
);
|
|
244
|
-
assert.match(
|
|
245
|
-
text,
|
|
246
|
-
/`anything else` is a cause too, not a gap/,
|
|
247
|
-
"the block no longer tells the finisher that an unmatched cause is still a cause — without it the fallback bullet reads as a note about incompleteness rather than an instruction",
|
|
248
|
-
);
|
|
249
|
-
|
|
250
|
-
// The fallback itself, and the report it forbids. `unexplained` is the exact
|
|
251
|
-
// output the block exists to make unnecessary: it is the one verdict from
|
|
252
|
-
// which letting the mismatch through is the cheapest next step.
|
|
253
|
-
assert.match(
|
|
254
|
-
text,
|
|
255
|
-
/\*\*Anything else\.\*\*/,
|
|
256
|
-
"the open-ended cause is gone — a fourth shape now has no bullet at all, which is the state #997 was filed from",
|
|
257
|
-
);
|
|
258
|
-
assert.match(
|
|
259
|
-
text,
|
|
260
|
-
/not a licence to report the mismatch as unexplained/,
|
|
261
|
-
"the fallback no longer forbids the unexplained report — an open list whose escape hatch is 'unexplained' is the closed list with extra words",
|
|
262
|
-
);
|
|
263
|
-
assert.match(
|
|
264
|
-
text,
|
|
265
|
-
/name what you did find: both `git status --porcelain -unormal` samples, the `git reflog` line at the move, and both SHAs/,
|
|
266
|
-
"the fallback no longer says what to put in the report — 'name whatever you find' with no named evidence is the bare \"head moved\" this block already rejects",
|
|
267
|
-
);
|
|
268
|
-
});
|
|
269
|
-
|
|
270
|
-
test("a moved head still halts, always — the cause decides what the report says, never whether it halts", () => {
|
|
271
|
-
const text = causeText();
|
|
272
|
-
// ONE exact contiguous span, not two independent phrase matches. The
|
|
273
|
-
// invariant lives in the join: splicing an exception clause between
|
|
274
|
-
// "halts, always" and "you never verify the dirt is harmless" reverses the
|
|
275
|
-
// rule while leaving both phrases intact, and two separate `assert.match`
|
|
276
|
-
// calls stayed green through exactly that mutation (measured, #488 review).
|
|
277
|
-
// The tail is the explicit rejection of issue option 3 ("accept a
|
|
278
|
-
// fast-forward") — the controller ruling took options 2+4, not 3, and a
|
|
279
|
-
// finisher that treats a clean rebase as auto-approved is what triage
|
|
280
|
-
// rejected. Whitespace is already normalised by causeText(), so this is
|
|
281
|
-
// literal text, not a shape.
|
|
282
|
-
// #997 widened this from "Either cause", which quantified over exactly two.
|
|
283
|
-
// The open list creates a false-negative the two-valued form could not
|
|
284
|
-
// cover: an unmatched cause with no halt rule quantifying over it reads as
|
|
285
|
-
// the one case where naming what you found might substitute for halting.
|
|
286
|
-
// Hence `named or not`, inside the same contiguous span.
|
|
287
|
-
assert.match(
|
|
288
|
-
text,
|
|
289
|
-
/Every cause halts, always — named or not, you never verify the dirt is harmless and label over it, a rebase is not a fast-forward you get to accept, a commit past the pin is not one either, and a cause you could not name is the least settled of the lot\./,
|
|
290
|
-
"the always-halts invariant no longer reads verbatim in the block the finisher reads — either it's gone, or a clause was inserted into it that makes the halt conditional, or it stopped quantifying over the unnamed cause, or the ban on labelling over a moved head was dropped",
|
|
291
|
-
);
|
|
292
|
-
});
|
|
293
|
-
|
|
294
|
-
test("the head-equality short-circuit compares against the dispatch pin, on a clean tree", () => {
|
|
295
|
-
const text = causeText();
|
|
296
|
-
// The short-circuit exists to stop finishers adjudicating a reflog that
|
|
297
|
-
// head-equality had already settled. WHICH head it compares to is the whole
|
|
298
|
-
// rule: this block is ENTERED on a mismatch against the dispatch pin, so a
|
|
299
|
-
// comparison against `PR headRefOid` answers a different question — "is the
|
|
300
|
-
// local tree in sync with the pushed tip?" — and a member that kept working
|
|
301
|
-
// and pushed after the pin passes it while holding commits no reviewer read.
|
|
302
|
-
// ONE contiguous span, not two matches: the operand and the clean-tree scope
|
|
303
|
-
// have to stay joined, since either half alone is satisfiable by the broken
|
|
304
|
-
// form.
|
|
305
|
-
assert.match(
|
|
306
|
-
text,
|
|
307
|
-
/head-equality first: `worktree HEAD == the SHA you were dispatched against` on a clean tree settles it\./,
|
|
308
|
-
"the head-equality short-circuit no longer reads as pin-equality scoped to a clean tree — either the operand moved off the dispatch pin, or the clean-tree scope was dropped",
|
|
309
|
-
);
|
|
310
|
-
// The superseded operand, verbatim. `headRefOid` still appears in the block
|
|
311
|
-
// as the SECOND, separate read (pushed vs unpushed), so only this exact
|
|
312
|
-
// equality can be excluded here, not the identifier.
|
|
313
|
-
assert.doesNotMatch(
|
|
314
|
-
text,
|
|
315
|
-
/`worktree HEAD == PR headRefOid`/,
|
|
316
|
-
"the short-circuit is back to comparing the worktree head to the pushed branch tip — a member that pushed after the pin reads as 'settled' and gets labelled over commits no reviewer saw",
|
|
317
|
-
);
|
|
318
|
-
// The clean-tree scope is what keeps the live-editor cause reachable at all:
|
|
319
|
-
// a dirty tree is never settled by the short-circuit, and the bullet opens
|
|
320
|
-
// directly on the dirty read with no head predicate to fail. Contiguous, so
|
|
321
|
-
// splicing a head condition in front of that read reds this — the loose
|
|
322
|
-
// `git status --porcelain.*dirty` pin above walks straight through it.
|
|
323
|
-
assert.match(
|
|
324
|
-
text,
|
|
325
|
-
/\*\*Live editor\.\*\* `git status --porcelain -unormal` is dirty\./,
|
|
326
|
-
"the live-editor cause is no longer keyed on a dirty tree alone — a head predicate in front of the dirty read strands the mid-mutation case with no named cause",
|
|
327
|
-
);
|
|
328
|
-
});
|
|
329
|
-
|
|
330
|
-
test("the pre-existing ruling-owed gate for the fix-applier is untouched", () => {
|
|
331
|
-
// ACCEPT side: this run's edit sits right next to the fix-applier dispatch
|
|
332
|
-
// paragraph. This pins that the older, unrelated rule wasn't clipped or
|
|
333
|
-
// reworded by mistake while adding the new one beside it.
|
|
334
|
-
assert.match(
|
|
335
|
-
RUN_TEAM,
|
|
336
|
-
/Never dispatch\s*\n?one while you still owe the fix-applier a ruling/,
|
|
337
|
-
"the fix-applier ruling-owed gate no longer reads as before — check it wasn't altered while adding the specialist-relay gate nearby",
|
|
338
|
-
);
|
|
339
|
-
});
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
// A finisher's duty-2 `<testCmd>` run can be killed from outside — an external
|
|
2
|
-
// `timeout`, SIGKILL, an `eval` cell deadline — and a killed `node --test`
|
|
3
|
-
// still prints a summary covering only the tests it reached. Read as a verdict
|
|
4
|
-
// it turns a partial suite into a clean pass; read the same way in the
|
|
5
|
-
// mutation direction it turns cancelled files into a mutant that "reddened".
|
|
6
|
-
// `cancelled` above 0 does not tell the two runs apart: a failing `before` hook
|
|
7
|
-
// or a per-test `timeout` cancels tests inside a run that completed, so the
|
|
8
|
-
// block tells the finisher to judge a run by how it ended.
|
|
9
|
-
// The finisher's agent definition carries no duty text, so the rule reaches
|
|
10
|
-
// it only through the verbatim block the controller hands over — which is
|
|
11
|
-
// what this file pins, one sentence per pin so a clause deleted from inside
|
|
12
|
-
// the block reds its own pin rather than being satisfied by a neighbour. The
|
|
13
|
-
// lead-in paragraph above the block is what tells the controller to hand it
|
|
14
|
-
// over, and is pinned on its own.
|
|
15
|
-
|
|
16
|
-
import { test } from "node:test";
|
|
17
|
-
import assert from "node:assert/strict";
|
|
18
|
-
import { readFileSync } from "node:fs";
|
|
19
|
-
import { join } from "node:path";
|
|
20
|
-
import { paragraph, quoteBlock, sentences, stripQuoteGutter } from "./prose-pin.mjs";
|
|
21
|
-
import { HALT_CAUSES } from "./ledger-grammar.mjs";
|
|
22
|
-
|
|
23
|
-
const RUN_TEAM = readFileSync(join(import.meta.dirname, "..", "skills", "run-team", "SKILL.md"), "utf8");
|
|
24
|
-
|
|
25
|
-
const OPENER = "**A test run is a verdict only if it ran to completion";
|
|
26
|
-
const block = () =>
|
|
27
|
-
stripQuoteGutter(quoteBlock(RUN_TEAM, OPENER, "the finisher's test-run verdict block")).replace(/\s+/g, " ");
|
|
28
|
-
const sentenceWith = (re, what) => {
|
|
29
|
-
const hits = sentences(block()).filter((s) => re.test(s));
|
|
30
|
-
assert.equal(hits.length, 1, `${what}: ${hits.length} sentences match ${re} in the verdict block`);
|
|
31
|
-
return hits[0];
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
test("a run is a verdict only on the command's own exit 0 with tests above 0 and cancelled 0", () => {
|
|
35
|
-
const s = sentenceWith(/is a verdict only when/, "verdict condition");
|
|
36
|
-
assert.match(s, /exit status is 0/);
|
|
37
|
-
assert.match(s, /`tests` above 0/);
|
|
38
|
-
assert.match(s, /`cancelled` 0/);
|
|
39
|
-
assert.match(sentenceWith(/summary line without that/, "bare summary"), /is not a verdict, whatever pass count it prints/);
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
test("a run completed only when it returned on its own, and `cancelled` does not say whether it did", () => {
|
|
43
|
-
const s = sentenceWith(/A run completed when/, "completion rule");
|
|
44
|
-
assert.match(s, /the command itself returned on its own\*\* — an exit code, no signal, and no `timeout`, deadline or kill of yours having fired/);
|
|
45
|
-
const judge = sentenceWith(/Judge that by how the run ended/, "judge by how it ended");
|
|
46
|
-
assert.match(judge, /never by its `cancelled` count/);
|
|
47
|
-
assert.match(judge, /a failing `before` hook or a per-test `timeout` cancels tests inside a run that completed/);
|
|
48
|
-
assert.match(judge, /a SIGTERM'd `node --test` can exit 1 with `cancelled` above 0 in a run that did not/);
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
test("124, 137 and 143 are a killed run, FAILED for green, and never a pass or a mutant reddening", () => {
|
|
52
|
-
const s = sentenceWith(/124/, "kill signatures");
|
|
53
|
-
assert.match(s, /Any run that did not complete is a killed run/);
|
|
54
|
-
assert.match(s, /137 \(SIGKILL\), 143 \(SIGTERM\), a signal in the spawn result, an `eval` cell's deadline/);
|
|
55
|
-
assert.match(s, /read for green it is FAILED, the same bucket as `tests 0`, however many tests had passed before the kill/);
|
|
56
|
-
const mutation = sentenceWith(/not a mutant that reddened/, "mutation direction");
|
|
57
|
-
assert.match(mutation, /The same holds for the mutation gate/);
|
|
58
|
-
assert.match(mutation, /files it cancelled are not failures/);
|
|
59
|
-
assert.match(mutation, /only a run that completed can kill a mutant/);
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
test("the halt for a killed run names cause `other` with the exit code and summary as evidence", () => {
|
|
63
|
-
assert.ok(HALT_CAUSES.includes("other"), "ledger grammar no longer accepts the `other` halt cause this block names");
|
|
64
|
-
const s = sentenceWith(/Halt with cause/, "halt cause");
|
|
65
|
-
assert.match(s, /cause `other`/);
|
|
66
|
-
assert.match(s, /exit code plus the summary line as evidence/);
|
|
67
|
-
assert.match(s, /label nothing/);
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
test("the exit status is read off the test command itself, never a pipeline's", () => {
|
|
71
|
-
const s = sentenceWith(/Never read the status of/, "pipeline rule");
|
|
72
|
-
assert.match(s, /`<testCmd> \| tail`/);
|
|
73
|
-
assert.match(s, /`<testCmd> \| grep`/);
|
|
74
|
-
assert.match(s, /a pipeline's status is its last stage's, so the filter's 0 hides the run's own exit/);
|
|
75
|
-
assert.match(s, /earlier stages' statuses is spelled differently per shell/);
|
|
76
|
-
assert.match(sentenceWith(/Redirect the run's output to a file/, "redirect rule"), /read the command's own `\$\?` straight after it, then read the file/);
|
|
77
|
-
const bridge = sentenceWith(/there is no `\$\?`/, "eval bridge");
|
|
78
|
-
assert.match(bridge, /In an `eval` cell there is no `\$\?`: spawn `<testCmd>` with its output going to that file/);
|
|
79
|
-
assert.match(bridge, /read the exit code and the signal off the spawn result/);
|
|
80
|
-
assert.match(bridge, /`exitCode` and `signalCode` on Bun's `spawnSync`, `returncode` on Python's `subprocess.run`, which is negative for a signal/);
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
test("testCmd is never wrapped in an external timeout, and a long suite runs in one eval cell with timeout 0", () => {
|
|
84
|
-
assert.match(sentenceWith(/Do not wrap/, "no external timeout"), /external `timeout`/);
|
|
85
|
-
assert.match(sentenceWith(/Run a long suite/, "eval cell"), /one `eval` cell with `timeout: 0`/);
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
// The other half: what the rule must ACCEPT. A completed run that exits 1 is
|
|
89
|
-
// a plain failure the finisher reports as one whatever `cancelled` says, and
|
|
90
|
-
// `tests 0` keeps its own bucket.
|
|
91
|
-
test("a completed run that exits 1 and a zero-test run keep their own verdicts", () => {
|
|
92
|
-
const s = sentenceWith(/A completed run that exits 1/, "completed red run");
|
|
93
|
-
assert.match(s, /A completed run that exits 1 is a plain failure, not a killed run, whatever its `cancelled` count/);
|
|
94
|
-
assert.match(s, /exit 0 with `tests 0` stays FAILED/);
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
// The block reaches a finisher only because the controller is told to hand it
|
|
98
|
-
// over, and the same sentence says what duty 2 uses `<testCmd>` for.
|
|
99
|
-
test("the lead-in tells the controller to hand the verdict rule over, and says duty 2 runs testCmd for the acceptance mutation", () => {
|
|
100
|
-
const p = paragraph(RUN_TEAM, "Give the finisher the test-run verdict rule verbatim too.", "the verdict block's lead-in").replace(/\s+/g, " ");
|
|
101
|
-
assert.match(p, /^Give the finisher the test-run verdict rule verbatim too\.\*\* Duty 2 runs `<testCmd>` for the acceptance mutation,/);
|
|
102
|
-
});
|
|
@@ -1,202 +0,0 @@
|
|
|
1
|
-
// #859. The fix-applier dispatch block (phase 3) is a `>` blockquote pasted
|
|
2
|
-
// VERBATIM into the fix-applier's prompt — the controller copies those lines
|
|
3
|
-
// as-is, it does not paraphrase them, and it does not chase a cross-reference
|
|
4
|
-
// out of the block. Before this ticket the block carried the mutation-testing
|
|
5
|
-
// rule and the re-derive-the-pin rule, but none of the three prose-discipline
|
|
6
|
-
// rules the implementer block carries, even though a fix-applier's whole job
|
|
7
|
-
// is writing prose after review — commit messages, deferral-issue rationale,
|
|
8
|
-
// its final report — on a snapshot nothing downstream re-reviews.
|
|
9
|
-
//
|
|
10
|
-
// Measured against `origin/main` before this file existed: an
|
|
11
|
-
// implementer-only search of the fix-applier's prompt slice —
|
|
12
|
-
// `awk 'NR==1483,NR==1631' skills/run-team/SKILL.md | grep -iE
|
|
13
|
-
// "settling command|positional|COUNT|tally"` — hit nothing but unrelated CI
|
|
14
|
-
// behind-count prose. No test in this suite pinned any of the three rules
|
|
15
|
-
// inside the fix-applier's own prompt slice either; the two files that pin
|
|
16
|
-
// this text (`immutable-body-claim-prose.test.mjs`,
|
|
17
|
-
// `cross-repo-citation-prose.test.mjs`) both scope to the IMPLEMENTER'S copy,
|
|
18
|
-
// which lives in `plugin/agents/fleet-implementer-<cell>.agent.md`, not in this
|
|
19
|
-
// section of SKILL.md. `grep -n '### Reviewers\|You are ALREADY in
|
|
20
|
-
// worktree\|Put the standing CI facts\|Two of the rules above are what
|
|
21
|
-
// caught both\|Fallback: hand-dispatched' skills/run-team/SKILL.md` against
|
|
22
|
-
// this tree finds `You are ALREADY in worktree` exactly ONCE, opening the
|
|
23
|
-
// fix-applier's own prompt this file pins below — it does not recur
|
|
24
|
-
// anywhere else in SKILL.md.
|
|
25
|
-
//
|
|
26
|
-
// SHAPE, matching the convention every file beside this one uses. Each rule
|
|
27
|
-
// gets its own ordered-span assertion, gaps sized to the punctuation that
|
|
28
|
-
// actually separates the anchors today (a handful of characters) so a
|
|
29
|
-
// deletion of the connecting clause reds without a loose `.{0,N}?` papering
|
|
30
|
-
// over it. A positive regex over the whole fix-applier prompt — 1200+ chars —
|
|
31
|
-
// would be satisfied by equivalent wording anywhere else in the Reviewers
|
|
32
|
-
// section it happened to also match; these slices are bounded to the fix-applier
|
|
33
|
-
// prompt specifically (`reviewersSection()` below, mirroring
|
|
34
|
-
// `review-path-default.test.mjs`'s `fixApplierPrompt()`, duplicated rather
|
|
35
|
-
// than imported for the reason `implementer-model-tier.test.mjs` gives for
|
|
36
|
-
// its own copy: two files, seven lines, nothing detects drift between them).
|
|
37
|
-
//
|
|
38
|
-
// THE CEILING these pins have: they prove a phrase is PRESENT and ADJACENT
|
|
39
|
-
// to its neighbor. A sentence appended after a pinned span that carves out
|
|
40
|
-
// an exception touches no pinned fragment and stays green, and so does a
|
|
41
|
-
// clause inserted inside one of the gaps above while it has headroom.
|
|
42
|
-
//
|
|
43
|
-
// #1002 closed that half for this prompt, with a mechanism that is not a
|
|
44
|
-
// regex: `dispatch-block-golden-prose.test.mjs` holds a whole-block golden
|
|
45
|
-
// fixture for the fix-applier prompt — its nested refuter prompt included —
|
|
46
|
-
// and any insertion reds there, because the prompt no longer equals its
|
|
47
|
-
// known-good copy. An LLM judge and a schema'd rule format were the two
|
|
48
|
-
// candidates considered there and both were rejected.
|
|
49
|
-
//
|
|
50
|
-
// These pins were kept, not replaced. A golden red says the prompt changed
|
|
51
|
-
// and hands the reader a diff; a red here names the correction rule that
|
|
52
|
-
// went missing. Editing this prompt now reds both, deliberately: the golden
|
|
53
|
-
// is re-blessed in the same change, which is the review point these pins do
|
|
54
|
-
// not have.
|
|
55
|
-
//
|
|
56
|
-
// #859's own third acceptance criterion — the candidates.test.mjs live-count
|
|
57
|
-
// clause restated as a property — is NOT covered by this file. Verified
|
|
58
|
-
// against this tree: neither "62 tests" nor "61 unrelated tests" appears
|
|
59
|
-
// anywhere in `plugin/scripts/candidates.test.mjs` today. Commit `7eed0a8`
|
|
60
|
-
// ("docs(candidates.test): drop three claims the tree contradicts from the
|
|
61
|
-
// pin's comments") already replaced both clauses with measured, count-free
|
|
62
|
-
// prose before this branch started, so there is nothing left there for this
|
|
63
|
-
// ticket to fix or to pin.
|
|
64
|
-
import { test } from "node:test";
|
|
65
|
-
import assert from "node:assert/strict";
|
|
66
|
-
import { readFileSync } from "node:fs";
|
|
67
|
-
import { join } from "node:path";
|
|
68
|
-
import { between, phrase } from "./prose-pin.mjs";
|
|
69
|
-
|
|
70
|
-
const REPO = join(import.meta.dirname, "..");
|
|
71
|
-
const RUN_TEAM = readFileSync(join(REPO, "skills", "run-team", "SKILL.md"), "utf8");
|
|
72
|
-
|
|
73
|
-
// Scoped to the Reviewers section first, so an `indexOf`-based anchor search
|
|
74
|
-
// starts inside the fix-applier's own prompt rather than risking a match
|
|
75
|
-
// against equivalent wording elsewhere in the file, present or future.
|
|
76
|
-
const reviewersSection = () =>
|
|
77
|
-
between(RUN_TEAM, "### Reviewers", "#### Fallback: hand-dispatched reviewer", "run-team Reviewers section");
|
|
78
|
-
|
|
79
|
-
const PROMPT_ANCHOR = "> You are ALREADY in worktree";
|
|
80
|
-
const PROMPT_END = "\n**Put the standing CI facts";
|
|
81
|
-
const fixApplierPrompt = () =>
|
|
82
|
-
between(reviewersSection(), PROMPT_ANCHOR, PROMPT_END, "run-team fix-applier prompt");
|
|
83
|
-
|
|
84
|
-
// The implementer's own copy of the count rule, the OTHER seat #859 requires
|
|
85
|
-
// the qualification to reach. It lives in the claim-discipline block of the
|
|
86
|
-
// implementer agent body, which the harness injects as every implementer's
|
|
87
|
-
// system prompt; bounded to that block so a rewording anywhere else in the
|
|
88
|
-
// body cannot satisfy this slice by accident.
|
|
89
|
-
const AGENT = readFileSync(join(REPO, "agents", "fleet-implementer-slow-high.agent.md"), "utf8");
|
|
90
|
-
const implementerCountRule = () =>
|
|
91
|
-
between(
|
|
92
|
-
AGENT,
|
|
93
|
-
"**Claim discipline, on every ticket:**",
|
|
94
|
-
"Commit incrementally as you go",
|
|
95
|
-
"the implementer agent body's claim-discipline block",
|
|
96
|
-
);
|
|
97
|
-
|
|
98
|
-
// `**` emphasis and the `>` blockquote gutter are stripped and whitespace
|
|
99
|
-
// collapsed before matching, so a pin survives a bold move or a rewrap.
|
|
100
|
-
// Single `*`/backtick are left alone — this slice's only single-`*` and
|
|
101
|
-
// backtick usage is code-quoted (`` `the closing/second/last X` ``,
|
|
102
|
-
// `` `every other test in the file` ``), never italics, so nothing here
|
|
103
|
-
// depends on preserving it.
|
|
104
|
-
const flatten = (s) =>
|
|
105
|
-
s
|
|
106
|
-
.split("\n")
|
|
107
|
-
.map((l) => l.replace(/^\s*>?\s?/, ""))
|
|
108
|
-
.join(" ")
|
|
109
|
-
.replace(/\*\*/g, "")
|
|
110
|
-
.split(/\s+/)
|
|
111
|
-
.join(" ")
|
|
112
|
-
.trim();
|
|
113
|
-
|
|
114
|
-
test("the fix-applier prompt carries the settling-command rule, tied to its citation caveat", () => {
|
|
115
|
-
const prompt = flatten(fixApplierPrompt());
|
|
116
|
-
assert.match(
|
|
117
|
-
prompt,
|
|
118
|
-
/Every factual claim your diff restates needs a settling command run against the tree first.{0,15}?the issue body is a lead, never a citation/,
|
|
119
|
-
"the fix-applier prompt no longer requires a settling command for every restated claim, or drops the caveat that the issue body is a lead and not a citation",
|
|
120
|
-
);
|
|
121
|
-
});
|
|
122
|
-
|
|
123
|
-
test("the fix-applier prompt carries the no-positional-references rule with its own example", () => {
|
|
124
|
-
const prompt = flatten(fixApplierPrompt());
|
|
125
|
-
assert.match(
|
|
126
|
-
prompt,
|
|
127
|
-
/No positional references.{0,15}?the closing\/second\/last X.{0,15}?name the thing semantically/,
|
|
128
|
-
"the fix-applier prompt no longer forbids a positional reference, or dropped the example/remedy pair that makes the rule actionable",
|
|
129
|
-
);
|
|
130
|
-
});
|
|
131
|
-
|
|
132
|
-
test("the fix-applier prompt's count rule is qualified — a live property is restated, a past-tense measurement is not", () => {
|
|
133
|
-
const prompt = flatten(fixApplierPrompt());
|
|
134
|
-
// One ordered span, not four presence checks. The failure this guards is
|
|
135
|
-
// not deletion of the rule — it is deleting only the qualification and
|
|
136
|
-
// leaving the bare "never write a COUNT" behind, which is exactly the
|
|
137
|
-
// unsafe, unqualified rule #859 measured minting a false claim once
|
|
138
|
-
// already (rewriting a correct past-tense record as a property).
|
|
139
|
-
assert.match(
|
|
140
|
-
prompt,
|
|
141
|
-
/Never write a COUNT or a tally into prose; state the property instead.{0,15}?unless it is a past-tense record of a measurement you performed, which stays as written.{0,10}?a present-tense claim about a live property must be restated as a property.{0,60}?true at any count/,
|
|
142
|
-
"the fix-applier prompt's count rule lost its past-tense/live-property qualification, its ordering, or one of its two halves",
|
|
143
|
-
);
|
|
144
|
-
});
|
|
145
|
-
|
|
146
|
-
test("the fix-applier prompt's settling grep takes -F over literal text and trusts a zero only after a known match", () => {
|
|
147
|
-
// #1087. One span, both halves: `-F` alone still lets a command that can
|
|
148
|
-
// never return non-zero write "absent" under `Verified:`, and the positive
|
|
149
|
-
// control alone leaves the pattern-reading of literal prose as the default.
|
|
150
|
-
assert.match(
|
|
151
|
-
flatten(fixApplierPrompt()),
|
|
152
|
-
phrase("A settling grep over literal text takes `grep -F`, and its zero counts only after the same command finds a line known to match"),
|
|
153
|
-
"the fix-applier prompt no longer tells a settling grep over literal text to take -F, or dropped the positive control that has to pass before its zero is trusted",
|
|
154
|
-
);
|
|
155
|
-
});
|
|
156
|
-
|
|
157
|
-
test("the implementer's own count rule carries the identical past-tense/live-property qualification", () => {
|
|
158
|
-
// #859's ruling is explicit that BOTH seats need this, not only the new
|
|
159
|
-
// copy — this is the pre-existing rule, being re-derived rather than left
|
|
160
|
-
// as the unsafe unqualified form the fix-applier copy above no longer has.
|
|
161
|
-
const rule = flatten(implementerCountRule());
|
|
162
|
-
assert.match(
|
|
163
|
-
rule,
|
|
164
|
-
/Never write a count or tally into present-tense prose; state the property instead.{0,40}?A past-tense record of a measurement you performed stays as written/,
|
|
165
|
-
"the implementer's own count rule lost its past-tense/live-property qualification — #859 requires both seats to carry it, not only the fix-applier's new copy",
|
|
166
|
-
);
|
|
167
|
-
});
|
|
168
|
-
|
|
169
|
-
test("a rewrapped fix-applier prompt still matches every pinned rule — these pins refuse drift, not reflow", () => {
|
|
170
|
-
// ACCEPT side. The fixture is DERIVED from the live text, never a quoted
|
|
171
|
-
// line, so a meaning-preserving reword of the surrounding prompt is not
|
|
172
|
-
// what this test measures — only that re-wrapping the pinned paragraph at
|
|
173
|
-
// a column width nothing here assumes leaves every ordered span intact.
|
|
174
|
-
const raw = between(
|
|
175
|
-
fixApplierPrompt(),
|
|
176
|
-
"Every factual claim your diff restates",
|
|
177
|
-
"\n>\n> **Apply",
|
|
178
|
-
"the fix-applier's new prose-discipline paragraph",
|
|
179
|
-
);
|
|
180
|
-
const body = flatten(raw);
|
|
181
|
-
const words = body.split(/\s+/).filter(Boolean);
|
|
182
|
-
const lines = words.reduce((acc, w) => {
|
|
183
|
-
const last = acc[acc.length - 1];
|
|
184
|
-
if (last && `${last} ${w}`.length <= 40) acc[acc.length - 1] = `${last} ${w}`;
|
|
185
|
-
else acc.push(w);
|
|
186
|
-
return acc;
|
|
187
|
-
}, []);
|
|
188
|
-
const narrow = lines.map((l) => `> ${l}`).join("\n");
|
|
189
|
-
assert.notEqual(narrow, raw, "the rewrap fixture no longer changes the paragraph's wrapping — update it");
|
|
190
|
-
const rewrappedFile = RUN_TEAM.replace(raw, () => narrow);
|
|
191
|
-
const rewrappedReviewers = between(
|
|
192
|
-
rewrappedFile,
|
|
193
|
-
"### Reviewers",
|
|
194
|
-
"#### Fallback: hand-dispatched reviewer",
|
|
195
|
-
"rewrapped run-team Reviewers section",
|
|
196
|
-
);
|
|
197
|
-
const prompt = flatten(between(rewrappedReviewers, PROMPT_ANCHOR, PROMPT_END, "rewrapped fix-applier prompt"));
|
|
198
|
-
assert.match(prompt, phrase("Every factual claim your diff restates needs a settling command run against the tree first"));
|
|
199
|
-
assert.match(prompt, phrase("No positional references"));
|
|
200
|
-
assert.match(prompt, phrase("unless it is a past-tense record of a measurement you performed"));
|
|
201
|
-
assert.match(prompt, phrase("its zero counts only after the same command finds a line known to match"));
|
|
202
|
-
});
|