@feigi/fleet-ctl 3.110.3 → 3.110.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.
@@ -5,7 +5,7 @@ model: "@slow:high"
5
5
  spawns: task
6
6
  ---
7
7
 
8
- You are a fleet fix-applier. Your brief names this dispatch's worktree, PR branch and test command, and the kind of work it is: a review's findings to apply or defer, a dispositions retry, a conflict hold to clear, or a red CI check to fix. Every brief names the scratch directory too, which your report file goes under; a conflict hold's and a red-check fix's name it for that file alone, so every other rule below that cites `<scratch>` is for a review and a dispositions retry. The rules about findings — scope and refuters, the apply/defer split, the dispositions record and the report of the split and the deferral issues — are for a review and a dispositions retry: a conflict hold and a red-check fix have no review file, and what each says to report is in its brief. Every other rule below holds for every kind. The review file and review path that those rules cite are the ones your brief names. Where the rules write `<abs-path>`, `<branch>`, `<testCmd>`, `<scratch>`, `<pr>` or `<run>`, they name the value your brief gives you; a prompt you write for a refuter carries the value itself, never the placeholder.
8
+ You are a fleet fix-applier. Your brief names this dispatch's worktree, PR branch and test command, and the kind of work it is: a review's findings to apply or defer, a dispositions retry, a conflict hold to clear, or a red CI check to fix. Every brief names the scratch directory too, which your report file goes under; a conflict hold's and a red-check fix's name it for that file alone, so every other rule below that cites `<scratch>` is for a review and a dispositions retry. The rules about findings — scope and refuters, the apply/defer split, the dispositions record and the report of the split and the deferral issues — are for a review and a dispositions retry: a conflict hold and a red-check fix have no review file and write no dispositions record, so their report's `dispositionsRecord` is `null`, and what else each says to report is in its brief. Every other rule below holds for every kind. The review file and review path that those rules cite are the ones your brief names. Where the rules write `<abs-path>`, `<branch>`, `<testCmd>`, `<scratch>`, `<pr>` or `<run>`, they name the value your brief gives you; a prompt you write for a refuter carries the value itself, never the placeholder.
9
9
 
10
10
  **`edit` and `read` resolve a bare relative path against the SESSION ROOT —
11
11
  the controller's own main checkout — not against that worktree and not
@@ -332,8 +332,10 @@ Then write your report to the file your brief names,
332
332
  number on its `deferred` entry, the deferral issues as `{issue, subject}`
333
333
  entries — `filed` for every issue step 5 created, and `unrecorded` for one
334
334
  whose `ledger.mjs filed` failed twice, which the controller's settle records —
335
- `dispositionsRecord` your record's path and `testRun` your test result. Then
336
- send the one line your brief gives, `<your name>: <outcome> <path>`, and exit.
335
+ `dispositionsRecord` your record's path and `testRun` your test result, `null`
336
+ when no test run exists — a `no-op`, or a `failed` that never ran tests; a
337
+ non-null `testRun` always reflects a real run. Then send the one line your
338
+ brief gives, `<your name>: <outcome> <path>`, and exit.
337
339
  **Deferring everything is a normal
338
340
  outcome, not a stall:** nothing is then staged, `git commit` refuses an empty
339
341
  index, `~/.fleet/bin/fleet-run push-sync.mjs --branch <branch>` prints git's
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feigi/fleet-ctl",
3
- "version": "3.110.3",
3
+ "version": "3.110.4",
4
4
  "description": "Agent fleet: run-team controller, merge bot, PR reviewer, and the ticket pipeline they share",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -26,7 +26,12 @@
26
26
  // is no bail`, gives no reason in `bailDetail`, or names a `pr` or a
27
27
  // `head`, as `$.pr: <pr> is not null, with outcome "blocked" — a block
28
28
  // reports no PR`, or whose `bailed` outcome names a `pr` or a `head`, as
29
- // `$.pr: <pr> is not null, with outcome "bailed" — a bail reports no PR`
29
+ // `$.pr: <pr> is not null, with outcome "bailed" — a bail reports no PR`,
30
+ // and a fix-pr report whose `applied` outcome names no `testRun`, as
31
+ // `$.testRun: null, with outcome "applied" — an applied fix reports the
32
+ // test run behind it`, or that defers a `refuted` finding with no
33
+ // `dispositionsRecord`, as `$.dispositionsRecord: null, with a refuted
34
+ // deferral at $.deferred[<i>] — settle reads its reason from that record`
30
35
  // 2 usage: no or unknown subcommand, a wrong argument count, an unknown
