@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,235 +0,0 @@
|
|
|
1
|
-
import { test } from "node:test";
|
|
2
|
-
import assert from "node:assert/strict";
|
|
3
|
-
import { readFileSync, readdirSync } from "node:fs";
|
|
4
|
-
import { join } from "node:path";
|
|
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.
|
|
14
|
-
//
|
|
15
|
-
// Slice by named anchors and fail loudly when one moves; slice SIZE is what
|
|
16
|
-
// does the work. One slice per paragraph, never per phase: widen a slice to its
|
|
17
|
-
// phase and a neighbouring paragraph satisfies the pin on its own.
|
|
18
|
-
const REPO = join(import.meta.dirname, "..");
|
|
19
|
-
const RUN_TEAM = readFileSync(join(REPO, "skills", "run-team", "SKILL.md"), "utf8");
|
|
20
|
-
|
|
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.
|
|
25
|
-
const dispatch = () =>
|
|
26
|
-
section(RUN_TEAM, "**Dispatch every implementer", "**Guard: accumulate per PR", "run-team phase 2 dispatch rule");
|
|
27
|
-
const guard = () =>
|
|
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");
|
|
34
|
-
|
|
35
|
-
test("phase 2 dispatches every implementer at its definition's tier, and says so with a mechanism", () => {
|
|
36
|
-
const slice = dispatch();
|
|
37
|
-
|
|
38
|
-
// Anchored to the omission, not the word "inherit": the tier is obtained by
|
|
39
|
-
// NOT passing `model`, and "implementers run at the session tier" with no
|
|
40
|
-
// mechanism is exactly the instruction-names-no-mechanism defect the skill's
|
|
41
|
-
// own tooling-fix triggers list calls out.
|
|
42
|
-
assert.match(
|
|
43
|
-
slice,
|
|
44
|
-
/dispatched with `model` set does not get the declared\s+tier back/,
|
|
45
|
-
"phase 2 no longer says HOW the declared tier is obtained — omitting `model` is still the mechanism",
|
|
46
|
-
);
|
|
47
|
-
// The omission resolves to the DEFINITION's tier first and the session's only
|
|
48
|
-
// after. Stated without that ordering, "omit `model`" reads as "inherit the
|
|
49
|
-
// session", which is what the declaration was written to stop being true.
|
|
50
|
-
assert.match(
|
|
51
|
-
slice,
|
|
52
|
-
/session's tier applies only when the definition\s+names none/,
|
|
53
|
-
"phase 2 states the omission mechanism without saying the definition's tier wins first",
|
|
54
|
-
);
|
|
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`).
|
|
60
|
-
assert.match(
|
|
61
|
-
slice,
|
|
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",
|
|
64
|
-
);
|
|
65
|
-
assert.match(
|
|
66
|
-
slice,
|
|
67
|
-
/agents\/fleet-implementer-<cell>\.agent\.md/,
|
|
68
|
-
"phase 2 no longer says WHERE the declared tier lives",
|
|
69
|
-
);
|
|
70
|
-
// `name` is orthogonal to `agent` and is what confers team membership —
|
|
71
|
-
// the ledger token and the hub address; both the spend classifier and
|
|
72
|
-
// member-outcomes.mjs read it. A rewrite that swaps the name for the
|
|
73
|
-
// agent silently unmakes the member.
|
|
74
|
-
assert.match(
|
|
75
|
-
slice,
|
|
76
|
-
/Keep `name: impl-<N>`/,
|
|
77
|
-
"phase 2 no longer keeps the impl-<N> name alongside the dispatched agent",
|
|
78
|
-
);
|
|
79
|
-
// `row` REPLACES the line (ledger.mjs's `data.rows[i] = line`). Replaying a
|
|
80
|
-
// two-token literal over a row carrying KILLED or → PR# drops those tokens with
|
|
81
|
-
// only `rewrote row #N` on stderr.
|
|
82
|
-
assert.match(
|
|
83
|
-
slice,
|
|
84
|
-
/replaces the whole line/,
|
|
85
|
-
"phase 2 shows a ledger literal without saying `row` replaces rather than appends",
|
|
86
|
-
);
|
|
87
|
-
});
|
|
88
|
-
|
|
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",
|
|
107
|
-
);
|
|
108
|
-
});
|
|
109
|
-
|
|
110
|
-
test("phase 2's append duty is mandatory and per PR", () => {
|
|
111
|
-
const slice = guard();
|
|
112
|
-
|
|
113
|
-
// The unit. Supply is one Pull per free slot (ADR 0013), so no batch of
|
|
114
|
-
// implementers exists to compare — the original rule compared one staged set
|
|
115
|
-
// of implementers against the set before it, two sets nobody can enumerate.
|
|
116
|
-
assert.match(slice, /unit is the PR/, "the guard's unit is no longer the PR");
|
|
117
|
-
assert.match(
|
|
118
|
-
slice,
|
|
119
|
-
/no implementer batches/,
|
|
120
|
-
"the guard no longer says why a batch is not a usable unit — it comes back otherwise",
|
|
121
|
-
);
|
|
122
|
-
|
|
123
|
-
// Normative, not advisory. This repo runs prose-compression passes that hedge
|
|
124
|
-
// exactly that way.
|
|
125
|
-
//
|
|
126
|
-
// A `/^\*\*Guard: /` pin sat here and was DELETED as a tautology (#529) — do
|
|
127
|
-
// not restore it on finding the guard heading unpinned. `section()` returns
|
|
128
|
-
// `source.slice(indexOf(startAnchor), end)`, so the slice opens with this
|
|
129
|
-
// block's start anchor whatever the end anchor is, and that regex carried no
|
|
130
|
-
// `m` flag: the start anchor alone satisfied it. A lead that breaks it breaks
|
|
131
|
-
// the anchor too, so `section()` reds first, under its own message.
|
|
132
|
-
//
|
|
133
|
-
// Settled by mutation, not argument. Replace the guard lead's
|
|
134
|
-
// `never conclude inside one run.**` with `never conclude inside one run —
|
|
135
|
-
// advisory, at your discretion, skip when time is short.**` in
|
|
136
|
-
// run-team/SKILL.md — the start anchor survives — then run
|
|
137
|
-
// `node --test plugin/scripts/*.test.mjs`: the suite stays green and
|
|
138
|
-
// the deleted pin's message appears nowhere in the output. Quote that whole
|
|
139
|
-
// span, not the `one run.**` tail: the tail is not unique in that SKILL, and
|
|
140
|
-
// its other hit is the `**Why not decide inside one run.**` heading that
|
|
141
|
-
// member-outcomes-prose.test.mjs uses as a `section()` end anchor — a global
|
|
142
|
-
// replace on the tail reds THAT suite, which reads as the deleted pin
|
|
143
|
-
// catching the hedge. Restore with `cp`, never `git checkout --`.
|
|
144
|
-
//
|
|
145
|
-
// That green is a recorded gap, not an open question:
|
|
146
|
-
// docs/adr/0017-prose-pins-pin-content-not-modality.md rules that prose
|
|
147
|
-
// pins pin content, never modality, and that this guard's obligation gets
|
|
148
|
-
// a code carrier — a script verdict surfaced as a fleet-tick row — with
|
|
149
|
-
// #2037's successor guard, not a stronger pin here. Until that lands, the
|
|
150
|
-
// mutation above stays green. The list below is a literal-word tripwire
|
|
151
|
-
// ONLY: it catches `Optional` and `you may` and nothing else, and the
|
|
152
|
-
// reworded lead uses neither. Widening it is ruled out by the same ADR,
|
|
153
|
-
// because that instrument was measured failing (#476).
|
|
154
|
-
assert.doesNotMatch(
|
|
155
|
-
slice,
|
|
156
|
-
/\bOptional\b|\byou may\b/i,
|
|
157
|
-
"the guard has been downgraded to advice — an optional guard is not a guard",
|
|
158
|
-
);
|
|
159
|
-
});
|
|
160
|
-
|
|
161
|
-
// ---------------------------------------------------------------------------
|
|
162
|
-
// THE DECLARATION ITSELF. Every pin above reads SKILL.md, so a tier changed in
|
|
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", () => {
|
|
177
|
-
// The declaration is one key, `model: "@<role>:<level>"` — the level rides
|
|
178
|
-
// on the model's own suffix (ADR 0014), so there is no second key to omit
|
|
179
|
-
// independently and leave the level inherited from whatever session
|
|
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`);
|
|
194
|
-
}
|
|
195
|
-
});
|
|
196
|
-
|
|
197
|
-
test("every implementer definition lists no tools — a list would drop dispatch capability", () => {
|
|
198
|
-
// references/member-lifecycle.md's "Every member is named" section: the
|
|
199
|
-
// name is the ledger token and the hub address — a `tools:` list that
|
|
200
|
-
// narrows what the member can call costs it silently, with no error.
|
|
201
|
-
// Omit the key.
|
|
202
|
-
for (const name of implementers()) assert.doesNotMatch(frontmatterOf(name), /^tools:/m, name);
|
|
203
|
-
});
|
|
204
|
-
|
|
205
|
-
// ADR 0014's ruling records the layer-1 (#1314) key set for every fleet
|
|
206
|
-
// agent file: `name`, `description`, `model` — the level no longer rides a
|
|
207
|
-
// separate key. This file only pins the implementer definitions #1345's
|
|
208
|
-
// dispatch-time tier check reads — #1314 owns the general checker over
|
|
209
|
-
// every agent file in the tree.
|
|
210
|
-
test("every implementer definition carries all three required keys", () => {
|
|
211
|
-
for (const name of implementers()) {
|
|
212
|
-
const fm = frontmatterOf(name);
|
|
213
|
-
for (const key of ["name", "description", "model"]) {
|
|
214
|
-
assert.match(fm, new RegExp(`^${key}:\\s*\\S`, "m"), `${name}.agent.md declares no ${key}`);
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
});
|
|
218
|
-
|
|
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
|
-
});
|
|
@@ -1,144 +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, phrase, stripHashGutter } from "./prose-pin.mjs";
|
|
6
|
-
|
|
7
|
-
// #800. Probe 3's comment borrows its rule from release-ticket.sh's
|
|
8
|
-
// worktree-registry read and cited that check by LINE. The line it named had
|
|
9
|
-
// stopped being that check — it landed in the argument-validation prose
|
|
10
|
-
// instead — and no test read inflight.sh as text, so a green run said nothing
|
|
11
|
-
// about it. The mismatch surfaced only when a review audited every
|
|
12
|
-
// line-numbered reference into release-ticket.sh in the tree, which is the one
|
|
13
|
-
// place a citation this shape can be checked at all.
|
|
14
|
-
//
|
|
15
|
-
// The convention that closes it is release-ticket.test.mjs's own: "The sites
|
|
16
|
-
// are named by construct throughout, never by line: they have moved every time
|
|
17
|
-
// this file was touched." So the citing-side pins below are a pair — the
|
|
18
|
-
// construct has to be named, and the form that rotted must not come back.
|
|
19
|
-
// Neither alone holds: the positive pin stays green beside a stray line
|
|
20
|
-
// citation, and the negative pin stays green if the whole clause is deleted.
|
|
21
|
-
//
|
|
22
|
-
// The negative pin forbids a citation FORM, not a vocabulary: a bare
|
|
23
|
-
// `release-ticket.sh` is exactly what the positive pin requires, so the
|
|
24
|
-
// accepting case is pinned here too rather than assumed.
|
|
25
|
-
//
|
|
26
|
-
// #870 adds the third pin, and it is the only one on the TARGET side. A
|
|
27
|
-
// construct citation rots less often than a line citation, not never: a pure
|
|
28
|
-
// identifier rename in release-ticket.sh — `s/\bwtroot\b/wt_registry/g`, zero
|
|
29
|
-
// behaviour change, no output or exit difference — left both pins above green
|
|
30
|
-
// while this file's prose named a `$wtroot` that release-ticket.sh no longer
|
|
31
|
-
// had. Measured on a copy of the tree before this pin existed: the whole
|
|
32
|
-
// `scripts/*.test.mjs` suite identical to the unmutated baseline.
|
|
33
|
-
//
|
|
34
|
-
// What the rename costs a reader is MISDIRECTION, not a dangling pointer.
|
|
35
|
-
// inflight.sh carries an identically-shaped guard on its own `$wtroot`, in its
|
|
36
|
-
// own `count_registry`, so a reader who greps the cited words after the rename
|
|
37
|
-
// lands on the CITING file's copy and reads it as the thing cited. The
|
|
38
|
-
// pre-#800 line citation pointed at unrelated prose, which a reader notices;
|
|
39
|
-
// this one would point at a real guard of the right shape in the wrong file,
|
|
40
|
-
// which a reader does not.
|
|
41
|
-
//
|
|
42
|
-
// Not a second existence check. release-ticket.test.mjs's `test("an unreadable
|
|
43
|
-
// worktree registry is unknown, never a release")` exercises modes `0o000` and
|
|
44
|
-
// `0o400`, and so already pins the guard's EXISTENCE and its `&&` — measured
|
|
45
|
-
// there: deleting the guard reds it, and weakening the `&&` to an `||` reds it
|
|
46
|
-
// too, because read-without-execute satisfies one half. What no behavioural
|
|
47
|
-
// test can pin is the guard's SPELLING, and the spelling is the whole of what
|
|
48
|
-
// a citation hands a reader. Coupling the prose to the identifier is the gap;
|
|
49
|
-
// re-checking that the guard exists would not touch it.
|
|
50
|
-
//
|
|
51
|
-
// The identifier has exactly one literal spelling in this file: WTROOT,
|
|
52
|
-
// defined below, right after the two file reads it sits beside. Both the
|
|
53
|
-
// citing-side phrase above and the target-side phrase below interpolate it
|
|
54
|
-
// rather than each spelling the word out, so the two pins cannot
|
|
55
|
-
// independently drift the way #870's own reproduction showed they could:
|
|
56
|
-
// rename release-ticket.sh's identifier, then patch only the target-side
|
|
57
|
-
// literal to match, and the suite used to go green while probe 3's comment
|
|
58
|
-
// still named the old one. Renaming WTROOT moves both phrases together, so
|
|
59
|
-
// that edit alone reds the citing-side pin against inflight.sh's untouched
|
|
60
|
-
// prose; editing release-ticket.sh alone without touching WTROOT reds the
|
|
61
|
-
// target-side pin as before. There is no single edit that turns the suite
|
|
62
|
-
// green without also fixing the citation.
|
|
63
|
-
//
|
|
64
|
-
// It lives HERE, with the citation, not in release-ticket.test.mjs. That file
|
|
65
|
-
// owns claims about release-ticket.sh's behaviour; this is a claim about what
|
|
66
|
-
// probe 3's comment promises, and a lone spelling literal parked beside a
|
|
67
|
-
// behavioural suite reads as unexplained with its reason in another file. The
|
|
68
|
-
// cost is that this file no longer reads inflight.sh alone — stated here
|
|
69
|
-
// rather than left for a reader to discover at the second `readFileSync`.
|
|
70
|
-
//
|
|
71
|
-
// THE CEILING, same as reaping-prose.test.mjs: PRESENCE pins over a bounded
|
|
72
|
-
// slice. Text spliced INSIDE the pinned clause reddens them; a whole new
|
|
73
|
-
// sentence appended after one, carving out an exception, does not. Reflow stays
|
|
74
|
-
// green by design — the words are pinned, not their layout — and that now holds
|
|
75
|
-
// on BOTH sides: the target-side pin goes through `phrase()` too, so re-wrapping
|
|
76
|
-
// the guard across lines keeps it green and only a changed token reds it.
|
|
77
|
-
//
|
|
78
|
-
// Two residuals the target-side slice narrows without closing. A whole-line `#`
|
|
79
|
-
// comment INSIDE `count_registry` that restates the guard verbatim would satisfy
|
|
80
|
-
// the pin with the code renamed: the slice is not comment-stripped, and
|
|
81
|
-
// release-ticket.sh does restate this guard in prose — its recount comment says
|
|
82
|
-
// "`count_registry`'s own `[ -r ] && [ -x ]` guard on $wtroot" — which is why
|
|
83
|
-
// the slice is bounded at all, and that restatement sits outside it. And a
|
|
84
|
-
// reflow that breaks the guard on a line-continuation `\` reds falsely, because
|
|
85
|
-
// `\s+` does not span a backslash; the failure names both sites and is cleared
|
|
86
|
-
// by touching either, which is the direction to be wrong in.
|
|
87
|
-
const INFLIGHT = readFileSync(join(import.meta.dirname, "inflight.sh"), "utf8");
|
|
88
|
-
const RELEASE_TICKET = readFileSync(join(import.meta.dirname, "release-ticket.sh"), "utf8");
|
|
89
|
-
|
|
90
|
-
// The one literal spelling of the identifier the guard below protects,
|
|
91
|
-
// named once so the citing-side and target-side phrases below cannot go out
|
|
92
|
-
// of sync with each other — see the note above the citing-side pin.
|
|
93
|
-
const WTROOT = "$wtroot";
|
|
94
|
-
|
|
95
|
-
// Bounded at both ends, by the probe's own heading and by the function the
|
|
96
|
-
// comment documents. inflight.sh names release-ticket.sh in other comments, on
|
|
97
|
-
// both sides of this slice; none of them satisfies the positive pin or trips
|
|
98
|
-
// the negative one today, and the bounds are what keep a future one from doing
|
|
99
|
-
// either with probe 3's clause untouched.
|
|
100
|
-
const probe3 = () =>
|
|
101
|
-
stripHashGutter(
|
|
102
|
-
between(INFLIGHT, "# Probe 3 — a local worktree or branch.", "probe_local() {", "inflight.sh"),
|
|
103
|
-
);
|
|
104
|
-
|
|
105
|
-
test("probe 3 names release-ticket.sh's worktree-registry guard by construct (#800)", () => {
|
|
106
|
-
assert.match(
|
|
107
|
-
probe3(),
|
|
108
|
-
phrase(`release-ticket.sh's \`-r\`/\`-x\` guard on \`${WTROOT}\``),
|
|
109
|
-
"probe 3 no longer names the check it borrows the establish-absence rule from, so a reader has nothing to follow to it",
|
|
110
|
-
);
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
test("probe 3 cites release-ticket.sh by construct, never by line (#800)", () => {
|
|
114
|
-
assert.doesNotMatch(
|
|
115
|
-
probe3(),
|
|
116
|
-
/release-ticket\.sh:\d/,
|
|
117
|
-
"a line-numbered citation into release-ticket.sh is back in probe 3's comment — the next insertion in that file moves the content out from under the number, which is how the previous one came to name the argument-validation prose instead of the registry check",
|
|
118
|
-
);
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
// The target side, bounded by `count_registry`'s own opening and by the entry
|
|
122
|
-
// loop's `-d` skip below the guard. Both bounds are CODE, deliberately: this
|
|
123
|
-
// pin's subject is code, and bounding it on a neighbouring COMMENT would make
|
|
124
|
-
// another file's prose load-bearing for this assertion — the rot this file is
|
|
125
|
-
// about, one level out. Both survive the rename the pin exists to catch, so a
|
|
126
|
-
// rename reds on the assertion, with its own message, rather than on
|
|
127
|
-
// `between`'s update-this-test throw. The slice is read RAW, never through
|
|
128
|
-
// `stripHashGutter`: the `#` gutter is what stops a WRAPPED comment restating
|
|
129
|
-
// the guard from satisfying a `\s+`-joined phrase.
|
|
130
|
-
const registryGuard = () =>
|
|
131
|
-
between(
|
|
132
|
-
RELEASE_TICKET,
|
|
133
|
-
"count_registry() {",
|
|
134
|
-
'[ -d "$entry" ] || continue',
|
|
135
|
-
"release-ticket.sh",
|
|
136
|
-
);
|
|
137
|
-
|
|
138
|
-
test("release-ticket.sh still spells the guard probe 3 cites the way probe 3 cites it (#870)", () => {
|
|
139
|
-
assert.match(
|
|
140
|
-
registryGuard(),
|
|
141
|
-
phrase(`[ -r "${WTROOT}" ] && [ -x "${WTROOT}" ]`),
|
|
142
|
-
"release-ticket.sh's count_registry no longer guards `$wtroot` with the `-r`/`-x` pair probe 3's comment names, so inflight.sh now cites a spelling that file does not have — and inflight.sh's own count_registry has an identically-shaped guard on its own `$wtroot`, so a reader who greps the cited words lands on the citing file's copy and reads it as the thing cited",
|
|
143
|
-
);
|
|
144
|
-
});
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
// #93. `run-team/SKILL.md`'s in-flight step said only "any hit = taken" and
|
|
2
|
-
// never named `inflight.sh`'s exit 2, so a controller following it literally had
|
|
3
|
-
// no instruction for "the question could not be answered". In `sh`, both
|
|
4
|
-
// `cmd || handle` and `if cmd; then` treat 1 and 2 alike, so the natural reading
|
|
5
|
-
// files an unanswerable probe under "taken" by accident rather than by rule —
|
|
6
|
-
// the safe direction, but undocumented.
|
|
7
|
-
//
|
|
8
|
-
// The pins below are the four rules the corrected step has to carry, each
|
|
9
|
-
// checked against `inflight.sh` itself before being written down:
|
|
10
|
-
//
|
|
11
|
-
// 1. exit 2 from a probe failure carries the same JSON as 0 and 1 plus an
|
|
12
|
-
// `unknown[]` (inflight.sh's header, and its single unconditional
|
|
13
|
-
// `{"issue":%s,"taken":%s,…}` printf, which every rc reaches);
|
|
14
|
-
// 2. `taken` is false on that payload (its `taken=false` arms), summarizing
|
|
15
|
-
// `hits` and NOT claiming the ticket is free — so a consumer reads
|
|
16
|
-
// `unknown`;
|
|
17
|
-
// 3. a hit outranks an unknown, so a non-empty `hits[]` AND a non-empty
|
|
18
|
-
// `unknown[]` is exit 1, taken (its `taken=true`/`rc=1` arm);
|
|
19
|
-
// 4. four causes still exit 2 with no payload at all — the `die()` inflight.sh
|
|
20
|
-
// defines up top, reached by a bad argument (its usage and numeric-issue
|
|
21
|
-
// guards), not being inside a git repository, `issue #$n does not exist in
|
|
22
|
-
// this repository`, and `could not write the verdict` — so exit 2 is not
|
|
23
|
-
// assumed to parse.
|
|
24
|
-
//
|
|
25
|
-
// Rule 4 is the one that makes the other three safe to state: without it the
|
|
26
|
-
// step would read as "exit 2 always carries a payload", which is false, and a
|
|
27
|
-
// consumer that reaches for `.unknown` on a `die()` would find no stdout at all.
|
|
28
|
-
//
|
|
29
|
-
// `next-ticket/SKILL.md` is pinned too, not corrected — it already carried the
|
|
30
|
-
// rule and is the wording run-team was told to match. If it drifts, the two
|
|
31
|
-
// documents disagree about one script and this test says so.
|
|
32
|
-
//
|
|
33
|
-
// THE CEILING, same as refuter-scratch-prose.test.mjs: these are PRESENCE pins
|
|
34
|
-
// over a bounded slice. Text spliced INSIDE a pinned phrase reddens them; a
|
|
35
|
-
// whole new sentence appended after one, carving out an exception, does not.
|
|
36
|
-
// A reflow (line wraps, `**bold**` moved) stays green by design.
|
|
37
|
-
import { test } from "node:test";
|
|
38
|
-
import assert from "node:assert/strict";
|
|
39
|
-
import { readFileSync } from "node:fs";
|
|
40
|
-
import { join } from "node:path";
|
|
41
|
-
import { between, phrase } from "./prose-pin.mjs";
|
|
42
|
-
|
|
43
|
-
const REPO = join(import.meta.dirname, "..");
|
|
44
|
-
const read = (...p) => readFileSync(join(REPO, ...p), "utf8");
|
|
45
|
-
const RUN_TEAM = read("skills", "run-team", "SKILL.md");
|
|
46
|
-
const NEXT_TICKET = read("skills", "next-ticket", "SKILL.md");
|
|
47
|
-
|
|
48
|
-
const step = () =>
|
|
49
|
-
between(RUN_TEAM, "**In-flight check, again**", "**Read the ticket in full, once**", "run-team/SKILL.md phase 1 Pull step 2");
|
|
50
|
-
|
|
51
|
-
test("the in-flight step names exit 2 and refuses to read it as free", () => {
|
|
52
|
-
assert.match(step(), phrase("Exit 2 is not free"));
|
|
53
|
-
assert.match(step(), phrase("treat it as taken"));
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
test("the in-flight step tells the reader to read `unknown`, not `taken` alone", () => {
|
|
57
|
-
assert.match(step(), phrase("read `unknown`, never `taken` alone"));
|
|
58
|
-
// The trap the payload sets: exit 2 says taken:false, which is a summary of
|
|
59
|
-
// `hits` and not a claim about the ticket.
|
|
60
|
-
assert.match(step(), phrase('exit 2 says `"taken": false`'));
|
|
61
|
-
assert.match(step(), phrase("not a claim the ticket is free"));
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
test("the in-flight step ranks a hit above an unknown", () => {
|
|
65
|
-
assert.match(step(), phrase("A hit outranks an unknown"));
|
|
66
|
-
// Both arrays non-empty at exit 1 is the case the rule exists for.
|
|
67
|
-
assert.match(step(), phrase("non-empty `hits[]` and a non-empty `unknown[]` at exit 1"));
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
test("the in-flight step denies that exit 2 always parses", () => {
|
|
71
|
-
assert.match(step(), phrase("Four causes print nothing at all"));
|
|
72
|
-
assert.match(step(), phrase("a bad argument, not inside a git repository, no such issue, a verdict that could not be written"));
|
|
73
|
-
assert.match(step(), phrase("never assume exit 2 parses"));
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
test("next-ticket/SKILL.md still carries the wording run-team was made to match", () => {
|
|
77
|
-
const s = between(NEXT_TICKET, "## 3. In-flight check", "## 4. Suggest", "next-ticket/SKILL.md");
|
|
78
|
-
assert.match(s, phrase("0 free, 1 taken, 2 unanswerable"));
|
|
79
|
-
assert.match(s, phrase("Exit 2 is not free"));
|
|
80
|
-
assert.match(s, phrase("treat it as taken until you know"));
|
|
81
|
-
});
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
// #415. `inflight.sh` sets `set -eu`, then runs each probe as `probe_X || :`.
|
|
2
|
-
// POSIX exempts a function's whole execution from `-e` while its status is what
|
|
3
|
-
// an `||` is testing, so `-e` reaches no command run DIRECTLY in a probe body.
|
|
4
|
-
// It does still reach inside a command substitution there — that is a subshell,
|
|
5
|
-
// and of the three shells only bash carries the exemption into one — which is
|
|
6
|
-
// why the wrappers carve that case out and why these pins cover the carve-out.
|
|
7
|
-
// Nothing fails open today — every status-producing command in the three bodies
|
|
8
|
-
// carries its own guard — but the next edit inside a probe is where that stops
|
|
9
|
-
// being true, and an editor adding a command stands at the wrapper.
|
|
10
|
-
//
|
|
11
|
-
// So all three wrappers carry the rule, and this pins it at all three rather
|
|
12
|
-
// than at whichever one a reader happens to open. That is the failure shape
|
|
13
|
-
// worth guarding: the rule surviving at one site while another loses it reads
|
|
14
|
-
// as covered, and the site an editor is standing at is the one that matters.
|
|
15
|
-
// `between` is bounded at both ends here, so a block deleted outright fails on
|
|
16
|
-
// its own missing bound rather than being satisfied by a sibling's copy.
|
|
17
|
-
//
|
|
18
|
-
// The clauses pinned are the ones an editor ACTS on, not the prose around them:
|
|
19
|
-
// that `-e` does not reach inside; that a verdict-feeding command needs its own
|
|
20
|
-
// `add_unknown …; return 1` naming that probe's key; that leaving it unguarded
|
|
21
|
-
// frees a ticket that is taken (the unsafe direction, which is why this is not
|
|
22
|
-
// tidiness); and that a command which cannot change the verdict must record no
|
|
23
|
-
// unknown — the distinction `probe_pr`'s `raw="?"` count already embodies, and
|
|
24
|
-
// the one a rule stated without it would get wrong on first use.
|
|
25
|
-
//
|
|
26
|
-
// The enforcement for the rule's BEHAVIOUR is in inflight.test.mjs ("probe 3: a
|
|
27
|
-
// branch LOOKUP that could not run is unknown, never free"), which reddens when
|
|
28
|
-
// a guard is actually removed. This file only pins that the rule is stated.
|
|
29
|
-
//
|
|
30
|
-
// THE CEILING: these are PRESENCE pins over a bounded slice. Text spliced inside
|
|
31
|
-
// a pinned phrase reddens them; a sentence appended after one, carving out an
|
|
32
|
-
// exception, does not. A reflow stays green by design — `phrase` matches across
|
|
33
|
-
// the comment gutter that a re-wrap moves.
|
|
34
|
-
import { test } from "node:test";
|
|
35
|
-
import assert from "node:assert/strict";
|
|
36
|
-
import { readFileSync } from "node:fs";
|
|
37
|
-
import { join } from "node:path";
|
|
38
|
-
import { between, phrase, stripHashGutter } from "./prose-pin.mjs";
|
|
39
|
-
|
|
40
|
-
const SH = readFileSync(join(import.meta.dirname, "inflight.sh"), "utf8");
|
|
41
|
-
|
|
42
|
-
// Keyed by the probe's own name and the `unknown` key it records under, so a
|
|
43
|
-
// block copied between sites without its key being updated is a failure here
|
|
44
|
-
// rather than a guard pointing at the wrong probe.
|
|
45
|
-
const PROBES = [["probe_pr", "pr"], ["probe_remote", "remote"], ["probe_local", "local"]];
|
|
46
|
-
|
|
47
|
-
const rule = (probe) =>
|
|
48
|
-
stripHashGutter(between(SH, `ADDING A COMMAND TO ${probe}`, `${probe} || :`, "inflight.sh"));
|
|
49
|
-
|
|
50
|
-
for (const [probe, key] of PROBES) {
|
|
51
|
-
test(`${probe}'s wrapper states the \`set -e\` exemption and its limits`, () => {
|
|
52
|
-
assert.match(rule(probe), phrase("`set -e` does not reach a command run DIRECTLY in the body"));
|
|
53
|
-
// Named as the shells the script actually runs under, because the claim is
|
|
54
|
-
// shell semantics and a reader who assumes it is a bash quirk will discount it.
|
|
55
|
-
// "in that shape" is load-bearing: the three-shell measurement covers a
|
|
56
|
-
// command run directly in the body, and carrying it over to a command
|
|
57
|
-
// substitution is the overclaim this wording exists to stop.
|
|
58
|
-
assert.match(rule(probe), phrase("measured in that shape under /bin/sh, /bin/dash and /bin/bash"));
|
|
59
|
-
// The carve-out itself, pinned separately so the sentence above cannot be
|
|
60
|
-
// widened back to "does not reach inside the body" — false of the
|
|
61
|
-
// `heads=$( … )` substitution probe_remote's own body is built around,
|
|
62
|
-
// under both /bin/sh and /bin/dash.
|
|
63
|
-
assert.match(rule(probe), phrase("only /bin/bash carries the exemption into one"));
|
|
64
|
-
// `-u` is NOT exempted, and an editor who reads "`set -eu` guards nothing
|
|
65
|
-
// here" as covering both would skip a guard it does still provide. But the
|
|
66
|
-
// abort is not the loud backstop the bare clause reads as, so where it
|
|
67
|
-
// lands is pinned with it: advertising a net that reports free is the
|
|
68
|
-
// #415 defect restated in the prose meant to prevent it.
|
|
69
|
-
assert.match(rule(probe), phrase("`-u` is exempted at neither level and still aborts"));
|
|
70
|
-
assert.match(rule(probe), phrase("it exits 0 with no payload — the free verdict"));
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
test(`${probe}'s wrapper demands a guard naming its own \`${key}\` key`, () => {
|
|
74
|
-
assert.match(rule(probe), phrase("A command that feeds a verdict field therefore carries its own"));
|
|
75
|
-
assert.match(rule(probe), phrase(`add_unknown "${key}"`));
|
|
76
|
-
// The `; return 1; }` half is what makes the guard a guard. Pinned in the
|
|
77
|
-
// same span as the key, because a rewrite to `|| add_unknown "K" "…"`
|
|
78
|
-
// teaches "record the unknown and keep going" — a probe reporting a
|
|
79
|
-
// definite absence and an unknown from the same run — and every other
|
|
80
|
-
// assertion in this file stays green through it (measured).
|
|
81
|
-
assert.match(rule(probe), phrase(`add_unknown "${key}" "…"; return 1; }`));
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
test(`${probe}'s wrapper names the unsafe direction, not just the failure`, () => {
|
|
85
|
-
// The whole severity argument: an unguarded failure is not a loud abort.
|
|
86
|
-
// ONE contiguous span, not three independent `phrase` matches: the
|
|
87
|
-
// invariant lives in the join. An exception clause spliced between "taken"
|
|
88
|
-
// and "a free verdict" reverses the guidance while leaving all three
|
|
89
|
-
// fragments intact, and three separate matches stayed green through
|
|
90
|
-
// exactly that mutation (measured). Same form finisher-pin-race-prose
|
|
91
|
-
// already uses for this defect class.
|
|
92
|
-
assert.match(rule(probe), phrase("gets reported as a definite absence, and frees a ticket that is taken — a free verdict puts a second agent on the ticket where a taken one only skips it"));
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
test(`${probe}'s wrapper exempts a command that cannot change the verdict`, () => {
|
|
96
|
-
assert.match(rule(probe), phrase("A command that cannot change the verdict is the opposite case and must record no unknown"));
|
|
97
|
-
assert.match(rule(probe), phrase('`probe_pr`\'s `raw="?"` count already has'));
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
// The exemption the rule points at has to still be the shape it describes: a
|
|
102
|
-
// tally guarded with `|| raw="?"` rather than an `add_unknown`. If that count
|
|
103
|
-
// ever starts recording an unknown, every one of the blocks above is teaching
|
|
104
|
-
// the distinction off an example that no longer holds.
|
|
105
|
-
test("the count the rule cites is still guarded without recording an unknown", () => {
|
|
106
|
-
const tally = between(SH, 'raw=$(printf', 'if [ -n "$pr" ]', "inflight.sh");
|
|
107
|
-
assert.match(tally, /\|\|\s*raw="\?"/);
|
|
108
|
-
assert.doesNotMatch(tally, /add_unknown/);
|
|
109
|
-
});
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
// #1075. `inflight.sh`'s three probes each ask whether a branch-shaped claim
|
|
2
|
-
// exists on a ticket — a PR, a remote head, a local branch, or a worktree —
|
|
3
|
-
// and phase 0's in-flight step said only "any hit = taken", never what a MISS
|
|
4
|
-
// means. A controller reading a free verdict took it as "nobody is on this",
|
|
5
|
-
// which the three probes cannot tell it: work done directly against the
|
|
6
|
-
// shared checkout — a concurrent human or agent session editing the ticket's
|
|
7
|
-
// target files there — stakes no branch-shaped claim and trips none of them.
|
|
8
|
-
// #1075's own thread measured exactly this: a candidate read free while a
|
|
9
|
-
// concurrent `/triage` session was mid-edit on its target region, outside any
|
|
10
|
-
// branch the scan could see.
|
|
11
|
-
//
|
|
12
|
-
// The fix adds one paragraph to the SAME phase-0 step a reader is already in
|
|
13
|
-
// when they read the scan's verdict — bounded here identically to
|
|
14
|
-
// inflight-exit2-prose.test.mjs's own slice, "**In-flight check**" through
|
|
15
|
-
// the next item's heading — so wording landing outside that step, or in a
|
|
16
|
-
// general narrative section elsewhere, throws here rather than reading as
|
|
17
|
-
// covered.
|
|
18
|
-
//
|
|
19
|
-
// THE CEILING, same as finisher-pin-race-prose.test.mjs: the scope sentence
|
|
20
|
-
// pins two joined facts — "probes see branch-shaped claims only" and "so a
|
|
21
|
-
// free verdict proves nothing about editing" — as ONE contiguous phrase,
|
|
22
|
-
// never two separate assertions on the same sentence. Two assertions would
|
|
23
|
-
// leave the JOIN open to a spliced exception clause inserted between them
|
|
24
|
-
// (finisher-pin-race-prose.test.mjs's own demonstrated defect); one exact-span
|
|
25
|
-
// assertion reds on that splice instead, because `phrase()` requires every
|
|
26
|
-
// word adjacent with only whitespace between. Measured: splicing ", except
|
|
27
|
-
// when every probe reports clean," between "evidence" and "that nobody" reds
|
|
28
|
-
// this file's second test while every other test in the suite stays green; a
|
|
29
|
-
// benign rewrap at a different column stays green on both tests, since
|
|
30
|
-
// `phrase()` matches across the line-wrap whitespace by design.
|
|
31
|
-
import { test } from "node:test";
|
|
32
|
-
import assert from "node:assert/strict";
|
|
33
|
-
import { readFileSync } from "node:fs";
|
|
34
|
-
import { join } from "node:path";
|
|
35
|
-
import { between, phrase } from "./prose-pin.mjs";
|
|
36
|
-
|
|
37
|
-
const REPO = join(import.meta.dirname, "..");
|
|
38
|
-
const RUN_TEAM = readFileSync(join(REPO, "skills", "run-team", "SKILL.md"), "utf8");
|
|
39
|
-
|
|
40
|
-
const step = () =>
|
|
41
|
-
between(RUN_TEAM, "**In-flight check, again**", "**Read the ticket in full, once**", "run-team/SKILL.md phase 1 Pull step 2");
|
|
42
|
-
|
|
43
|
-
test("the in-flight step names the four branch-shaped claims the scan's probes look for", () => {
|
|
44
|
-
assert.match(
|
|
45
|
-
step(),
|
|
46
|
-
phrase("a PR, a remote head, a local branch, or a worktree"),
|
|
47
|
-
"the in-flight step no longer names what the three probes actually detect, so a reader has no way to know the ceiling on a free verdict",
|
|
48
|
-
);
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
test("the in-flight step states, as one exact span, that a free verdict is not evidence nobody is editing the ticket's files", () => {
|
|
52
|
-
assert.match(
|
|
53
|
-
step(),
|
|
54
|
-
phrase("A free verdict is not evidence that nobody is editing the ticket's target files."),
|
|
55
|
-
"the scope claim is gone, reworded past recognition, or split into two halves — which would let a splice inserted between them go undetected",
|
|
56
|
-
);
|
|
57
|
-
});
|