@melite/estate-queue 0.1.5-pre-alpha → 0.2.0-alpha
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/LICENSE +561 -457
- package/lib/cardsArmError.d.ts +52 -3
- package/lib/cardsArmError.js +7 -1
- package/lib/cardsCompose.js +43 -7
- package/lib/cardsFacts.d.ts +16 -0
- package/lib/cardsFacts.js +25 -1
- package/lib/cardsLanes.d.ts +51 -3
- package/lib/cardsLanes.js +337 -13
- package/lib/cardsLanesCopy.d.ts +21 -0
- package/lib/cardsLanesCopy.js +22 -0
- package/lib/cardsRegistry.d.ts +102 -5
- package/lib/cardsRegistry.js +668 -45
- package/lib/cardsVariant.d.ts +12 -7
- package/lib/cardsVariant.js +196 -58
- package/lib/discloseRegistry.d.ts +36 -6
- package/lib/discloseRegistry.js +153 -15
- package/lib/filmLead.js +5 -3
- package/lib/flowsData.d.ts +1 -1
- package/lib/flowsData.js +7 -4
- package/lib/flowsFamilyCompose.js +12 -1
- package/lib/flowsRegistryRows.d.ts +1 -0
- package/lib/flowsRegistryRows.js +193 -35
- package/lib/index.d.ts +1 -0
- package/lib/index.js +6 -0
- package/lib/loadPlane.js +9 -0
- package/lib/manageOps.js +2 -1
- package/lib/managePlane.d.ts +11 -1
- package/lib/managePlane.js +559 -24
- package/lib/managePreflight.d.ts +26 -0
- package/lib/managePreflight.js +179 -0
- package/lib/manageProbe.d.ts +17 -0
- package/lib/manageProbe.js +61 -1
- package/lib/queueCore.d.ts +14 -1
- package/lib/queueCore.js +13 -0
- package/lib/queueResurrect.d.ts +7 -2
- package/lib/queueResurrect.js +25 -6
- package/lib/queueSidecar.d.ts +110 -1
- package/lib/queueSidecar.js +177 -7
- package/lib/queueSubmit.d.ts +67 -4
- package/lib/queueSubmit.js +133 -4
- package/lib/runsErrorCodes.js +5 -3
- package/lib/runsExecute.js +44 -4
- package/lib/runsGates.d.ts +5 -1
- package/lib/runsGates.js +6 -2
- package/lib/runsList.d.ts +43 -3
- package/lib/runsList.js +159 -39
- package/lib/runsRefusalVoices.js +50 -1
- package/lib/runsRegistry.d.ts +84 -6
- package/lib/runsRegistry.js +515 -105
- package/lib/runsStart.d.ts +24 -3
- package/lib/runsStart.js +128 -13
- package/lib/runsTypes.d.ts +27 -2
- package/lib/runsTypes.js +23 -6
- package/lib/runsValidateServe.js +20 -10
- package/lib/runsValidateShared.d.ts +9 -0
- package/lib/runsValidateShared.js +14 -0
- package/lib/runsValidateStages.js +21 -9
- package/lib/runtimeProvision.d.ts +119 -0
- package/lib/runtimeProvision.js +243 -0
- package/lib/skillRows.js +7 -2
- package/package.json +18 -18
package/lib/cardsLanes.js
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
// Extracted from cardsRegistry: which families have a live lane on
|
|
3
3
|
// disk (the packs the compose arm refuses without).
|
|
4
4
|
import { checkModelPresent, getModel, loadEndpointConfig } from "@melite/comfyui-cordis";
|
|
5
|
+
import { LIVE_ACQUIRE_STATES, provisioningSeat } from "@melite/estate-provisioning";
|
|
6
|
+
import { resolveCellRow } from "@melite/contracts/laneRelations";
|
|
7
|
+
import { engineOutputDir, engineRootOf, resolveRuntimeHome, runtimeEnvView, sentinelHit } from "./runtimeProvision.js";
|
|
8
|
+
import { hashPhaseWordOf, laneVoice } from "./cardsLanesCopy.js";
|
|
5
9
|
import { CardArmError } from "./cardsArmError.js";
|
|
6
10
|
|
|
7
11
|
// The operator's alarm: "If Img Gen works and Img Edit doesn't,
|
|
@@ -69,14 +73,14 @@ export function lanePackFolders() {
|
|
|
69
73
|
|
|
70
74
|
|
|
71
75
|
|
|
72
|
-
export function lanePresenceRefusal(fam) {
|
|
76
|
+
export function lanePresenceRefusal(fam, body, mid) {
|
|
73
77
|
const sandbox = process.env["INFERENCE_TEST_SANDBOX"] ?? "";
|
|
74
78
|
const envPath = process.env["COMFYUI_ENDPOINT_CONFIG"] ?? "";
|
|
75
79
|
if (sandbox !== "" && envPath === "")
|
|
76
80
|
return null;
|
|
77
81
|
// the refusal is a THROW, never a value (phase1Card's pinned
|
|
78
82
|
// contract — no return-value arm there)
|
|
79
|
-
const miss = lanePresenceMiss(fam);
|
|
83
|
+
const miss = lanePresenceMiss(fam, body, mid);
|
|
80
84
|
if (miss !== null)
|
|
81
85
|
throw miss;
|
|
82
86
|
return null;
|
|
@@ -93,10 +97,42 @@ function homeProbes(home, name) {
|
|
|
93
97
|
probes.push([home + "/" + name.slice(0, cut), name.slice(cut + 1)]);
|
|
94
98
|
return probes;
|
|
95
99
|
}
|
|
96
|
-
|
|
97
|
-
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
function laneMisses(decl, check, variantRow, cellRow) {
|
|
109
|
+
// THE VARIANT-LANE PRESENCE LAW (h¹ remainder — the one-parameter
|
|
110
|
+
// switch): the probe judges the RESOLVED lane inputs — the family's
|
|
111
|
+
// rows under the STATED variant's per-key override (the same merge
|
|
112
|
+
// the compose stamps; a variant that does not override a key leaves
|
|
113
|
+
// the family's row gating). A family-only probe green-lit a variant
|
|
114
|
+
// whose own file never existed (the Singularity burn: the family's
|
|
115
|
+
// timeline unet present, the override's 20 GB never fetched).
|
|
116
|
+
const li = {
|
|
117
|
+
...(decl.lane_inputs ?? {}),
|
|
118
|
+
...(variantRow?.lane_inputs ?? {}),
|
|
119
|
+
|
|
120
|
+
// the STATED cell's rows fold in last — the same per-key
|
|
121
|
+
// precedence the compose stamps (the derived route read folds
|
|
122
|
+
// atom → variant → CELL, comfyui-cordis service.ts getModel) and
|
|
123
|
+
// the client mirror's resolvedLaneSurface rides (the ONE
|
|
124
|
+
// RESOLVER's coordinate, never a second spelling). A family whose
|
|
125
|
+
// weight tiers live only at variants[].cells (qwen-img-21 /
|
|
126
|
+
// qwen-img-edit-21's bf16+turbo unets, qwen3-tts's per-size
|
|
127
|
+
// model_path) gated the DEFAULT tier's files for every stated
|
|
128
|
+
// coordinate — the burn: a missing stated-cell weight sailed the
|
|
129
|
+
// presence gate straight into the engine's validation.
|
|
130
|
+
...(cellRow?.lane_inputs ?? {}),
|
|
131
|
+
};
|
|
98
132
|
const homes = (decl.lane_homes ?? {});
|
|
99
133
|
const packs = lanePackFolders();
|
|
134
|
+
const misses = [];
|
|
135
|
+
const seen = new Set();
|
|
100
136
|
for (const [key, stock] of Object.entries(LANE_FOLDERS)) {
|
|
101
137
|
const raw = li[key];
|
|
102
138
|
const name = typeof raw === "string" ? raw.trim() : "";
|
|
@@ -116,7 +152,11 @@ function firstLaneMiss(decl, check) {
|
|
|
116
152
|
folders.push(prov.folder);
|
|
117
153
|
if (folders.some((folder) => check(folder, name) !== null))
|
|
118
154
|
continue;
|
|
119
|
-
|
|
155
|
+
const dedupe = key + " " + name;
|
|
156
|
+
if (!seen.has(dedupe)) {
|
|
157
|
+
seen.add(dedupe);
|
|
158
|
+
misses.push({ key, name, folders });
|
|
159
|
+
}
|
|
120
160
|
}
|
|
121
161
|
|
|
122
162
|
// model_path/texture_vae name files whose loader is pack-specific
|
|
@@ -136,11 +176,36 @@ function firstLaneMiss(decl, check) {
|
|
|
136
176
|
if (prov !== undefined && !probes.some(([f, n]) => f === prov.folder && n === name)) {
|
|
137
177
|
probes.push([prov.folder, name]);
|
|
138
178
|
}
|
|
179
|
+
|
|
180
|
+
// a loader-side subpath ("qwen3-tts/hf/…-Base" — the C++ load
|
|
181
|
+
// gate reads it relative to the AUDIO pack root, transcript-014)
|
|
182
|
+
// double-joins under its lane_homes key (the qwen3_tts extras
|
|
183
|
+
// map already descends into audio/qwen3-tts/hf), so the home
|
|
184
|
+
// probes can never hit a present tree. The snapshot row owns
|
|
185
|
+
// the placement truth (folder + bare name — the same anchor
|
|
186
|
+
// probe the provisioning plane's presence rides), so it probes
|
|
187
|
+
// as its own (folder, name) pair, never re-suffixed.
|
|
188
|
+
const base = name.split("/").pop() ?? name;
|
|
189
|
+
const snap = (decl.snapshot_provisions ?? []).find((s) => s.name === base && typeof s.folder === "string" && s.folder !== "");
|
|
190
|
+
if (snap !== undefined &&
|
|
191
|
+
!probes.some(([f, n]) => f === snap.folder && (n === name || n === snap.name))) {
|
|
192
|
+
probes.push([snap.folder, snap.name]);
|
|
193
|
+
}
|
|
139
194
|
if (probes.some(([folder, probeName]) => check(folder, probeName) !== null))
|
|
140
195
|
continue;
|
|
141
|
-
|
|
196
|
+
const dedupe = key + " " + name;
|
|
197
|
+
if (!seen.has(dedupe)) {
|
|
198
|
+
seen.add(dedupe);
|
|
199
|
+
misses.push({ key, name, folders: probes.map(([f, n]) => f + " × " + n) });
|
|
200
|
+
}
|
|
142
201
|
}
|
|
143
|
-
return
|
|
202
|
+
return misses;
|
|
203
|
+
}
|
|
204
|
+
/** The first miss — the presence boolean's own leg (laneFilesStatus)
|
|
205
|
+
* and the refusal's LEAD row. The whole list rides beside it
|
|
206
|
+
* (laneMisses → the refusal's missingAll). */
|
|
207
|
+
function firstLaneMiss(decl, check, variantRow) {
|
|
208
|
+
return laneMisses(decl, check, variantRow)[0] ?? null;
|
|
144
209
|
}
|
|
145
210
|
export function laneFilesStatus(decl, check = (folder, name) => checkModelPresent("models/" + folder, name)) {
|
|
146
211
|
const li = (decl.lane_inputs ?? {});
|
|
@@ -153,15 +218,273 @@ export function laneFilesStatus(decl, check = (folder, name) => checkModelPresen
|
|
|
153
218
|
return null;
|
|
154
219
|
return firstLaneMiss(decl, check) === null;
|
|
155
220
|
}
|
|
156
|
-
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
function runtimeLegMiss(decl, fam, body) {
|
|
243
|
+
const rt = decl.runtime;
|
|
244
|
+
if (rt === undefined)
|
|
245
|
+
return null;
|
|
246
|
+
const stated = body?.[rt.consuming_param];
|
|
247
|
+
if (typeof stated !== "string" || stated.trim() === "")
|
|
248
|
+
return null;
|
|
249
|
+
const root = engineRootOf();
|
|
250
|
+
if (root === null)
|
|
251
|
+
return null;
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
// walk-up — a deliberately stated path is right far more often
|
|
255
|
+
// than a blind walk is. The known split (an override valid in the
|
|
256
|
+
// LANE's env but absent from the ENGINE's own env) then passes the
|
|
257
|
+
// gate and burns at the engine — but that burn is FACED (the
|
|
258
|
+
// post-hoc runtime banner voices the same provision + env, and the
|
|
259
|
+
// provision_runtime verb answers it), never silent. The alternative
|
|
260
|
+
// (distrusting a stated-valid path) would false-refuse managed
|
|
261
|
+
// deployments whose override points outside any walk-up tree —
|
|
262
|
+
// blocking good work is worse than facing a bad run.
|
|
263
|
+
const override = runtimeEnvView(rt.env);
|
|
264
|
+
if (override.value !== "") {
|
|
265
|
+
if (rt.sentinel.every((s) => sentinelHit(override.value, s)))
|
|
266
|
+
return null;
|
|
267
|
+
return runtimeRefusal(fam, rt, [override.value]);
|
|
268
|
+
}
|
|
269
|
+
const start = engineOutputDir(root);
|
|
270
|
+
const home = resolveRuntimeHome(start, rt);
|
|
271
|
+
if (home !== null)
|
|
272
|
+
return null;
|
|
273
|
+
return runtimeRefusal(fam, rt, [start]);
|
|
274
|
+
}
|
|
275
|
+
/** The press-time runtime refusal: the engine-voiced sentence the
|
|
276
|
+
* E2 parser anchors on (run-rescue-core.ts THE RUNTIME-MISS
|
|
277
|
+
* VOICE) — `<name> runtime not found at <path>. Provision it:
|
|
278
|
+
* <cmd>. Or point <ENV> at an existing runtime.` — plus the
|
|
279
|
+
* lanes.env hatch. Deliberately NOT the "lane presence:" prefix:
|
|
280
|
+
* that voice is the model leg's anchor (weight extensions), and
|
|
281
|
+
* this sentence must fall through to the runtime arm, never be
|
|
282
|
+
* claimed by it. */
|
|
283
|
+
function runtimeRefusal(fam, rt, checked) {
|
|
284
|
+
return new CardArmError(400, "family '" + fam + "' declares runtime '" + rt.name + "' (" + rt.consuming_param + " stated) but no " +
|
|
285
|
+
"provisioned copy exists — " + rt.name + " runtime not found at " + checked[0] + ". Provision it: " +
|
|
286
|
+
rt.command + ". Or point " + rt.env + " at an existing runtime. If " + rt.env + " is set for the " +
|
|
287
|
+
"engine but the lane cannot see it, export it in lanes.env and restart the lane. (walk-up from " +
|
|
288
|
+
checked[0] + " for " + rt.rel.join("/") + " found no copy holding " + rt.sentinel.join(", ") + ")", "lane_input_missing", undefined, undefined, undefined, {
|
|
289
|
+
family: fam,
|
|
290
|
+
slot: rt.consuming_param,
|
|
291
|
+
missing: rt.name,
|
|
292
|
+
folders: [...checked],
|
|
293
|
+
kind: "runtime",
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
/** THE IN-FLIGHT READ (the run gate's seat query — the provisioning
|
|
297
|
+
* service's operation read, wired through the process seat the way
|
|
298
|
+
* the models seat's namespace arms the models table): the LIVE
|
|
299
|
+
* acquire row for one family, null when no seat is mounted in this
|
|
300
|
+
* process, no acquisition runs for the family, or the row already
|
|
301
|
+
* settled (a settled row is the rescue verbs' story — the idle miss's
|
|
302
|
+
* own voice stands for it, and its fresh-fetch hint is then true).
|
|
303
|
+
* The read keys the family ref the acquire door itself starts
|
|
304
|
+
* (owner family, no variant/quant), so the gate sees exactly the
|
|
305
|
+
* operation the manage seat's Download press minted. */
|
|
306
|
+
function acquireInFlight(fam) {
|
|
307
|
+
const progress = provisioningSeat()?.progressOfRef({ kind: "model", owner: "family", id: fam }) ?? null;
|
|
308
|
+
if (progress === null)
|
|
309
|
+
return null;
|
|
310
|
+
return LIVE_ACQUIRE_STATES.has(progress.state) ? progress : null;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
|
|
319
|
+
function inFlightFraction(progress) {
|
|
320
|
+
const fraction = progress.total <= 0
|
|
321
|
+
? "total undeclared"
|
|
322
|
+
: String(Math.floor((progress.bytes * 100) / progress.total)) + "%";
|
|
323
|
+
return laneVoice.inFlightFraction({ fraction, phaseWord: hashPhaseWordOf(progress) });
|
|
324
|
+
}
|
|
325
|
+
/** THE STATED VARIANT'S ROW (the same derivation the compose
|
|
326
|
+
* stamps, over the DECL's own rows — the facts fold drops
|
|
327
|
+
* lane_inputs): a stated body.variant wins (id match), else the
|
|
328
|
+
* ADDRESS's own row (route/id/cell-route/resolver model — a bare
|
|
329
|
+
* route pick composes that route's defaults), else undefined (the
|
|
330
|
+
* family default: no override, the family rows gate alone). */
|
|
331
|
+
function statedVariantRow(decl, body, mid) {
|
|
332
|
+
const variants = decl.variants ?? [];
|
|
333
|
+
const stated = typeof body?.["variant"] === "string" && body["variant"].trim() !== ""
|
|
334
|
+
? body["variant"].trim()
|
|
335
|
+
: "";
|
|
336
|
+
if (stated !== "") {
|
|
337
|
+
const row = variants.find((v) => v.id === stated || v.route === stated);
|
|
338
|
+
if (row !== undefined)
|
|
339
|
+
return row;
|
|
340
|
+
}
|
|
341
|
+
if (mid === undefined || mid === "")
|
|
342
|
+
return undefined;
|
|
343
|
+
return variants.find((v) => v.route === mid || v.id === mid
|
|
344
|
+
|| (v.cells ?? []).some((c) => c.route === mid)
|
|
345
|
+
|| v.resolver_defaults?.["model"] === mid);
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
|
|
355
|
+
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
|
|
359
|
+
export function statedCellRow(variant, body, mid) {
|
|
360
|
+
if (variant === undefined)
|
|
361
|
+
return undefined;
|
|
362
|
+
const raw = body?.["quant"];
|
|
363
|
+
const stated = typeof raw === "string" && raw !== "native" ? raw : null;
|
|
364
|
+
// the explicit cell type: the resolver's generic erases to its
|
|
365
|
+
// constraint (ResolverCellRow) — the runtime row IS the DECL cell
|
|
366
|
+
const res = resolveCellRow(variant, stated, mid ?? "", "offered");
|
|
367
|
+
return res.status === "resolved" ? (res.cell ?? undefined) : undefined;
|
|
368
|
+
}
|
|
369
|
+
export function laneFetchAnchor(decl, seats, name) {
|
|
370
|
+
// 1. the family's own provisions row — the loaded-identity rule
|
|
371
|
+
// (full name or basename, the registration law's spelling)
|
|
372
|
+
const base = name.split("/").pop() ?? name;
|
|
373
|
+
const prov = (decl.provisions ?? []).find((p) => p.name === name || p.name === base);
|
|
374
|
+
if (prov !== undefined) {
|
|
375
|
+
return { url: prov.url, ...(prov.size_bytes !== undefined ? { sizeBytes: prov.size_bytes } : {}) };
|
|
376
|
+
}
|
|
377
|
+
// 2. the stated cell/variant artifact — the source_url's basename is
|
|
378
|
+
// the lane file's name (the cell's own spelling, krea-2/qwen law);
|
|
379
|
+
// only the cell row declares an artifact member
|
|
380
|
+
for (const seat of seats) {
|
|
381
|
+
if (seat === undefined || !("artifact" in seat))
|
|
382
|
+
continue;
|
|
383
|
+
const artifact = seat.artifact;
|
|
384
|
+
const url = artifact?.source_url;
|
|
385
|
+
if (typeof url === "string" && url.length > 0 && (url.split("/").pop() ?? "") === base) {
|
|
386
|
+
const size = artifact?.size_bytes;
|
|
387
|
+
return { url, ...(typeof size === "number" ? { sizeBytes: size } : {}) };
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
// 2.5 THE FAMILY-WIDE ARTIFACT FALLBACK (the shared-weight law): a
|
|
391
|
+
// weight many coordinates ride (the family default unet under a
|
|
392
|
+
// lora variant) declares its channel ONCE — on the OWNING cell's
|
|
393
|
+
// artifact row. The basename is the file identity: any cell's
|
|
394
|
+
// artifact with that basename is a true URL for the missing
|
|
395
|
+
// weight, exactly what the provisioner fetches. Refusing to say
|
|
396
|
+
// it (the seat-only lookup) is the kroma class wearing a
|
|
397
|
+
// different coat — a URL exists, the press reports a bare miss.
|
|
398
|
+
for (const variant of decl.variants ?? []) {
|
|
399
|
+
for (const cell of variant.cells) {
|
|
400
|
+
const url = cell.artifact?.source_url;
|
|
401
|
+
if (typeof url === "string" && url.length > 0 && (url.split("/").pop() ?? "") === base) {
|
|
402
|
+
const size = cell.artifact?.size_bytes;
|
|
403
|
+
return { url, ...(typeof size === "number" ? { sizeBytes: size } : {}) };
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
// 3. the snapshot tree — the repo link anchors the fetch AT ITS
|
|
408
|
+
|
|
409
|
+
// omitted the pin — the fetcher's coordinate is the tree, not the
|
|
410
|
+
// moving default branch; the refusal names repo@revision)
|
|
411
|
+
const snap = (decl.snapshot_provisions ?? []).find((s) => s.name === base);
|
|
412
|
+
if (snap !== undefined) {
|
|
413
|
+
return { url: "https://huggingface.co/" + snap.repo_id + "/tree/" + snap.revision };
|
|
414
|
+
}
|
|
415
|
+
return undefined;
|
|
416
|
+
}
|
|
417
|
+
export function lanePresenceMiss(fam, body, mid) {
|
|
157
418
|
const decl = getModel(fam);
|
|
158
|
-
const
|
|
419
|
+
const check = (folder, name) => checkModelPresent("models/" + folder, name);
|
|
420
|
+
const variantRow = statedVariantRow(decl, body, mid);
|
|
421
|
+
const cellRow = statedCellRow(variantRow, body, mid);
|
|
422
|
+
const misses = laneMisses(decl, check, variantRow, cellRow);
|
|
423
|
+
const miss = misses[0] ?? null;
|
|
159
424
|
if (miss === null)
|
|
160
|
-
return
|
|
161
|
-
|
|
425
|
+
return runtimeLegMiss(decl, fam, body);
|
|
426
|
+
// THE IN-FLIGHT LEG (ERRORS.md k2 — NEVER-RUN-ON-INCOMPLETE): a
|
|
427
|
+
// miss whose file is landing RIGHT NOW is not the idle story. The
|
|
428
|
+
// refusal voices the acquisition (the operation and its live
|
|
429
|
+
// fraction, real landed bytes over the DECL total), carries the
|
|
430
|
+
// structured row beside the lane miss, and DROPS the fresh-fetch
|
|
431
|
+
// hint — "fetch it: <url>" while a fetch runs is what re-pops the
|
|
432
|
+
// download loop the burn names.
|
|
433
|
+
const inFlight = acquireInFlight(fam);
|
|
434
|
+
if (inFlight !== null) {
|
|
435
|
+
return new CardArmError(400, "lane presence: family '" + fam + "' declares " + miss.key + " '" + miss.name +
|
|
436
|
+
"' — acquisition in flight (" + inFlightFraction(inFlight) + "): operation " +
|
|
437
|
+
inFlight.operationId + ", " + String(inFlight.bytes) + "/" + String(inFlight.total) +
|
|
438
|
+
" bytes landed — the run refuses until the weight is on the store", "lane_input_missing", undefined, undefined, undefined,
|
|
439
|
+
// the lane miss stands WITHOUT its fetchUrl (no fresh-fetch
|
|
440
|
+
// hint): the popup keys its face on fields and finds no
|
|
441
|
+
// download offer to double-press
|
|
442
|
+
{
|
|
443
|
+
family: fam,
|
|
444
|
+
slot: miss.key,
|
|
445
|
+
missing: miss.name,
|
|
446
|
+
folders: miss.folders,
|
|
447
|
+
kind: "model",
|
|
448
|
+
}, {
|
|
449
|
+
acquire_in_flight: true,
|
|
450
|
+
operation_id: inFlight.operationId,
|
|
451
|
+
bytes: inFlight.bytes,
|
|
452
|
+
total: inFlight.total,
|
|
453
|
+
});
|
|
454
|
+
}
|
|
455
|
+
// THE ONE-FACE LIST (the sequential-missing-weight-reveal cure,
|
|
456
|
+
|
|
457
|
+
// anchor byte-exact; the WHOLE miss list rides after it (prose)
|
|
458
|
+
// and inside the structured row (missingAll) — the operator learns
|
|
459
|
+
// of the vae in the refusal that names the text encoder, with the
|
|
460
|
+
// DECL's declared size per file, never one wedged run later.
|
|
461
|
+
|
|
462
|
+
// row's anchor resolves through laneFetchAnchor — the cascade's
|
|
463
|
+
// own channels (provisions, the stated cell/variant artifact, the
|
|
464
|
+
// snapshot repo), NEVER provisions alone. The wall
|
|
465
|
+
// (variant-linkability ARM 4) walks this exact builder over an
|
|
466
|
+
// empty store and reds any declared weight the door cannot anchor.
|
|
467
|
+
const rows = misses.map((m) => {
|
|
468
|
+
const anchor = laneFetchAnchor(decl, [variantRow, cellRow], m.name);
|
|
469
|
+
return {
|
|
470
|
+
slot: m.key,
|
|
471
|
+
name: m.name,
|
|
472
|
+
folders: m.folders,
|
|
473
|
+
...(anchor?.sizeBytes !== undefined ? { sizeBytes: anchor.sizeBytes } : {}),
|
|
474
|
+
...(anchor !== undefined ? { fetchUrl: anchor.url } : {}),
|
|
475
|
+
};
|
|
476
|
+
});
|
|
477
|
+
const listVoice = misses.length > 1
|
|
478
|
+
? "; the run declares " + String(misses.length) + " missing files — " +
|
|
479
|
+
misses.map((m) => {
|
|
480
|
+
const anchor = laneFetchAnchor(decl, [variantRow, cellRow], m.name);
|
|
481
|
+
return m.key + " '" + m.name + "'" + (anchor !== undefined ? " — fetch it: " + anchor.url : "");
|
|
482
|
+
}).join("; ")
|
|
483
|
+
: "";
|
|
162
484
|
return new CardArmError(400, "lane presence: family '" + fam + "' declares " + miss.key + " '" + miss.name +
|
|
163
485
|
"' but no store copy exists (folders checked: " + miss.folders.join(", ") + ")" +
|
|
164
|
-
(
|
|
486
|
+
(rows[0]?.fetchUrl !== undefined ? " — fetch it: " + rows[0].fetchUrl : "") +
|
|
487
|
+
listVoice, "lane_input_missing", undefined, undefined, undefined,
|
|
165
488
|
|
|
166
489
|
// details carry the same facts the prose carries, so the
|
|
167
490
|
// client's missing-model popup keys its download action on
|
|
@@ -171,7 +494,8 @@ export function lanePresenceMiss(fam) {
|
|
|
171
494
|
slot: miss.key,
|
|
172
495
|
missing: miss.name,
|
|
173
496
|
folders: miss.folders,
|
|
174
|
-
...(
|
|
497
|
+
...(rows[0]?.fetchUrl !== undefined ? { fetchUrl: rows[0].fetchUrl } : {}),
|
|
498
|
+
...(rows.length > 1 ? { missingAll: rows } : {}),
|
|
175
499
|
kind: "model",
|
|
176
500
|
});
|
|
177
501
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { WeightAcquireProgress } from "@melite/estate-provisioning";
|
|
2
|
+
export declare const laneVoice: {
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
hashingWord: string;
|
|
8
|
+
/** The live fraction's composition: the fraction itself, joined
|
|
9
|
+
* with the live phase word when one is named — never a bare
|
|
10
|
+
* frozen percent mid-hash. */
|
|
11
|
+
inFlightFraction: (p: {
|
|
12
|
+
fraction: string;
|
|
13
|
+
phaseWord?: string;
|
|
14
|
+
}) => string;
|
|
15
|
+
};
|
|
16
|
+
/** The row's hash-phase word, undefined when the row is not hashing:
|
|
17
|
+
* the live phase names the hash ('verify', or a present file's
|
|
18
|
+
* 'recheck'), and — on rows seeded before the phase law — the state
|
|
19
|
+
* word 'verifying' says it alone. */
|
|
20
|
+
export declare function hashPhaseWordOf(progress: WeightAcquireProgress): string | undefined;
|
|
21
|
+
//# sourceMappingURL=cardsLanesCopy.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export const laneVoice = {
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
hashingWord: "hashing",
|
|
7
|
+
/** The live fraction's composition: the fraction itself, joined
|
|
8
|
+
* with the live phase word when one is named — never a bare
|
|
9
|
+
* frozen percent mid-hash. */
|
|
10
|
+
inFlightFraction: (p) => p.phaseWord === undefined ? p.fraction : p.fraction + " · " + p.phaseWord,
|
|
11
|
+
};
|
|
12
|
+
/** The row's hash-phase word, undefined when the row is not hashing:
|
|
13
|
+
* the live phase names the hash ('verify', or a present file's
|
|
14
|
+
* 'recheck'), and — on rows seeded before the phase law — the state
|
|
15
|
+
* word 'verifying' says it alone. */
|
|
16
|
+
export function hashPhaseWordOf(progress) {
|
|
17
|
+
const hashing = progress.phase === "verify"
|
|
18
|
+
|| progress.phase === "recheck"
|
|
19
|
+
|| progress.state === "verifying";
|
|
20
|
+
return hashing ? laneVoice.hashingWord : undefined;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=cardsLanesCopy.js.map
|
package/lib/cardsRegistry.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import type { CardDefinition } from '@melite/comfyui-card-kit/card-definition';
|
|
|
5
5
|
import { RUNS_ERROR_CODES } from "./runsErrorCodes.js";
|
|
6
6
|
export { CardArmError } from "./cardsArmError.js";
|
|
7
7
|
import type { CardDeclRow, ModelFactsRow } from "./cardsFacts.js";
|
|
8
|
+
import { type FamilyLaw } from "@melite/contracts/familyLane";
|
|
8
9
|
export { selectCardVariant, stampCardOverlay, liftCardParams } from "./cardsVariant.js";
|
|
9
10
|
export type { VariantSelection } from "./cardsVariant.js";
|
|
10
11
|
export type { CardDeclRow, ModelFactsRow, VariantCellRow, ResolvedVariantRow } from "./cardsFacts.js";
|
|
@@ -54,12 +55,39 @@ export declare function resolveCardOutputsOrThrow(defs: ReadonlyMap<string, Pick
|
|
|
54
55
|
outputs: Record<string, string>;
|
|
55
56
|
outputNodes: Record<string, string>;
|
|
56
57
|
};
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
export declare const FAMILY_RESEAT_CARVE: readonly string[];
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
export declare function familyLawDrift(laws: ReadonlyMap<string, FamilyLaw>): string[];
|
|
57
82
|
export declare class CardRegistryService extends Service {
|
|
58
83
|
static inject: string[];
|
|
59
84
|
/** The primed card definitions (null until prime()). */
|
|
60
85
|
private defs;
|
|
61
86
|
/** The frozen model facts (lazy — strict load, throws LOUD). */
|
|
62
87
|
private facts;
|
|
88
|
+
/** When the facts cache primed (HMR audit 009 F2 — the staleness
|
|
89
|
+
* signal's own clock; null until the first modelFacts()). */
|
|
90
|
+
private factsPrimedAt;
|
|
63
91
|
/** Route address → family owner from the registry-derived facts. */
|
|
64
92
|
private owners;
|
|
65
93
|
/** Registry reads for the row derivation (primed with the models boot). */
|
|
@@ -117,6 +145,21 @@ export declare class CardRegistryService extends Service {
|
|
|
117
145
|
/** Sync read of the primed registry reads (unprimed access throws LOUD). */
|
|
118
146
|
readsSync(): FactsReads;
|
|
119
147
|
modelFacts(): Record<string, ModelFactsRow>;
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
factsStaleness(): {
|
|
158
|
+
primed_at: string | null;
|
|
159
|
+
source: string;
|
|
160
|
+
source_mtime: string;
|
|
161
|
+
stale: boolean;
|
|
162
|
+
};
|
|
120
163
|
/** The decl projection — derived from defs + the strict facts, or
|
|
121
164
|
* from defs + caller-supplied facts (the validate door's
|
|
122
165
|
* degraded read; derived fresh, never cached over foreign facts). */
|
|
@@ -124,11 +167,20 @@ export declare class CardRegistryService extends Service {
|
|
|
124
167
|
/** The primed live doc (sync face for the sweeps/spec fakes).
|
|
125
168
|
* null = never primed, or the engine was unreachable at prime. */
|
|
126
169
|
objectInfo(): Record<string, unknown> | null;
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
primeObjectInfo(boundMs?: number): Promise<boolean>;
|
|
132
184
|
|
|
133
185
|
|
|
134
186
|
|
|
@@ -241,6 +293,51 @@ export declare class CardRegistryService extends Service {
|
|
|
241
293
|
|
|
242
294
|
|
|
243
295
|
|
|
296
|
+
admitStageFamily(card: string, params: Record<string, unknown>): {
|
|
297
|
+
ok: true;
|
|
298
|
+
} | {
|
|
299
|
+
ok: false;
|
|
300
|
+
error: string;
|
|
301
|
+
};
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
reseatStageFamily(card: string, params: Record<string, unknown>, priorParams: Record<string, unknown>): {
|
|
321
|
+
params: Record<string, unknown>;
|
|
322
|
+
dropped: readonly string[];
|
|
323
|
+
} | null;
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+
|
|
244
341
|
|
|
245
342
|
|
|
246
343
|
|