@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/flowsRegistryRows.js
CHANGED
|
@@ -18,17 +18,22 @@ export const ANNY_HMR_ESTIMATOR = {
|
|
|
18
18
|
id: "estimate",
|
|
19
19
|
engine: CARD_PLANE_ENGINE,
|
|
20
20
|
// the estimator engine of the same verb — family DECL owns
|
|
21
|
-
// the nodes (SAM 3D Body → grounded anny)
|
|
22
|
-
//
|
|
21
|
+
// the nodes (SAM 3D Body → grounded anny). The person picker
|
|
22
|
+
// rides the person_index INITIAL (required: its $spell rides
|
|
23
|
+
// the composed graph on every press, and the merge resolves
|
|
24
|
+
// it against the run's initials — the door teaches an absent
|
|
25
|
+
// one BEFORE the run registers; the verb's chip owns the
|
|
26
|
+
// pick, the flow owns the lane).
|
|
23
27
|
family: "anny",
|
|
24
28
|
action: "estimate_photo",
|
|
25
29
|
description: "SAM 3D Body estimator → grounded anny GLB",
|
|
26
|
-
inputs: { photo: initial("photo") },
|
|
27
|
-
expected: { photo: "image" },
|
|
28
|
-
params: { photo: "$photo" },
|
|
30
|
+
inputs: { photo: initial("photo"), person_index: initial("person_index") },
|
|
31
|
+
expected: { photo: "image", person_index: "num" },
|
|
32
|
+
params: { photo: "$photo", person_index: "$person_index" },
|
|
29
33
|
}),
|
|
30
34
|
],
|
|
31
|
-
initialValidators: { photo: "photo" },
|
|
35
|
+
initialValidators: { photo: "photo", person_index: "number" },
|
|
36
|
+
requiredInitials: ["photo", "person_index"],
|
|
32
37
|
tool: null,
|
|
33
38
|
skillRefs: [],
|
|
34
39
|
};
|
|
@@ -101,8 +106,8 @@ export const FIT_SEAT = {
|
|
|
101
106
|
export const IMAGE_UPSCALE = {
|
|
102
107
|
id: "image-upscale",
|
|
103
108
|
description: "Prompt → image → 1080p SeedVR2 upscale, one card per stroke (the first " +
|
|
104
|
-
"two-card flow: image-gen + upscale-tools card= stages;
|
|
105
|
-
"the generator). RUNS on the {flow:} door (2026-10-04: the VALIDATE-ONLY " +
|
|
109
|
+
"two-card flow: image-gen + upscale-tools card= stages; the make stage " +
|
|
110
|
+
"FIXES the generator at krea-2 — no model seat exists on this row). RUNS on the {flow:} door (2026-10-04: the VALIDATE-ONLY " +
|
|
106
111
|
"stamp is GONE — both card stages compose through the card plane and " +
|
|
107
112
|
"submit as one merged run); the {model:} door drives a single card.",
|
|
108
113
|
stages: [
|
|
@@ -152,18 +157,18 @@ export const IMAGE_UPSCALE = {
|
|
|
152
157
|
name: "image_upscale",
|
|
153
158
|
version: 1,
|
|
154
159
|
description: "Generate an image from a prompt and upscale it to 1080p in one call " +
|
|
155
|
-
"(krea-2
|
|
160
|
+
"(krea-2 generator, FIXED by the row's make stage — no image_model " +
|
|
161
|
+
"seat exists and one stated anywhere is a dead letter (audit " +
|
|
162
|
+
"2026-11-14 FL-7); SeedVR2 upscale always on). One POST runs " +
|
|
156
163
|
"the whole flow.",
|
|
157
164
|
properties: {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
enum: ["krea-2", "z-image"],
|
|
166
|
-
},
|
|
165
|
+
|
|
166
|
+
// face: the runtime reads it nowhere — the make stage pins
|
|
167
|
+
// model "krea-2" and cardAdmission has no image-gen seat for
|
|
168
|
+
// the key, so a stated value refused or dead-lettered. Re-seat
|
|
169
|
+
// it only by wiring a real admission seat (an initial that
|
|
170
|
+
// overrides the make stage's model), never by re-publishing
|
|
171
|
+
// the knob.
|
|
167
172
|
prompt: {
|
|
168
173
|
ptype: "string",
|
|
169
174
|
description: "what to generate (up to 4000 chars)",
|
|
@@ -412,11 +417,26 @@ export const OBJECT_FORGE = {
|
|
|
412
417
|
engine: CARD_PLANE_ENGINE,
|
|
413
418
|
card: "img-to-mesh",
|
|
414
419
|
description: "Image → textured mesh via the img-to-mesh card (trellis2-native, " +
|
|
415
|
-
"no pack;
|
|
420
|
+
"no pack; the lift stamps the high recipe's own knobs — the " +
|
|
421
|
+
"same stamps every UI birth carries, Recipe default high)",
|
|
416
422
|
inputs: { concept: fromStage("concept", "image") },
|
|
417
423
|
expected: { concept: "image" },
|
|
418
424
|
cardIo: { mesh: "mesh" },
|
|
419
|
-
|
|
425
|
+
|
|
426
|
+
// birth lands stamped with the declared default Recipe "high"
|
|
427
|
+
// (resolution 1536, remesh 1024, 1M faces — wire_defaults,
|
|
428
|
+
// applied client-side at birth only), while a bare {flow:}
|
|
429
|
+
// press composed at the family floor (1024) — the same lift
|
|
430
|
+
// produced different meshes by door. The stamps below are the
|
|
431
|
+
// high row's wire_defaults verbatim, and 1536 is the official
|
|
432
|
+
// template's own upsample default
|
|
433
|
+
// (3d_pixal3d_trellis2_image_to_model.json [94]). Compose
|
|
434
|
+
// never applies recipe wire_defaults server-side; the stage's
|
|
435
|
+
// own params are the flow plane's one seat.
|
|
436
|
+
params: {
|
|
437
|
+
model: "trellis2-native", input_image: "$concept",
|
|
438
|
+
resolution: "1536", remesh_resolution: 1024, decimate_faces: 1000000,
|
|
439
|
+
},
|
|
420
440
|
}),
|
|
421
441
|
],
|
|
422
442
|
initialValidators: { prompt: "text" },
|
package/lib/ledgerTail.js
CHANGED
|
@@ -68,6 +68,7 @@ const parseTail = (lines) => {
|
|
|
68
68
|
for (const e of lines) {
|
|
69
69
|
try {
|
|
70
70
|
out.push(JSON.parse(e));
|
|
71
|
+
// an unparseable journal line throws SyntaxError — the tail keeps unparseables in its last-N window and they parse-skip at the end, never surfacing as entries
|
|
71
72
|
}
|
|
72
73
|
catch {
|
|
73
74
|
continue;
|
package/lib/loadPlane.js
CHANGED
|
@@ -316,6 +316,7 @@ export function flowLeafDocs(repo, flowName) {
|
|
|
316
316
|
let entries;
|
|
317
317
|
try {
|
|
318
318
|
entries = readdirSync(dir, { withFileTypes: true });
|
|
319
|
+
// a missing or unreadable directory throws ENOENT — the walk simply contributes no doc files, never refusing the bundle
|
|
319
320
|
}
|
|
320
321
|
catch {
|
|
321
322
|
return;
|
|
@@ -417,6 +418,7 @@ export function loadCard(repo, cards, modelsSeat, cardId, stateRoot) {
|
|
|
417
418
|
try {
|
|
418
419
|
const rows = models.resolveCatalogArtifact(fam, "", "", repo);
|
|
419
420
|
present = rows.length > 0 && rows.every((row) => models.checkModelPresent(row.relative_path, row.name, repo) !== null);
|
|
421
|
+
// a family with no resolvable catalog artifact throws — presence stays false, which is what the served hint reports; the run door owns the loud refusal
|
|
420
422
|
}
|
|
421
423
|
catch {
|
|
422
424
|
present = false;
|
package/lib/managePlane.js
CHANGED
|
@@ -16,7 +16,7 @@ import { closeSync, fstatSync, openSync, readFileSync, readSync, statSync } from
|
|
|
16
16
|
import { dirname, join } from "node:path";
|
|
17
17
|
import { resolveRuntimeProvision, nodeRuntimeFs, runtimeEnvView, engineOutputDir, engineRootOf, sentinelHit } from "./runtimeProvision.js";
|
|
18
18
|
import { loadShippedExtensionManifest } from "@melite/comfyui-cordis/provisioning-manifest";
|
|
19
|
-
import { ComfyError, endpointConfigPath, invalidateObjectInfo, liveObjectInfo, loadEndpointConfig, resolveEngineBaseUrl, } from "@melite/comfyui-cordis";
|
|
19
|
+
import { ComfyError, endpointConfigPath, invalidateObjectInfo, liveObjectInfo, loadEndpointConfig, resolveEngineBaseUrl, sdkClient, } from "@melite/comfyui-cordis";
|
|
20
20
|
import { writeJsonAtomic } from "./queueLock.js";
|
|
21
21
|
import { installUserLora, installUserLoraBytes, loraNamesFromObjectInfo, readUserLoraRows, refmodNamesFromObjectInfo, resolveEngineLorasDir, seatUserLoraRow, unboardedRows, userLorasPath, validateUserLoraRow, } from "@melite/comfyui-cordis/user-loras";
|
|
22
22
|
import { rearmLoraFlavors } from "@melite/comfyui-cordis";
|
|
@@ -1340,6 +1340,7 @@ async function hLoraFetch(req, ctx) {
|
|
|
1340
1340
|
let inComboNow = false;
|
|
1341
1341
|
try {
|
|
1342
1342
|
inComboNow = loraNamesFromObjectInfo(await objectInfoDoc(ctx, railMs(req))).includes(comboName);
|
|
1343
|
+
// the engine's deadline refusal is advisory here — a folded false reads as "not yet in the combo read", and the landed lora plus the restart voice below are untouched
|
|
1343
1344
|
}
|
|
1344
1345
|
catch {
|
|
1345
1346
|
inComboNow = false;
|
|
@@ -2133,7 +2134,11 @@ async function hEndpointSet(req, ctx) {
|
|
|
2133
2134
|
const dl = deadlineOf(ctx.signal, 5000, "ENDPOINT_SET_PROBE");
|
|
2134
2135
|
let stats;
|
|
2135
2136
|
try {
|
|
2136
|
-
|
|
2137
|
+
|
|
2138
|
+
// the endpoint-set probe rides fetchApi — the same engine-read
|
|
2139
|
+
// spelling as the health gate and the manage probes, never a
|
|
2140
|
+
// parallel fetch beside the estate's declared client law.
|
|
2141
|
+
const r = await sdkClient(url).fetchApi("/system_stats", { signal: dl.signal });
|
|
2137
2142
|
if (!r.ok)
|
|
2138
2143
|
throw new Error("HTTP " + String(r.status));
|
|
2139
2144
|
stats = (await r.json());
|
|
@@ -2545,6 +2550,7 @@ async function objectInfoDoc(ctx, boundMs) {
|
|
|
2545
2550
|
if (ctx.objectInfo !== undefined) {
|
|
2546
2551
|
try {
|
|
2547
2552
|
return await ctx.objectInfo();
|
|
2553
|
+
// a failed lane-carried objectInfo read means the engine did not answer — the null-doc contract folds to not-visible, never a throw across the sidebar
|
|
2548
2554
|
}
|
|
2549
2555
|
catch {
|
|
2550
2556
|
return null;
|
package/lib/manageProbe.js
CHANGED
|
@@ -6,6 +6,7 @@ import { promisify } from "node:util";
|
|
|
6
6
|
import { readFileSync, readdirSync, statSync, writeFileSync } from "node:fs";
|
|
7
7
|
import { join } from "node:path";
|
|
8
8
|
import { sweepOutputRoots } from "./cardsDangling.js";
|
|
9
|
+
import { sdkClient } from "@melite/comfyui-cordis";
|
|
9
10
|
import { deadline } from "@deepseek-ai/dsh-timeout";
|
|
10
11
|
const execFileAsync = promisify(execFile);
|
|
11
12
|
// ── runs / security / probe (TS-native) ────────────────────────────
|
|
@@ -141,6 +142,7 @@ export function managerSecurity(repoRoot) {
|
|
|
141
142
|
let text;
|
|
142
143
|
try {
|
|
143
144
|
text = readFileSync(ini, "utf-8");
|
|
145
|
+
// an absent or unreadable candidate ini pins nothing — the loop falls through to the legacy layout and the final "unpinned" answer is the truth
|
|
144
146
|
}
|
|
145
147
|
catch {
|
|
146
148
|
continue;
|
|
@@ -177,7 +179,11 @@ export async function engineQueueView(mctx) {
|
|
|
177
179
|
return null;
|
|
178
180
|
const dl = deadline(mctx.signal, 5000, "MANAGE_PROBE");
|
|
179
181
|
try {
|
|
180
|
-
|
|
182
|
+
|
|
183
|
+
// engine reads ride sdkClient().fetchApi — never a parallel
|
|
184
|
+
// hand-rolled fetch spelling beside the estate's declared
|
|
185
|
+
// client law (comfyui-transport.ts owns fetch + endpoints).
|
|
186
|
+
const r = await sdkClient(url).fetchApi("/queue", { signal: dl.signal });
|
|
181
187
|
const q = (await r.json());
|
|
182
188
|
const running = q["queue_running"];
|
|
183
189
|
const pending = q["queue_pending"];
|
|
@@ -207,7 +213,10 @@ export async function probeEndpoint(mctx) {
|
|
|
207
213
|
return { reachable: false, reason: "no url in endpoint config" };
|
|
208
214
|
const dl = deadline(mctx.signal, 5000, "MANAGE_PROBE");
|
|
209
215
|
try {
|
|
210
|
-
|
|
216
|
+
// THE SDK SEAT OWNS THE WIRE (A1): the /system_stats health read
|
|
217
|
+
// rides the same fetchApi spelling the execute seat's health
|
|
218
|
+
// gate uses — ONE wire spelling for engine reads tree-wide.
|
|
219
|
+
const r = await sdkClient(url).fetchApi("/system_stats", { signal: dl.signal });
|
|
211
220
|
const stats = (await r.json());
|
|
212
221
|
const sysinfo = (stats["system"] ?? {});
|
|
213
222
|
const devices = (stats["devices"] ?? []).slice(0, 4).map((d) => ({
|
|
@@ -326,10 +335,30 @@ export async function engineUnitCensus(mctx) {
|
|
|
326
335
|
const degraded = (Number.isFinite(restarts) && restarts >= DEGRADE_RESTART_FLOOR)
|
|
327
336
|
|| (Number.isFinite(exitStatus) && exitStatus === KILL_SIGNAL)
|
|
328
337
|
|| (oomKills !== undefined && oomKills > 0);
|
|
329
|
-
if (degraded)
|
|
338
|
+
if (degraded) {
|
|
330
339
|
row.verdict = "degraded";
|
|
340
|
+
|
|
341
|
+
// laws that fired and what they mean — a bare "degraded" left
|
|
342
|
+
// the reader to cross-join restarts/exit/oom themselves (the
|
|
343
|
+
// burn: "still degraded: restarts 3, oom-kill 4 while serving").
|
|
344
|
+
// Kernel oom evidence adds the memory-pressure reading and the
|
|
345
|
+
// maker's lever: smaller windows (the refine design window is
|
|
346
|
+
// 2.33 s = 56 f — the operator's OOM ruling).
|
|
347
|
+
const causes = [];
|
|
348
|
+
if (Number.isFinite(restarts) && restarts >= DEGRADE_RESTART_FLOOR)
|
|
349
|
+
causes.push("the restart loop (>= " + DEGRADE_RESTART_FLOOR + ")");
|
|
350
|
+
if (Number.isFinite(exitStatus) && exitStatus === KILL_SIGNAL)
|
|
351
|
+
causes.push("a SIGKILL last exit");
|
|
352
|
+
const oom = oomKills !== undefined && oomKills > 0;
|
|
353
|
+
if (oom)
|
|
354
|
+
causes.push("kernel oom evidence");
|
|
355
|
+
row.note = "degraded by " + causes.join(" and ")
|
|
356
|
+
+ (oom
|
|
357
|
+
? " — the engine died under memory pressure and systemd restarted it; the maker's lever is smaller windows (the refine design window is 2.33 s = 56 f)"
|
|
358
|
+
: " — systemd restarted the engine; read the journal tail for the death cause");
|
|
359
|
+
}
|
|
331
360
|
if (journalNote !== undefined)
|
|
332
|
-
row.note = journalNote;
|
|
361
|
+
row.note = row.note === undefined ? journalNote : row.note + " (" + journalNote + ")";
|
|
333
362
|
return row;
|
|
334
363
|
}
|
|
335
364
|
//# sourceMappingURL=manageProbe.js.map
|
package/lib/manageRegistry.d.ts
CHANGED
|
@@ -28,14 +28,22 @@ export interface ManageConfig {
|
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
autoProvision?: boolean;
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
userLorasPath?: string;
|
|
31
37
|
}
|
|
32
38
|
/** The validator twin of {@link ManageConfig}. */
|
|
33
39
|
export declare const ManageConfig: Schema<Schemastery.ObjectS<NoInfer<{
|
|
34
40
|
comfyUnit: Schema<string, string, "defined">;
|
|
35
41
|
autoProvision: Schema<boolean, boolean, "defined">;
|
|
42
|
+
userLorasPath: Schema<string, string, "defined">;
|
|
36
43
|
}>>, Schemastery.ObjectT<NoInfer<{
|
|
37
44
|
comfyUnit: Schema<string, string, "defined">;
|
|
38
45
|
autoProvision: Schema<boolean, boolean, "defined">;
|
|
46
|
+
userLorasPath: Schema<string, string, "defined">;
|
|
39
47
|
}>>, "plain">;
|
|
40
48
|
export declare class ManageGatewayService extends Service {
|
|
41
49
|
static inject: string[];
|
|
@@ -57,9 +65,11 @@ export declare const manageProvider: {
|
|
|
57
65
|
Config: Schema<Schemastery.ObjectS<NoInfer<{
|
|
58
66
|
comfyUnit: Schema<string, string, "defined">;
|
|
59
67
|
autoProvision: Schema<boolean, boolean, "defined">;
|
|
68
|
+
userLorasPath: Schema<string, string, "defined">;
|
|
60
69
|
}>>, Schemastery.ObjectT<NoInfer<{
|
|
61
70
|
comfyUnit: Schema<string, string, "defined">;
|
|
62
71
|
autoProvision: Schema<boolean, boolean, "defined">;
|
|
72
|
+
userLorasPath: Schema<string, string, "defined">;
|
|
63
73
|
}>>, "plain">;
|
|
64
74
|
apply(ctx: Context, config?: ManageConfig): void;
|
|
65
75
|
};
|
package/lib/manageRegistry.js
CHANGED
|
@@ -13,13 +13,14 @@
|
|
|
13
13
|
// Erasable-syntax TS only (node --experimental-strip-types).
|
|
14
14
|
import { Service } from "@deepseek-ai/cordis";
|
|
15
15
|
import Schema from "@deepseek-ai/schemastery";
|
|
16
|
-
import { loadEndpointConfig, resolveRepoRoot, modelsService } from "@melite/comfyui-cordis";
|
|
16
|
+
import { loadEndpointConfig, resolveRepoRoot, modelsService, setUserLorasPath } from "@melite/comfyui-cordis";
|
|
17
17
|
import { RemoteError } from "@deepseek-ai/dsh-typert-protocol";
|
|
18
18
|
import { dispatchManage } from "./managePlane.js";
|
|
19
19
|
/** The validator twin of {@link ManageConfig}. */
|
|
20
20
|
export const ManageConfig = Schema.object({
|
|
21
21
|
comfyUnit: Schema.string().default("melite-comfyui.service"),
|
|
22
22
|
autoProvision: Schema.boolean().default(false),
|
|
23
|
+
userLorasPath: Schema.string().default(""),
|
|
23
24
|
});
|
|
24
25
|
export class ManageGatewayService extends Service {
|
|
25
26
|
|
|
@@ -98,6 +99,11 @@ export const manageProvider = {
|
|
|
98
99
|
inject: ["timer", "queue"],
|
|
99
100
|
Config: ManageConfig,
|
|
100
101
|
apply(ctx, config = {}) {
|
|
102
|
+
// The rows-file pin lands BEFORE the service exists: every
|
|
103
|
+
// manage-plane read (lora_list's rows_path, the hot drop-in)
|
|
104
|
+
// resolves through userLorasPath()'s one spelling, so the
|
|
105
|
+
// config field must win from the first read, never after.
|
|
106
|
+
setUserLorasPath(config.userLorasPath ?? "");
|
|
101
107
|
new ManageGatewayService(ctx, config);
|
|
102
108
|
},
|
|
103
109
|
};
|
package/lib/managerRail.js
CHANGED
|
@@ -58,6 +58,7 @@ async function call(base, path, opts) {
|
|
|
58
58
|
return null;
|
|
59
59
|
try {
|
|
60
60
|
return JSON.parse(text);
|
|
61
|
+
// a non-JSON body is the vendor's own plain text — folding to raw text hands the caller the vendor's words instead of a parse refusal
|
|
61
62
|
}
|
|
62
63
|
catch {
|
|
63
64
|
return text;
|
package/lib/queueCore.js
CHANGED
|
@@ -42,7 +42,9 @@ export class QueueCore {
|
|
|
42
42
|
continue;
|
|
43
43
|
run.status = "running";
|
|
44
44
|
this.activeId = runId;
|
|
45
|
-
|
|
45
|
+
// the ROW's own branded id feeds the bus (the order array is
|
|
46
|
+
// the wire-facing FIFO of bare strings — the brand rides rows)
|
|
47
|
+
notifyRunChanged(run.runId);
|
|
46
48
|
return run;
|
|
47
49
|
}
|
|
48
50
|
return null;
|
package/lib/queueLock.js
CHANGED
|
@@ -113,6 +113,7 @@ export function acquireLock(stateRoot, pid = process.pid, nowS = Math.floor(Date
|
|
|
113
113
|
let holder = "";
|
|
114
114
|
try {
|
|
115
115
|
holder = readFileSync(lockPath, "utf8").trim();
|
|
116
|
+
// an unreadable lock file is the dead-or-garbage case — holder "" falls through to the steal path that already owns it
|
|
116
117
|
}
|
|
117
118
|
catch {
|
|
118
119
|
holder = "";
|
|
@@ -146,6 +147,7 @@ export function releaseLock(stateRoot, pid = process.pid) {
|
|
|
146
147
|
let holder = "";
|
|
147
148
|
try {
|
|
148
149
|
holder = readFileSync(lockPath, "utf8").trim();
|
|
150
|
+
// an absent or unreadable lock file frees nothing this pid can prove it owns — false is the honest not-released
|
|
149
151
|
}
|
|
150
152
|
catch {
|
|
151
153
|
return false;
|
|
@@ -154,6 +156,7 @@ export function releaseLock(stateRoot, pid = process.pid) {
|
|
|
154
156
|
return false;
|
|
155
157
|
try {
|
|
156
158
|
unlinkSync(lockPath);
|
|
159
|
+
// a refused unlink leaves the lock on disk — false reports still-held instead of a phantom release
|
|
157
160
|
}
|
|
158
161
|
catch {
|
|
159
162
|
return false;
|
package/lib/queueResurrect.js
CHANGED
|
@@ -156,6 +156,7 @@ export function durableRecordUsable(sidecarText, requestText, draftExists) {
|
|
|
156
156
|
// here would orphan records resurrect saves).
|
|
157
157
|
try {
|
|
158
158
|
JSON.parse(requestText);
|
|
159
|
+
// an unparseable _request.json cannot rebuild the run — false orphans the record instead of admitting an unresurrectable row
|
|
159
160
|
}
|
|
160
161
|
catch {
|
|
161
162
|
return false;
|
|
@@ -171,6 +172,7 @@ export function durableRecordUsable(sidecarText, requestText, draftExists) {
|
|
|
171
172
|
sidecarList(rec["stages"]);
|
|
172
173
|
sidecarList(rec["skipped_stages"]);
|
|
173
174
|
artifactStrings(rec["artifacts"]);
|
|
175
|
+
// a non-listable stages/skipped/artifacts field means the record cannot replay — false is the same not-resurrectable answer the replay road would force
|
|
174
176
|
}
|
|
175
177
|
catch {
|
|
176
178
|
return false;
|
|
@@ -182,6 +184,7 @@ export function durableRecordUsable(sidecarText, requestText, draftExists) {
|
|
|
182
184
|
export function planResurrect(stateRoot, readSidecar = (runId) => {
|
|
183
185
|
try {
|
|
184
186
|
return readFileSync(join(stateRoot, "output", runId, "_flow.json"), "utf8");
|
|
187
|
+
// an absent or unreadable sidecar answers null — the plan orphans the run for the reconcile surface instead of dropping it
|
|
185
188
|
}
|
|
186
189
|
catch {
|
|
187
190
|
return null;
|
|
@@ -189,6 +192,7 @@ export function planResurrect(stateRoot, readSidecar = (runId) => {
|
|
|
189
192
|
}, readRequest = (runId) => {
|
|
190
193
|
try {
|
|
191
194
|
return readFileSync(join(stateRoot, "output", runId, "_request.json"), "utf8");
|
|
195
|
+
// an absent or unreadable _request.json answers null — usable goes false and the run orphans, never a throw
|
|
192
196
|
}
|
|
193
197
|
catch {
|
|
194
198
|
return null;
|
|
@@ -204,6 +208,7 @@ export function planResurrect(stateRoot, readSidecar = (runId) => {
|
|
|
204
208
|
let names;
|
|
205
209
|
try {
|
|
206
210
|
names = readdirSync(outRoot);
|
|
211
|
+
// an absent output root means no run was ever written — an empty plan (no order, no orphans) is the whole answer
|
|
207
212
|
}
|
|
208
213
|
catch {
|
|
209
214
|
return { order: [], orphans: [] };
|
package/lib/queueSidecar.d.ts
CHANGED
|
@@ -22,8 +22,12 @@ export interface SidecarStage {
|
|
|
22
22
|
readonly status: string;
|
|
23
23
|
readonly engine?: string;
|
|
24
24
|
readonly url?: string;
|
|
25
|
+
/** A gallery row's file `name` is the media-route key; `label`
|
|
26
|
+
* (queue 12's output_name mint at settle) is the display name a
|
|
27
|
+
* face reads — absent when the run spelled no output_name. */
|
|
25
28
|
readonly gallery?: Array<{
|
|
26
29
|
name: string;
|
|
30
|
+
label?: string;
|
|
27
31
|
}>;
|
|
28
32
|
readonly result_outputs?: Record<string, unknown>;
|
|
29
33
|
|
|
@@ -61,6 +65,20 @@ export declare function sidecarStageOf(stage: {
|
|
|
61
65
|
|
|
62
66
|
|
|
63
67
|
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
64
82
|
|
|
65
83
|
|
|
66
84
|
|
|
@@ -77,7 +95,7 @@ export interface GraphReceiptPair {
|
|
|
77
95
|
readonly carried: readonly string[];
|
|
78
96
|
/** The judged keys NOT found in the graph, sorted — the honesty face. */
|
|
79
97
|
readonly dropped: readonly string[];
|
|
80
|
-
readonly verdict: "complete" | "
|
|
98
|
+
readonly verdict: "complete" | "params_unbound";
|
|
81
99
|
/** THE BAKE'S RECORD (study §7 item 2, the run voice): present
|
|
82
100
|
* iff the composed graph bakes or loads a refmod mod — read off
|
|
83
101
|
* the graph's own nodes (the extract/loader inputs VERBATIM),
|
|
@@ -240,6 +258,11 @@ export declare function sidecarDoc(args: {
|
|
|
240
258
|
|
|
241
259
|
|
|
242
260
|
replaySuspect?: boolean;
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
attribution?: string;
|
|
243
266
|
}): Record<string, unknown>;
|
|
244
267
|
/** The door name the run started with (_pipeline_of 2111-2119:
|
|
245
268
|
* exactly one of flow | flow_inline | model — the sidecar's
|
package/lib/queueSidecar.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CARD_ENVELOPE_KEYS } from "./vocab.js";
|
|
1
2
|
export function sidecarStageOf(stage) {
|
|
2
3
|
const out = {
|
|
3
4
|
id: stage.id,
|
|
@@ -14,6 +15,10 @@ export function sidecarStageOf(stage) {
|
|
|
14
15
|
if (typeof stage.url === 'string')
|
|
15
16
|
out.url = stage.url;
|
|
16
17
|
if (Array.isArray(stage.gallery)) {
|
|
18
|
+
// THE LABEL CARRY (queue 12): a gallery row may carry a display
|
|
19
|
+
// `label` (the output_name mint at settle) beside its file `name`
|
|
20
|
+
// — the name is the media-route key, the label is what faces
|
|
21
|
+
// read. Both ride the sidecar so a restored row renders labeled.
|
|
17
22
|
const gallery = stage.gallery.filter((entry) => typeof entry === 'object' && entry !== null && !Array.isArray(entry)
|
|
18
23
|
&& typeof entry.name === 'string'
|
|
19
24
|
&& entry.name !== '');
|
|
@@ -122,6 +127,8 @@ export function graphReceiptOf(params, composed) {
|
|
|
122
127
|
const found = [];
|
|
123
128
|
const missed = [];
|
|
124
129
|
for (const [key, value] of Object.entries(params)) {
|
|
130
|
+
if (CARD_ENVELOPE_KEYS.includes(key))
|
|
131
|
+
continue;
|
|
125
132
|
const scalar = receiptScalarOf(value);
|
|
126
133
|
if (scalar === undefined)
|
|
127
134
|
continue;
|
|
@@ -136,7 +143,9 @@ export function graphReceiptOf(params, composed) {
|
|
|
136
143
|
populated,
|
|
137
144
|
carried: found,
|
|
138
145
|
dropped: missed,
|
|
139
|
-
|
|
146
|
+
// the verdict names its plane (D-11): not integration
|
|
147
|
+
// vocabulary — populated params whose literal never rode
|
|
148
|
+
verdict: missed.length === 0 ? "complete" : "params_unbound",
|
|
140
149
|
...(bake !== undefined ? { bake } : {}),
|
|
141
150
|
};
|
|
142
151
|
}
|
|
@@ -176,7 +185,7 @@ export function graphReceiptFoldOf(rows, promptId) {
|
|
|
176
185
|
populated: union((r) => r.populated),
|
|
177
186
|
carried: union((r) => r.carried),
|
|
178
187
|
dropped: union((r) => r.dropped),
|
|
179
|
-
verdict: complete ? "complete" : "
|
|
188
|
+
verdict: complete ? "complete" : "params_unbound",
|
|
180
189
|
stages: rows.map((r) => graphReceiptStageOf(r.stage, r)),
|
|
181
190
|
// THE BAKE rides the fold: the first stage that carries one
|
|
182
191
|
// (the card run's single stage; a multi-stage flow receipts the
|
|
@@ -265,6 +274,10 @@ export function sidecarDoc(args) {
|
|
|
265
274
|
...(args.loudness !== undefined ? { loudness: args.loudness } : {}),
|
|
266
275
|
...(args.voiceFreshness !== undefined ? { voice_freshness: args.voiceFreshness } : {}),
|
|
267
276
|
...(args.replaySuspect === true ? { replay_suspect: true } : {}),
|
|
277
|
+
// THE ATTRIBUTION MARKER (D3-07): rides the identity prefix —
|
|
278
|
+
// the list row's 8191-byte window must reach it so a missed
|
|
279
|
+
// stamp is visible even when the payload before it is bulky.
|
|
280
|
+
...(args.attribution !== undefined && args.attribution !== "" ? { attribution: args.attribution } : {}),
|
|
268
281
|
error: args.error !== "" ? JSON.stringify(args.error).slice(0, 20000) : "",
|
|
269
282
|
stages: args.stages,
|
|
270
283
|
skipped_stages: [...args.skippedStages],
|
package/lib/queueSweep.d.ts
CHANGED
|
@@ -1,18 +1,41 @@
|
|
|
1
|
+
import type { RunId } from "./queueCore.js";
|
|
1
2
|
export interface SweepResult {
|
|
2
3
|
readonly touched: boolean;
|
|
3
4
|
readonly wasQueued: boolean;
|
|
5
|
+
/** The D-8 hold: the queued face was NOT resettled — the row
|
|
6
|
+
* stays queued for the next boot's replay (only a caller that
|
|
7
|
+
* passes maxHolds > 0 can hold; the default resettles). */
|
|
8
|
+
readonly held: boolean;
|
|
4
9
|
readonly doc: Record<string, unknown>;
|
|
5
10
|
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
export declare function sweepSidecar(doc: Record<string, unknown>, why: string, queuedWhy?: string, maxHolds?: number): SweepResult;
|
|
13
27
|
/** Boot-sweep notes (boot_sweep 2402-2409). */
|
|
14
28
|
export declare const BOOT_SWEEP_WHY: string;
|
|
15
29
|
export declare const BOOT_SWEEP_QUEUED_WHY: string;
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
export declare const BOOT_SWEEP_MAX_HOLDS: number;
|
|
16
39
|
/** Read-time sweep notes + response errors (sidecar_status
|
|
17
40
|
* 2428-2451): the ledger state is ALWAYS "failed" (even for a
|
|
18
41
|
* queued zombie — the error TEXT carries the never-executed
|
|
@@ -23,8 +46,12 @@ export declare const READ_SWEEP_RUNNING_ERROR: string;
|
|
|
23
46
|
/** Boot-time zombie sweep (boot_sweep 2378-2410, fs half): every
|
|
24
47
|
* sidecar still claiming running/queued belongs to a DEAD process
|
|
25
48
|
* — EXCEPT liveRunIds (boot_resurrect just re-queued those; their
|
|
26
|
-
* queued sidecar is resurrected work, not a zombie).
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
|
|
49
|
+
* queued sidecar is resurrected work, not a zombie). A RUNNING
|
|
50
|
+
* claim retires failed; a still-QUEUED claim NEVER executed, so it
|
|
51
|
+
* HOLDS as queued for the next boot's replay (D-8, bounded by
|
|
52
|
+
* BOOT_SWEEP_MAX_HOLDS — past the bound it settles failed loud).
|
|
53
|
+
* Swept BEFORE traffic, so the ledger never shows phantom actives.
|
|
54
|
+
* Returns the RETIRED run ids in sorted order (held rows are not
|
|
55
|
+
* retired and never ride it). */
|
|
56
|
+
export declare function bootSweep(stateRoot: string, liveRunIds?: readonly RunId[], nowS?: number): Promise<string[]>;
|
|
30
57
|
//# sourceMappingURL=queueSweep.d.ts.map
|