@feigi/fleet-ctl 3.24.2 → 3.24.4
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/board.html +22 -22
- package/scripts/board.mjs +143 -145
- package/scripts/compute-board.mjs +39 -38
- package/scripts/derive-testcmd.sh +1 -1
- package/scripts/drop-merged-label.sh +10 -11
- package/scripts/fleet-bootstrap +8 -8
- package/scripts/fleet-provenance +8 -8
- package/scripts/fleet-run +3 -3
- package/scripts/frontmatter-allowlist.json +6 -6
- package/scripts/instruments.sh +30 -31
- package/scripts/json.sh +12 -13
- package/scripts/net.sh +23 -21
- package/scripts/prove-merge.sh +7 -7
- package/scripts/review-core.mjs +57 -58
- package/scripts/review-eval.mjs +14 -15
- package/scripts/verify-sha.sh +4 -4
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// Pure board-model builder. No I/O and no clock read — `now` is passed in, so
|
|
2
2
|
// dwell/staleness is deterministic and unit-testable. board.mjs does the gh/
|
|
3
3
|
// ledger I/O and calls computeBoard(); every stage-derivation and flag decision
|
|
4
|
-
// lives here and is exercised by
|
|
4
|
+
// lives here and is exercised by its unit tests (`node --test`).
|
|
5
5
|
//
|
|
6
|
-
//
|
|
6
|
+
// The THREE imports this module takes, all pure ones.
|
|
7
7
|
// fleet-state.mjs owns the heartbeat's `beat` key, and the rule for reading
|
|
8
8
|
// that key travels with it rather than being copied here. That module's own
|
|
9
9
|
// I/O (its path probe, its file read) is never called from this file; only
|
|
@@ -16,26 +16,27 @@
|
|
|
16
16
|
// from it for the same reason — one grammar, one reader, so the cockpit and
|
|
17
17
|
// fleet-tick.mjs cannot disagree about which members are live.
|
|
18
18
|
// fleet-tick.mjs owns a row's PR reading, PR_MENTION, and a row with no impl
|
|
19
|
-
// token is read through it (
|
|
20
|
-
// the same PR for the same text, for a row that
|
|
19
|
+
// token is read through it (see the paragraph below on a row with no `impl`
|
|
20
|
+
// token) so both readers name the same PR for the same text, for a row that
|
|
21
|
+
// carries a PR-bound signal —
|
|
21
22
|
// an unsignaled row (no mention, no PR-bound member, no review=/reviewed=)
|
|
22
23
|
// still gets pr: null here while fleet-tick.mjs's own row-key fallback keys
|
|
23
|
-
// it to its ticket number regardless; see the
|
|
24
|
+
// it to its ticket number regardless; see the same paragraph below. The
|
|
24
25
|
// regex is all this file takes from it: the tick's I/O and main() never run
|
|
25
26
|
// here, main() being guarded on argv[1].
|
|
26
27
|
import { assessBeat, isStalled, stallReport } from "./fleet-state.mjs";
|
|
27
28
|
import { parseToken, HALT_CAUSES } from "./ledger-grammar.mjs";
|
|
28
29
|
import { PR_MENTION, REVIEWED, latestFinisherAttempts } from "./fleet-tick.mjs";
|
|
29
30
|
|
|
30
|
-
// A ledger row is freeform, controller-authored text. Two
|
|
31
|
-
//
|
|
32
|
-
//
|
|
31
|
+
// A ledger row is freeform, controller-authored text. Two example shapes:
|
|
32
|
+
// #<n> impl-<n>=PR#<m> → PR#<m> → MERGED 73b356de
|
|
33
|
+
// #<n> impl-<n>=PR#<m> → PR#<m> · fix-pr-<m> · ruled:6-applies · held-behind:#<k>
|
|
33
34
|
// Extract by token, never by position — the controller reorders and appends
|
|
34
35
|
// tokens freely. Unknown text is ignored, never fatal.
|
|
35
36
|
//
|
|
36
|
-
// Member tokens are ledger-grammar.mjs's
|
|
37
|
+
// Member tokens are ledger-grammar.mjs's. On a row that has one, the
|
|
37
38
|
// row's latest `impl` attempt decides the card — the greatest retry suffix,
|
|
38
|
-
// wherever it sits (
|
|
39
|
+
// wherever it sits (laterAttempt below): live → IMPLEMENTING, `=PR#M`
|
|
39
40
|
// → that PR decides, `=released`/`=bailed` → no card of
|
|
40
41
|
// the row's own (the POOL loop shows the ticket if it is still
|
|
41
42
|
// `ready-for-agent`), `=killed`/`=tier-mismatch` → IMPLEMENTING with that
|
|
@@ -46,7 +47,7 @@ import { PR_MENTION, REVIEWED, latestFinisherAttempts } from "./fleet-tick.mjs";
|
|
|
46
47
|
// nothing enforces that order, so on such a row the arrow is never a value
|
|
47
48
|
// either reader may rely on.
|
|
48
49
|
//
|
|
49
|
-
//
|
|
50
|
+
// A row with no `impl` token at all has no outcome to
|
|
50
51
|
// read, so it takes the tick's reading. `ledger.mjs dispatch <pr> fix-pr-<pr>` /
|
|
51
52
|
// `finisher-pr-<pr>` appends `#<pr> <member>` for a PR this run's
|
|
52
53
|
// implementers did not open. Once such a row carries a PR-bound signal — a
|
|
@@ -57,7 +58,7 @@ import { PR_MENTION, REVIEWED, latestFinisherAttempts } from "./fleet-tick.mjs";
|
|
|
57
58
|
// A member settled anywhere on the row is settled — a bare copy beside
|
|
58
59
|
// `<member>=<outcome>` is what a whole-line `row` rewrite leaves.
|
|
59
60
|
//
|
|
60
|
-
//
|
|
61
|
+
// A PR whose latest finisher attempt settled `halted:<cause>` carries
|
|
61
62
|
// that outcome as a severity-4 flag while the PR sits in REVIEW. The halt is
|
|
62
63
|
// the finisher working correctly — it refused to label — so the PR has no
|
|
63
64
|
// `ready-to-merge` until the controller resolves the cause; the flag is what
|
|
@@ -66,7 +67,7 @@ import { PR_MENTION, REVIEWED, latestFinisherAttempts } from "./fleet-tick.mjs";
|
|
|
66
67
|
// `## Dispatched` tokens): a live `-b` after the halt clears it, and a later
|
|
67
68
|
// attempt settled anywhere replaces it.
|
|
68
69
|
//
|
|
69
|
-
//
|
|
70
|
+
// A PR whose finisher settled `labelled` while the open list shows no
|
|
70
71
|
// `ready-to-merge` on it carries a severity-4 `unlabelled` flag in REVIEW —
|
|
71
72
|
// fleet-tick.mjs's own reading (unlabelledFinishers: the latest attempt since
|
|
72
73
|
// the last `label-off=`), off the same `## Dispatched` and row tokens the tick
|
|
@@ -80,12 +81,12 @@ import { PR_MENTION, REVIEWED, latestFinisherAttempts } from "./fleet-tick.mjs";
|
|
|
80
81
|
// dispatches nothing for these; the flag is what puts the PR in front of a
|
|
81
82
|
// human. The names are not the bare `killed` flag, which is the implementer's.
|
|
82
83
|
//
|
|
83
|
-
// A PR's review is not a member
|
|
84
|
+
// A PR's review is not a member: `review=wf:<runId>` is a Workflow
|
|
84
85
|
// with nobody to name, while `review=member:<name>` and
|
|
85
86
|
// `review=fallback:<name>` name a runner member, live until the token is
|
|
86
87
|
// settled `=failed` or a later `reviewed=` records its result.
|
|
87
88
|
//
|
|
88
|
-
//
|
|
89
|
+
// A `review=` token puts the PR under review only while
|
|
89
90
|
// it is live. A settled `review=…=failed` is a dead review and the PR is owed
|
|
90
91
|
// one again, as run-team SKILL.md defines review-due and as fleet-tick.mjs's
|
|
91
92
|
// `reviewedAny` reads the token: the PR is owed none while the row carries
|
|
@@ -105,7 +106,7 @@ const PREMISE = /\bbehind-(pr|issue):#?([^\s,;]+)/g;
|
|
|
105
106
|
// what each kind means and how `=failed` settles it.
|
|
106
107
|
const REVIEW = /^review=(wf|member|fallback):([^=\s]+?)(=failed)?$/;
|
|
107
108
|
|
|
108
|
-
//
|
|
109
|
+
// Which of two well-formed impl tokens is the later attempt for THIS
|
|
109
110
|
// row's ticket. A token whose number matches the row's own ticket always
|
|
110
111
|
// outranks one that does not: a retry suffix only orders attempts on ONE
|
|
111
112
|
// number (ledger-grammar.mjs's MEMBER regex comment — "Attempts on one
|
|
@@ -158,8 +159,8 @@ export function parseRow(row) {
|
|
|
158
159
|
const finishers = []; // well-formed finisher tokens, for the row's PR below
|
|
159
160
|
let anyImpl = false;
|
|
160
161
|
let prMember = false;
|
|
161
|
-
let review = false; // any review= token: a PR-bound signal
|
|
162
|
-
let reviewLive = false; // one not settled `=failed
|
|
162
|
+
let review = false; // any review= token: a PR-bound signal on a row with no impl token
|
|
163
|
+
let reviewLive = false; // one not settled `=failed`: a live review
|
|
163
164
|
let reviewed = false;
|
|
164
165
|
let reviewedHead = null;
|
|
165
166
|
let runners = [];
|
|
@@ -194,7 +195,7 @@ export function parseRow(row) {
|
|
|
194
195
|
}
|
|
195
196
|
} else if (tok.startsWith("reviewed=")) {
|
|
196
197
|
reviewed = true;
|
|
197
|
-
//
|
|
198
|
+
// The head that review actually read — the cockpit's own copy
|
|
198
199
|
// of fleet-tick.mjs's `reviewedHead`, needed below to tell a past-pin
|
|
199
200
|
// halt already answered by this review apart from one still owed a
|
|
200
201
|
// fresh one.
|
|
@@ -208,7 +209,7 @@ export function parseRow(row) {
|
|
|
208
209
|
const implOutcome = lastImpl ? (implOutcomes.get(lastImpl.name) ?? null) : null;
|
|
209
210
|
const prM = implOutcome && /^PR#(\d+)$/.exec(implOutcome);
|
|
210
211
|
let pr = prM ? Number(prM[1]) : null;
|
|
211
|
-
//
|
|
212
|
+
// A row with NO impl token — a malformed one still
|
|
212
213
|
// counts, since that row's key is a ticket — is keyed, once THIS row
|
|
213
214
|
// carries a PR-bound signal, the way fleet-tick.mjs's PR_MENTION-then-
|
|
214
215
|
// row-key logic would: its first PR_MENTION (itself a signal), else the
|
|
@@ -249,7 +250,7 @@ export function parseRow(row) {
|
|
|
249
250
|
// released or bailed implementer: the ticket went back to the tracker, and the
|
|
250
251
|
// POOL loop shows it if it is still `ready-for-agent`). An Exclusion is POOL.
|
|
251
252
|
// MERGED is an explicit `MERGED <sha>` token or, failing one, `prState.merged`
|
|
252
|
-
// — gh's answer for a row PR absent from the open list, or
|
|
253
|
+
// — gh's answer for a row PR absent from the open list, or a
|
|
253
254
|
// carry-forward of the previous board's MERGED for that SAME PR on that
|
|
254
255
|
// ticket: MERGED is terminal, so a merged PR never reopens regardless of
|
|
255
256
|
// what this run's merged read says — but a ticket retried under a NEW PR
|
|
@@ -276,7 +277,7 @@ export const STALE_MS = {
|
|
|
276
277
|
READY: 15 * 60 * 1000,
|
|
277
278
|
};
|
|
278
279
|
|
|
279
|
-
// An Exclusion's badges are its premises, `excluded
|
|
280
|
+
// An Exclusion's badges are its premises, `excluded:#<n>` for a number and
|
|
280
281
|
// `excluded:<branch>` for a branch name, and nothing else: it is supply, so no
|
|
281
282
|
// dwell clock and no cause applies. isBadge() keeps them out of `attention`.
|
|
282
283
|
export function deriveFlags(parsed, ctx) {
|
|
@@ -352,7 +353,7 @@ function splitNumbered(line) {
|
|
|
352
353
|
return m ? { issue: Number(m[1]), subject: m[2] } : { issue: null, subject: line };
|
|
353
354
|
}
|
|
354
355
|
|
|
355
|
-
// The stall surface, or null when there is nothing to say.
|
|
356
|
+
// The stall surface, or null when there is nothing to say.
|
|
356
357
|
//
|
|
357
358
|
// The two facts the report needs beyond the mark itself — what is claimed and
|
|
358
359
|
// whether the pool still has supply — are read off THIS model rather than
|
|
@@ -386,7 +387,7 @@ function stall(beat, ticked, tickets, pool, { ledgerOk, poolOk }, now) {
|
|
|
386
387
|
return { ...verdict, claimed, supply, text: stallReport(verdict, { claimed, supply }) };
|
|
387
388
|
}
|
|
388
389
|
|
|
389
|
-
//
|
|
390
|
+
// Which of gather()'s `gh ... list` reads came back exactly as long as
|
|
390
391
|
// its own `--limit` — and so may have been cut there, gh saying nothing — as
|
|
391
392
|
// one rendered line, or null when neither did. The pool's count carries its
|
|
392
393
|
// own `n+` besides (computeBoard below); this line is for what a count cannot
|
|
@@ -401,7 +402,7 @@ function capNotice({ poolCapped, prsCapped }) {
|
|
|
401
402
|
return parts.length ? parts.join("; ") : null;
|
|
402
403
|
}
|
|
403
404
|
|
|
404
|
-
//
|
|
405
|
+
// The previous board already showed this SAME PR MERGED on this
|
|
405
406
|
// ticket. MERGED is terminal, so that verdict stands whatever this run's
|
|
406
407
|
// merged read says. Keyed on the PR, not just the ticket: a ticket retried
|
|
407
408
|
// under a NEW PR after its earlier one merged carries no MERGED verdict
|
|
@@ -412,7 +413,7 @@ function carriedMerged(prevTicket, p) {
|
|
|
412
413
|
return prevTicket?.column === "MERGED" && prevTicket.pr === p.pr;
|
|
413
414
|
}
|
|
414
415
|
|
|
415
|
-
//
|
|
416
|
+
// The row PRs whose merged status gather() has to ask gh about this
|
|
416
417
|
// tick — exactly those computeBoard() would consult `merged` for and cannot
|
|
417
418
|
// already place: a row PR absent from the open list `prs`, on a row that is
|
|
418
419
|
// not an Exclusion (always POOL), carries no `MERGED <sha>` token, has a PR
|
|
@@ -441,15 +442,15 @@ export function mergedReadPrs({ ledger, prs, prev }) {
|
|
|
441
442
|
return [...need].sort((a, b) => a - b);
|
|
442
443
|
}
|
|
443
444
|
|
|
444
|
-
// `merged`
|
|
445
|
+
// `merged` is gh's list of merged PR numbers, consulted only for a row
|
|
445
446
|
// PR absent from the open list `prs`; absent means none known, and a PR in
|
|
446
447
|
// neither list (closed unmerged, or a failed read) keeps REVIEW — unless
|
|
447
|
-
//
|
|
448
|
+
// carriedMerged() holds for it, in which case it stays MERGED
|
|
448
449
|
// whether this run's merged read failed outright or simply succeeded
|
|
449
450
|
// without listing it. A PR that IS in the open list is never eligible for
|
|
450
451
|
// this carry-forward — only the "absent from both `prs` and (maybe)
|
|
451
452
|
// `merged`" branch below ever consults it. gather() asks gh only about
|
|
452
|
-
// mergedReadPrs()'s set
|
|
453
|
+
// mergedReadPrs()'s set, so `merged` never lists more than that.
|
|
453
454
|
export function computeBoard(inputs) {
|
|
454
455
|
const { ledger, issues, prs, ci, prev, now } = inputs;
|
|
455
456
|
const prByNum = new Map(prs.map((p) => [p.number, p]));
|
|
@@ -492,8 +493,8 @@ export function computeBoard(inputs) {
|
|
|
492
493
|
});
|
|
493
494
|
}
|
|
494
495
|
|
|
495
|
-
// A wayfinder:* ticket is documentation-only regardless of its triage role
|
|
496
|
-
//
|
|
496
|
+
// A wayfinder:* ticket is documentation-only regardless of its triage role:
|
|
497
|
+
// candidates.mjs's dispatch scan never surfaces one even carrying
|
|
497
498
|
// `ready-for-agent`, so this POOL column must not either, or an
|
|
498
499
|
// undispatchable ticket inflates the operator's read of available work.
|
|
499
500
|
// Filtered HERE rather than out of gather()'s gh query: `issues` also feeds
|
|
@@ -515,8 +516,8 @@ export function computeBoard(inputs) {
|
|
|
515
516
|
.sort((a, b) => severity(b.flags) - severity(a.flags));
|
|
516
517
|
|
|
517
518
|
// Backlog is a PR nobody has reviewed and nobody is reviewing: no live
|
|
518
|
-
// `review=` (
|
|
519
|
-
// `reviewed=`, and no live fix-applier or finisher on the row — or
|
|
519
|
+
// `review=` (a settled `=failed` one is no review), no
|
|
520
|
+
// `reviewed=`, and no live fix-applier or finisher on the row — or
|
|
520
521
|
// a returned review whose finisher halted `past-pin` against a head it
|
|
521
522
|
// never read: owed again until the head catches up to what `reviewed=`
|
|
522
523
|
// recorded, the same rule fleet-tick.mjs's reviewDue reads off headRefOid
|
|
@@ -530,7 +531,7 @@ export function computeBoard(inputs) {
|
|
|
530
531
|
return t.column === "REVIEW" && !p.underReview && (!p.reviewed || pastPinBacklog(p));
|
|
531
532
|
}).length;
|
|
532
533
|
const cardsInPool = tickets.filter((t) => t.column === "POOL").length;
|
|
533
|
-
//
|
|
534
|
+
// A capped pool read makes this count a floor, and it says so the way
|
|
534
535
|
// fleet-tick.mjs's claimed count does — `"100+"`, never a bare 100 that
|
|
535
536
|
// reads as exact. stall() below receives the same value, so the stall line
|
|
536
537
|
// and the footer cannot disagree about it.
|
|
@@ -541,13 +542,13 @@ export function computeBoard(inputs) {
|
|
|
541
542
|
interval: inputs.interval ?? 15,
|
|
542
543
|
repo: inputs.repo ?? null,
|
|
543
544
|
repoUrl: inputs.repoUrl ?? null,
|
|
544
|
-
//
|
|
545
|
+
// Which workspace this board describes and which port served it.
|
|
545
546
|
// Pass-through, exactly like repo/repoUrl above and for the same reason —
|
|
546
547
|
// resolveCockpitInstance() answers both at the gather boundary, and this
|
|
547
548
|
// module reads no cwd, no git and no socket, so it cannot re-derive either
|
|
548
549
|
// and must not try. Defaulted to null rather than left undefined: a
|
|
549
550
|
// missing key and a null one are the same value to a reader in JS but not
|
|
550
|
-
// in the JSON on disk, and
|
|
551
|
+
// in the JSON on disk, and the launch handshake reads `workspace` off
|
|
551
552
|
// that JSON — a dropped key would make every board anonymous to it.
|
|
552
553
|
workspace: inputs.workspace ?? null,
|
|
553
554
|
port: inputs.port ?? null,
|
|
@@ -557,7 +558,7 @@ export function computeBoard(inputs) {
|
|
|
557
558
|
filed: (ledger.filed || []).map(splitNumbered),
|
|
558
559
|
// Not derivable from anything else in this model: a ledger that was never
|
|
559
560
|
// read, one read empty, and one whose payload would not parse all reduce to
|
|
560
|
-
// the same empty lists
|
|
561
|
+
// the same empty lists. gather() is the
|
|
561
562
|
// only caller that can tell them apart, so it says so and this carries the
|
|
562
563
|
// answer to the page. Defaulted rather than required — every other caller
|
|
563
564
|
// of computeBoard builds its inputs by hand and means a ledger it read.
|
|
@@ -569,7 +570,7 @@ export function computeBoard(inputs) {
|
|
|
569
570
|
// which would read as "this run was free", and shows the error, which is
|
|
570
571
|
// a bug the operator has to act on.
|
|
571
572
|
spend: inputs.spend ?? null,
|
|
572
|
-
//
|
|
573
|
+
// Telemetry beside `spend`, and under the same rule: a liveness
|
|
573
574
|
// input can only ever POPULATE or OMIT this field, and nothing above it
|
|
574
575
|
// reads `inputs.beat` — no column, no flag, no dwell clock, no attention
|
|
575
576
|
// row. A dead controller does not move a ticket; it means nobody is
|
|
@@ -99,7 +99,7 @@ unrunnable() { printf '%s: %s\n' "$NAME" "$1" >&2; exit 3; }
|
|
|
99
99
|
|
|
100
100
|
# Named once: every refusal that sends the caller to re-derive names the same
|
|
101
101
|
# step, so a controller or reviewer reading any of them knows what to run.
|
|
102
|
-
derive="run the Recipe derivation step (run-team phase 0, before the first claim
|
|
102
|
+
derive="run the Recipe derivation step (run-team phase 0, before the first claim) to derive, prove and write it"
|
|
103
103
|
|
|
104
104
|
[ $# -eq 2 ] || die "usage: derive-testcmd.sh <repo> <install|test>"
|
|
105
105
|
repo=$1
|
|
@@ -4,16 +4,15 @@
|
|
|
4
4
|
# claim that never became" a PR). This is neither Release nor Reap
|
|
5
5
|
# (CONTEXT.md's Reap is branches and worktrees, not the label) — a third,
|
|
6
6
|
# merge-triggered step in the claim lifecycle CONTEXT.md does not yet name.
|
|
7
|
-
# #170.
|
|
8
7
|
#
|
|
9
|
-
# Single writer
|
|
8
|
+
# Single writer: the merge is the only moment the ticket
|
|
10
9
|
# number and the fact of completion are known together, so only a PROVEN merge
|
|
11
10
|
# triggers this — never reap (branches, not tickets), never a repo automation
|
|
12
11
|
# (no attribution). The merge bot's branch-delete step, delete-merged-branch.sh,
|
|
13
12
|
# calls this script as a sibling with --apply, after its own MERGED gate: the
|
|
14
13
|
# claim has not ended until the merge lands. Direct use is manual repair.
|
|
15
14
|
#
|
|
16
|
-
#
|
|
15
|
+
# `closingIssuesReferences` reflects `Closes #N` syntax in the PR's own
|
|
17
16
|
# title/body, but NOT a commit-message-only reference — GitHub's real
|
|
18
17
|
# merge-time closer honors the latter (confirmed via the issue's own
|
|
19
18
|
# timeline), this field never does, even after the merge. This script unions
|
|
@@ -53,7 +52,7 @@ if ! issues=$(gh pr view "$pr" --json closingIssuesReferences --jq '.closingIssu
|
|
|
53
52
|
die "gh pr view $pr failed — cannot read which issues it closes"
|
|
54
53
|
fi
|
|
55
54
|
|
|
56
|
-
#
|
|
55
|
+
# The query above misses a commit-message-only close. Scan every
|
|
57
56
|
# commit's own headline+body for the same close/fix/resolve keyword forms
|
|
58
57
|
# GitHub's real closer recognizes, and union the result into `$issues` — the
|
|
59
58
|
# set of issues this PR is proven to close, so the check below acts on
|
|
@@ -63,13 +62,13 @@ if ! commit_text=$(gh pr view "$pr" --json commits --jq '[.commits[] | (.message
|
|
|
63
62
|
die "gh pr view $pr failed — cannot scan its commit messages for issue closes"
|
|
64
63
|
fi
|
|
65
64
|
|
|
66
|
-
# Same three-outcome discipline as the label scan below
|
|
65
|
+
# Same three-outcome discipline as the label scan below: rc 1 (no
|
|
67
66
|
# keyword anywhere in any commit) must read as zero commit-closed issues,
|
|
68
67
|
# never conflated with rc 2+ (the scan itself broke), which must halt loudly
|
|
69
68
|
# instead of silently behaving like "commits close nothing".
|
|
70
69
|
# The leading `(^|[^[:alnum:]_])` requires a non-word character (or line
|
|
71
|
-
# start) immediately before the keyword, so "bugfix #
|
|
72
|
-
# never
|
|
70
|
+
# start) immediately before the keyword, so "bugfix #N" or "prefix #N"
|
|
71
|
+
# never reads as closing issue N just because "fix" is a substring of a
|
|
73
72
|
# larger word — only a real close/fix/resolve keyword counts.
|
|
74
73
|
if matched=$(printf '%s\n' "$commit_text" | grep -Eio '(^|[^[:alnum:]_])(close[sd]?|fix(e[sd])?|resolve[sd]?)[[:space:]]*#[0-9]+'); then
|
|
75
74
|
commit_grep_rc=0
|
|
@@ -92,9 +91,9 @@ esac
|
|
|
92
91
|
# Union both signals through the SAME three-outcome discipline, never a bare
|
|
93
92
|
# `grep | sort`: command substitution reports only the LAST pipe stage's
|
|
94
93
|
# exit status, so `sort`'s own rc 0 would otherwise mask a grep 2+ break
|
|
95
|
-
# entirely — the exact "commits close nothing" misreading
|
|
96
|
-
# guards against
|
|
97
|
-
# leading zeros
|
|
94
|
+
# entirely — the exact "commits close nothing" misreading the label scan
|
|
95
|
+
# below already guards against. `awk '{print $0+0}'` strips any
|
|
96
|
+
# leading zeros before the final sort, so a
|
|
98
97
|
# commit-message "#007" reaches the JSON payload below as the bare,
|
|
99
98
|
# valid-JSON integer `7` — and correctly dedupes against a plain `7` named
|
|
100
99
|
# by the other signal.
|
|
@@ -127,7 +126,7 @@ for n in $issues; do
|
|
|
127
126
|
fi
|
|
128
127
|
|
|
129
128
|
# grep's OWN scan failing (rc 2+) must not read as "no in-progress label":
|
|
130
|
-
# the same defect
|
|
129
|
+
# the same defect reap.sh's grep_probe guards against. A bare
|
|
131
130
|
# `if … grep -qx …; then had=true; else had=false; fi` has room for only two
|
|
132
131
|
# of grep's three `-q` outcomes — rc 0 matched, rc 1 none did, rc 2+ the
|
|
133
132
|
# scan itself broke — so a scan that could not look would read here exactly
|
package/scripts/fleet-bootstrap
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
// The Resolver's one-time bootstrap
|
|
2
|
+
// The Resolver's one-time bootstrap. Places a copy
|
|
3
3
|
// of `fleet-run` at `~/.fleet/bin/fleet-run` — the one artefact this repo
|
|
4
4
|
// owns OUTSIDE the plugin, because the Resolver cannot resolve itself and no
|
|
5
5
|
// per-session mechanism can carry it (nothing survives between harness
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
// placed copy already matches.
|
|
8
8
|
//
|
|
9
9
|
// SOURCE, and the one licensed exception. Every other script's rule is
|
|
10
|
-
// "only installed scripts run"
|
|
10
|
+
// "only installed scripts run" — never a source checkout.
|
|
11
11
|
// This script's source is always ITS OWN sibling `fleet-run`, i.e. whatever
|
|
12
12
|
// directory this file itself is running from. Two shapes exist for that:
|
|
13
13
|
// - run as an INSTALLED script (this file's own directory IS a registry
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
// - run DIRECTLY FROM A CHECKOUT (this file's own directory is not any
|
|
17
17
|
// registered installPath) — the state the world is actually in the
|
|
18
18
|
// first time this ever runs, since no install anywhere yet carries
|
|
19
|
-
// `scripts/fleet-run`.
|
|
19
|
+
// `scripts/fleet-run`. This exception is licensed exactly once, loudly.
|
|
20
20
|
// This file cannot tell those apart by calling git (that would be exactly
|
|
21
|
-
// the self-location-derives-a-repo pattern
|
|
21
|
+
// the self-location-derives-a-repo pattern every other script is barred from); it
|
|
22
22
|
// tells them apart by comparing its own directory's PARENT against the
|
|
23
23
|
// registries' recorded installPath strings — a plain string compare, no git
|
|
24
24
|
// involved, so it never anchors a git root to its own location.
|
|
@@ -36,7 +36,7 @@ function die(message) {
|
|
|
36
36
|
process.exit(2);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
// The Install root, same resolution point as scripts/fleet-run
|
|
39
|
+
// The Install root, same resolution point as scripts/fleet-run:
|
|
40
40
|
// the realpath of `~/.omp/plugins/node_modules/@feigi/fleet-ctl`. Absent or
|
|
41
41
|
// dangling answers null, which the caller reports as "omp: not installed".
|
|
42
42
|
function readInstallPath(packagePath) {
|
|
@@ -66,7 +66,7 @@ function main() {
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
const home = os.homedir();
|
|
69
|
-
const PLUGIN_KEY = "@feigi/fleet-ctl"; //
|
|
69
|
+
const PLUGIN_KEY = "@feigi/fleet-ctl"; // the plugin's package name, and its node_modules package dir.
|
|
70
70
|
const ompInstall = readInstallPath(path.join(home, ".omp", "plugins", "node_modules", PLUGIN_KEY));
|
|
71
71
|
// Both sides are realpaths — readInstallPath() already resolved the install,
|
|
72
72
|
// and this file's own directory exists, so its parent resolves too — so a
|
|
@@ -85,7 +85,7 @@ function main() {
|
|
|
85
85
|
die(
|
|
86
86
|
`refusing to place ${target} from ${ownDir}, which is not omp's resolved install root (looked at `
|
|
87
87
|
+ `${ompInstall ? `omp: ${ompInstall}` : "omp: not installed"}) — re-run with --from-checkout to take `
|
|
88
|
-
+ "
|
|
88
|
+
+ "the one-time bootstrap exception explicitly",
|
|
89
89
|
);
|
|
90
90
|
}
|
|
91
91
|
|
|
@@ -94,7 +94,7 @@ function main() {
|
|
|
94
94
|
`${NAME}: BOOTSTRAP EXCEPTION — running from a source checkout (${ownDir}), not omp's resolved `
|
|
95
95
|
+ "install root (looked at "
|
|
96
96
|
+ `${ompInstall ? `omp: ${ompInstall}` : "omp: not installed"}). `
|
|
97
|
-
+ "
|
|
97
|
+
+ "This is licensed ONCE, as the Resolver's own bootstrap, because no install anywhere yet carries "
|
|
98
98
|
+ "scripts/fleet-run for an install-root-driven copy to come from. Every other fleet script must run through "
|
|
99
99
|
+ "the Resolver once it exists.\n",
|
|
100
100
|
);
|
package/scripts/fleet-provenance
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
// The Provenance check (
|
|
2
|
+
// The Provenance check (CONTEXT.md § Install
|
|
3
3
|
// "Provenance check"). Names the live Install root — the realpath of omp's
|
|
4
4
|
// `node_modules/@feigi/fleet-ctl` package entry, the one path every install kind
|
|
5
|
-
// places
|
|
5
|
+
// places — its kind and recorded version, and hashes the placed
|
|
6
6
|
// Resolver (`~/.fleet/bin/fleet-run`) against the Install root's own copy and
|
|
7
7
|
// refuses on drift. Writes nothing, mutates no config — every path below is
|
|
8
8
|
// read-only.
|
|
9
9
|
//
|
|
10
|
-
// The `enabledProviders: ["claude-plugins"]` assertion retired here
|
|
11
|
-
//
|
|
10
|
+
// The `enabledProviders: ["claude-plugins"]` assertion retired here: omp
|
|
11
|
+
// 18.2.1 exempts omp-origin installs from
|
|
12
12
|
// that provider gate, and the native package route never depended on it.
|
|
13
13
|
// Asserting it refused correct setups.
|
|
14
14
|
//
|
|
@@ -27,7 +27,7 @@ const os = require("node:os");
|
|
|
27
27
|
const crypto = require("node:crypto");
|
|
28
28
|
|
|
29
29
|
const NAME = "fleet-provenance";
|
|
30
|
-
const PLUGIN_KEY = "@feigi/fleet-ctl"; //
|
|
30
|
+
const PLUGIN_KEY = "@feigi/fleet-ctl"; // the plugin's package name, and its node_modules package dir.
|
|
31
31
|
|
|
32
32
|
// Same resolution point as scripts/fleet-run (its header names the shape of
|
|
33
33
|
// each install kind). Duplicated rather than shared because a module the
|
|
@@ -49,7 +49,7 @@ function resolveInstall(home) {
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
// Version lives in omp's runtime plugin lock, which every install kind writes
|
|
52
|
-
//
|
|
52
|
+
// — a link records the manifest's own `package.json`
|
|
53
53
|
// version (measured on 18.4.8: `0.0.0`, the placeholder), so the number never
|
|
54
54
|
// identifies a link; `kind:` does. Read tolerantly: any shape problem degrades
|
|
55
55
|
// to null, it never fails the check, because the version is informational.
|
|
@@ -67,7 +67,7 @@ function readLockVersion(home) {
|
|
|
67
67
|
|
|
68
68
|
// Every regular file under `<root>/scripts`, repo-relative, sorted — a
|
|
69
69
|
// filesystem walk rather than `git ls-files`: an installed copy need not
|
|
70
|
-
// carry a .git at all (a directory-source install can exclude it
|
|
70
|
+
// carry a .git at all (a directory-source install can exclude it),
|
|
71
71
|
// so git is not an instrument this check can rely on being present.
|
|
72
72
|
function walkFiles(dir, base = dir, out = []) {
|
|
73
73
|
let entries;
|
|
@@ -182,7 +182,7 @@ function main() {
|
|
|
182
182
|
}
|
|
183
183
|
|
|
184
184
|
if (kind === "linked-checkout") {
|
|
185
|
-
// Not a failure: a link is the dev loop
|
|
185
|
+
// Not a failure: a link is the dev loop. It is a NOTICE on
|
|
186
186
|
// every other install's answer, because a linked root outranks an
|
|
187
187
|
// installed copy of the same names in omp's own discovery — the check
|
|
188
188
|
// above certified the LINK, not what a session without the link runs.
|
package/scripts/fleet-run
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
// The Resolver (
|
|
2
|
+
// The Resolver (CONTEXT.md § Install
|
|
3
3
|
// "Resolver"). The single door between prose and an installed script: a prose
|
|
4
4
|
// callsite names a SCRIPT, never a path, and this reads omp's own extension
|
|
5
5
|
// package layout to find where that script actually lives right now.
|
|
6
6
|
//
|
|
7
|
-
// RESOLUTION POINT
|
|
7
|
+
// RESOLUTION POINT: `~/.omp/plugins/node_modules/@feigi/fleet-ctl`. Every
|
|
8
8
|
// omp install kind — marketplace, `omp plugin link`, npm — places an entry
|
|
9
9
|
// there (a symlink for marketplace/link, a real directory for npm), and it is
|
|
10
10
|
// the only path common to all three. Its realpath IS the Install root. The
|
|
@@ -37,7 +37,7 @@ const os = require("node:os");
|
|
|
37
37
|
const { spawnSync } = require("node:child_process");
|
|
38
38
|
|
|
39
39
|
const NAME = "fleet-run";
|
|
40
|
-
const PLUGIN_KEY = "@feigi/fleet-ctl"; //
|
|
40
|
+
const PLUGIN_KEY = "@feigi/fleet-ctl"; // the plugin's package name, and its node_modules package dir, no longer a qualified registry key.
|
|
41
41
|
|
|
42
42
|
function die(message) {
|
|
43
43
|
process.stderr.write(`${NAME}: ${message}\n`);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"_comment": "The allow-list data
|
|
2
|
+
"_comment": "The allow-list data. One allow-list per artefact kind (agents, skills, commands) for omp's documented keys (`omp://task-agent-discovery.md`, `omp://skills.md`). Enforced by frontmatter-check.mjs: unknown keys are rejected, required keys are enforced, and `forbidden` catches a key that reads as configuration but silently reroutes a member's tier, tree, or dispatch.",
|
|
3
3
|
|
|
4
4
|
"agents": {
|
|
5
5
|
"required": ["name", "description", "model"],
|
|
@@ -11,18 +11,18 @@
|
|
|
11
11
|
"thinking-level": "the level rides on model's `@<role>:<level>` suffix — one spelling only",
|
|
12
12
|
"thinking": "the level rides on model's `@<role>:<level>` suffix — one spelling only",
|
|
13
13
|
"effort": "retired Claude Code key — silently ignored by omp",
|
|
14
|
-
"prewalk": "silent mid-run model hand-off —
|
|
15
|
-
"advisor": "silent mid-run model hand-off —
|
|
16
|
-
"isolation": "members never use harness isolation
|
|
14
|
+
"prewalk": "silent mid-run model hand-off — a tier degradation the fleet forbids",
|
|
15
|
+
"advisor": "silent mid-run model hand-off — a tier degradation the fleet forbids",
|
|
16
|
+
"isolation": "members never use harness isolation: omp builds the workspace outside the claimed worktree and patch-applies into the controller's checkout"
|
|
17
17
|
},
|
|
18
18
|
"values": {
|
|
19
19
|
"model": {
|
|
20
20
|
"pattern": "^@(slow|task|smol):(minimal|low|medium|high|xhigh|max)$",
|
|
21
|
-
"message": "must be a fleet tier route `@slow|@task|@smol` with an explicit `:<level>` suffix
|
|
21
|
+
"message": "must be a fleet tier route `@slow|@task|@smol` with an explicit `:<level>` suffix"
|
|
22
22
|
},
|
|
23
23
|
"name": {
|
|
24
24
|
"pattern": "^fleet-[^:]*$",
|
|
25
|
-
"message": "must be fleet--prefixed with no ':' — omp's agent registry is bare-name/unnamespaced, so the prefix is the only collision guard
|
|
25
|
+
"message": "must be fleet--prefixed with no ':' — omp's agent registry is bare-name/unnamespaced, so the prefix is the only collision guard"
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
},
|