31
36
  // family, any flag; or <file> could not be read; or print could not
32
37
  // write the schema to stdout. Refused on stderr, nothing on stdout
@@ -141,8 +146,10 @@ export const SCHEMAS = {
141
146
  deferred: listOf({ bucket: str, index: int, issue: id }),
142
147
  filed: issues,
143
148
  unrecorded: issues,
144
- dispositionsRecord: { type: "string", pattern: "^/" },
145
- testRun: obj({ cmd: str, exit: int, tests: int, cancelled: int }),
149
+ // `null` where nothing exists: a conflict hold or a red-check fix writes no
150
+ // dispositions record, and a no-op or a failed fix may have run no tests.
151
+ dispositionsRecord: { type: ["string", "null"], pattern: "^/" },
152
+ testRun: obj({ cmd: str, exit: int, tests: int, cancelled: int }, ["object", "null"]),
146
153
  confirmation: strings,
147
154
  }),
148
155
  finisher: report({
@@ -188,9 +195,12 @@ export function mergeBotVerdicts(report) {
188
195
  // text that is not only whitespace, and names no `pr` or `head`, since a block
189
196
  // reports no PR; a `bailed` outcome names no `pr` or `head` either, since a
190
197
  // bail is the pre-code outcome — a PR the member opened is outcome `pr`, which
191
- // settle checks. For a merge-bot report: each PR gets one verdict — merged,
192
- // held, conflict-held or refused — the last it reached in the pass, so a PR
193
- // named twice, in one list or in two, is a violation at its second entry.
198
+ // settle checks. For a fix-pr report: an `applied` outcome names its
199
+ // `testRun`, the run behind the commit, and a `refuted` deferral, under any
200
+ // outcome, names the `dispositionsRecord` settle reads its reason from. For a
201
+ // merge-bot report: each PR gets one verdict — merged, held, conflict-held or
202
+ // refused — the last it reached in the pass, so a PR named twice, in one list
203
+ // or in two, is a violation at its second entry.
194
204
  export function reportViolation(family, value) {
195
205
  const found = validate(SCHEMAS[family], value);
196
206
  if (found !== null) return found;
@@ -206,6 +216,15 @@ export function reportViolation(family, value) {
206
216
  if (value[field] !== null) return `$.${field}: ${show(value[field])} is not null, with outcome "bailed" — a bail reports no PR`;
207
217
  }
208
218
  }
219
+ if (family === "fix-pr") {
220
+ if (value.outcome === "applied" && value.testRun === null) {
221
+ return '$.testRun: null, with outcome "applied" — an applied fix reports the test run behind it';
222
+ }
223
+ const refuted = value.deferred.findIndex((d) => d.bucket === "refuted");
224
+ if (refuted !== -1 && value.dispositionsRecord === null) {
225
+ return `$.dispositionsRecord: null, with a refuted deferral at $.deferred[${refuted}] — settle reads its reason from that record`;
226
+ }
227
+ }
209
228
  if (family !== "merge-bot") return null;
210
229
  const first = new Map();
211
230
  for (const { pr, path } of mergeBotVerdicts(value)) {
@@ -136,8 +136,12 @@ recorded nothing — so run it again with `timeout: 0` on the call.
136
136
 
137
137
  Your report is a file, `<scratch>/reports/<your name>.json`, `<your name>` the
138
138
  `fix-pr-` name you were dispatched as, in the shape
139
- `~/.fleet/bin/fleet-run report-schema.mjs print fix-pr` prints. Write it
140
- before your final message, and send nothing until
139
+ `~/.fleet/bin/fleet-run report-schema.mjs print fix-pr` prints. A field with
140
+ nothing real to point at is `null`: `dispositionsRecord` for a conflict hold or
141
+ a red-check fix, which write no dispositions record, and `testRun` when no test
142
+ run exists — a `no-op`, or a `failed` that never ran tests. A non-null value
143
+ always reflects a real record or a real run. Write the report before your
144
+ final message, and send nothing until
141
145
  `~/.fleet/bin/fleet-run report-schema.mjs validate fix-pr <scratch>/reports/<your name>.json`
142
146
  answers `valid`. Your final message is then one line,
143
147
  `<your name>: <outcome> <scratch>/reports/<your name>.json`, `<outcome>` the