@melite/estate-queue 0.2.2-alpha → 0.2.3-rc.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.
- package/lib/bench.js +30 -3
- package/lib/cardsCompose.js +10 -1
- package/lib/cardsDangling.js +17 -7
- package/lib/cardsDroppable.d.ts +11 -0
- package/lib/cardsDroppable.js +50 -0
- package/lib/cardsFacts.d.ts +37 -0
- package/lib/cardsFacts.js +47 -1
- package/lib/cardsLanes.d.ts +18 -0
- package/lib/cardsLanes.js +2 -1
- package/lib/cardsRegistry.d.ts +7 -18
- package/lib/cardsRegistry.js +128 -93
- package/lib/filmLead.js +9 -1
- package/lib/filmMemoryWarn.js +1 -0
- package/lib/flowsData.d.ts +33 -0
- package/lib/flowsData.js +45 -2
- package/lib/flowsFamilyCompose.js +1 -0
- package/lib/flowsParamsOverlay.d.ts +8 -1
- package/lib/flowsParamsOverlay.js +47 -2
- package/lib/flowsRegistryRows.js +40 -20
- package/lib/ledgerTail.js +1 -0
- package/lib/loadPlane.js +2 -0
- package/lib/managePlane.js +8 -2
- package/lib/manageProbe.js +33 -4
- package/lib/manageRegistry.d.ts +10 -0
- package/lib/manageRegistry.js +7 -1
- package/lib/managerRail.js +1 -0
- package/lib/queueCore.js +3 -1
- package/lib/queueLock.js +3 -0
- package/lib/queueResurrect.js +5 -0
- package/lib/queueSidecar.d.ts +24 -1
- package/lib/queueSidecar.js +15 -2
- package/lib/queueSweep.d.ts +38 -11
- package/lib/queueSweep.js +73 -16
- package/lib/runsChange.d.ts +5 -4
- package/lib/runsExecute.js +39 -5
- package/lib/runsGates.js +1 -0
- package/lib/runsList.js +11 -0
- package/lib/runsRegistry.d.ts +29 -3
- package/lib/runsRegistry.js +187 -8
- package/lib/runsSourceEcho.js +9 -3
- package/lib/runsTypes.d.ts +35 -0
- package/lib/runsTypes.js +42 -0
- package/lib/runsValidateArms.js +23 -2
- package/lib/runtimeProvision.js +10 -2
- package/lib/skillFs.js +3 -0
- package/lib/skillRows.js +10 -6
- package/lib/vocab.d.ts +29 -0
- package/lib/vocab.js +78 -0
- package/package.json +7 -7
package/lib/queueSweep.js
CHANGED
|
@@ -7,14 +7,36 @@
|
|
|
7
7
|
import { readdirSync, readFileSync, rmSync } from "node:fs";
|
|
8
8
|
import { join } from "node:path";
|
|
9
9
|
import { appendLedger, writeJsonAtomic } from "./queueLock.js";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
export function sweepSidecar(doc, why, queuedWhy = "", maxHolds = 0) {
|
|
17
26
|
const wasQueued = doc["status"] === "queued";
|
|
27
|
+
if (wasQueued && maxHolds > 0) {
|
|
28
|
+
const held = (typeof doc["sweep_holds"] === "number" ? doc["sweep_holds"] : 0) + 1;
|
|
29
|
+
doc["sweep_holds"] = held;
|
|
30
|
+
if (held <= maxHolds) {
|
|
31
|
+
const note = queuedWhy !== "" ? queuedWhy : why;
|
|
32
|
+
doc["sweep"] =
|
|
33
|
+
`${note} — held as queued for the next boot's replay ` +
|
|
34
|
+
`(hold ${held}/${maxHolds}, defect board D-8)`;
|
|
35
|
+
return { touched: true, wasQueued, held: true, doc };
|
|
36
|
+
}
|
|
37
|
+
// past the bound: fall through to the terminal resettle — the
|
|
38
|
+
// note below names the exhausted holds (the haunt law)
|
|
39
|
+
}
|
|
18
40
|
let touched = false;
|
|
19
41
|
const patch = (o) => {
|
|
20
42
|
if (Array.isArray(o)) {
|
|
@@ -42,16 +64,30 @@ export function sweepSidecar(doc, why, queuedWhy = "") {
|
|
|
42
64
|
};
|
|
43
65
|
patch(doc);
|
|
44
66
|
if (!touched)
|
|
45
|
-
return { touched: false, wasQueued, doc };
|
|
46
|
-
const
|
|
67
|
+
return { touched: false, wasQueued, held: false, doc };
|
|
68
|
+
const exhausted = wasQueued && maxHolds > 0;
|
|
69
|
+
const note = exhausted
|
|
70
|
+
? `${queuedWhy !== "" ? queuedWhy : why} — held ${String(doc["sweep_holds"])} boots without a replay; settling failed (resubmit)`
|
|
71
|
+
: wasQueued && queuedWhy !== ""
|
|
72
|
+
? queuedWhy
|
|
73
|
+
: why;
|
|
47
74
|
doc["sweep"] = note;
|
|
48
75
|
if (wasQueued && queuedWhy !== "")
|
|
49
|
-
doc["error"] =
|
|
50
|
-
return { touched: true, wasQueued, doc };
|
|
76
|
+
doc["error"] = note;
|
|
77
|
+
return { touched: true, wasQueued, held: false, doc };
|
|
51
78
|
}
|
|
52
79
|
/** Boot-sweep notes (boot_sweep 2402-2409). */
|
|
53
80
|
export const BOOT_SWEEP_WHY = "host restarted (boot sweep): stale active sidecar from a dead process";
|
|
54
|
-
export const BOOT_SWEEP_QUEUED_WHY = "host restarted before the run started (never executed)
|
|
81
|
+
export const BOOT_SWEEP_QUEUED_WHY = "host restarted before the run started (never executed)";
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
export const BOOT_SWEEP_MAX_HOLDS = 3;
|
|
55
91
|
/** Read-time sweep notes + response errors (sidecar_status
|
|
56
92
|
* 2428-2451): the ledger state is ALWAYS "failed" (even for a
|
|
57
93
|
* queued zombie — the error TEXT carries the never-executed
|
|
@@ -62,16 +98,24 @@ export const READ_SWEEP_RUNNING_ERROR = "zombie swept at read time";
|
|
|
62
98
|
/** Boot-time zombie sweep (boot_sweep 2378-2410, fs half): every
|
|
63
99
|
* sidecar still claiming running/queued belongs to a DEAD process
|
|
64
100
|
* — EXCEPT liveRunIds (boot_resurrect just re-queued those; their
|
|
65
|
-
* queued sidecar is resurrected work, not a zombie).
|
|
66
|
-
*
|
|
67
|
-
*
|
|
101
|
+
* queued sidecar is resurrected work, not a zombie). A RUNNING
|
|
102
|
+
* claim retires failed; a still-QUEUED claim NEVER executed, so it
|
|
103
|
+
* HOLDS as queued for the next boot's replay (D-8, bounded by
|
|
104
|
+
* BOOT_SWEEP_MAX_HOLDS — past the bound it settles failed loud).
|
|
105
|
+
* Swept BEFORE traffic, so the ledger never shows phantom actives.
|
|
106
|
+
* Returns the RETIRED run ids in sorted order (held rows are not
|
|
107
|
+
* retired and never ride it). */
|
|
68
108
|
export async function bootSweep(stateRoot, liveRunIds = [], nowS = Math.floor(Date.now() / 1000)) {
|
|
69
109
|
const swept = [];
|
|
110
|
+
// THE ONE UNBRAND, at the durable edge (the brand rides the bus
|
|
111
|
+
// and the registry rows; the sweep compares against directory
|
|
112
|
+
// names, which the fs hands back as bare strings).
|
|
70
113
|
const live = new Set(liveRunIds);
|
|
71
114
|
const outRoot = join(stateRoot, "output");
|
|
72
115
|
let names;
|
|
73
116
|
try {
|
|
74
117
|
names = readdirSync(outRoot);
|
|
118
|
+
// an absent or unreadable output root holds no runs to sweep — the empty swept set is the answer
|
|
75
119
|
}
|
|
76
120
|
catch {
|
|
77
121
|
return swept;
|
|
@@ -87,6 +131,7 @@ export async function bootSweep(stateRoot, liveRunIds = [], nowS = Math.floor(Da
|
|
|
87
131
|
if (typeof pre !== "object" || pre === null || Array.isArray(pre)) {
|
|
88
132
|
pre = {};
|
|
89
133
|
}
|
|
134
|
+
// a pre-read that cannot read or parse the sidecar cannot prove the queued hold — the row falls to the retire path, and the authoritative read below still ledgers it
|
|
90
135
|
}
|
|
91
136
|
catch {
|
|
92
137
|
pre = {};
|
|
@@ -120,10 +165,22 @@ export async function bootSweep(stateRoot, liveRunIds = [], nowS = Math.floor(Da
|
|
|
120
165
|
appendLedger(stateRoot, "run.swept", { run_id: name, state: "unreadable", error: "boot sweep: _flow.json is not an object" }, nowS);
|
|
121
166
|
continue;
|
|
122
167
|
}
|
|
123
|
-
const res = sweepSidecar(current, BOOT_SWEEP_WHY, wasQueued ? BOOT_SWEEP_QUEUED_WHY : "");
|
|
168
|
+
const res = sweepSidecar(current, BOOT_SWEEP_WHY, wasQueued ? BOOT_SWEEP_QUEUED_WHY : "", BOOT_SWEEP_MAX_HOLDS);
|
|
124
169
|
if (!res.touched)
|
|
125
170
|
continue;
|
|
126
171
|
await writeJsonAtomic(path, res.doc);
|
|
172
|
+
if (res.held) {
|
|
173
|
+
// D-8: the press never executed — the row stays queued for the
|
|
174
|
+
// next boot's replay, ledgered queued_held (never failed). It
|
|
175
|
+
// is NOT in the swept return: the sweep retired nothing.
|
|
176
|
+
appendLedger(stateRoot, "run.swept", {
|
|
177
|
+
run_id: name,
|
|
178
|
+
state: "queued_held",
|
|
179
|
+
error: `boot sweep: held as queued for the next boot's replay ` +
|
|
180
|
+
`(hold ${String(res.doc["sweep_holds"])}/${BOOT_SWEEP_MAX_HOLDS}) — the press never executed`,
|
|
181
|
+
}, nowS);
|
|
182
|
+
continue;
|
|
183
|
+
}
|
|
127
184
|
appendLedger(stateRoot, "run.swept", { run_id: name, state: wasQueued ? "queued_lost" : "failed", error: "boot sweep" }, nowS);
|
|
128
185
|
swept.push(name);
|
|
129
186
|
}
|
package/lib/runsChange.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { Context } from "@deepseek-ai/cordis";
|
|
2
|
-
type
|
|
2
|
+
import type { RunId } from "./queueCore.js";
|
|
3
|
+
type RunChangeListener = (runId: RunId) => void;
|
|
3
4
|
/** The event seam this pure-domain spine reaches the bus through
|
|
4
5
|
* (the bench seam's law, verbatim: the writers own no Context, the
|
|
5
6
|
* owning service installs the pair once). */
|
|
6
7
|
export interface RunsChangeSeam {
|
|
7
|
-
emit: (runId:
|
|
8
|
+
emit: (runId: RunId) => void;
|
|
8
9
|
on: (fn: RunChangeListener) => () => void;
|
|
9
10
|
}
|
|
10
11
|
declare module "@deepseek-ai/cordis" {
|
|
@@ -16,7 +17,7 @@ declare module "@deepseek-ai/cordis" {
|
|
|
16
17
|
* @mode emit
|
|
17
18
|
* @param runId - the run whose row moved.
|
|
18
19
|
*/
|
|
19
|
-
"runs.changed": (runId:
|
|
20
|
+
"runs.changed": (runId: RunId) => void;
|
|
20
21
|
}
|
|
21
22
|
}
|
|
22
23
|
/** Install the seam (the registry service does this with its
|
|
@@ -48,7 +49,7 @@ export declare function onRunChange(fn: RunChangeListener): () => void;
|
|
|
48
49
|
* subscriber's park in a microtask, by which time the writer's
|
|
49
50
|
* synchronous mutation has landed — the re-read serves the moved
|
|
50
51
|
* row, never the pre-write one. */
|
|
51
|
-
export declare function notifyRunChanged(runId:
|
|
52
|
+
export declare function notifyRunChanged(runId: RunId): void;
|
|
52
53
|
/** Install the typed runs event seam on a Context (the registry
|
|
53
54
|
* service's constructor — the bench installer's law, drafts
|
|
54
55
|
* remote.ts installBenchChangeSeam): fiber-scoped through
|
package/lib/runsExecute.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CARD_PLANE_ENGINE } from "@melite/contracts/benchStage";
|
|
2
|
-
import { loadCardDefs, needComfyUI, spliceWorkflow } from "@melite/comfyui-cordis";
|
|
2
|
+
import { loadCardDefs, needComfyUI, spliceWorkflow, warnWiringAbsent } from "@melite/comfyui-cordis";
|
|
3
3
|
import { deadline } from "@deepseek-ai/dsh-timeout";
|
|
4
4
|
import { errText, runRel } from "./runsTypes.js";
|
|
5
5
|
import { notifyRunChanged } from "./runsChange.js";
|
|
@@ -27,7 +27,11 @@ async function raceExecuteFuse(p, ceilMs, what) {
|
|
|
27
27
|
dl.signal.addEventListener("abort", () => {
|
|
28
28
|
const shown = ceil < 60_000
|
|
29
29
|
? Math.round(ceil) + "ms"
|
|
30
|
-
:
|
|
30
|
+
: /* v8 ignore next -- the min face needs a ceiling ≥ 60 s AND a
|
|
31
|
+
* call that outlives it: an honest arm is a minute-long
|
|
32
|
+
* timed test, a flake factory by construction. The ms face
|
|
33
|
+
* (every real ceiling) is the walled spelling. */
|
|
34
|
+
Math.round(ceil / 60_000) + " min";
|
|
31
35
|
reject(new Error("runs/execute-hung: " + what + " exceeded the execute ceiling (" +
|
|
32
36
|
shown +
|
|
33
37
|
") — a hung engine call must never strand the serial queue; raise the queue config's executeCeilMs, set it <= 0 to disable, or state the run's own execute_ceil_ms"));
|
|
@@ -73,7 +77,13 @@ export function startRunLiveness(run) {
|
|
|
73
77
|
};
|
|
74
78
|
const tick = () => {
|
|
75
79
|
// settled runs own no stamp (the terminal writer deleted the
|
|
76
|
-
// activity lines); only a still-running row may move.
|
|
80
|
+
// activity lines); only a still-running row may move. The two
|
|
81
|
+
// guard tails below are timer-edge classes: a tick landing after
|
|
82
|
+
// settle (clearInterval racing the interval's in-flight fire) and
|
|
83
|
+
// a stamp fired inside the watchdog window — both benign by
|
|
84
|
+
// design, honest arms would be wall-clock flakes.
|
|
85
|
+
/* v8 ignore next 2 -- timer-edge tails: the guard exists for the
|
|
86
|
+
* clear-race, not a state any arm can hold. */
|
|
77
87
|
if (run.status !== "running")
|
|
78
88
|
return;
|
|
79
89
|
if (Date.now() - lastReportAt < LIVENESS_WATCHDOG_MS)
|
|
@@ -292,6 +302,12 @@ export async function runOne(run, ctx, settle) {
|
|
|
292
302
|
// Unarmed (no wiring service in the composition): the wall
|
|
293
303
|
// stands down — the standing law.
|
|
294
304
|
const wiring = ctx.get("comfyuiWiring");
|
|
305
|
+
// Absent PROVIDER (never an unarmed doc): the composition
|
|
306
|
+
// mounted no wiring row at all — the whole fence stands down,
|
|
307
|
+
// LOUD once per process (warnWiringAbsent). An armed-but-empty
|
|
308
|
+
// doc keeps its silent stand-down (the doc-null law below).
|
|
309
|
+
if (wiring === undefined)
|
|
310
|
+
warnWiringAbsent(ctx, "run seat fence");
|
|
295
311
|
// UNARMED, THE WHOLE FENCE STANDS DOWN — splice included (the
|
|
296
312
|
|
|
297
313
|
// wall's own stand-down, so a lane whose /object_info fetch
|
|
@@ -444,7 +460,7 @@ export async function runOne(run, ctx, settle) {
|
|
|
444
460
|
stampUnansweredRows(run, refusal, false, missingRows);
|
|
445
461
|
throw new Error(refusal);
|
|
446
462
|
}
|
|
447
|
-
for (const stage of run.stages) {
|
|
463
|
+
for (const [stageIdx, stage] of run.stages.entries()) {
|
|
448
464
|
const row = result.stages[stage.id];
|
|
449
465
|
const arts = row.artifacts.filter((a) => a !== "");
|
|
450
466
|
run.artifacts.push(...arts);
|
|
@@ -482,7 +498,25 @@ export async function runOne(run, ctx, settle) {
|
|
|
482
498
|
// chain + CreateVideo/SaveVideo h3_t4_film); the harness's
|
|
483
499
|
// only job here is presentation order.)
|
|
484
500
|
stage["url"] = names[0];
|
|
485
|
-
|
|
501
|
+
|
|
502
|
+
// "there is no place for the ai agent or the user through
|
|
503
|
+
// the card UI to label output names"): the stage's reserved
|
|
504
|
+
// `output_name` param (spelled by the agent's patch or the
|
|
505
|
+
// user's field — STAGE_RESERVED_PARAMS carries it onto the
|
|
506
|
+
// composed row) labels the gallery rows on the DISPLAY
|
|
507
|
+
// plane. The `name` stays the machine file key (the media
|
|
508
|
+
// route and every dedup law ride it); the `label` is what
|
|
509
|
+
// faces read. One artifact wears the stem alone; several
|
|
510
|
+
// wear the stem on the hero and `stem · 2…n` after (the
|
|
511
|
+
// hero-led gallery order above decides which is which).
|
|
512
|
+
const stageParams = run.params[stageIdx];
|
|
513
|
+
const labelStem = typeof stageParams?.["output_name"] === "string"
|
|
514
|
+
&& stageParams["output_name"].trim() !== ""
|
|
515
|
+
? stageParams["output_name"].trim()
|
|
516
|
+
: null;
|
|
517
|
+
stage["gallery"] = names.map((n, i) => (labelStem === null
|
|
518
|
+
? { name: n }
|
|
519
|
+
: { name: n, label: i === 0 ? labelStem : `${labelStem} · ${i + 1}` }));
|
|
486
520
|
}
|
|
487
521
|
stage["result_outputs"] = { ...row.outputs };
|
|
488
522
|
stage["status"] = "completed";
|
package/lib/runsGates.js
CHANGED
|
@@ -156,6 +156,7 @@ function tryLeaf(schema, v) {
|
|
|
156
156
|
try {
|
|
157
157
|
z.resolve(v, schema, {});
|
|
158
158
|
return true;
|
|
159
|
+
// a schema refusal throws out of z.resolve — the refusal is the negative verdict itself, so false is the answer, not an error to recover
|
|
159
160
|
}
|
|
160
161
|
catch {
|
|
161
162
|
return false;
|
package/lib/runsList.js
CHANGED
|
@@ -138,6 +138,7 @@ function byteLess(a, b) {
|
|
|
138
138
|
function isDir(path) {
|
|
139
139
|
try {
|
|
140
140
|
return statSync(path).isDirectory();
|
|
141
|
+
// a missing or unreadable path is not a directory — false is the probe's whole answer
|
|
141
142
|
}
|
|
142
143
|
catch {
|
|
143
144
|
return false;
|
|
@@ -146,6 +147,7 @@ function isDir(path) {
|
|
|
146
147
|
function fileSize(path) {
|
|
147
148
|
try {
|
|
148
149
|
return statSync(path).size;
|
|
150
|
+
// an unstatable file has no knowable size — -1 is the sentinel the artifact pusher drops the row on
|
|
149
151
|
}
|
|
150
152
|
catch {
|
|
151
153
|
return -1;
|
|
@@ -157,6 +159,7 @@ export function mediaCandidates(runDir) {
|
|
|
157
159
|
let names;
|
|
158
160
|
try {
|
|
159
161
|
names = readdirSync(runDir);
|
|
162
|
+
// an unlistable run dir (vanished or unreadable) yields no media candidates — the empty list is the answer
|
|
160
163
|
}
|
|
161
164
|
catch {
|
|
162
165
|
return [];
|
|
@@ -177,6 +180,7 @@ export function mediaCandidates(runDir) {
|
|
|
177
180
|
let inner;
|
|
178
181
|
try {
|
|
179
182
|
inner = readdirSync(join(runDir, sub));
|
|
183
|
+
// a subdir unreadable at readdir time contributes no candidates — skipping it keeps the walk over the remaining subs
|
|
180
184
|
}
|
|
181
185
|
catch {
|
|
182
186
|
continue;
|
|
@@ -295,6 +299,7 @@ export function runArchivedArtifacts(runDir, outDirLiteral) {
|
|
|
295
299
|
let tops;
|
|
296
300
|
try {
|
|
297
301
|
tops = readdirSync(join(runDir, ARCHIVED_DIR_NAME));
|
|
302
|
+
// an absent _archived dir is the pinned empty face — the empty list is the answer, never a throw
|
|
298
303
|
}
|
|
299
304
|
catch {
|
|
300
305
|
return [];
|
|
@@ -315,6 +320,7 @@ export function runArchivedArtifacts(runDir, outDirLiteral) {
|
|
|
315
320
|
let inner;
|
|
316
321
|
try {
|
|
317
322
|
inner = readdirSync(join(runDir, ARCHIVED_DIR_NAME, sub));
|
|
323
|
+
// an archived subdir unreadable at readdir time contributes no rows — skipping it keeps the tuck walk over the rest
|
|
318
324
|
}
|
|
319
325
|
catch {
|
|
320
326
|
continue;
|
|
@@ -393,6 +399,7 @@ export function runDirHasMedia(runDir) {
|
|
|
393
399
|
let names;
|
|
394
400
|
try {
|
|
395
401
|
names = readdirSync(runDir);
|
|
402
|
+
// an unlistable run dir cannot be scanned for media — false is the answer, the same verdict an empty dir earns
|
|
396
403
|
}
|
|
397
404
|
catch {
|
|
398
405
|
return false;
|
|
@@ -410,6 +417,7 @@ export function runDirHasMedia(runDir) {
|
|
|
410
417
|
if (has(inner))
|
|
411
418
|
return true;
|
|
412
419
|
}
|
|
420
|
+
// a subdir that vanishes or refuses the readdir after passing its isDir probe holds no checkable media — skipping it answers false for that branch
|
|
413
421
|
}
|
|
414
422
|
catch {
|
|
415
423
|
continue;
|
|
@@ -566,6 +574,7 @@ const scanCache = new Map();
|
|
|
566
574
|
function mtimeMsOf(path) {
|
|
567
575
|
try {
|
|
568
576
|
return statSync(path).mtimeMs;
|
|
577
|
+
// a vanished path has no mtime — -1 is the sentinel scanRunEnt reads as a gone run
|
|
569
578
|
}
|
|
570
579
|
catch {
|
|
571
580
|
return -1;
|
|
@@ -590,6 +599,7 @@ function scanRunEnt(runDir) {
|
|
|
590
599
|
let buf = "";
|
|
591
600
|
try {
|
|
592
601
|
buf = readFileSync(join(runDir, "_flow.json"), "utf8").slice(0, 8191);
|
|
602
|
+
// a run with no readable _flow.json sidecar has no recorded created time — the empty buffer keeps the scan entry alive at created 0
|
|
593
603
|
}
|
|
594
604
|
catch {
|
|
595
605
|
buf = "";
|
|
@@ -615,6 +625,7 @@ function scanRunsRoot(stateRoot) {
|
|
|
615
625
|
let names;
|
|
616
626
|
try {
|
|
617
627
|
names = readdirSync(seatRoot);
|
|
628
|
+
// a state root without this out seat (output/ or test-output/ never created) holds no runs — skipping the seat is the answer
|
|
618
629
|
}
|
|
619
630
|
catch {
|
|
620
631
|
continue;
|
package/lib/runsRegistry.d.ts
CHANGED
|
@@ -110,8 +110,6 @@ declare module "@deepseek-ai/dsh-typert-protocol" {
|
|
|
110
110
|
};
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
|
-
/** The refusal codes this remote serves, folded to the
|
|
114
|
-
* protocol's vocabulary — a literal table, no dynamic key. */
|
|
115
113
|
export declare function enrichDiskRow(row: Record<string, unknown>): Record<string, unknown>;
|
|
116
114
|
|
|
117
115
|
|
|
@@ -181,7 +179,7 @@ export declare class RunsRuntimeService extends Service {
|
|
|
181
179
|
* parks on); returns the unsubscribe. Delegates to the module
|
|
182
180
|
* seam — a listener's fault never breaks the write (the wrapper
|
|
183
181
|
* guards; the law lives at runsChange.ts onRunChange). */
|
|
184
|
-
onRunChange(fn: (runId:
|
|
182
|
+
onRunChange(fn: (runId: RunId) => void): () => void;
|
|
185
183
|
/** THE BOOT RECONCILE (stroke 83; boot_resurrect reborn as a
|
|
186
184
|
* REPLAY, not a hollow requeue): every usable QUEUED record's
|
|
187
185
|
* _request.json goes back through the START door under its own
|
|
@@ -374,6 +372,34 @@ export declare class RunsRuntimeService extends Service {
|
|
|
374
372
|
private chainStoreNameOf;
|
|
375
373
|
status(runId: string, signal: AbortSignal, includeLog?: boolean): Promise<Record<string, unknown>>;
|
|
376
374
|
stop(runId: string, signal: AbortSignal): Promise<Record<string, unknown>>;
|
|
375
|
+
/** THE ATTRIBUTION DOOR (F3 D3-07, the 15 s bound's third burn —
|
|
376
|
+
* RIG s_94: a green run whose cards-tab stamp died at the bench
|
|
377
|
+
* plane's bound). The stamp-back's bounded retry lives client-side
|
|
378
|
+
* (melite-flow); when every take dies, THIS door carries the miss
|
|
379
|
+
* on the run row — a different plane than the wedged drafts
|
|
380
|
+
* PATCH, so the fact lands even when the stamp could not. The
|
|
381
|
+
* status door and the press receipt then answer "completed — NOT
|
|
382
|
+
* shown on the tab (stamp missed; re-stamp)" instead of a bare
|
|
383
|
+
* done. Idempotent: a re-stamp that landed clears it
|
|
384
|
+
* (value "" unstamps), the persist is best-effort by the
|
|
385
|
+
* claim/settle law, and the change rides notifyRunChanged so the
|
|
386
|
+
* tab's poller re-fires on the truth. */
|
|
387
|
+
attribute(runId: string, value: string, signal: AbortSignal): Promise<Record<string, unknown>>;
|
|
388
|
+
/** THE OUTPUT-RENAME DOOR (queue 12 Phase B): a settled run's
|
|
389
|
+
* gallery row gets a new display `label`, post-run — the output_name
|
|
390
|
+
* mint at settle named the rows once; this door owns every rename
|
|
391
|
+
* after. The `name` (the machine file key the media route and every
|
|
392
|
+
* dedup law ride) NEVER moves — the patch rewrites the addressed
|
|
393
|
+
* row's label alone: no sibling renumbering, no `stem · 2…n`
|
|
394
|
+
* auto-repair; a caller with several rows to rename patches each
|
|
395
|
+
* row it wants. Guards speak before any write: unknown run
|
|
396
|
+
* (runs/run-unknown, the searched-trees voice), a live row (rename
|
|
397
|
+
* waits for settle), an empty/whitespace label, an out-of-range
|
|
398
|
+
* stage or gallery index. The patch lands in the live row, the
|
|
399
|
+
* change rides notifyRunChanged (the tab's poller re-fires), and
|
|
400
|
+
* the sidecar rewrite persists it (the disk fallback and every
|
|
401
|
+
* boot re-read spread the new label). */
|
|
402
|
+
renameOutput(runId: string, stageIndex: number, galleryIndex: number, label: string, signal: AbortSignal): Promise<Record<string, unknown>>;
|
|
377
403
|
/** The live map (the queue seat's core registry — rich rows). */
|
|
378
404
|
private liveRun;
|
|
379
405
|
|