@evident-ai/runner-synchroniser 3.4.1-dev.c03b461 → 3.4.1-dev.e91ca26

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.
Files changed (3) hide show
  1. package/README.md +11 -11
  2. package/dist/cli.js +5 -2
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -56,7 +56,7 @@ build time.
56
56
  | `env` | resolved config as shell-eval'able vars | `0` = ran; non-zero = tool broken |
57
57
  | `litestream-config` | the generated `litestream.yml` | `0` = ran; non-zero = tool broken |
58
58
  | `restore <claude\|opencode>` | — | `0` = ran; non-zero = tool broken |
59
- | `sync-once <claude\|opencode>` | — | `0` = ran; non-zero = tool broken |
59
+ | `sync-once <claude\|opencode>` | — | `0` = uploaded/unchanged/absent/disabled; `40` = not persisted; other = tool broken |
60
60
  | `model-auth-ready` | — | `0` = ready, `10` = not ready; other = tool broken |
61
61
  | `self-stop` | — | `0` = stopped, `20` = keep the task; other = tool broken |
62
62
  | `session-db-classify <litestream-restore-exit-code> <attempt> [--on-unusable-replica=<prune\|leave\|clear\|crash>] [--recovery-occurred] [--fresh-db-fallback]` | — | `0` = restored/no-replica/disabled, `32` = re-run and ask again, `31` = unusable (booted fresh, replicates into the existing prefix), `30` = fatal; other = usage/tool broken |
@@ -250,8 +250,7 @@ and it can never repair corruption at a higher compaction level.
250
250
 
251
251
  `EVIDENT_ON_UNUSABLE_REPLICA` is a `runner/docker-images/fargate` (entrypoint) variable translated into the flag above at boot — this CLI never reads it, so it has no row in this README's Configuration table below; see [the Fargate image README](../docker-images/fargate/README.md#when-the-replica-is-unusable-evident_on_unusable_replica). An unrecognised value (including wrong casing, e.g. `Prune`) exits `2`, outside `entrypoint.sh`'s `0|10|20|30|31|32|33` allow-list — a typo **crash-loops the task on attempt 1** rather than falling back to `prune`, and also logs the misleading "credential persistence is DEGRADED" ERROR.
252
252
 
253
- See `specs/local-runner.feature`'s "Recovering session history at startup" scenarios for
254
- the behavioural anchor (31 comes online, 30 does not).
253
+ The behavioural anchor is explicit: **31 comes online, 30 does not**.
255
254
 
256
255
  ### `session-db-verify`
257
256
 
@@ -327,15 +326,16 @@ same way it already reuses `SESSION-DB-REPLICA-UNUSABLE` for `session-db-classif
327
326
 
328
327
  ### Why the contract is asymmetric
329
328
 
330
- `restore` and `sync-once` **never** report a domain outcome through the exit code. A
331
- missing remote object, a corrupt local file, a failed upload, an IAM denial — all of
332
- those are logged and still exit `0`. None of them should abort a boot: a runner with no
333
- credentials yet is a runner a human can still log into.
329
+ `restore` logs domain outcomes and still exits `0`: a missing remote object or a
330
+ restore failure should not abort a boot, because a runner with no credentials yet
331
+ is a runner a human can still log into. `sync-once` returns `40` when the current
332
+ credential file is not persisted (`failed`, `hashFailed`, or `localInvalid`), while
333
+ `absent` and `disabled` remain legitimate `0` outcomes.
334
334
 
335
- The consequence is the point: **any non-zero status from `restore`/`sync-once` means the
336
- tool itself broke** — bad arguments (`2`), an uncaught throw (`1`), or a bundle that
337
- would not run at all. The shell needs no case analysis to know something is wrong, so
338
- its "credential persistence is DEGRADED" error lives in exactly one helper.
335
+ The consequence is the point: **any non-zero status from `restore` means the tool itself
336
+ broke** — and `sync-once` uses `40` for its typed persistence answer; other non-zero
337
+ statuses still mean bad arguments (`2`), an uncaught throw (`1`), or a bundle that would
338
+ not run at all. The shell keeps that distinction in one helper.
339
339
 
340
340
  The **two predicates** — `model-auth-ready` and `self-stop` — each need to distinguish
341
341
  "the answer is no" from "the tool is broken", so each answers no with its own dedicated
package/dist/cli.js CHANGED
@@ -62164,6 +62164,7 @@ var EXIT_SESSION_DB_UNUSABLE = 31;
62164
62164
  var EXIT_SESSION_DB_RETRY = 32;
62165
62165
  var EXIT_SESSION_DB_UNVERIFIABLE = 33;
62166
62166
  var EXIT_SESSION_DB_UNSEPARATED = 34;
62167
+ var EXIT_SYNC_NOT_PERSISTED = 40;
62167
62168
  var STATE_SUFFIX = ".synchash";
62168
62169
  var COMMANDS = shell_contract_default.commands;
62169
62170
  var USAGE = `Usage: runner-synchroniser <command> [args]
@@ -62314,6 +62315,7 @@ async function commandSyncOnce(name, config, deps) {
62314
62315
  if (result.hash !== null && result.hash !== lastHash) {
62315
62316
  await writeLastHash(fileOps, statePath, result.hash, log);
62316
62317
  }
62318
+ return result.outcome.kind === "failed" || result.outcome.kind === "hashFailed" || result.outcome.kind === "localInvalid" ? EXIT_SYNC_NOT_PERSISTED : 0;
62317
62319
  }
62318
62320
  async function commandSessionDbClassify(args, config, deps) {
62319
62321
  const { fileOps, log } = deps;
@@ -62451,10 +62453,10 @@ ${USAGE}`);
62451
62453
  }
62452
62454
  if (command12 === "restore") {
62453
62455
  await commandRestore(name, config, deps);
62456
+ return 0;
62454
62457
  } else {
62455
- await commandSyncOnce(name, config, deps);
62458
+ return commandSyncOnce(name, config, deps);
62456
62459
  }
62457
- return 0;
62458
62460
  }
62459
62461
  function isEntryPoint() {
62460
62462
  const entry = process.argv[1];
@@ -62487,6 +62489,7 @@ export {
62487
62489
  EXIT_SESSION_DB_UNSEPARATED,
62488
62490
  EXIT_SESSION_DB_UNUSABLE,
62489
62491
  EXIT_SESSION_DB_UNVERIFIABLE,
62492
+ EXIT_SYNC_NOT_PERSISTED,
62490
62493
  EXIT_USAGE,
62491
62494
  main
62492
62495
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evident-ai/runner-synchroniser",
3
- "version": "3.4.1-dev.c03b461",
3
+ "version": "3.4.1-dev.e91ca26",
4
4
  "description": "Restores and syncs the Evident runner's OpenCode credential stores (and litestream config) to an object store, so a runner survives task replacement with almost no state loss.",
5
5
  "type": "module",
6
6
  "main": "./dist/cli.js",