@feigi/fleet-ctl 0.0.0
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/.claude-plugin/plugin.json +9 -0
- package/LICENSE +202 -0
- package/NOTICE +18 -0
- package/agents/fleet-finisher.agent.md +7 -0
- package/agents/fleet-implementer-alt.agent.md +210 -0
- package/agents/fleet-implementer.agent.md +210 -0
- package/agents/fleet-merge-bot.agent.md +7 -0
- package/agents/fleet-review-comments.agent.md +40 -0
- package/agents/fleet-review-correctness.agent.md +43 -0
- package/agents/fleet-review-runner.agent.md +73 -0
- package/agents/fleet-review-silent-failure.agent.md +49 -0
- package/agents/fleet-review-simplify.agent.md +46 -0
- package/agents/fleet-review-snapshot.agent.md +24 -0
- package/agents/fleet-review-tests.agent.md +46 -0
- package/agents/fleet-review-types.agent.md +41 -0
- package/agents/fleet-review-verifier.agent.md +29 -0
- package/commands/review-and-fix.md +98 -0
- package/commands/run-merge-bot.md +357 -0
- package/commands/run-team-help.md +17 -0
- package/package.json +23 -0
- package/scripts/agent-test-dir-prose.test.mjs +59 -0
- package/scripts/agent-test.test.mjs +1636 -0
- package/scripts/ambient-git-vars-mjs-prose.test.mjs +354 -0
- package/scripts/ambient-git-vars-prose.test.mjs +192 -0
- package/scripts/ancestry-check-position-prose.test.mjs +175 -0
- package/scripts/apply-ruleset.test.mjs +420 -0
- package/scripts/arg-header-probes-prose.test.mjs +393 -0
- package/scripts/arg.mjs +600 -0
- package/scripts/arg.test.mjs +1354 -0
- package/scripts/board-cli.test.mjs +694 -0
- package/scripts/board-identity.test.mjs +429 -0
- package/scripts/board-liveness-banner.test.mjs +119 -0
- package/scripts/board-prev-shape.test.mjs +229 -0
- package/scripts/board-tryparse-null.test.mjs +119 -0
- package/scripts/board.html +471 -0
- package/scripts/board.mjs +2037 -0
- package/scripts/board.test.mjs +3086 -0
- package/scripts/brief-after-cut-prose.test.mjs +53 -0
- package/scripts/candidates-exit3-prose.test.mjs +302 -0
- package/scripts/candidates.mjs +674 -0
- package/scripts/candidates.test.mjs +2101 -0
- package/scripts/caveat-unification-prose.test.mjs +98 -0
- package/scripts/ci-comment-rot-prose.test.mjs +2025 -0
- package/scripts/ci-completes-premise-prose.test.mjs +257 -0
- package/scripts/ci-state-prose.test.mjs +113 -0
- package/scripts/ci-state.mjs +761 -0
- package/scripts/ci-state.test.mjs +1640 -0
- package/scripts/ci-vacuous-green.test.mjs +368 -0
- package/scripts/citation-sweep-prose.test.mjs +1572 -0
- package/scripts/claim-lifecycle.test.mjs +185 -0
- package/scripts/claim-ticket.sh +417 -0
- package/scripts/claim-ticket.test.mjs +1121 -0
- package/scripts/closing-keyword-prose.test.mjs +193 -0
- package/scripts/cockpit-launch-idempotent-prose.test.mjs +165 -0
- package/scripts/cockpit-tick-nonblocking.test.mjs +210 -0
- package/scripts/compute-board.mjs +579 -0
- package/scripts/compute-board.test.mjs +1060 -0
- package/scripts/compute-spend.mjs +329 -0
- package/scripts/compute-spend.test.mjs +451 -0
- package/scripts/cross-repo-citation-prose.test.mjs +156 -0
- package/scripts/cwd-isolation-pins.mjs +83 -0
- package/scripts/dedupe-guard-prose.test.mjs +243 -0
- package/scripts/derive-testcmd.sh +239 -0
- package/scripts/derive-testcmd.test.mjs +380 -0
- package/scripts/diff-stats.mjs +231 -0
- package/scripts/diff-stats.test.mjs +408 -0
- package/scripts/dispatch-block-golden-prose.test.mjs +1024 -0
- package/scripts/dispatch-block-pins-prose.test.mjs +615 -0
- package/scripts/drop-merged-label.sh +173 -0
- package/scripts/drop-merged-label.test.mjs +480 -0
- package/scripts/expected-jobs-prose.test.mjs +80 -0
- package/scripts/filing-bar-seat-prose.test.mjs +242 -0
- package/scripts/filing-claim-bar-prose.test.mjs +166 -0
- package/scripts/finisher-dispatch-premise-prose.test.mjs +312 -0
- package/scripts/finisher-halt-prose.test.mjs +106 -0
- package/scripts/finisher-name-prose.test.mjs +134 -0
- package/scripts/finisher-own-tree-prose.test.mjs +285 -0
- package/scripts/finisher-pin-race-prose.test.mjs +339 -0
- package/scripts/fix-applier-correction-rules-prose.test.mjs +201 -0
- package/scripts/fix-applier-result-file-prose.test.mjs +100 -0
- package/scripts/fleet-bootstrap +155 -0
- package/scripts/fleet-heartbeat.mjs +272 -0
- package/scripts/fleet-heartbeat.test.mjs +450 -0
- package/scripts/fleet-provenance +207 -0
- package/scripts/fleet-provenance.test.mjs +64 -0
- package/scripts/fleet-run +148 -0
- package/scripts/fleet-run.test.mjs +90 -0
- package/scripts/fleet-state.mjs +400 -0
- package/scripts/fleet-state.test.mjs +373 -0
- package/scripts/fleet-tick-prose.test.mjs +299 -0
- package/scripts/fleet-tick.mjs +832 -0
- package/scripts/fleet-tick.test.mjs +1332 -0
- package/scripts/force-with-lease-reason-prose.test.mjs +184 -0
- package/scripts/frontmatter-allowlist.json +64 -0
- package/scripts/frontmatter-check.mjs +256 -0
- package/scripts/frontmatter-check.test.mjs +436 -0
- package/scripts/git-env.mjs +124 -0
- package/scripts/git-env.test.mjs +149 -0
- package/scripts/git-status-untracked-mode-sweep.test.mjs +216 -0
- package/scripts/gone-walk.test.mjs +213 -0
- package/scripts/gp-sep-invariant-prose.test.mjs +188 -0
- package/scripts/head-moved-after-label-prose.test.mjs +233 -0
- package/scripts/immutable-body-claim-prose.test.mjs +413 -0
- package/scripts/implementer-model-tier.test.mjs +643 -0
- package/scripts/inflight-citation-prose.test.mjs +144 -0
- package/scripts/inflight-exit2-prose.test.mjs +81 -0
- package/scripts/inflight-probe-guard-prose.test.mjs +109 -0
- package/scripts/inflight-scan-scope-prose.test.mjs +57 -0
- package/scripts/inflight.sh +1106 -0
- package/scripts/inflight.test.mjs +2984 -0
- package/scripts/injection-control-prose.test.mjs +404 -0
- package/scripts/install-root-audit.test.mjs +464 -0
- package/scripts/instrument-check-prose.test.mjs +235 -0
- package/scripts/instruments.sh +394 -0
- package/scripts/instruments.test.mjs +787 -0
- package/scripts/issue-tracker-prose.test.mjs +71 -0
- package/scripts/json.sh +248 -0
- package/scripts/json.test.mjs +364 -0
- package/scripts/ledger-dispatch.test.mjs +516 -0
- package/scripts/ledger-grammar.mjs +85 -0
- package/scripts/ledger-grammar.test.mjs +142 -0
- package/scripts/ledger-read-require-file.test.mjs +197 -0
- package/scripts/ledger.mjs +1753 -0
- package/scripts/ledger.test.mjs +3554 -0
- package/scripts/line-distance-prose.test.mjs +245 -0
- package/scripts/liveness-rationale-prose.test.mjs +83 -0
- package/scripts/locale-pin-prose.test.mjs +189 -0
- package/scripts/member-outcome-prose.test.mjs +167 -0
- package/scripts/member-outcomes-header.test.mjs +148 -0
- package/scripts/member-outcomes-prose.test.mjs +63 -0
- package/scripts/member-outcomes.mjs +231 -0
- package/scripts/member-outcomes.test.mjs +507 -0
- package/scripts/member-prompt-prose.test.mjs +161 -0
- package/scripts/member-record.mjs +605 -0
- package/scripts/member-record.test.mjs +516 -0
- package/scripts/member-write-guard.mjs +279 -0
- package/scripts/member-write-guard.test.mjs +211 -0
- package/scripts/merge-commit-probe-prose.test.mjs +122 -0
- package/scripts/merge-gate.mjs +262 -0
- package/scripts/merge-gate.test.mjs +613 -0
- package/scripts/muted-git-guard-sweep.test.mjs +493 -0
- package/scripts/net-ssh-precedence-prose.test.mjs +91 -0
- package/scripts/net-watchdog-prose.test.mjs +79 -0
- package/scripts/net.sh +409 -0
- package/scripts/net.test.mjs +211 -0
- package/scripts/no-ci-gate-prose.test.mjs +108 -0
- package/scripts/no-undo-audit.sh +1134 -0
- package/scripts/no-undo-audit.test.mjs +3965 -0
- package/scripts/no-wave.test.mjs +138 -0
- package/scripts/node-floor-sweep.test.mjs +611 -0
- package/scripts/pointer-target-prose.test.mjs +186 -0
- package/scripts/pr-overlap.mjs +417 -0
- package/scripts/pr-overlap.test.mjs +695 -0
- package/scripts/printf-die-sweep.test.mjs +384 -0
- package/scripts/prompt-renderer.mjs +39 -0
- package/scripts/prompt-renderer.test.mjs +68 -0
- package/scripts/prose-pin.mjs +808 -0
- package/scripts/prose-pin.test.mjs +1034 -0
- package/scripts/prove-merge.sh +228 -0
- package/scripts/prove-merge.test.mjs +995 -0
- package/scripts/pull-table-relabel-prose.test.mjs +60 -0
- package/scripts/quiet-payload-prose.test.mjs +222 -0
- package/scripts/reap.sh +1768 -0
- package/scripts/reap.test.mjs +4395 -0
- package/scripts/reaping-prose.test.mjs +159 -0
- package/scripts/refuter-scratch-prose.test.mjs +135 -0
- package/scripts/release-label-required-prose.test.mjs +71 -0
- package/scripts/release-label-split-prose.test.mjs +169 -0
- package/scripts/release-ticket.sh +1716 -0
- package/scripts/release-ticket.test.mjs +5106 -0
- package/scripts/renovate-release-contract.test.mjs +379 -0
- package/scripts/repo-root.mjs +544 -0
- package/scripts/repo-root.test.mjs +873 -0
- package/scripts/reporter-output-rule-prose.test.mjs +208 -0
- package/scripts/review-agent-report-only.test.mjs +49 -0
- package/scripts/review-core-cwd-isolation.test.mjs +374 -0
- package/scripts/review-core-reads.test.mjs +478 -0
- package/scripts/review-core-refuter-scratch.test.mjs +148 -0
- package/scripts/review-core-snapshot-path.test.mjs +777 -0
- package/scripts/review-core-specialist-scratch.test.mjs +189 -0
- package/scripts/review-core-testcmd.test.mjs +288 -0
- package/scripts/review-core-unrun.test.mjs +530 -0
- package/scripts/review-core-unverified-discriminant.test.mjs +208 -0
- package/scripts/review-core.mjs +1028 -0
- package/scripts/review-eval-resolver-path.test.mjs +55 -0
- package/scripts/review-eval.mjs +197 -0
- package/scripts/review-host-fixture.mjs +73 -0
- package/scripts/review-in-run-retry.test.mjs +187 -0
- package/scripts/review-no-vendor-dispatch.test.mjs +45 -0
- package/scripts/review-path-default.test.mjs +796 -0
- package/scripts/review-runner-spawns.test.mjs +93 -0
- package/scripts/review-runner.test.mjs +155 -0
- package/scripts/review-tier-audit.test.mjs +140 -0
- package/scripts/run-artifact-pr-prose.test.mjs +341 -0
- package/scripts/run-merge-bot-prose.test.mjs +1391 -0
- package/scripts/scratch-partition-invariant-prose.test.mjs +74 -0
- package/scripts/scripts-path-citation-sweep.test.mjs +73 -0
- package/scripts/section-between-guard-prose.test.mjs +378 -0
- package/scripts/select-dimensions.test.mjs +674 -0
- package/scripts/shared-refusal.test.mjs +388 -0
- package/scripts/shell-traps-prose.test.mjs +507 -0
- package/scripts/shortlist.mjs +355 -0
- package/scripts/shortlist.test.mjs +366 -0
- package/scripts/slow-transport.mjs +72 -0
- package/scripts/snapshot-repo.test.mjs +772 -0
- package/scripts/snapshot-runner-audience-prose.test.mjs +129 -0
- package/scripts/spend-view.test.mjs +312 -0
- package/scripts/staleness-qualifier-prose.test.mjs +251 -0
- package/scripts/staleness-verdict-prose.test.mjs +142 -0
- package/scripts/staleness.mjs +414 -0
- package/scripts/staleness.test.mjs +893 -0
- package/scripts/stalled-member-liveness-prose.test.mjs +219 -0
- package/scripts/stash-prohibition-prose.test.mjs +313 -0
- package/scripts/strip-comments.mjs +44 -0
- package/scripts/tier-check.mjs +468 -0
- package/scripts/tier-check.test.mjs +726 -0
- package/scripts/tier-guard-gate-prose.test.mjs +216 -0
- package/scripts/tier-outcomes-header.test.mjs +586 -0
- package/scripts/tier-outcomes.mjs +441 -0
- package/scripts/tier-outcomes.test.mjs +342 -0
- package/scripts/tier-roles.mjs +250 -0
- package/scripts/tier-roles.test.mjs +316 -0
- package/scripts/tracker-block-copy-prose.test.mjs +288 -0
- package/scripts/triage-labels-gloss-prose.test.mjs +97 -0
- package/scripts/unattended-git-sweep.test.mjs +142 -0
- package/scripts/verify-sha-exit2-prose.test.mjs +269 -0
- package/scripts/verify-sha.sh +117 -0
- package/scripts/verify-sha.test.mjs +693 -0
- package/scripts/watcher-degraded-block.test.mjs +372 -0
- package/scripts/watcher-key-prose.test.mjs +106 -0
- package/scripts/within-run-pair-prose.test.mjs +208 -0
- package/scripts/worktree-audit.sh +482 -0
- package/scripts/worktree-audit.test.mjs +1407 -0
- package/scripts/worktree-head-prose.test.mjs +276 -0
- package/scripts/worktree-listing-sweep.test.mjs +217 -0
- package/scripts/worktree-model-prose.test.mjs +216 -0
- package/scripts/worktree.sh +470 -0
- package/skills/next-ticket/SKILL.md +138 -0
- package/skills/run-team/SKILL.md +3603 -0
- package/skills/run-team/references/ci-and-staleness.md +75 -0
- package/skills/run-team/references/correction-tickets.md +37 -0
- package/skills/run-team/references/isolation.md +23 -0
- package/skills/run-team/references/member-lifecycle.md +73 -0
- package/skills/run-team/references/reaping.md +73 -0
- package/skills/sizing-a-ticket/SKILL.md +39 -0
|
@@ -0,0 +1,144 @@
|
|
|
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
|
+
});
|
|
@@ -0,0 +1,81 @@
|
|
|
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
|
+
});
|
|
@@ -0,0 +1,109 @@
|
|
|
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
|
+
});
|
|
@@ -0,0 +1,57 @@
|
|
|
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
|
+
});
|