@feigi/fleet-ctl 0.0.0 → 3.16.3
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/agents/{fleet-implementer.agent.md → fleet-implementer-slow-high.agent.md} +23 -2
- package/agents/fleet-implementer-slow-medium.agent.md +231 -0
- package/agents/fleet-implementer-smol-high.agent.md +231 -0
- package/agents/{fleet-implementer-alt.agent.md → fleet-implementer-task-high.agent.md} +23 -2
- package/agents/fleet-implementer-task-max.agent.md +231 -0
- package/agents/fleet-review-comments.agent.md +4 -2
- package/agents/fleet-review-correctness.agent.md +2 -1
- package/agents/fleet-review-runner.agent.md +14 -10
- package/agents/fleet-review-silent-failure.agent.md +4 -3
- package/agents/fleet-review-simplify.agent.md +2 -1
- package/agents/fleet-review-snapshot.agent.md +2 -1
- package/agents/fleet-review-test-run.agent.md +29 -0
- package/agents/fleet-review-tests.agent.md +10 -5
- package/agents/fleet-review-types.agent.md +4 -2
- package/agents/fleet-review-verifier.agent.md +4 -3
- package/commands/review-and-fix.md +7 -6
- package/commands/run-merge-bot.md +14 -4
- package/package.json +4 -2
- package/scripts/agent-test.test.mjs +36 -32
- package/scripts/ambient-git-vars-mjs-prose.test.mjs +23 -13
- package/scripts/apply-ruleset.test.mjs +4 -3
- package/scripts/arg-header-probes-prose.test.mjs +1 -0
- package/scripts/arg.test.mjs +18 -18
- package/scripts/board-cli.test.mjs +18 -21
- package/scripts/board-identity.test.mjs +9 -9
- package/scripts/board-liveness-banner.test.mjs +6 -6
- package/scripts/board-prev-shape.test.mjs +12 -13
- package/scripts/board-tryparse-null.test.mjs +7 -7
- package/scripts/board.mjs +4 -7
- package/scripts/board.test.mjs +57 -61
- package/scripts/candidates.test.mjs +228 -17
- package/scripts/ci-completes-premise-prose.test.mjs +1 -1
- package/scripts/ci-state-prose.test.mjs +2 -2
- package/scripts/ci-state.mjs +389 -187
- package/scripts/ci-state.test.mjs +458 -165
- package/scripts/citation-sweep-prose.test.mjs +59 -1
- package/scripts/claim-lifecycle.test.mjs +2 -1
- package/scripts/claim-ticket.test.mjs +35 -34
- package/scripts/closing-keyword-prose.test.mjs +1 -1
- package/scripts/cockpit-tick-nonblocking.test.mjs +8 -8
- package/scripts/compute-board.mjs +13 -3
- package/scripts/compute-board.test.mjs +64 -1
- package/scripts/compute-spend.mjs +46 -8
- package/scripts/compute-spend.test.mjs +64 -10
- package/scripts/cross-repo-citation-prose.test.mjs +18 -19
- package/scripts/delete-merged-branch.sh +218 -0
- package/scripts/delete-merged-branch.test.mjs +576 -0
- package/scripts/derive-testcmd.sh +18 -7
- package/scripts/derive-testcmd.test.mjs +9 -8
- package/scripts/diff-stats.mjs +2 -2
- package/scripts/diff-stats.test.mjs +7 -11
- package/scripts/dispatch-block-golden-prose.test.mjs +111 -6
- package/scripts/dispatch-block-pins-prose.test.mjs +5 -5
- package/scripts/dispositions-check.mjs +507 -0
- package/scripts/dispositions-check.test.mjs +843 -0
- package/scripts/dispositions-gate-prose.test.mjs +114 -0
- package/scripts/drop-merged-label.test.mjs +3 -4
- package/scripts/exec-stub.mjs +93 -0
- package/scripts/exec-stub.test.mjs +69 -0
- package/scripts/filing-bar-seat-prose.test.mjs +1 -1
- package/scripts/finisher-test-verdict-prose.test.mjs +102 -0
- package/scripts/fix-applier-correction-rules-prose.test.mjs +11 -10
- package/scripts/fleet-bootstrap +5 -20
- package/scripts/fleet-bootstrap.test.mjs +75 -0
- package/scripts/fleet-heartbeat.mjs +2 -2
- package/scripts/fleet-provenance +15 -24
- package/scripts/fleet-provenance.test.mjs +86 -12
- package/scripts/fleet-run.test.mjs +5 -5
- package/scripts/fleet-state.mjs +33 -11
- package/scripts/fleet-state.test.mjs +90 -3
- package/scripts/fleet-tick.mjs +346 -70
- package/scripts/fleet-tick.test.mjs +566 -16
- package/scripts/force-with-lease-reason-prose.test.mjs +1 -1
- package/scripts/frontmatter-check.mjs +3 -2
- package/scripts/frontmatter-check.test.mjs +6 -6
- package/scripts/immutable-body-claim-prose.test.mjs +53 -262
- package/scripts/implementer-model-tier.test.mjs +98 -506
- package/scripts/inflight.test.mjs +18 -127
- package/scripts/is-cli.mjs +26 -0
- package/scripts/is-cli.test.mjs +99 -0
- package/scripts/json.test.mjs +3 -3
- package/scripts/ledger-dispatch.test.mjs +368 -7
- package/scripts/ledger-grammar.mjs +85 -1
- package/scripts/ledger-grammar.test.mjs +86 -1
- package/scripts/ledger-read-require-file.test.mjs +7 -7
- package/scripts/ledger-rotate.test.mjs +142 -0
- package/scripts/ledger.mjs +181 -17
- package/scripts/ledger.test.mjs +12 -130
- package/scripts/main-checkout.mjs +312 -0
- package/scripts/main-checkout.test.mjs +332 -0
- package/scripts/member-outcomes-header.test.mjs +3 -3
- package/scripts/member-outcomes.mjs +4 -5
- package/scripts/member-outcomes.test.mjs +92 -18
- package/scripts/member-prompt-prose.test.mjs +17 -13
- package/scripts/member-record.mjs +8 -3
- package/scripts/member-record.test.mjs +5 -5
- package/scripts/member-write-guard.mjs +5 -5
- package/scripts/member-write-guard.test.mjs +6 -3
- package/scripts/no-undo-audit.sh +24 -21
- package/scripts/no-undo-audit.test.mjs +9 -13
- package/scripts/pointer-target-prose.test.mjs +1 -1
- package/scripts/pr-overlap.test.mjs +6 -9
- package/scripts/prompt-renderer.mjs +10 -9
- package/scripts/prose-pin.mjs +10 -11
- package/scripts/prove-merge.test.mjs +3 -3
- package/scripts/quiet-payload-prose.test.mjs +1 -1
- package/scripts/reap.test.mjs +3 -4
- package/scripts/release-label-split-prose.test.mjs +17 -2
- package/scripts/release-ticket.test.mjs +35 -44
- package/scripts/review-core-cwd-isolation.test.mjs +7 -6
- package/scripts/review-core-reads.test.mjs +1 -1
- package/scripts/review-core-scratch-refusal.test.mjs +64 -0
- package/scripts/review-core-shared-test-run.test.mjs +238 -0
- package/scripts/review-core-snapshot-path.test.mjs +59 -12
- package/scripts/review-core-specialist-scratch.test.mjs +12 -10
- package/scripts/review-core-testcmd.test.mjs +76 -45
- package/scripts/review-core-unrun.test.mjs +154 -168
- package/scripts/review-core.mjs +250 -56
- package/scripts/review-eval.mjs +11 -4
- package/scripts/review-host-fixture.mjs +12 -3
- package/scripts/review-in-run-retry.test.mjs +27 -3
- package/scripts/review-runner-spawns.test.mjs +5 -3
- package/scripts/review-runner.test.mjs +14 -3
- package/scripts/review-tier-audit.test.mjs +1 -1
- package/scripts/run-merge-bot-prose.test.mjs +29 -6
- package/scripts/scratch-partition-invariant-prose.test.mjs +1 -1
- package/scripts/section-between-guard-prose.test.mjs +4 -3
- package/scripts/select-dimensions.test.mjs +1 -1
- package/scripts/shell-traps-prose.test.mjs +6 -9
- package/scripts/shortlist.mjs +4 -1
- package/scripts/shortlist.test.mjs +30 -16
- package/scripts/snapshot-repo.test.mjs +177 -4
- package/scripts/stash-prohibition-prose.test.mjs +1 -1
- package/scripts/temp-dir.mjs +47 -0
- package/scripts/tier-check.mjs +95 -28
- package/scripts/tier-check.test.mjs +131 -29
- package/scripts/tier-outcomes-header.test.mjs +11 -54
- package/scripts/tier-outcomes.mjs +34 -12
- package/scripts/tier-outcomes.test.mjs +157 -4
- package/scripts/tier-roles.mjs +118 -29
- package/scripts/tier-roles.test.mjs +226 -61
- package/scripts/tracker-block-copy-prose.test.mjs +3 -3
- package/scripts/verify-sha.test.mjs +4 -5
- package/scripts/watcher-degraded-block.test.mjs +5 -8
- package/scripts/within-run-pair-prose.test.mjs +43 -75
- package/scripts/worktree-audit.test.mjs +2 -1
- package/skills/next-ticket/SKILL.md +2 -2
- package/skills/run-team/SKILL.md +433 -303
- package/skills/run-team/references/ci-and-staleness.md +7 -6
- package/skills/run-team/references/correction-tickets.md +3 -3
- package/skills/run-team/references/isolation.md +1 -1
- package/skills/sizing-a-ticket/SKILL.md +8 -8
- package/scripts/tier-guard-gate-prose.test.mjs +0 -216
|
@@ -1,341 +1,40 @@
|
|
|
1
1
|
import { test } from "node:test";
|
|
2
2
|
import assert from "node:assert/strict";
|
|
3
|
-
import { readFileSync } from "node:fs";
|
|
3
|
+
import { readFileSync, readdirSync } from "node:fs";
|
|
4
4
|
import { join } from "node:path";
|
|
5
|
-
import { between as section
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
11
|
-
//
|
|
12
|
-
//
|
|
13
|
-
//
|
|
14
|
-
// for at length, and restores `model: "sonnet"` in one of the two places that
|
|
15
|
-
// used to carry it. The negative pins below exist for that, and there are two
|
|
16
|
-
// because phase 0 and phase 2 each stated the binding independently — changing
|
|
17
|
-
// only one is exactly the half-revert this test failed to catch when the revert
|
|
18
|
-
// was first written. (b) The class judgement is dropped as pointless now that
|
|
19
|
-
// it prices nothing, taking the correction discipline with it. Nothing outside
|
|
20
|
-
// this file catches either; the fleet never reads back the model it dispatched
|
|
21
|
-
// at (board.mjs parses `message.usage` off the subagent JSONL and drops
|
|
22
|
-
// `message.model` on the same line).
|
|
23
|
-
//
|
|
24
|
-
// Presence pins are not enough here. An earlier draft of these tests passed
|
|
25
|
-
// with the rule INVERTED end to end — corrections at `sonnet`, everything else
|
|
26
|
-
// at top tier — because every token it looked for was still somewhere in the
|
|
27
|
-
// slice. Each class is therefore pinned to its tier by ADJACENCY, with the
|
|
28
|
-
// competing tier token excluded from the gap.
|
|
5
|
+
import { between as section } from "./prose-pin.mjs";
|
|
6
|
+
import { CELL_DEF } from "./ledger-grammar.mjs";
|
|
7
|
+
|
|
8
|
+
// Implementers dispatch at the tier their DEFINITION declares, never one the
|
|
9
|
+
// controller passes: the dispatch rule omits `model` and names the definition
|
|
10
|
+
// `ledger.mjs dispatch` printed. Nothing outside this file pins either half of
|
|
11
|
+
// that rule. A dispatch that breaks it is caught only after the fact, at run
|
|
12
|
+
// time: tier-check.mjs compares the agent the member ran as, and the model and
|
|
13
|
+
// level the harness resolved, against the definition its ledger row names.
|
|
29
14
|
//
|
|
30
15
|
// Slice by named anchors and fail loudly when one moves; slice SIZE is what
|
|
31
16
|
// does the work. One slice per paragraph, never per phase: widen a slice to its
|
|
32
|
-
// phase and a neighbouring paragraph satisfies the pin on its own.
|
|
33
|
-
// the old phase 0 — delete step 4's `**correction-ticket discipline**` sentence
|
|
34
|
-
// and the pin on that phrase below stayed green regardless, on step 6's "which
|
|
35
|
-
// tickets carry the correction-ticket discipline" alone. #1804 retired step 6
|
|
36
|
-
// (the multi-select) and moved step 4 into phase 1's Pull as its step 3; the
|
|
37
|
-
// rule the measurement taught still holds, since phase 2's prompt paragraph
|
|
38
|
-
// names the same discipline a few hundred lines on.
|
|
17
|
+
// phase and a neighbouring paragraph satisfies the pin on its own.
|
|
39
18
|
const REPO = join(import.meta.dirname, "..");
|
|
40
19
|
const RUN_TEAM = readFileSync(join(REPO, "skills", "run-team", "SKILL.md"), "utf8");
|
|
41
20
|
|
|
42
|
-
//
|
|
43
|
-
//
|
|
44
|
-
|
|
45
|
-
|
|
21
|
+
// The first two slices each run from a named paragraph to the next anchor named
|
|
22
|
+
// here, several paragraphs on, so a neighbouring paragraph can satisfy a pin
|
|
23
|
+
// read over them. A failure here means the text was deleted OR relocated —
|
|
24
|
+
// check the rest of the file before assuming deletion.
|
|
46
25
|
const dispatch = () =>
|
|
47
26
|
section(RUN_TEAM, "**Dispatch every implementer", "**Guard: accumulate per PR", "run-team phase 2 dispatch rule");
|
|
48
27
|
const guard = () =>
|
|
49
28
|
section(RUN_TEAM, "**Guard: accumulate per PR", "Why the agent body carries what it does", "run-team phase 2 tier guard");
|
|
29
|
+
// Paragraph-tight: the dispatch rule alone, ending where the tier check opens.
|
|
30
|
+
// The paragraphs past it recount historical rows by vendor model name, so an
|
|
31
|
+
// absence pin read over `dispatch()` would refuse the file as it stands.
|
|
32
|
+
const dispatchRule = () =>
|
|
33
|
+
section(RUN_TEAM, "**Dispatch every implementer", "**After every Pull's dispatch", "run-team phase 2 dispatch rule paragraph");
|
|
50
34
|
|
|
51
|
-
|
|
52
|
-
// the `class=routine` → `sonnet` binding, whose SPAN the rebindings scan exempts.
|
|
53
|
-
const REVERT_NOTE = /\*\*`class=routine` → `sonnet` was REVERTED on [\s\S]*?\*\*/;
|
|
54
|
-
|
|
55
|
-
// Every `class=routine`/`sonnet` binding stated in `slice` that starts outside
|
|
56
|
-
// `note`'s span. Read one sentence at a time, via `sentences()`, with a gap that
|
|
57
|
-
// tolerates a period — never a first-period `[^.]` window over the raw slice
|
|
58
|
-
// (#1983). Any hit is a fault, so a window cut short is this scan's silent
|
|
59
|
-
// direction: "`class=routine` tickets follow `agents/fleet-implementer.agent.md`
|
|
60
|
-
// at `sonnet`" ended the old window at the filename's period and passed. The
|
|
61
|
-
// sentence is what bounds the gap, so a `class=routine` in one sentence never
|
|
62
|
-
// pairs with a `sonnet` in the next. Each sentence's offset is recovered by
|
|
63
|
-
// searching the slice from the previous sentence's end — sentences() drops the
|
|
64
|
-
// whitespace it splits on — so a hit's index is still an index into `slice`,
|
|
65
|
-
// comparable against the note's span as before.
|
|
66
|
-
//
|
|
67
|
-
// The note's own span is masked out of whichever sentence it falls in before
|
|
68
|
-
// matching, the same technique citationFault uses for quoted/parenthesized
|
|
69
|
-
// spans. Found in review: without this, a restoration glued onto the note's
|
|
70
|
-
// closing `**` with no whitespace before it (`.**;`, `.**,`, or nothing at
|
|
71
|
-
// all) leaves the note and the restoration in ONE sentence, because
|
|
72
|
-
// `sentences()` only splits at a terminator FOLLOWED by whitespace. The
|
|
73
|
-
// note's own `class=routine`/`sonnet` pair would then anchor a match whose
|
|
74
|
-
// gap runs past the note and swallows the restoration, and the exemption
|
|
75
|
-
// filter below — keyed on where the match STARTS — would read the whole
|
|
76
|
-
// thing as covered by the note, a silent miss the OLD raw-slice scan did not
|
|
77
|
-
// have (the note's literal period ended its `[^.]` tail first). Masking
|
|
78
|
-
// keeps the sentence the same length, so the offsets recovered above still
|
|
79
|
-
// line up, and the filter below is now a second, redundant guard rather than
|
|
80
|
-
// the only one.
|
|
81
|
-
//
|
|
82
|
-
// RESIDUAL: sentences() still cuts short at a `.)`, `."`, a mid-sentence `?`,
|
|
83
|
-
// a capitalised "E.g." or an "etc." (silent here — none of those four is in
|
|
84
|
-
// this slice today), and still merges two real sentences across #1987's
|
|
85
|
-
// `**late**.[1]` and #1899's sentence-final lowercase "vs." (an over-fire
|
|
86
|
-
// here, also absent today). `.**` itself is common in this slice (14
|
|
87
|
-
// bold-lead sentence ends) but each is a genuine boundary between two
|
|
88
|
-
// unrelated sentences, not one straddling a rebinding fact — the note's own
|
|
89
|
-
// `.**` is the one exception, which is exactly what the masking above is for
|
|
90
|
-
// rather than trusting the corpus to stay accidentally clean.
|
|
91
|
-
const REBINDING = /`class=routine`[\s\S]{0,120}sonnet[\s\S]{0,40}|sonnet[\s\S]{0,120}`class=routine`[\s\S]{0,40}/g;
|
|
92
|
-
const rebindingsOutside = (slice, note) => {
|
|
93
|
-
const noteAt = slice.indexOf(note);
|
|
94
|
-
const noteEnd = noteAt + note.length;
|
|
95
|
-
const hits = [];
|
|
96
|
-
let cursor = 0;
|
|
97
|
-
for (const sentence of sentences(slice)) {
|
|
98
|
-
const at = slice.indexOf(sentence, cursor);
|
|
99
|
-
cursor = at + sentence.length;
|
|
100
|
-
const overlapStart = Math.max(at, noteAt);
|
|
101
|
-
const overlapEnd = Math.min(cursor, noteEnd);
|
|
102
|
-
const masked = overlapStart < overlapEnd
|
|
103
|
-
? sentence.slice(0, overlapStart - at) + "#".repeat(overlapEnd - overlapStart) + sentence.slice(overlapEnd - at)
|
|
104
|
-
: sentence;
|
|
105
|
-
for (const hit of masked.matchAll(REBINDING)) {
|
|
106
|
-
const index = at + hit.index;
|
|
107
|
-
hits.push({ index, text: slice.slice(index, index + hit[0].length) });
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
return hits.filter((hit) => hit.index < noteAt || hit.index >= noteEnd).map((hit) => hit.text);
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
test("phase 0 step 4 still earns its class judgement now that the class prices nothing", () => {
|
|
114
|
-
const slice = step4();
|
|
115
|
-
|
|
116
|
-
// The criterion, not the label: what makes a ticket a correction ticket has
|
|
117
|
-
// to be checkable by the controller reading the issue, or the class is a coin
|
|
118
|
-
// flip. Not /docs|comments/ — this slice opens with `--json title,body,comments`,
|
|
119
|
-
// so the `comments` alternative stays green with the criterion deleted.
|
|
120
|
-
// Bound to the class it selects, with `routine` excluded from the gap: a bare
|
|
121
|
-
// /bad citations/ survives the two classes being swapped.
|
|
122
|
-
assert.match(
|
|
123
|
-
slice,
|
|
124
|
-
/bad citations(?:(?!routine)[^.])*?`class=correction`/,
|
|
125
|
-
"step 4 no longer routes the correction criterion to `class=correction`",
|
|
126
|
-
);
|
|
127
|
-
// What the class is FOR after the revert. Without this the judgement reads as
|
|
128
|
-
// vestigial and the next compression pass deletes it — taking the correction
|
|
129
|
-
// discipline, which is the half that caught real defects, with it.
|
|
130
|
-
assert.match(
|
|
131
|
-
slice,
|
|
132
|
-
/no longer selects a model tier/,
|
|
133
|
-
"step 4 no longer says the class stopped selecting a tier — the reverted binding reads as live again",
|
|
134
|
-
);
|
|
135
|
-
assert.match(
|
|
136
|
-
slice,
|
|
137
|
-
/correction-ticket\*{0,2} discipline/,
|
|
138
|
-
"step 4 no longer says what the class still selects, so the judgement reads as vestigial",
|
|
139
|
-
);
|
|
140
|
-
// THE NEGATIVE, half one of two. Restoring `class=routine` → `sonnet` here
|
|
141
|
-
// while phase 2 stays reverted is the self-contradiction the revert shipped
|
|
142
|
-
// with on its first pass: phase 0 priced the ticket, phase 2 ignored it, and
|
|
143
|
-
// nothing failed. The window spans sentences rather than one, because the
|
|
144
|
-
// stated reason for the one-sentence bound is false OF THIS SLICE: step 4
|
|
145
|
-
// holds ZERO `sonnet` occurrences, and every past-tense mention the bound was
|
|
146
|
-
// guarding against (L224, L235, L303, L304, L314) lives in the `dispatch` and
|
|
147
|
-
// `guard` slices, which this pin does not cover. Measured: under the old
|
|
148
|
-
// bound a restoration split across two sentences escaped the whole suite at
|
|
149
|
-
// 725/725; [\s\S]{0,400} reds it and leaves the clean tree green. Neither is
|
|
150
|
-
// the ORDER assumed — a restoration reading "`sonnet` is what `class=routine`
|
|
151
|
-
// tickets dispatch at" binds the class just as squarely and walks straight
|
|
152
|
-
// through the forward-only form, so both directions are scanned.
|
|
153
|
-
assert.doesNotMatch(
|
|
154
|
-
slice,
|
|
155
|
-
/`class=routine`[\s\S]{0,400}`sonnet`|`sonnet`[\s\S]{0,400}`class=routine`/,
|
|
156
|
-
"step 4 has re-bound `class=routine` to `sonnet` — the reverted rule is back in phase 0",
|
|
157
|
-
);
|
|
158
|
-
// Safe direction on a judgement with no tiebreak. The adjacent decided?
|
|
159
|
-
// judgement says "Torn → surface"; this one is cheap enough to just default.
|
|
160
|
-
assert.match(slice, /\*\*Torn → correction\*\*/, "step 4 lost its tiebreak, so a torn class dispatches on a guess");
|
|
161
|
-
// The citation is a precaution, NOT evidence about tiers —
|
|
162
|
-
// references/correction-tickets.md measures no tier and blames the ticket's
|
|
163
|
-
// framing. An earlier draft claimed the four-for-four happened "at top tier",
|
|
164
|
-
// a qualifier that reference does not carry. Pin the honesty, or it comes back.
|
|
165
|
-
assert.match(
|
|
166
|
-
slice,
|
|
167
|
-
/precaution, not a\s+\*{0,2}measurement/,
|
|
168
|
-
"step 4 states the correction exception as measured rather than as a precaution",
|
|
169
|
-
);
|
|
170
|
-
assert.match(
|
|
171
|
-
slice,
|
|
172
|
-
/measures no tier at\s+all/,
|
|
173
|
-
"step 4 no longer says the cited reference measures no tier — the citation reads as evidence again",
|
|
174
|
-
);
|
|
175
|
-
});
|
|
176
|
-
|
|
177
|
-
test("phase 2 dispatches every class at the session tier, and says so with a mechanism", () => {
|
|
35
|
+
test("phase 2 dispatches every implementer at its definition's tier, and says so with a mechanism", () => {
|
|
178
36
|
const slice = dispatch();
|
|
179
37
|
|
|
180
|
-
// The rule, bound to "whatever the class" so a re-introduced per-class branch
|
|
181
|
-
// reds here rather than silently coexisting with this sentence.
|
|
182
|
-
assert.match(
|
|
183
|
-
slice,
|
|
184
|
-
/omit `model` on the `task`\s+call, whatever the class/,
|
|
185
|
-
"phase 2 no longer dispatches every class the same way — a per-class tier branch is back",
|
|
186
|
-
);
|
|
187
|
-
// The revert is dated and attributed, or the next reader takes the missing
|
|
188
|
-
// tier for an omission and helpfully restores it. Pinned BEFORE the scan
|
|
189
|
-
// below, whose exemption is the SPAN this note occupies: a reworded note has
|
|
190
|
-
// to be diagnosed as a reworded note, or the scan reports it as a restored
|
|
191
|
-
// binding and sends the reader hunting a rebinding nobody made.
|
|
192
|
-
assert.match(
|
|
193
|
-
slice,
|
|
194
|
-
/REVERTED on 2026-08-16/,
|
|
195
|
-
"phase 2 no longer records WHEN and WHY the tier binding was removed",
|
|
196
|
-
);
|
|
197
|
-
// THE POSITIVE SHAPE PIN (#553). The pin above only checks the phrase is
|
|
198
|
-
// PRESENT somewhere in the slice, so a restoration clause written INSIDE
|
|
199
|
-
// the note — keeping "was REVERTED on 2026-08-16" intact — still satisfies
|
|
200
|
-
// it, then rides the scan's note exemption below to green: that exemption
|
|
201
|
-
// drops every hit starting inside the note's span, whatever else the hit
|
|
202
|
-
// says. Pin the note's own shape instead of slicing the note out before the
|
|
203
|
-
// scan (the rejected remedy — a larger change, not needed once the shape
|
|
204
|
-
// itself is pinned). Isolated to the bold span itself, not the whole slice,
|
|
205
|
-
// so a present-tense rebinding written anywhere else in THIS DISPATCH SLICE
|
|
206
|
-
// stays the rebindings scan's job below. Not "anywhere in phase 2": the
|
|
207
|
-
// `## Phase 2` heading is far wider than this paragraph, and the guard
|
|
208
|
-
// paragraph inside it has no rebindings scan of its own — this file holds
|
|
209
|
-
// exactly one.
|
|
210
|
-
//
|
|
211
|
-
// This doc's own convention grounds the shape: a dated note states one
|
|
212
|
-
// action on one date (comment above — "dated and attributed"), so a
|
|
213
|
-
// restoration smuggled inside it surfaces as a further date (when the
|
|
214
|
-
// restoration happened), as the state the binding is restored TO, or as a
|
|
215
|
-
// second mention of the binding itself. Those are the three checks below,
|
|
216
|
-
// in that order. Settled against a single edit to this note — appending
|
|
217
|
-
// "and is RESTORED on 2026-08-18, so routine members dispatch at `sonnet`
|
|
218
|
-
// again." — each of the three matches it independently and names the
|
|
219
|
-
// note, not the scan. A pure whitespace reflow, or a past-tense reword
|
|
220
|
-
// that adds no further mention of the binding, trips none of them — but
|
|
221
|
-
// that is narrower than "any reword": the third check's own grid below
|
|
222
|
-
// measures which benign rewords DO trip it (3/7, corrected below).
|
|
223
|
-
const revertNote = REVERT_NOTE.exec(slice)?.[0];
|
|
224
|
-
assert.ok(
|
|
225
|
-
revertNote,
|
|
226
|
-
"the revert note's opening clause changed shape enough that this pin can no longer find it — read the slice and update the anchor",
|
|
227
|
-
);
|
|
228
|
-
assert.equal(
|
|
229
|
-
(revertNote.match(/\d{4}-\d{2}-\d{2}/g) ?? []).length,
|
|
230
|
-
1,
|
|
231
|
-
"the revert note now names more than one date — a restoration is hiding inside the note whose span the rebindings scan exempts",
|
|
232
|
-
);
|
|
233
|
-
// ponytail: catches the measured restoration and any dated repeat of it,
|
|
234
|
-
// plus the specific verb this doc's own restorations are written with. The
|
|
235
|
-
// dateless restoration phrased without "restored" that this one lets past
|
|
236
|
-
// is the third check's job, below (#1226).
|
|
237
|
-
assert.doesNotMatch(
|
|
238
|
-
revertNote,
|
|
239
|
-
/\bRESTORED\b/i,
|
|
240
|
-
"the revert note now says the binding is RESTORED — a restoration is hiding inside the note whose span the rebindings scan exempts",
|
|
241
|
-
);
|
|
242
|
-
// THE TOKEN BUDGET (#1226). A restoration written inside the note that
|
|
243
|
-
// carries no second date and never spells "RESTORED" satisfies both checks
|
|
244
|
-
// above and then rides the scan's span exemption below, because that
|
|
245
|
-
// exemption drops every hit starting inside the note whatever the hit says.
|
|
246
|
-
// Measured from a copy of this tree under a scratch directory: the note
|
|
247
|
-
// re-ended "firing; that binding is back in force, so routine members
|
|
248
|
-
// dispatch at `sonnet`." left this file at 10/10.
|
|
249
|
-
//
|
|
250
|
-
// Pin what the note is ALLOWED TO SAY, not the vocabulary a restoration
|
|
251
|
-
// would say it in. The note's legitimate job is to state the reverted
|
|
252
|
-
// binding once; any further `class=routine` or `sonnet` inside it is a
|
|
253
|
-
// second statement of a binding the scan below is forbidden to look at.
|
|
254
|
-
// That invariant survives rewording. A word list does not.
|
|
255
|
-
//
|
|
256
|
-
// #1226 asked first whether #476's trigger was met, reading it as a count
|
|
257
|
-
// of misses. It is not a count: #476 closed with "re-open trigger: someone
|
|
258
|
-
// exhibits a regex that passes that grid", so the cross-review arithmetic
|
|
259
|
-
// the issue carried — is one review's two dimensions a second miss? — never
|
|
260
|
-
// gated anything; the grid did. Ten restoration mutants of this note and
|
|
261
|
-
// seven benign edits of it, each run as its own copy:
|
|
262
|
-
//
|
|
263
|
-
// instrument kills over-fires
|
|
264
|
-
// /\b(is|are) (now )?(back|restored|in force)\b/i 4/10 0/7
|
|
265
|
-
// the note states its binding exactly once 6/10 3/7 <- this
|
|
266
|
-
// tight one-clause template over the whole note 8/10 3/7
|
|
267
|
-
//
|
|
268
|
-
// Re-measured under independent review: an earlier pass of this comment
|
|
269
|
-
// claimed 0/7 for this row and claimed above that "a reflow or a
|
|
270
|
-
// past-tense-only reword trips none of them" — both wrong. This check
|
|
271
|
-
// counts mentions, not intent, so any benign edit that re-mentions
|
|
272
|
-
// `class=routine` or `sonnet` inside the note trips it exactly as a
|
|
273
|
-
// restoration would. The 3 over-fires on the 7-edit grid: pulling the
|
|
274
|
-
// guard paragraph's own adjacent "reverts `class=routine`" clause into the
|
|
275
|
-
// note, a reword naming the tier the class moved off to ("...instead of
|
|
276
|
-
// `sonnet`"), and a parenthetical gloss restating the binding for context.
|
|
277
|
-
// The other four — whitespace reflow, a past-tense-only reword that adds
|
|
278
|
-
// no mention, a comma fix, and a moved bold marker — leave the note's
|
|
279
|
-
// mention count at one and pass. Kept over the template row despite the
|
|
280
|
-
// now-tied 3/7: this row's over-fires are all edits that literally repeat
|
|
281
|
-
// the pinned tokens, the same shape a restoration takes, where the
|
|
282
|
-
// template's 3 over-fires (an em-dash reason, a semicolon expansion, a
|
|
283
|
-
// moved bold marker — #476's sentence-anchor column, reproduced) are
|
|
284
|
-
// structural and share nothing with a restoration. The suggested word list
|
|
285
|
-
// is rejected on its own mutant regardless of either row: drop "that
|
|
286
|
-
// binding is back in force" from the measured restoration and keep the
|
|
287
|
-
// restoration — "firing; routine members dispatch at `sonnet` again." —
|
|
288
|
-
// and it goes green where this check reds. Widening it is ruled out by
|
|
289
|
-
// docs/adr/0017-prose-pins-pin-content-not-modality.md (#529, #476).
|
|
290
|
-
//
|
|
291
|
-
// RESIDUAL, measured and still exposed — TWO gaps, not one:
|
|
292
|
-
// (1) a restoration that never re-states the binding at all — "that
|
|
293
|
-
// binding is back in force.", "That revert no longer holds.", "(since
|
|
294
|
-
// undone)." — passes all three checks here, because none of them read for
|
|
295
|
-
// restoration MODALITY, only for a repeated token or a repeated date.
|
|
296
|
-
// (2) a restoration that DOES re-state the binding, but in the doc's own
|
|
297
|
-
// unbackticked prose rather than the backticked `class=routine` literal —
|
|
298
|
-
// "routine members dispatch at `sonnet` again", placed outside the note —
|
|
299
|
-
// clears this check (it never touches the note) and clears the rebindings
|
|
300
|
-
// scan below (that scan's own regex requires the backticked
|
|
301
|
-
// `` `class=routine` `` token, which this reword never spells): measured
|
|
302
|
-
// 10/10 green on a copy of this tree. Gap (2) is strictly larger than gap
|
|
303
|
-
// (1) — it needs no dateless, wordless restoration trick, just the doc's
|
|
304
|
-
// ordinary vocabulary — and is not fixed here. Catching either is a
|
|
305
|
-
// question about prose MODALITY, and that is settled, not open:
|
|
306
|
-
// docs/adr/0017-prose-pins-pin-content-not-modality.md rules that prose
|
|
307
|
-
// pins assert content, never modality, and that an obligation which must
|
|
308
|
-
// not soften gets a code carrier (a script verdict surfaced as a
|
|
309
|
-
// fleet-tick row), not a prose pin. This residual is a recorded gap under
|
|
310
|
-
// that ADR. Do not close it with a longer word list.
|
|
311
|
-
assert.deepEqual(
|
|
312
|
-
(revertNote.match(/class=routine|sonnet/gi) ?? []).map((token) => token.toLowerCase()),
|
|
313
|
-
["class=routine", "sonnet"],
|
|
314
|
-
"the revert note mentions `class=routine` or `sonnet` more than once — either a restoration is hiding inside the note whose span the rebindings scan exempts, or this is a benign reword that re-mentions the binding (see the grid above); read the note before assuming which",
|
|
315
|
-
);
|
|
316
|
-
// THE NEGATIVE, half two of two. See the step-4 companion: the binding was
|
|
317
|
-
// stated independently in both places, so restoring either one alone is
|
|
318
|
-
// undetectable without a pin on each. Nothing is assumed between the two
|
|
319
|
-
// tokens — not the arrow, not a verb, not the backticks around `sonnet` —
|
|
320
|
-
// because the `class=routine` → `model: "sonnet"` literal this used to require
|
|
321
|
-
// is only one spelling of the restoration. Measured: `→ `sonnet``, "now
|
|
322
|
-
// resolves to", and `model:'sonnet'` each re-bind the class in the file's own
|
|
323
|
-
// vocabulary and each walked straight through the literal form. The one
|
|
324
|
-
// legitimate statement of the binding in this slice is the past-tense revert
|
|
325
|
-
// note, exempted by the SPAN it occupies rather than by narrowing the pattern
|
|
326
|
-
// back to a literal — a narrower pattern is what let the half-revert through.
|
|
327
|
-
// Exempting on the phrase "was REVERTED" instead was measured to swallow a
|
|
328
|
-
// live restoration written AFTER the note that quoted that phrase in its own
|
|
329
|
-
// sentence: the hit began past the note's end and was dropped anyway, because
|
|
330
|
-
// the filter read the hit's words rather than where it sat. A span cannot be
|
|
331
|
-
// quoted. The ORDER is not assumed either, for the same reason the arrow is
|
|
332
|
-
// not: the mirrored sentence states the same binding and matched nothing at
|
|
333
|
-
// all.
|
|
334
|
-
assert.deepEqual(
|
|
335
|
-
rebindingsOutside(slice, revertNote),
|
|
336
|
-
[],
|
|
337
|
-
"phase 2 states a `class=routine` → `sonnet` binding outside the past-tense revert note — the reverted rule is back",
|
|
338
|
-
);
|
|
339
38
|
// Anchored to the omission, not the word "inherit": the tier is obtained by
|
|
340
39
|
// NOT passing `model`, and "implementers run at the session tier" with no
|
|
341
40
|
// mechanism is exactly the instruction-names-no-mechanism defect the skill's
|
|
@@ -353,16 +52,19 @@ test("phase 2 dispatches every class at the session tier, and says so with a mec
|
|
|
353
52
|
/session's tier applies only when the definition\s+names none/,
|
|
354
53
|
"phase 2 states the omission mechanism without saying the definition's tier wins first",
|
|
355
54
|
);
|
|
356
|
-
// The dispatch rule has to
|
|
357
|
-
// somewhere the reader of this phase can neither find nor
|
|
55
|
+
// The dispatch rule has to name WHERE the definition comes from, or the
|
|
56
|
+
// tier is declared somewhere the reader of this phase can neither find nor
|
|
57
|
+
// audit. Since #2208 that is the `agent` `ledger.mjs dispatch` prints — a
|
|
58
|
+
// name recalled from this prose is exactly what a compaction dropped (#2208
|
|
59
|
+
// counts 11 implementers dispatched as generic `task`).
|
|
358
60
|
assert.match(
|
|
359
61
|
slice,
|
|
360
|
-
/agent
|
|
361
|
-
"phase 2 no longer dispatches the
|
|
62
|
+
/Dispatch every implementer with the `agent` that `ledger\.mjs dispatch`\s+printed/,
|
|
63
|
+
"phase 2 no longer dispatches the agent ledger.mjs dispatch printed",
|
|
362
64
|
);
|
|
363
65
|
assert.match(
|
|
364
66
|
slice,
|
|
365
|
-
/agents\/fleet-implementer
|
|
67
|
+
/agents\/fleet-implementer-<cell>\.agent\.md/,
|
|
366
68
|
"phase 2 no longer says WHERE the declared tier lives",
|
|
367
69
|
);
|
|
368
70
|
// `name` is orthogonal to `agent` and is what confers team membership —
|
|
@@ -374,44 +76,6 @@ test("phase 2 dispatches every class at the session tier, and says so with a mec
|
|
|
374
76
|
/Keep `name: impl-<N>`/,
|
|
375
77
|
"phase 2 no longer keeps the impl-<N> name alongside the dispatched agent",
|
|
376
78
|
);
|
|
377
|
-
|
|
378
|
-
// A lost class no longer misprices anything, but it still costs the correction
|
|
379
|
-
// discipline — so the recording rule has to survive the revert, and has to say
|
|
380
|
-
// what is actually lost or it reads as bookkeeping and gets dropped.
|
|
381
|
-
assert.match(
|
|
382
|
-
slice,
|
|
383
|
-
/\*\*No class recorded → record `class=unknown`, never a guess\.\*\*/,
|
|
384
|
-
"a missing class is no longer recorded as `class=unknown` — the gap goes invisible",
|
|
385
|
-
);
|
|
386
|
-
// Anchored to "still costs the", not bare: the phrase occurs TWICE in this
|
|
387
|
-
// slice — here, and incidentally in the REVERTED paragraph above ("it still
|
|
388
|
-
// governs the correction-ticket discipline"). Measured: an unanchored
|
|
389
|
-
// /correction-ticket discipline/ stayed green with this sentence's cost
|
|
390
|
-
// clause gutted, because the other copy satisfied it on its own. It pinned
|
|
391
|
-
// the phrase's existence somewhere in the slice, never the recording rule.
|
|
392
|
-
assert.match(
|
|
393
|
-
slice,
|
|
394
|
-
/still costs the \*\*correction-ticket discipline\*\*/,
|
|
395
|
-
"phase 2 no longer says what a lost class actually costs now that it prices nothing",
|
|
396
|
-
);
|
|
397
|
-
// Reconstructing the class from the model would resurrect the confound the
|
|
398
|
-
// revert removed, and would silently break under any future tier control.
|
|
399
|
-
assert.match(
|
|
400
|
-
slice,
|
|
401
|
-
/Never infer the class from the tier/,
|
|
402
|
-
"phase 2 no longer forbids inferring class from tier",
|
|
403
|
-
);
|
|
404
|
-
|
|
405
|
-
// All three ledger literals. Only `class=correction` was ever spelled, which
|
|
406
|
-
// left an absent field ambiguous between "ran routine", "never recorded" and
|
|
407
|
-
// "row predates the rule" — and partitioning by class is the guard's whole job.
|
|
408
|
-
for (const cls of ["routine", "correction", "unknown"]) {
|
|
409
|
-
assert.match(
|
|
410
|
-
slice,
|
|
411
|
-
new RegExp(`ledger\\.mjs row <N> "impl-<N> · class=${cls}"`),
|
|
412
|
-
`phase 2 no longer spells the ledger literal for class=${cls}`,
|
|
413
|
-
);
|
|
414
|
-
}
|
|
415
79
|
// `row` REPLACES the line (ledger.mjs's `data.rows[i] = line`). Replaying a
|
|
416
80
|
// two-token literal over a row carrying KILLED or → PR# drops those tokens with
|
|
417
81
|
// only `rewrote row #N` on stderr.
|
|
@@ -422,50 +86,28 @@ test("phase 2 dispatches every class at the session tier, and says so with a mec
|
|
|
422
86
|
);
|
|
423
87
|
});
|
|
424
88
|
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
const
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
"a `class=routine` and a `sonnet` in two different sentences read as one binding",
|
|
89
|
+
// The rule is "omit `model`", so the paragraph that states it names no value
|
|
90
|
+
// for `model` and no vendor model at all. The pins above assert the mechanism
|
|
91
|
+
// is present and stay green beside an appended sentence that contradicts it —
|
|
92
|
+
// measured: `Pass `model: "sonnet"` when the ticket is class=routine.` added
|
|
93
|
+
// before `Keep `name: impl-<N>``, full suite green. The paragraph's own
|
|
94
|
+
// "`model` set" and "omit `model`" are what these must accept: neither puts a
|
|
95
|
+
// colon after the word.
|
|
96
|
+
test("phase 2's dispatch rule binds no model value to any ticket", () => {
|
|
97
|
+
const slice = dispatchRule();
|
|
98
|
+
assert.doesNotMatch(
|
|
99
|
+
slice,
|
|
100
|
+
/\bmodel\b`?:\s*\S/,
|
|
101
|
+
"phase 2's dispatch rule now passes a `model` value — the declared tier is obtained by omitting it",
|
|
102
|
+
);
|
|
103
|
+
assert.doesNotMatch(
|
|
104
|
+
slice,
|
|
105
|
+
/\b(?:sonnet|opus|haiku)\b/i,
|
|
106
|
+
"phase 2's dispatch rule now names a vendor model — the tier lives in the definition's frontmatter, as a route",
|
|
444
107
|
);
|
|
445
108
|
});
|
|
446
109
|
|
|
447
|
-
test("
|
|
448
|
-
// Found in review of #1983: sentences() only splits at a terminator FOLLOWED
|
|
449
|
-
// by whitespace, so a restoration glued directly onto the note's closing
|
|
450
|
-
// `**` — a semicolon, a comma, or nothing at all before the next token —
|
|
451
|
-
// leaves the note and the restoration in ONE sentence. Unmasked, the note's
|
|
452
|
-
// own `class=routine`/`sonnet` pair anchors a match whose gap runs past the
|
|
453
|
-
// note and swallows the restoration, and the exemption filter, keyed on
|
|
454
|
-
// where the match starts, reads the whole thing as covered by the note.
|
|
455
|
-
const slice = dispatch();
|
|
456
|
-
const note = REVERT_NOTE.exec(slice)?.[0];
|
|
457
|
-
for (const glue of [
|
|
458
|
-
`${note}; \`class=routine\` is back at \`sonnet\`.`,
|
|
459
|
-
`${note}, and \`class=routine\` is back at \`sonnet\`.`,
|
|
460
|
-
`${note}\`class=routine\` binds \`sonnet\` immediately.`,
|
|
461
|
-
]) {
|
|
462
|
-
const mutated = slice.replace(note, glue);
|
|
463
|
-
assert.notEqual(mutated, slice, `the glued fixture no longer matches the dispatch slice: ${glue}`);
|
|
464
|
-
assert.equal(rebindingsOutside(mutated, note).length, 1, `a rebinding glued onto the note's own span read as covered by it: ${glue}`);
|
|
465
|
-
}
|
|
466
|
-
});
|
|
467
|
-
|
|
468
|
-
test("phase 2's guard is mandatory, runnable, and scoped to one class", () => {
|
|
110
|
+
test("phase 2's append duty is mandatory and per PR", () => {
|
|
469
111
|
const slice = guard();
|
|
470
112
|
|
|
471
113
|
// The unit. Supply is one Pull per free slot (ADR 0013), so no batch of
|
|
@@ -478,23 +120,6 @@ test("phase 2's guard is mandatory, runnable, and scoped to one class", () => {
|
|
|
478
120
|
"the guard no longer says why a batch is not a usable unit — it comes back otherwise",
|
|
479
121
|
);
|
|
480
122
|
|
|
481
|
-
// Runnable, not merely named. `compute-spend.mjs` is a pure module: no
|
|
482
|
-
// shebang, no process.argv, no main — running it prints nothing and exits 0,
|
|
483
|
-
// which reads as "no spend recorded". `board.mjs build` emits it at `.spend`
|
|
484
|
-
// (compute-board.mjs's `spend: inputs.spend ?? null`). The doesNotMatch is
|
|
485
|
-
// over a verified-zero baseline and needs the positive companion above it to
|
|
486
|
-
// stay meaningful. Case-sensitive on purpose, and ruled so twice (#529): the
|
|
487
|
-
// file on disk is lowercase and so is every reference to it, so an `i` flag
|
|
488
|
-
// would pin a spelling nothing in the repo can write. Settled with
|
|
489
|
-
// `grep -rio compute-spend --exclude-dir=.git . | grep -v ':compute-spend$'`,
|
|
490
|
-
// which is empty.
|
|
491
|
-
assert.match(slice, /board\.mjs build/, "the guard no longer names a runnable way to read spend");
|
|
492
|
-
assert.doesNotMatch(
|
|
493
|
-
slice,
|
|
494
|
-
/compute-spend\.mjs/,
|
|
495
|
-
"the guard points at compute-spend.mjs, which has no CLI — it exits 0 printing nothing",
|
|
496
|
-
);
|
|
497
|
-
|
|
498
123
|
// Normative, not advisory. This repo runs prose-compression passes that hedge
|
|
499
124
|
// exactly that way.
|
|
500
125
|
//
|
|
@@ -531,103 +156,59 @@ test("phase 2's guard is mandatory, runnable, and scoped to one class", () => {
|
|
|
531
156
|
/\bOptional\b|\byou may\b/i,
|
|
532
157
|
"the guard has been downgraded to advice — an optional guard is not a guard",
|
|
533
158
|
);
|
|
534
|
-
|
|
535
|
-
// A threshold, or "either climbs" fires on the first noisy pair or never.
|
|
536
|
-
assert.match(
|
|
537
|
-
slice,
|
|
538
|
-
/at least\s+three `class=routine` PRs/,
|
|
539
|
-
"the guard no longer states a minimum sample, so one PR's findings can trigger a revert",
|
|
540
|
-
);
|
|
541
|
-
// Findings/fix-rounds are the counter-signal: reviews run 3-5x LONGER than
|
|
542
|
-
// implementation, so an extra fix-round costs an implementer slot. A guard on
|
|
543
|
-
// spend alone measures the wrong side.
|
|
544
|
-
assert.match(
|
|
545
|
-
slice,
|
|
546
|
-
/one extra fix-round costs an implementer slot/,
|
|
547
|
-
"the guard measures spend without the fix-round cost that would eat the saving",
|
|
548
|
-
);
|
|
549
|
-
// The revert UNIT. `/revert/` alone stays green through "revert the rule",
|
|
550
|
-
// which is the wholesale revert this sentence exists to forbid.
|
|
551
|
-
assert.match(
|
|
552
|
-
slice,
|
|
553
|
-
/revert \*\*`class=routine`\*\*/,
|
|
554
|
-
"the guard no longer scopes the revert to the affected class",
|
|
555
|
-
);
|
|
556
|
-
// The first run under the rule has no top-tier PRs to compare against, so the
|
|
557
|
-
// guard reads clean by construction. Unstated, that silence reads as a pass.
|
|
558
|
-
assert.match(
|
|
559
|
-
slice,
|
|
560
|
-
/never read the guard's silence as a pass/i,
|
|
561
|
-
"the guard no longer warns that its first-run silence is a missing baseline, not a pass",
|
|
562
|
-
);
|
|
563
|
-
});
|
|
564
|
-
|
|
565
|
-
test("phase 3 owns the guard — otherwise nothing in the event loop ever runs it", () => {
|
|
566
|
-
// The guard lives in phase 2, which is entered per-dispatch, BEFORE the PRs it
|
|
567
|
-
// wants to measure exist. Phase 3's tick is what the controller actually acts
|
|
568
|
-
// on, and the alt Pull it names is where the floor is read (ADR 0005 as
|
|
569
|
-
// amended by ADR 0012), so the guard needs its paragraph there or it is
|
|
570
|
-
// unreachable by design.
|
|
571
|
-
const slice = section(RUN_TEAM, "**Tier guards under Pull.**", "**Own the CI waits.", "run-team phase 3 tier guard under Pull");
|
|
572
|
-
assert.match(
|
|
573
|
-
slice,
|
|
574
|
-
/alt Pull/,
|
|
575
|
-
"phase 3's tier-guard paragraph no longer names the alt Pull as where it runs",
|
|
576
|
-
);
|
|
577
|
-
assert.match(
|
|
578
|
-
slice,
|
|
579
|
-
/tier\s+guard/,
|
|
580
|
-
"no phase 3 step dispatches the tier guard — it is stated in phase 2 and never reached",
|
|
581
|
-
);
|
|
582
159
|
});
|
|
583
160
|
|
|
584
161
|
// ---------------------------------------------------------------------------
|
|
585
162
|
// THE DECLARATION ITSELF. Every pin above reads SKILL.md, so a tier changed in
|
|
586
|
-
// `agents/fleet-implementer
|
|
587
|
-
// dispatched tier flips — the same silent drift they exist to catch,
|
|
588
|
-
// around the document they read. That hazard is why the declaration
|
|
589
|
-
// with these
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
163
|
+
// an `agents/fleet-implementer-<cell>.agent.md` leaves all of them green while
|
|
164
|
+
// the dispatched tier flips — the same silent drift they exist to catch,
|
|
165
|
+
// routed around the document they read. That hazard is why the declaration
|
|
166
|
+
// arrived with these pins, and why they walk every implementer definition on
|
|
167
|
+
// disk rather than a list of names: a cell added tomorrow is pinned the day it
|
|
168
|
+
// lands (spec 2026-09-28 § 2).
|
|
169
|
+
const AGENTS = join(REPO, "agents");
|
|
170
|
+
const PREFIX = "fleet-implementer-";
|
|
171
|
+
const implementers = () =>
|
|
172
|
+
readdirSync(AGENTS).filter((f) => f.startsWith("fleet-implementer") && f.endsWith(".agent.md")).map((f) => f.slice(0, -".agent.md".length)).sort();
|
|
173
|
+
const fileOf = (name) => readFileSync(join(AGENTS, `${name}.agent.md`), "utf8");
|
|
174
|
+
const frontmatterOf = (name) => fileOf(name).split("---")[1] ?? "";
|
|
175
|
+
|
|
176
|
+
test("every implementer definition is named for a cell and declares exactly the route its name derives", () => {
|
|
594
177
|
// The declaration is one key, `model: "@<role>:<level>"` — the level rides
|
|
595
178
|
// on the model's own suffix (ADR 0014), so there is no second key to omit
|
|
596
179
|
// independently and leave the level inherited from whatever session
|
|
597
|
-
// dispatched the member.
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
const model = /^model:\s*"?(\S+?)"?$/m.exec(frontmatterOf(name))?.[1];
|
|
612
|
-
assert.match(model, /^@(slow|task|smol):(minimal|low|medium|high|xhigh|max)$/, `${name}: not a tier route: ${model}`);
|
|
180
|
+
// dispatched the member. A route, never a vendor id: a vendor id rots into
|
|
181
|
+
// a superseded generation that is weaker AND dearer, while the role alias
|
|
182
|
+
// tracks whatever `modelRoles` currently points it at. And the route is the
|
|
183
|
+
// NAME's: tier-check judges a `tier=<cell>` row against the definition that
|
|
184
|
+
// cell names, so a file whose route disagrees with its name runs every row
|
|
185
|
+
// at a cell nobody drew.
|
|
186
|
+
const names = implementers();
|
|
187
|
+
assert.ok(names.includes(`${PREFIX}slow-high`), `the policy cell's definition is missing: ${names.join(", ")}`);
|
|
188
|
+
for (const name of names) {
|
|
189
|
+
assert.ok(CELL_DEF.test(name), `${name}.agent.md is not named fleet-implementer-<cell> — nothing is named fleet-implementer alone`);
|
|
190
|
+
const [role, level] = name.slice(PREFIX.length).split("-");
|
|
191
|
+
const fm = frontmatterOf(name);
|
|
192
|
+
assert.match(fm, new RegExp(`^model: "@${role}:${level}"$`, "m"), `${name}.agent.md does not declare model: "@${role}:${level}"`);
|
|
193
|
+
assert.match(fm, new RegExp(`^name: ${name}$`, "m"), `${name}.agent.md's name: is not its file name`);
|
|
613
194
|
}
|
|
614
195
|
});
|
|
615
196
|
|
|
616
|
-
test("
|
|
197
|
+
test("every implementer definition lists no tools — a list would drop dispatch capability", () => {
|
|
617
198
|
// references/member-lifecycle.md's "Every member is named" section: the
|
|
618
199
|
// name is the ledger token and the hub address — a `tools:` list that
|
|
619
200
|
// narrows what the member can call costs it silently, with no error.
|
|
620
201
|
// Omit the key.
|
|
621
|
-
assert.doesNotMatch(frontmatterOf(
|
|
202
|
+
for (const name of implementers()) assert.doesNotMatch(frontmatterOf(name), /^tools:/m, name);
|
|
622
203
|
});
|
|
623
204
|
|
|
624
205
|
// ADR 0014's ruling records the layer-1 (#1314) key set for every fleet
|
|
625
206
|
// agent file: `name`, `description`, `model` — the level no longer rides a
|
|
626
|
-
// separate key. This file only pins the
|
|
207
|
+
// separate key. This file only pins the implementer definitions #1345's
|
|
627
208
|
// dispatch-time tier check reads — #1314 owns the general checker over
|
|
628
209
|
// every agent file in the tree.
|
|
629
|
-
test("
|
|
630
|
-
for (const name of
|
|
210
|
+
test("every implementer definition carries all three required keys", () => {
|
|
211
|
+
for (const name of implementers()) {
|
|
631
212
|
const fm = frontmatterOf(name);
|
|
632
213
|
for (const key of ["name", "description", "model"]) {
|
|
633
214
|
assert.match(fm, new RegExp(`^${key}:\\s*\\S`, "m"), `${name}.agent.md declares no ${key}`);
|
|
@@ -635,9 +216,20 @@ test("both implementer definitions carry all three required keys", () => {
|
|
|
635
216
|
}
|
|
636
217
|
});
|
|
637
218
|
|
|
638
|
-
|
|
639
|
-
//
|
|
640
|
-
//
|
|
641
|
-
//
|
|
642
|
-
//
|
|
643
|
-
//
|
|
219
|
+
test("every implementer definition's body is byte-identical (#1801)", () => {
|
|
220
|
+
// #1801 moved the shared implementer background into the definitions'
|
|
221
|
+
// BODIES, on the premise that a member reads its own agent.md body as
|
|
222
|
+
// `§ Role` whichever prompt dispatched it (measured on #1777: omp injects
|
|
223
|
+
// the body verbatim). A body that drifts between cells dispatches
|
|
224
|
+
// differently-briefed implementers under one label, and a cell comparison
|
|
225
|
+
// then measures the brief as well as the model — silently: the frontmatter
|
|
226
|
+
// pins above read one line each. Exact string equality over the whole body
|
|
227
|
+
// is the tightest pin this claim admits; nothing benign satisfies it by
|
|
228
|
+
// accident.
|
|
229
|
+
const body = (name) => fileOf(name).split("---").slice(2).join("---");
|
|
230
|
+
const [first, ...rest] = implementers();
|
|
231
|
+
assert.ok(rest.length > 0, "fewer than two implementer definitions — nothing to compare");
|
|
232
|
+
for (const name of rest) {
|
|
233
|
+
assert.equal(body(name), body(first), `${name}'s body has diverged from ${first}'s — the shared background must be pasted identically into every cell`);
|
|
234
|
+
}
|
|
235
|
+
});
|