@feigi/fleet-ctl 3.91.0 → 3.91.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feigi/fleet-ctl",
3
- "version": "3.91.0",
3
+ "version": "3.91.1",
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": {
@@ -412,10 +412,11 @@ export function mapCi(ciJson, pr) {
412
412
  // A receipt with no session to give is `{ error }`, which the panel shows:
413
413
  // the board names no session rather than guessing one. So is a recorded
414
414
  // session whose NAME is not an omp `<ISO>_<uuid>` session directory:
415
- // phase0.mjs accepts any existing directory as the session, so a `--session`
416
- // naming the encoded-cwd project dir instead of its own session child lands in
417
- // the receipt, and readOmpSpend would book every session under it — the
418
- // controller's own main-session transcript included — as this run's agents.
415
+ // phase0.mjs refuses a directory with no `<dir>.jsonl` beside it, but a
416
+ // receipt it wrote before that refusal, or one written by hand, can record the
417
+ // encoded-cwd project dir instead of its own session child, and readOmpSpend
418
+ // would book every session under it — the controller's own main-session
419
+ // transcript included — as this run's agents.
419
420
  // A recorded directory that does not exist yet is not an error — that is
420
421
  // gatherSpend()'s quiet `null`, below.
421
422
  export function receiptSpendDir(stateDir) {
@@ -8,9 +8,11 @@
8
8
  // The session directory is `--session`, else `PI_ARTIFACTS_DIR`, which omp
9
9
  // exports to its Python eval kernel and the processes that kernel starts (the
10
10
  // bash tool's environment does not carry it); with neither, exit 2. It is
11
- // accepted when it is an existing directory, or when `<dir>.jsonl` exists
12
- // beside it — omp creates the directory when the session's first subagent
13
- // writes there.
11
+ // accepted when `<dir>.jsonl` exists beside it and the path is a directory or
12
+ // does not exist yet — omp creates the directory when the session's first
13
+ // subagent writes there. An existing directory with no `<dir>.jsonl` beside
14
+ // it names no session (the directory holding every session of a checkout is
15
+ // one): from either source it exits 2 naming the path, writing no receipt.
14
16
  //
15
17
  // Reached through the Resolver and run from the MAIN checkout (a linked
16
18
  // worktree refuses: the checks below judge the checkout the controller reads
@@ -528,15 +530,19 @@ function main() {
528
530
  }
529
531
  const source = given === null ? "PI_ARTIFACTS_DIR" : "--session";
530
532
  const session = resolve(given ?? fromEnv);
531
- // An existing directory, or `<session>.jsonl` beside a path that does not
532
- // exist yet: omp creates the directory when the session's first subagent
533
- // writes there.
533
+ // A session is named by its transcript, `<session>.jsonl`, beside the
534
+ // directory: an existing directory with none beside it — the one holding
535
+ // every session of a checkout, say — names no session. The directory itself
536
+ // may not exist yet: omp creates it when the session's first subagent writes
537
+ // there.
538
+ const transcript = existsSync(`${session}.jsonl`);
534
539
  try {
535
540
  if (!statSync(session).isDirectory()) die(`${source} ${session} is not a directory`);
541
+ if (!transcript) die(`${source} ${session} has no ${session}.jsonl beside it, so it names no session`);
536
542
  } catch (e) {
537
543
  if (e.code === undefined) throw e;
538
544
  if (e.code !== "ENOENT") die(`${source} ${session} is not readable (${e.code})`);
539
- if (!existsSync(`${session}.jsonl`)) die(`${source} ${session} does not exist, and no ${session}.jsonl beside it names a session`);
545
+ if (!transcript) die(`${source} ${session} does not exist, and no ${session}.jsonl beside it names a session`);
540
546
  }
541
547
  const positive = (name) => {
542
548
  const n = F.numArg(name);
@@ -7,7 +7,12 @@ environment carries `PI_ARTIFACTS_DIR`, this run's own session directory,
7
7
  which phase 0 records in its receipt; the bash tool's does not, so there
8
8
  phase 0 exits 2. `expanduser` is required: a literal `~/…` fails with
9
9
  `FileNotFoundError`. So is the `stderr` redirect: the cell never shows a
10
- child's stderr. `--session <dir>` overrides the variable.
10
+ child's stderr. `--session <dir>` overrides the variable. Either way the
11
+ directory must have its transcript `<dir>.jsonl` beside it; the directory
12
+ itself may not exist yet. An existing directory with no `<dir>.jsonl` beside
13
+ it — `~/.omp/agent/sessions/<encoded-cwd>`, which holds every session of the
14
+ checkout — names no session: phase 0 exits 2 naming the path and where it
15
+ came from, and writes no receipt.
11
16
 
12
17
  Exit 3 is a step that failed: its line carries the refusal, so fix the cause
13
18
  and run it again.