@feigi/fleet-ctl 3.137.5 → 3.138.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agents/fleet-finisher.agent.md +8 -8
- package/agents/fleet-fix-applier.agent.md +1 -1
- package/agents/fleet-merge-bot.agent.md +1 -1
- package/agents/fleet-recipe-deriver.agent.md +5 -5
- package/agents/fleet-review-runner.agent.md +1 -1
- package/commands/review-and-fix.md +11 -11
- package/commands/run-merge-bot.md +9 -9
- package/package.json +1 -1
- package/scripts/claim-ticket.sh +15 -1
- package/scripts/controller-alarm.mjs +1 -1
- package/scripts/evict-mark.mjs +1 -1
- package/scripts/finisher-audit.mjs +1 -1
- package/scripts/finisher-label.mjs +1 -1
- package/scripts/finisher-tree.mjs +1 -1
- package/scripts/fleet-provenance +9 -52
- package/scripts/fleet-run +5 -10
- package/scripts/fleet-tick.mjs +3 -3
- package/scripts/instruments.sh +3 -4
- package/scripts/ledger.mjs +1 -1
- package/scripts/main-checkout.mjs +1 -1
- package/scripts/phase0-receipt.mjs +1 -1
- package/scripts/preflight.mjs +0 -1
- package/scripts/recipe-check.mjs +1 -1
- package/scripts/release-ticket.sh +16 -0
- package/scripts/repo-root.mjs +1 -1
- package/scripts/report-schema.mjs +1 -1
- package/scripts/review-core.mjs +6 -6
- package/scripts/review-eval.mjs +1 -1
- package/scripts/ticketless.mjs +1 -1
- package/scripts/worktree.sh +46 -0
- package/skills/next-ticket/SKILL.md +8 -8
- package/skills/run-team/SKILL.md +22 -34
- package/skills/run-team/briefs/finisher.md +2 -2
- package/skills/run-team/briefs/fix-applier.md +9 -9
- package/skills/run-team/briefs/implementer.md +3 -3
- package/skills/run-team/briefs/merge-bot.md +2 -2
- package/skills/run-team/references/ci-and-staleness.md +1 -1
- package/skills/run-team/references/ci-watcher.md +1 -1
- package/skills/run-team/references/close-out.md +5 -5
- package/skills/run-team/references/failure-handling.md +2 -2
- package/skills/run-team/references/finisher.md +2 -2
- package/skills/run-team/references/instruments.md +1 -1
- package/skills/run-team/references/isolation.md +3 -3
- package/skills/run-team/references/ledger.md +1 -1
- package/skills/run-team/references/member-lifecycle.md +1 -1
- package/skills/run-team/references/phase-0.md +20 -20
- package/skills/run-team/references/pull.md +18 -10
- package/skills/run-team/references/reaping.md +15 -1
- package/skills/run-team/references/reviewers.md +9 -1
- package/skills/run-team/references/tick-rows.md +2 -2
- package/skills/sizing-a-ticket/SKILL.md +1 -1
- package/scripts/fleet-bootstrap +0 -140
package/scripts/fleet-provenance
CHANGED
|
@@ -2,23 +2,19 @@
|
|
|
2
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 — its kind and recorded version, and
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
// read-only.
|
|
5
|
+
// places — its kind and recorded version, and a digest over its scripts/.
|
|
6
|
+
// Exits 0 when the package entry resolves and 2 when it does not. Writes
|
|
7
|
+
// nothing, mutates no config — every path below is read-only.
|
|
9
8
|
//
|
|
10
9
|
// The `enabledProviders: ["claude-plugins"]` assertion retired here: omp
|
|
11
10
|
// 18.2.1 exempts omp-origin installs from
|
|
12
11
|
// that provider gate, and the native package route never depended on it.
|
|
13
12
|
// Asserting it refused correct setups.
|
|
14
13
|
//
|
|
15
|
-
// SEPARATE FILE, not `fleet-run --check`. `fleet-run` is
|
|
16
|
-
//
|
|
17
|
-
//
|
|
18
|
-
//
|
|
19
|
-
// plugin for a feature that never needs to travel there. This script stays
|
|
20
|
-
// inside the install and is reached like every other one, through the
|
|
21
|
-
// Resolver: `fleet-run fleet-provenance`.
|
|
14
|
+
// SEPARATE FILE, not `fleet-run --check`. `fleet-run` is the single door
|
|
15
|
+
// between prose and a script, and maps a script name to the Install root and
|
|
16
|
+
// nothing else; this check is one more script behind that door, reached like
|
|
17
|
+
// every other one, through the Resolver: `fleet-run fleet-provenance`.
|
|
22
18
|
"use strict";
|
|
23
19
|
|
|
24
20
|
const fs = require("node:fs");
|
|
@@ -30,9 +26,8 @@ const NAME = "fleet-provenance";
|
|
|
30
26
|
const PLUGIN_KEY = "@feigi/fleet-ctl"; // the plugin's package name, and its node_modules package dir.
|
|
31
27
|
|
|
32
28
|
// Same resolution point as scripts/fleet-run (its header names the shape of
|
|
33
|
-
// each install kind)
|
|
34
|
-
//
|
|
35
|
-
// fleet-run's own header.
|
|
29
|
+
// each install kind), resolved in this file's own lines: fleet-run requires
|
|
30
|
+
// nothing from the rest of the plugin, so there is no shared module to call.
|
|
36
31
|
function resolveInstall(home) {
|
|
37
32
|
const packagePath = path.join(home, ".omp", "plugins", "node_modules", PLUGIN_KEY);
|
|
38
33
|
let stat;
|
|
@@ -132,17 +127,6 @@ function main() {
|
|
|
132
127
|
process.exit(2);
|
|
133
128
|
}
|
|
134
129
|
|
|
135
|
-
const placedPath = path.join(home, ".fleet", "bin", "fleet-run");
|
|
136
|
-
let placedBuf = null;
|
|
137
|
-
let placedError = null;
|
|
138
|
-
try {
|
|
139
|
-
placedBuf = fs.readFileSync(placedPath);
|
|
140
|
-
} catch (e) {
|
|
141
|
-
placedError = `${e.code || e.message}`;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
let failed = false;
|
|
145
|
-
|
|
146
130
|
const kind = kindOf(reg);
|
|
147
131
|
const version = readLockVersion(home);
|
|
148
132
|
process.stdout.write(`${NAME}: Install root: ${reg.installPath}\n`);
|
|
@@ -156,31 +140,6 @@ function main() {
|
|
|
156
140
|
process.stdout.write(`${NAME}: scripts/ digest: sha256 ${digest.digest} (${digest.fileCount} files)\n`);
|
|
157
141
|
}
|
|
158
142
|
|
|
159
|
-
const installedRunPath = path.join(reg.installPath, "scripts", "fleet-run");
|
|
160
|
-
let installedRunBuf = null;
|
|
161
|
-
let installedRunError = null;
|
|
162
|
-
try {
|
|
163
|
-
installedRunBuf = fs.readFileSync(installedRunPath);
|
|
164
|
-
} catch (e) {
|
|
165
|
-
installedRunError = `${e.code || e.message}`;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
if (placedError) {
|
|
169
|
-
process.stdout.write(`${NAME}: Resolver drift: REFUSED — placed copy ${placedPath} unreadable (${placedError})\n`);
|
|
170
|
-
failed = true;
|
|
171
|
-
} else if (installedRunError) {
|
|
172
|
-
process.stdout.write(`${NAME}: Resolver drift: REFUSED — installed copy ${installedRunPath} unreadable (${installedRunError})\n`);
|
|
173
|
-
failed = true;
|
|
174
|
-
} else if (!placedBuf.equals(installedRunBuf)) {
|
|
175
|
-
process.stdout.write(
|
|
176
|
-
`${NAME}: Resolver drift: REFUSED — ${placedPath} (sha256 ${sha256(placedBuf)}) `
|
|
177
|
-
+ `!= ${installedRunPath} (sha256 ${sha256(installedRunBuf)})\n`,
|
|
178
|
-
);
|
|
179
|
-
failed = true;
|
|
180
|
-
} else {
|
|
181
|
-
process.stdout.write(`${NAME}: Resolver drift: none — ${placedPath} matches ${installedRunPath}\n`);
|
|
182
|
-
}
|
|
183
|
-
|
|
184
143
|
if (kind === "linked-checkout") {
|
|
185
144
|
// Not a failure: a link is the dev loop. It is a NOTICE on
|
|
186
145
|
// every other install's answer, because a linked root outranks an
|
|
@@ -191,8 +150,6 @@ function main() {
|
|
|
191
150
|
+ "every fleet-run answer above came from that checkout, not from an installed release.\n",
|
|
192
151
|
);
|
|
193
152
|
}
|
|
194
|
-
|
|
195
|
-
process.exit(failed ? 1 : 0);
|
|
196
153
|
}
|
|
197
154
|
|
|
198
155
|
main();
|
package/scripts/fleet-run
CHANGED
|
@@ -19,16 +19,11 @@
|
|
|
19
19
|
// CI dependency — node is (the whole test suite is `node --test`). node's
|
|
20
20
|
// `realpathSync` is exact and already required.
|
|
21
21
|
//
|
|
22
|
-
// SINGLE FILE
|
|
23
|
-
//
|
|
24
|
-
//
|
|
25
|
-
// `scripts/
|
|
26
|
-
//
|
|
27
|
-
// nothing from the rest of the plugin (CommonJS, core `node:*` modules
|
|
28
|
-
// only) even though `scripts/fleet-provenance` duplicates a couple of lines
|
|
29
|
-
// of its resolution logic rather than sharing a module with it, for the same
|
|
30
|
-
// reason: a module this file `require()`s would need to travel with it, and
|
|
31
|
-
// nothing else does.
|
|
22
|
+
// SINGLE FILE. Prose runs this file where the package holds it,
|
|
23
|
+
// `scripts/fleet-run` under the package entry above. It requires nothing from
|
|
24
|
+
// the rest of the plugin (CommonJS, core `node:*` modules only), and
|
|
25
|
+
// `scripts/fleet-provenance` and `scripts/instruments.sh` resolve the Install
|
|
26
|
+
// root the same way in their own lines rather than calling it.
|
|
32
27
|
"use strict";
|
|
33
28
|
|
|
34
29
|
const fs = require("node:fs");
|
package/scripts/fleet-tick.mjs
CHANGED
|
@@ -249,7 +249,7 @@ const mkRow = (role, actual, target, detail) => (action, { acts = false, extra =
|
|
|
249
249
|
// `<file>` does — one batch file, one entry per held member, the shape under
|
|
250
250
|
// **The batch file is a JSON array, one entry per dispatched member** in
|
|
251
251
|
// run-team/references/tick-rows.md.
|
|
252
|
-
const tierCheckStep = (members, session) => "run ~/.fleet/
|
|
252
|
+
const tierCheckStep = (members, session) => "run ~/.omp/plugins/node_modules/@feigi/fleet-ctl/scripts/fleet-run tier-check.mjs --batch <file> with "
|
|
253
253
|
+ JSON.stringify(members.map((member) => (session ? { member } : { member, session: "<session>" })));
|
|
254
254
|
|
|
255
255
|
// A mismatch clears when the next attempt on the ticket is dispatched at its
|
|
@@ -442,9 +442,9 @@ function reviewers(s) {
|
|
|
442
442
|
// turns a record-only line into a HOLD.
|
|
443
443
|
const conflictRows = [];
|
|
444
444
|
if (s.conflicts.length) {
|
|
445
|
-
const record = s.conflicts.map((n) => `~/.fleet/
|
|
445
|
+
const record = s.conflicts.map((n) => `~/.omp/plugins/node_modules/@feigi/fleet-ctl/scripts/fleet-run ledger.mjs row <key> "<text> · conflict-hold:#${n} (conflict: mergeable=CONFLICTING)" on the row naming PR#${n}`);
|
|
446
446
|
conflictRows.push(row(`CONFLICT ${prs(s.conflicts)}`,
|
|
447
|
-
{ acts: true, extra: `GitHub reads CONFLICTING; ~/.fleet/
|
|
447
|
+
{ acts: true, extra: `GitHub reads CONFLICTING; ~/.omp/plugins/node_modules/@feigi/fleet-ctl/scripts/fleet-run ledger.mjs read, then ${record.join("; ")}` }));
|
|
448
448
|
}
|
|
449
449
|
if (s.conflictEscalate.length) {
|
|
450
450
|
conflictRows.push(row(`ESCALATE conflict ${prs(s.conflictEscalate)}`,
|
package/scripts/instruments.sh
CHANGED
|
@@ -183,10 +183,9 @@ fi
|
|
|
183
183
|
base="$root/.fleet/instruments.sha"
|
|
184
184
|
|
|
185
185
|
# The Install root, resolved inline on every pin and every check: the same
|
|
186
|
-
# path fleet-run
|
|
187
|
-
#
|
|
188
|
-
#
|
|
189
|
-
# from the package, and an environment override or a `node` call would be a
|
|
186
|
+
# path fleet-run and fleet-provenance resolve, the same way — the package
|
|
187
|
+
# entry's own link-ness for the kind, its realpath for the tree. Mirrored
|
|
188
|
+
# rather than called: an environment override or a `node` call would be a
|
|
190
189
|
# second way to name a tree the fleet does not execute.
|
|
191
190
|
#
|
|
192
191
|
# HOME is checked by hand because `set -u` does not answer for it: measured,
|
package/scripts/ledger.mjs
CHANGED
|
@@ -2023,7 +2023,7 @@ async function rulingOf(pr) {
|
|
|
2023
2023
|
if (ruling !== undefined) return { tickets, ruling, tsv, refusal: null };
|
|
2024
2024
|
}
|
|
2025
2025
|
return { tickets, ruling: null, refusal: `PR #${pr}, the implementer PR of ${tickets.length === 1 ? "ticket" : "tickets"} ${tickets.map((n) => `#${n}`).join(", ")}, has no ruling — `
|
|
2026
|
-
+ `${tsv} has no row for it; rule its review with \`~/.fleet/
|
|
2026
|
+
+ `${tsv} has no row for it; rule its review with \`~/.omp/plugins/node_modules/@feigi/fleet-ctl/scripts/fleet-run tier-outcomes.mjs append ${pr}\`, `
|
|
2027
2027
|
+ "then dispatch the finisher again" };
|
|
2028
2028
|
}
|
|
2029
2029
|
|
|
@@ -126,7 +126,7 @@ import { makeDie, defineFlags } from "./arg.mjs";
|
|
|
126
126
|
import { gitEnv, mainCheckoutDirFromGitCommonDir } from "./git-env.mjs";
|
|
127
127
|
|
|
128
128
|
export const BASELINE_FILE = "main-checkout.sha";
|
|
129
|
-
export const RECORD_COMMAND = "~/.fleet/
|
|
129
|
+
export const RECORD_COMMAND = "~/.omp/plugins/node_modules/@feigi/fleet-ctl/scripts/fleet-run main-checkout.mjs --record";
|
|
130
130
|
const RUN_BOOKKEEPING = new Set(["docs/metrics/tier-outcomes.tsv", "docs/metrics/member-outcomes.tsv", "docs/metrics/ticket-features.tsv"]);
|
|
131
131
|
// Any change to an entry's hash or to a line's format bumps VERSION: a
|
|
132
132
|
// baseline an older plugin wrote then reads `outdated` (re-record) and one a
|
|
@@ -76,7 +76,7 @@ export function readRunReceipt(opts) {
|
|
|
76
76
|
// With no recorded session the remedy is the eval-cell run: phase0.mjs falls
|
|
77
77
|
// back to PI_ARTIFACTS_DIR, which the bash tool's environment carries none of.
|
|
78
78
|
const phase0Command = (session) => session
|
|
79
|
-
? `~/.fleet/
|
|
79
|
+
? `~/.omp/plugins/node_modules/@feigi/fleet-ctl/scripts/fleet-run phase0.mjs --session ${session}`
|
|
80
80
|
: "phase0.mjs from a Python eval cell in the main checkout, without --session (run-team SKILL.md phase 0 step 0)";
|
|
81
81
|
|
|
82
82
|
/**
|
package/scripts/preflight.mjs
CHANGED
|
@@ -75,7 +75,6 @@ export const CHECKS = [
|
|
|
75
75
|
{ name: "allow-merge-commit", argv: ["gh", "api", "repos/{owner}/{repo}", "--jq", ".allow_merge_commit"], want: "true" },
|
|
76
76
|
{ name: "ruleset", argv: ["gh", "api", "repos/{owner}/{repo}/rulesets", "--jq", ".[].name"], want: NONEMPTY },
|
|
77
77
|
{ name: "ci-workflow", argv: ["sh", "-c", CI_NAMED], warn: true },
|
|
78
|
-
{ name: "resolver", argv: ["~/.fleet/bin/fleet-run", "--root"] },
|
|
79
78
|
];
|
|
80
79
|
|
|
81
80
|
/** sha256 over every row's name, argv, want and warn, in table order. */
|
package/scripts/recipe-check.mjs
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
//
|
|
8
8
|
// Run from the member's worktree, after `git add` and before the commit and
|
|
9
9
|
// push, and again after any content change or rebase. Reached through the
|
|
10
|
-
// Resolver: `~/.fleet/
|
|
10
|
+
// Resolver: `~/.omp/plugins/node_modules/@feigi/fleet-ctl/scripts/fleet-run recipe-check.mjs ...`.
|
|
11
11
|
//
|
|
12
12
|
// `--member` is the `impl-<N>[-x]` or `fix-pr-<M>[-x]` name the member was
|
|
13
13
|
// dispatched as. `--testCmd` is the Test entrypoint exactly as the member was
|
|
@@ -1335,6 +1335,7 @@ if [ "$apply" = false ]; then
|
|
|
1335
1335
|
[ "$has_label" = true ] && echo " would: gh issue edit $issue --remove-label $in_progress" >&2
|
|
1336
1336
|
[ -n "$wt" ] && printf ' would: git worktree remove %s\n' "$wt" >&2
|
|
1337
1337
|
[ "$has_branch" = true ] && echo " would: git update-ref -d refs/heads/$branch <its current tip>" >&2
|
|
1338
|
+
[ "$has_branch" = true ] && echo " would: git config --remove-section branch.$branch — if one is left behind" >&2
|
|
1338
1339
|
if [ "$closed_pr" = true ]; then
|
|
1339
1340
|
echo " PR states on $branch:$pr_seen" >&2
|
|
1340
1341
|
echo " would: git push origin --delete refs/heads/$branch (origin read at $remote_sha)" >&2
|
|
@@ -1476,6 +1477,21 @@ else
|
|
|
1476
1477
|
;;
|
|
1477
1478
|
*) halt "$branch $wt_restore_why — branch restored, not deleted" ;;
|
|
1478
1479
|
esac
|
|
1480
|
+
|
|
1481
|
+
# The `[branch "$branch"]` config section, which `git update-ref -d` leaves
|
|
1482
|
+
# behind and `git branch -D` would have removed with the ref. Left, a later
|
|
1483
|
+
# claim of the same name inherits the upstream and reads `[gone]` at once,
|
|
1484
|
+
# and reap.sh then removes the live claim (claim-ticket.sh clears it too;
|
|
1485
|
+
# this is the deleter cleaning up after itself, as reap.sh's delete does).
|
|
1486
|
+
# The ref is already gone and the release otherwise complete, so a section
|
|
1487
|
+
# that stays is a note on stderr and never a halt — the housekeeping
|
|
1488
|
+
# `git worktree prune` below is the same shape. Unlike reap.sh, which also
|
|
1489
|
+
# puts that note in its stdout `warnings`, the receipt has no field for it:
|
|
1490
|
+
# the next claim of the name removes the section itself, and refuses when
|
|
1491
|
+
# it cannot. A claim that never pushed has no section, and that is not a
|
|
1492
|
+
# fault: `wt_clear_branch_config` tells the two apart.
|
|
1493
|
+
wt_clear_branch_config "$branch" ||
|
|
1494
|
+
echo "$NAME: $branch deleted, but its branch config section was left: $wt_err" >&2
|
|
1479
1495
|
done_branch=true
|
|
1480
1496
|
fi
|
|
1481
1497
|
|
package/scripts/repo-root.mjs
CHANGED
|
@@ -533,7 +533,7 @@ function hasNodeShebang(path, buf) {
|
|
|
533
533
|
* Every tracked file this repository ships that the consumer's own `node`
|
|
534
534
|
* executes, in the working tree at `root`, repo-relative: each `*.mjs`, and
|
|
535
535
|
* any other file whose first line is a node shebang — the extensionless
|
|
536
|
-
* entrypoints `fleet-run
|
|
536
|
+
* entrypoints `fleet-run` and `fleet-provenance`.
|
|
537
537
|
* A shebang decides, never an extension alone: `plugin/workflows/*.js` is ESM
|
|
538
538
|
* a harness runs and plain node never loads, and carries none. Test files —
|
|
539
539
|
* `*.test.mjs`, the one naming this repository gives them — are not shipped,
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// report-schema.mjs print <family>
|
|
6
6
|
// report-schema.mjs validate <family> <file>
|
|
7
7
|
//
|
|
8
|
-
// Reached through the Resolver: `~/.fleet/
|
|
8
|
+
// Reached through the Resolver: `~/.omp/plugins/node_modules/@feigi/fleet-ctl/scripts/fleet-run report-schema.mjs ...`.
|
|
9
9
|
// <family> is one of `impl`, `fix-pr`, `finisher`, `merge-bot`. The review
|
|
10
10
|
// runner is not a family here: its report already has a shape of its own.
|
|
11
11
|
//
|
package/scripts/review-core.mjs
CHANGED
|
@@ -419,7 +419,7 @@ export function resolveTestCmd(explicit, snap) {
|
|
|
419
419
|
// command is one word to the wrapper — it hands the string to `sh -c` itself —
|
|
420
420
|
// so it is single-quoted here, each embedded `'` closed, escaped and reopened.
|
|
421
421
|
function slotted(cmd) {
|
|
422
|
-
return `~/.fleet/
|
|
422
|
+
return `~/.omp/plugins/node_modules/@feigi/fleet-ctl/scripts/fleet-run suite-slot.mjs '${cmd.replaceAll("'", "'\\''")}'`;
|
|
423
423
|
}
|
|
424
424
|
|
|
425
425
|
// The status suite-slot.mjs exits with when its wait for a slot expired.
|
|
@@ -1072,7 +1072,7 @@ export async function runReview(host, args) {
|
|
|
1072
1072
|
mkdir -p "${runRootParent}" || { echo SNAPSHOT_RUNROOT_FAILED; exit 1; }
|
|
1073
1073
|
RUN=$(mktemp -d "${runRootPrefix}XXXXXXXX") || { echo SNAPSHOT_RUNROOT_FAILED; exit 1; }
|
|
1074
1074
|
echo SNAPSHOT_RUN_ROOT="$RUN"
|
|
1075
|
-
~/.fleet/
|
|
1075
|
+
~/.omp/plugins/node_modules/@feigi/fleet-ctl/scripts/fleet-run reclaim-scratch.mjs --pr ${pr} --root "${scratch}" --apply | grep -qF '"failed":[]' || echo SNAPSHOT_PRUNE_FAILED
|
|
1076
1076
|
SHA=$(git -C ${worktree} rev-parse --short HEAD) || { echo SNAPSHOT_REVPARSE_FAILED; exit 1; }
|
|
1077
1077
|
SNAP="$RUN/snapshot-$SHA"
|
|
1078
1078
|
echo SNAPSHOT_DEST="$SNAP"
|
|
@@ -1082,7 +1082,7 @@ export async function runReview(host, args) {
|
|
|
1082
1082
|
( cd "$SNAP" && git init -q && git add -A -f && git -c user.name=fleet -c user.email=fleet@invalid commit -q --no-verify -m "review snapshot of $SHA" ) || echo SNAPSHOT_INIT_FAILED
|
|
1083
1083
|
SNAPTREE=$(git -C "$SNAP" rev-parse 'HEAD^{tree}' 2>/dev/null); SRCTREE=$(git -C ${worktree} rev-parse 'HEAD^{tree}')
|
|
1084
1084
|
{ [ -d "$SNAP/.git" ] && [ -n "$SNAPTREE" ] && [ "$SNAPTREE" = "$SRCTREE" ]; } && echo SNAPSHOT_TREE_MATCH || echo SNAPSHOT_TREE_MISMATCH="snapshot $SNAPTREE vs commit $SRCTREE"
|
|
1085
|
-
INSTALL=$(~/.fleet/
|
|
1085
|
+
INSTALL=$(~/.omp/plugins/node_modules/@feigi/fleet-ctl/scripts/fleet-run derive-testcmd.sh ${worktree} install) && echo SNAPSHOT_INSTALL_STEP="$INSTALL" || { INSTALL=; echo SNAPSHOT_INSTALL_UNREAD; }
|
|
1086
1086
|
[ -z "$INSTALL" ] || { ( cd "$SNAP" && env -u CI sh -c "$INSTALL" ) >"$RUN/install.log" 2>&1; echo SNAPSHOT_INSTALL_EXIT=$?; }
|
|
1087
1087
|
if [ -d "$SNAP/.git" ] && git -C "$SNAP" status --porcelain --untracked-files=all >"$RUN/status.txt"; then head -n 20 "$RUN/status.txt" | sed 's/^/SNAPSHOT_UNTRACKED=/'; echo SNAPSHOT_UNTRACKED_COUNT=$(wc -l <"$RUN/status.txt" | tr -d ' '); else echo SNAPSHOT_STATUS_FAILED; fi
|
|
1088
1088
|
|
|
@@ -1203,7 +1203,7 @@ caller decide.
|
|
|
1203
1203
|
|
|
1204
1204
|
Then read this repository's Test entrypoint out of its Recipe cache:
|
|
1205
1205
|
|
|
1206
|
-
~/.fleet/
|
|
1206
|
+
~/.omp/plugins/node_modules/@feigi/fleet-ctl/scripts/fleet-run derive-testcmd.sh ${worktree} test
|
|
1207
1207
|
|
|
1208
1208
|
Report \`testCmd\` = its stdout ONLY if it exited 0. If it exited non-zero,
|
|
1209
1209
|
report \`testCmdError\` = its stderr and omit \`testCmd\`. Never derive or
|
|
@@ -1214,7 +1214,7 @@ that instead of deriving.
|
|
|
1214
1214
|
Then read, out of the same cache, the merge-gating CI steps that neither the
|
|
1215
1215
|
Test entrypoint nor the Check step runs:
|
|
1216
1216
|
|
|
1217
|
-
~/.fleet/
|
|
1217
|
+
~/.omp/plugins/node_modules/@feigi/fleet-ctl/scripts/fleet-run derive-testcmd.sh ${worktree} uncovered
|
|
1218
1218
|
|
|
1219
1219
|
Report \`uncovered\` = its stdout, one line of JSON copied verbatim, ONLY if it
|
|
1220
1220
|
exited 0. If it exited non-zero, report \`uncoveredError\` = its stderr and omit
|
|
@@ -1226,7 +1226,7 @@ it again because it is a separate command; the capture block above already
|
|
|
1226
1226
|
reported why when it could not:
|
|
1227
1227
|
|
|
1228
1228
|
REPO=$(cd ${worktree} && gh repo view --json url -q .url 2>/dev/null)
|
|
1229
|
-
if [ -n "$REPO" ]; then ~/.fleet/
|
|
1229
|
+
if [ -n "$REPO" ]; then ~/.omp/plugins/node_modules/@feigi/fleet-ctl/scripts/fleet-run diff-stats.mjs --pr ${pr} --repo "$REPO"; else echo SNAPSHOT_REPO_UNRESOLVED; fi
|
|
1230
1230
|
|
|
1231
1231
|
If that printed SNAPSHOT_REPO_UNRESOLVED, omit \`diffStats\`.
|
|
1232
1232
|
|
package/scripts/review-eval.mjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// review-core.mjs directly) through
|
|
3
3
|
// the Resolver, from an `eval` cell:
|
|
4
4
|
//
|
|
5
|
-
// const path = (await Bun.$`~/.fleet/
|
|
5
|
+
// const path = (await Bun.$`~/.omp/plugins/node_modules/@feigi/fleet-ctl/scripts/fleet-run --path review-eval.mjs`.text()).trim();
|
|
6
6
|
// const { runReviewOnOmp } = await import(path);
|
|
7
7
|
// const result = await runReviewOnOmp({ pr, branch, worktree, testCmd, scratch });
|
|
8
8
|
//
|
package/scripts/ticketless.mjs
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
// it; `--ledger` names the ledger file instead. A ledger that cannot be
|
|
17
17
|
// resolved is exit 2: `ledger.mjs`'s own cwd-relative fallback is never taken,
|
|
18
18
|
// since an empty cwd-local ledger would answer Ticketless. Reached through the
|
|
19
|
-
// Resolver: `~/.fleet/
|
|
19
|
+
// Resolver: `~/.omp/plugins/node_modules/@feigi/fleet-ctl/scripts/fleet-run ticketless.mjs ...`.
|
|
20
20
|
//
|
|
21
21
|
// Stdout is one JSON line:
|
|
22
22
|
//
|
package/scripts/worktree.sh
CHANGED
|
@@ -1345,3 +1345,49 @@ wt_outcome() {
|
|
|
1345
1345
|
fi
|
|
1346
1346
|
return 0
|
|
1347
1347
|
}
|
|
1348
|
+
|
|
1349
|
+
# Removes the `[branch "<name>"]` config section of a branch whose ref is gone
|
|
1350
|
+
# or has never existed. `git branch -D` takes the section with the ref;
|
|
1351
|
+
# `git update-ref -d` leaves it, and `git worktree add --no-track -b <name>` of
|
|
1352
|
+
# a later claim under the same name inherits the leftover upstream, which
|
|
1353
|
+
# names a remote ref that no longer exists and so reads `[gone]` at once
|
|
1354
|
+
# (measured, git 2.50.1). Calling it with the ref still present would unset the
|
|
1355
|
+
# live branch's upstream, so while `refs/heads/<name>` exists it removes
|
|
1356
|
+
# nothing and returns 1.
|
|
1357
|
+
#
|
|
1358
|
+
# Returns 0 when no key of that section is left, whether this call removed it
|
|
1359
|
+
# or there was none to remove, and 1 when one remains or the config could not
|
|
1360
|
+
# be read, with `$wt_err` naming the cause. `--remove-section` fails the same
|
|
1361
|
+
# way for a missing section as for a lock it could not take, so its status
|
|
1362
|
+
# cannot tell them apart: the keys are listed afterwards, the way reap.sh's
|
|
1363
|
+
# `branch_keys_left` does, and only a key of this branch's section left behind
|
|
1364
|
+
# is a failure. `${key%.*}` drops the variable name off `branch.<name>.<var>`;
|
|
1365
|
+
# the subsection may itself hold dots and slashes, so a regex built from the
|
|
1366
|
+
# name would misread them. Only the repository's own config file is cleared and
|
|
1367
|
+
# listed (`--local`): a section in an included file or in config.worktree is
|
|
1368
|
+
# neither removed nor reported, and its upstream still applies. Writes
|
|
1369
|
+
# `$wt_err`, and clobbers `$wt_cfg_out`, `$wt_cfg_keys` and `$wt_cfg_k`; call as
|
|
1370
|
+
# a bare `if`/`||` condition, never inside `$( )`.
|
|
1371
|
+
wt_clear_branch_config() {
|
|
1372
|
+
wt_err=
|
|
1373
|
+
if git show-ref --verify --quiet "refs/heads/$1"; then
|
|
1374
|
+
wt_err="branch $1 still exists"
|
|
1375
|
+
return 1
|
|
1376
|
+
fi
|
|
1377
|
+
if wt_cfg_out=$(git config --remove-section "branch.$1" 2>&1); then return 0; fi
|
|
1378
|
+
if wt_cfg_keys=$(git config --local --name-only --get-regexp '^branch\.' 2>&1); then :
|
|
1379
|
+
elif [ "$?" -eq 1 ]; then return 0
|
|
1380
|
+
else
|
|
1381
|
+
wt_err="could not list the branch config keys: $(printf '%s' "$wt_cfg_keys" | tr '\n' ' ')"
|
|
1382
|
+
return 1
|
|
1383
|
+
fi
|
|
1384
|
+
while IFS= read -r wt_cfg_k; do
|
|
1385
|
+
if [ "${wt_cfg_k%.*}" = "branch.$1" ]; then
|
|
1386
|
+
wt_err=$(printf '%s' "$wt_cfg_out" | tr '\n' ' ')
|
|
1387
|
+
return 1
|
|
1388
|
+
fi
|
|
1389
|
+
done <<EOK
|
|
1390
|
+
$wt_cfg_keys
|
|
1391
|
+
EOK
|
|
1392
|
+
return 0
|
|
1393
|
+
}
|
|
@@ -18,13 +18,13 @@ Suggest ready tickets, maintainer picks, mark in-progress, implement at depth ti
|
|
|
18
18
|
Before the query, run the Label map derivation step:
|
|
19
19
|
|
|
20
20
|
```bash
|
|
21
|
-
~/.fleet/
|
|
21
|
+
~/.omp/plugins/node_modules/@feigi/fleet-ctl/scripts/fleet-run label-map.mjs ensure
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
-
Exit 0 → the map is in place; go on. Exit 3 → it printed the question payload, a JSON object with `certain`, `uncertain` and `tableFile`, the path of the repository's triage-label table: render it to the maintainer as one question listing each uncertain role, its suggestion, why it is uncertain (a role declared in the table but not in the tracker names the payload's `tableFile`) and the alternatives, ending with "reply `defaults` to accept every suggestion, or name `<role>=<label>` for any you want otherwise — a role with no suggestion must be named; labels that do not exist are created on your confirmation". **Wait for the answer**, then run `~/.fleet/
|
|
24
|
+
Exit 0 → the map is in place; go on. Exit 3 → it printed the question payload, a JSON object with `certain`, `uncertain` and `tableFile`, the path of the repository's triage-label table: render it to the maintainer as one question listing each uncertain role, its suggestion, why it is uncertain (a role declared in the table but not in the tracker names the payload's `tableFile`) and the alternatives, ending with "reply `defaults` to accept every suggestion, or name `<role>=<label>` for any you want otherwise — a role with no suggestion must be named; labels that do not exist are created on your confirmation". **Wait for the answer**, then run `~/.omp/plugins/node_modules/@feigi/fleet-ctl/scripts/fleet-run label-map.mjs set --create` with it — `--accept-suggestions` for `defaults`, plus each `<role>=<label>` the maintainer named — and run `ensure` again, which now exits 0. Tell the maintainer how to make the answer permanent: add or edit the row for the role in the file the payload's `tableFile` names, the role in the first cell and the string in the second; never write that table yourself. Exit 1 or 2 → show what it printed and stop; neither is a question.
|
|
25
25
|
|
|
26
26
|
```bash
|
|
27
|
-
~/.fleet/
|
|
27
|
+
~/.omp/plugins/node_modules/@feigi/fleet-ctl/scripts/fleet-run candidates.mjs --require-label ready-for-agent --allow-fallback
|
|
28
28
|
```
|
|
29
29
|
|
|
30
30
|
Script owns the query: label exclusions server-side, raw `body` never fetched for
|
|
@@ -55,7 +55,7 @@ Cut runs on step 1 data alone — number, title, labels, `d` — never the Agent
|
|
|
55
55
|
## 3. In-flight check (all three, per candidate) — then fetch
|
|
56
56
|
|
|
57
57
|
```bash
|
|
58
|
-
~/.fleet/
|
|
58
|
+
~/.omp/plugins/node_modules/@feigi/fleet-ctl/scripts/fleet-run inflight.sh <N> # 0 free, 1 taken, 2 unanswerable
|
|
59
59
|
```
|
|
60
60
|
|
|
61
61
|
Runs all three — a PR about the ticket, a remote branch, a local worktree or branch. Exit 1 → taken. "Shipped" memory not proof; open PR means unmerged. Exit 2 is not free: the question went unanswered (`gh` failed, no such issue, not a repo), so treat it as taken until you know.
|
|
@@ -87,9 +87,9 @@ Ask which. **Wait for answer.** Maintainer says taken → drop, re-suggest.
|
|
|
87
87
|
gh issue edit <N> --add-label "<in-progress string>"
|
|
88
88
|
```
|
|
89
89
|
|
|
90
|
-
`<in-progress string>` is what `~/.fleet/
|
|
90
|
+
`<in-progress string>` is what `~/.omp/plugins/node_modules/@feigi/fleet-ctl/scripts/fleet-run label-map.mjs show in-progress` prints. The derivation step in step 1 already confirmed the label exists in the tracker, creating it on the maintainer's confirmation where it was missing.
|
|
91
91
|
|
|
92
|
-
Infer branch/worktree convention from `git worktree list` / `git branch -r` — commonly `feat|fix|refactor/<N>-slug` and `.worktrees/<N>-slug`. Branch off fresh `origin/main`, run the Install step, run the Check step, run the Test entrypoint as the baseline — the repo's **Recipe**, read from its Recipe cache: `~/.fleet/
|
|
92
|
+
Infer branch/worktree convention from `git worktree list` / `git branch -r` — commonly `feat|fix|refactor/<N>-slug` and `.worktrees/<N>-slug`. Branch off fresh `origin/main`, run the Install step, run the Check step, run the Test entrypoint as the baseline — the repo's **Recipe**, read from its Recipe cache: `~/.omp/plugins/node_modules/@feigi/fleet-ctl/scripts/fleet-run derive-testcmd.sh . install`, `… . check` and `… . test --at origin/main` print them. **No usable cache (any of the three exits 1) → run the Recipe derivation step first:** dispatch a `task` member, agent `fleet-recipe-deriver`, its prompt naming the main checkout's absolute path as `<repo>` and `<scratch>/derive-recipe/` as its scratch directory, `<scratch>` the output of `~/.omp/plugins/node_modules/@feigi/fleet-ctl/scripts/fleet-run scratch-root.mjs`; it reads the repo, proves all three commands in a throwaway worktree and writes the cache only on proof. `RECIPE NOT PROVEN` → stop and give the maintainer its reason; never pick a command yourself. Exit 3 is no verdict on the cache — the reader could not run a tool it needs — so fix that environment fault and re-run instead of deriving.
|
|
93
93
|
|
|
94
94
|
**Run the Install step with `CI` removed**, from the new worktree's root: `env -u CI sh -c "<install>"`, `<install>` the output of `derive-testcmd.sh . install`. A setup script that skips under `CI` installs no git hooks there, and you would then commit with the repository's commit-time checks silently absent. Only the Install step loses `CI`; the Check step and the Test entrypoint baseline run in your shell's own environment.
|
|
95
95
|
|
|
@@ -105,7 +105,7 @@ Come back here. The sizing path hands off; this step always follows.
|
|
|
105
105
|
|
|
106
106
|
```bash
|
|
107
107
|
git fetch origin && git rebase origin/main # rebase, never merge main in
|
|
108
|
-
~/.fleet/
|
|
108
|
+
~/.omp/plugins/node_modules/@feigi/fleet-ctl/scripts/fleet-run recipe-check.mjs --member <your name> --testCmd "<test command>" --reports <scratch>/reports # re-run after any content change or rebase
|
|
109
109
|
git push --force-with-lease -u origin HEAD
|
|
110
110
|
gh pr create --base main --body "…
|
|
111
111
|
|
|
@@ -168,7 +168,7 @@ and a member sent into one is on `## HEAD (no branch)`, where the push above exi
|
|
|
168
168
|
the cause, so no `-u`/force combination reaches it: the unqualified `HEAD`
|
|
169
169
|
destination is, and plain `git push origin HEAD` fails the same way while a bare
|
|
170
170
|
`git push` exits 128 (`fatal: You are not currently on a branch`). Name the branch
|
|
171
|
-
instead, through the helper — `~/.fleet/
|
|
171
|
+
instead, through the helper — `~/.omp/plugins/node_modules/@feigi/fleet-ctl/scripts/fleet-run push-sync.mjs --branch <branch> --force-with-lease`.
|
|
172
172
|
A refspec push alone moves origin's ref and leaves the claim worktree's
|
|
173
173
|
`refs/heads/<branch>` at its old tip; the helper pushes `HEAD:refs/heads/<branch>`,
|
|
174
174
|
then moves the worktree holding `<branch>` to the pushed SHA with `reset --keep`,
|