@evident-ai/runner-synchroniser 3.4.1-dev.c03b461 → 3.4.1-dev.cb56b3f
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/README.md +10 -9
- package/dist/cli.js +5 -2
- 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` =
|
|
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 |
|
|
@@ -327,15 +327,16 @@ same way it already reuses `SESSION-DB-REPLICA-UNUSABLE` for `session-db-classif
|
|
|
327
327
|
|
|
328
328
|
### Why the contract is asymmetric
|
|
329
329
|
|
|
330
|
-
`restore` and
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
330
|
+
`restore` logs domain outcomes and still exits `0`: a missing remote object or a
|
|
331
|
+
restore failure should not abort a boot, because a runner with no credentials yet
|
|
332
|
+
is a runner a human can still log into. `sync-once` returns `40` when the current
|
|
333
|
+
credential file is not persisted (`failed`, `hashFailed`, or `localInvalid`), while
|
|
334
|
+
`absent` and `disabled` remain legitimate `0` outcomes.
|
|
334
335
|
|
|
335
|
-
The consequence is the point: **any non-zero status from `restore
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
336
|
+
The consequence is the point: **any non-zero status from `restore` means the tool itself
|
|
337
|
+
broke** — and `sync-once` uses `40` for its typed persistence answer; other non-zero
|
|
338
|
+
statuses still mean bad arguments (`2`), an uncaught throw (`1`), or a bundle that would
|
|
339
|
+
not run at all. The shell keeps that distinction in one helper.
|
|
339
340
|
|
|
340
341
|
The **two predicates** — `model-auth-ready` and `self-stop` — each need to distinguish
|
|
341
342
|
"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
|
-
|
|
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.
|
|
3
|
+
"version": "3.4.1-dev.cb56b3f",
|
|
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",
|