@melite/estate-queue 0.2.0-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/README.md +0 -5
- package/lib/bench.js +30 -3
- package/lib/cardsCompose.d.ts +31 -0
- package/lib/cardsCompose.js +65 -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 +12 -20
- package/lib/cardsRegistry.js +288 -96
- package/lib/discloseRegistry.d.ts +5 -0
- package/lib/discloseRegistry.js +3 -3
- package/lib/filmLead.js +9 -1
- package/lib/filmMemoryWarn.js +1 -0
- package/lib/flowsData.d.ts +110 -21
- package/lib/flowsData.js +201 -23
- package/lib/flowsFamilyCompose.js +1 -0
- package/lib/flowsParamsOverlay.d.ts +8 -1
- package/lib/flowsParamsOverlay.js +47 -2
- package/lib/flowsRegistryRows.d.ts +0 -4
- package/lib/flowsRegistryRows.js +177 -371
- package/lib/index.d.ts +0 -1
- package/lib/index.js +0 -4
- package/lib/ledgerTail.js +1 -0
- package/lib/loadPlane.d.ts +46 -4
- package/lib/loadPlane.js +109 -7
- package/lib/loadRegistry.js +9 -2
- package/lib/managePlane.d.ts +5 -0
- package/lib/managePlane.js +412 -51
- package/lib/managePreflight.js +38 -6
- package/lib/manageProbe.d.ts +35 -0
- package/lib/manageProbe.js +141 -2
- 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 +22 -10
- package/lib/queueResurrect.d.ts +0 -3
- package/lib/queueResurrect.js +5 -3
- package/lib/queueRetry.d.ts +12 -10
- package/lib/queueRetry.js +2 -4
- package/lib/queueSidecar.d.ts +36 -1
- package/lib/queueSidecar.js +30 -2
- package/lib/queueSubmit.d.ts +4 -1
- package/lib/queueSubmit.js +28 -5
- package/lib/queueSweep.d.ts +38 -11
- package/lib/queueSweep.js +73 -16
- package/lib/runsChange.d.ts +5 -4
- package/lib/runsExecute.d.ts +16 -1
- package/lib/runsExecute.js +102 -50
- package/lib/runsGates.d.ts +11 -3
- package/lib/runsGates.js +12 -3
- package/lib/runsList.d.ts +59 -3
- package/lib/runsList.js +228 -36
- package/lib/runsRegistry.d.ts +87 -6
- package/lib/runsRegistry.js +664 -98
- package/lib/runsSourceEcho.js +9 -3
- package/lib/runsStart.d.ts +6 -4
- package/lib/runsStart.js +32 -25
- package/lib/runsTypes.d.ts +54 -1
- package/lib/runsTypes.js +82 -3
- package/lib/runsValidate.d.ts +1 -0
- package/lib/runsValidate.js +5 -0
- package/lib/runsValidateArms.js +48 -2
- package/lib/runsValidateServe.js +15 -12
- package/lib/runsValidateShared.d.ts +8 -10
- package/lib/runsValidateShared.js +41 -15
- package/lib/runsValidateStages.d.ts +1 -1
- package/lib/runsValidateStages.js +90 -50
- package/lib/runtimeProvision.js +10 -2
- package/lib/skillAuthored.d.ts +50 -0
- package/lib/skillAuthored.js +178 -0
- package/lib/skillFs.js +3 -0
- package/lib/skillPlane.d.ts +40 -2
- package/lib/skillPlane.js +63 -13
- package/lib/skillRegistry.d.ts +24 -1
- package/lib/skillRegistry.js +69 -5
- package/lib/skillRows.d.ts +13 -3
- package/lib/skillRows.js +52 -9
- package/lib/vocab.d.ts +29 -0
- package/lib/vocab.js +78 -0
- package/package.json +24 -14
- package/lib/resurrect.d.ts +0 -6
- package/lib/resurrect.js +0 -18
package/lib/cardsRegistry.js
CHANGED
|
@@ -80,12 +80,12 @@ import { readFileSync, statSync } from "node:fs";
|
|
|
80
80
|
* imported through the engine's public surface like every other
|
|
81
81
|
* engine dep. No deep path, no runtime-only dodge. */
|
|
82
82
|
import { bootModels, cardDefsNow, ComposeRefusal, getModel, liveScanOrder, loadCardDefs, loadFacts, owningAtom, registryIds, registryModel, resolveCardFlowOutputs, resolveRepoRoot, theService } from "@melite/comfyui-cordis";
|
|
83
|
+
import { foldLegacyAliases } from '@melite/comfyui-card-kit';
|
|
83
84
|
import { probeMedia } from '@melite/contracts/media-probe';
|
|
84
|
-
import {
|
|
85
|
+
import { resolveSourceRefs } from "./runsSourceEcho.js";
|
|
85
86
|
import { CardArmError, EnvelopeRefusal, phaseRefusalCode } from "./cardsArmError.js";
|
|
86
87
|
export { CardArmError } from "./cardsArmError.js";
|
|
87
|
-
import { cardAdmits, factsPath, deriveDecls, familyLanesOf } from "./cardsFacts.js";
|
|
88
|
-
import { WIRE_STAGE_KEYS } from "@melite/contracts/benchStage";
|
|
88
|
+
import { cardAdmits, factsPath, deriveDecls, familyLanesOf, liftStageReservedForAdmission } from "./cardsFacts.js";
|
|
89
89
|
import { reseatDeadKeys } from "@melite/contracts/familyLane";
|
|
90
90
|
import { dropAuthoringIncomplete, isUnstatedRequiredVoice, judgeDeliverableSize, judgeLaneBounds, judgeLaneRelations, judgeLaneSurface, laneBoundsOf, laneStaleCarry, laneSurfaceOf, laneTogetherClosure, RELATION_WORDS } from "@melite/contracts/laneRelations";
|
|
91
91
|
import { lanePresenceRefusal } from "./cardsLanes.js";
|
|
@@ -95,72 +95,13 @@ import { selectCardVariant, liftCardParams } from "./cardsVariant.js";
|
|
|
95
95
|
export { selectCardVariant, stampCardOverlay, liftCardParams } from "./cardsVariant.js";
|
|
96
96
|
import { deriveWiringDoc, liveObjectInfo, resolveEngineBaseUrl } from "@melite/comfyui-cordis";
|
|
97
97
|
import { admissionRefusal, composeOnce, liftStanza, prepareCardParams } from "./cardsCompose.js";
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
export const CARD_ENVELOPE_KEYS = [
|
|
116
|
-
...DOOR_KEYS,
|
|
117
|
-
// …every wire coordinate EXCEPT `params` — and the exception is the
|
|
118
|
-
// load-bearing one. `params` is the row's knob CONTAINER: the run
|
|
119
|
-
// body's `{model, params:{…}}` stanza is what liftCardParams
|
|
120
|
-
// unwraps (the stanza law, benchStage's own), and filtering the
|
|
121
|
-
// container BEFORE that unwrap would drop every knob a caller sent
|
|
122
|
-
// — the first cut of this list did exactly that and turned every
|
|
123
|
-
// run into "this lane requires 'prompt'". A coordinate selects the
|
|
124
|
-
// graph; the knobs ride inside `params`, never as a key of it.
|
|
125
|
-
...WIRE_STAGE_KEYS.filter((k) => k !== "params"),
|
|
126
|
-
"draft_id",
|
|
127
|
-
"test",
|
|
128
|
-
"service",
|
|
129
|
-
// press_key is the submit door's retry-dedup coordinate
|
|
130
|
-
// (queueSubmit names ONE press across retries) — door
|
|
131
|
-
// vocabulary, never a card knob. It rode unregistered and the
|
|
132
|
-
// live Run press refused "unknown param(s) … press_key" while
|
|
133
|
-
// the whole suite stayed green (the contract-depth red,
|
|
134
|
-
|
|
135
|
-
"press_key",
|
|
136
|
-
// bench_stage_id is the SINGLE-CARD press's bench identity (the
|
|
137
|
-
|
|
138
|
-
// vocabulary — the card never sees it as a knob, and the composed
|
|
139
|
-
// stage stamps it (runsRegistry's card arm) so the run sidecar's
|
|
140
|
-
// digest names the row the operator pressed, which is what the
|
|
141
|
-
// bench read's `last_run` binds to. Unregistered, it would land in
|
|
142
|
-
// every card's params as an unknown knob and refuse the press.
|
|
143
|
-
"bench_stage_id",
|
|
144
|
-
// seeds is the submit door's seed-sweep coordinate (friction #9,
|
|
145
|
-
|
|
146
|
-
// door vocabulary consumed before any card composes, never a card
|
|
147
|
-
// knob. The per-run body carries the SEAT's `seed` (a real knob,
|
|
148
|
-
// deliberately NOT on this list — liftCardParams must carry it
|
|
149
|
-
// into the card's params); the sweep key itself rides the envelope.
|
|
150
|
-
"seeds",
|
|
151
|
-
// the bench row's own non-wire coordinates (benchStage's stage row
|
|
152
|
-
// carries these beside the wire keys; they select, they never ride)
|
|
153
|
-
"author",
|
|
154
|
-
"rev",
|
|
155
|
-
"stage",
|
|
156
|
-
"title",
|
|
157
|
-
"inputOutputs",
|
|
158
|
-
"result",
|
|
159
|
-
"runStatus",
|
|
160
|
-
"expect_rev",
|
|
161
|
-
"provenance",
|
|
162
|
-
"capability",
|
|
163
|
-
];
|
|
98
|
+
/** The card-envelope keys: SELECT the graph, never ride it —
|
|
99
|
+
* re-exported from the vocabulary's own home (vocab.ts) so the
|
|
100
|
+
* compose door and the graph receipt's scope gate read the ONE
|
|
101
|
+
* list (D-11: envelope keys are never knobs; the receipt never
|
|
102
|
+
* judges them). The list's derivation law and its reasons live
|
|
103
|
+
* beside the list. */
|
|
104
|
+
export { CARD_ENVELOPE_KEYS } from "./vocab.js";
|
|
164
105
|
/** The card-lane refusal: status + the _refusal envelope shape
|
|
165
106
|
* (error, code, then loc/expected/got) — the door maps it through
|
|
166
107
|
* the local refusal path. */
|
|
@@ -285,6 +226,7 @@ function stampClipGeometry(body, admits) {
|
|
|
285
226
|
bytes = new Uint8Array(readFileSync(abs));
|
|
286
227
|
}
|
|
287
228
|
catch {
|
|
229
|
+
// a missing or unreadable clip file throws at the stat/read — no bytes means no geometry stamp, never a refusal (the engine's follow-the-clip contract is the belt)
|
|
288
230
|
return;
|
|
289
231
|
}
|
|
290
232
|
let probed;
|
|
@@ -292,6 +234,7 @@ function stampClipGeometry(body, admits) {
|
|
|
292
234
|
probed = probeMedia(bytes);
|
|
293
235
|
}
|
|
294
236
|
catch {
|
|
237
|
+
// an unreadable or unrecognized container throws in the probe — the stamp skips and the engine's follow-the-clip contract is the belt
|
|
295
238
|
return;
|
|
296
239
|
}
|
|
297
240
|
const stream = probed.streams.find((s) => s.width !== undefined && s.height !== undefined);
|
|
@@ -306,8 +249,20 @@ function stampClipGeometry(body, admits) {
|
|
|
306
249
|
* soundtrack (each composes a VHS [frames, audio] load and feeds
|
|
307
250
|
* the sound VAE — replace swaps the cast, repair cleans it, extend
|
|
308
251
|
* continues it, refine upscales it; the reshoot bag is absent on
|
|
309
|
-
* purpose, its card states the soundtrack does not carry over).
|
|
310
|
-
|
|
252
|
+
* purpose, its card states the soundtrack does not carry over).
|
|
253
|
+
* THE COLLAPSE: `edit` is the live door and its masked lanes carry
|
|
254
|
+
* the source soundtrack too; the five legacy spellings stay listed
|
|
255
|
+
* because a pre-collapse doc still arms them (each resolves to the
|
|
256
|
+
* same edit cell). The upscale posture is absent like the old
|
|
257
|
+
* upscale bag: it resumes a prior run, never the source's sound. */
|
|
258
|
+
const H3_SOUND_CARRYING_BAGS = ["replace", "repair", "extend", "refine", "edit"];
|
|
259
|
+
/** An edit entry stating a chain_run composes the upscale posture
|
|
260
|
+
* (the prior run's checkpointed scenes resumed) and reads no source
|
|
261
|
+
* clip; the belt never speaks for it. */
|
|
262
|
+
function resumesPriorRun(entry) {
|
|
263
|
+
const chain = entry["chain_run"];
|
|
264
|
+
return typeof chain === "string" && chain.trim() !== "";
|
|
265
|
+
}
|
|
311
266
|
/** Resolve a bag source to a readable file: absolute, repo-relative
|
|
312
267
|
* (the compose's own staged-leaf posture), else the estate input
|
|
313
268
|
* index by basename. */
|
|
@@ -334,6 +289,31 @@ function bagSourceBytes(leaf) {
|
|
|
334
289
|
}
|
|
335
290
|
return null;
|
|
336
291
|
}
|
|
292
|
+
/** Resolve a probe source through the estate's OWN roots first (the
|
|
293
|
+
* runs trees a prior stage's render left behind — runsSourceEcho's
|
|
294
|
+
* resolver, the run door's own vocabulary: run-tails land in
|
|
295
|
+
* `<root>/output/<runId>/<rel>`, absolutes verbatim), then the
|
|
296
|
+
* compose spellings. A produced clip is the bench's actual posture
|
|
297
|
+
* (the rev-122 burn's 7.5 s film): the three compose candidates
|
|
298
|
+
* never saw it, and the window probes silently went deaf. A source
|
|
299
|
+
* that resolves nowhere answers null — the belt, never an invented
|
|
300
|
+
* refusal. */
|
|
301
|
+
function bagSourceBytesViaRoots(leaf, roots) {
|
|
302
|
+
try {
|
|
303
|
+
for (const row of resolveSourceRefs([leaf], roots)) {
|
|
304
|
+
const st = statSync(row.file);
|
|
305
|
+
if (!st.isFile())
|
|
306
|
+
continue;
|
|
307
|
+
return new Uint8Array(readFileSync(row.file));
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
catch {
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
}
|
|
315
|
+
return bagSourceBytes(leaf);
|
|
316
|
+
}
|
|
337
317
|
|
|
338
318
|
|
|
339
319
|
|
|
@@ -352,7 +332,10 @@ function refuseSilentSource(card, params) {
|
|
|
352
332
|
for (const entry of bag) {
|
|
353
333
|
if (entry === null || typeof entry !== "object" || Array.isArray(entry))
|
|
354
334
|
continue;
|
|
355
|
-
const
|
|
335
|
+
const row = entry;
|
|
336
|
+
if (lane === "edit" && resumesPriorRun(row))
|
|
337
|
+
continue;
|
|
338
|
+
const leaf = row["source_clip"];
|
|
356
339
|
if (typeof leaf !== "string" || leaf.trim() === "")
|
|
357
340
|
continue;
|
|
358
341
|
const bytes = bagSourceBytes(leaf.trim());
|
|
@@ -361,6 +344,7 @@ function refuseSilentSource(card, params) {
|
|
|
361
344
|
let probed;
|
|
362
345
|
try {
|
|
363
346
|
probed = probeMedia(bytes);
|
|
347
|
+
// a container the probe cannot read throws — without a positive no-audio reading this door never refuses, and the engine's own belt owns the clip
|
|
364
348
|
}
|
|
365
349
|
catch {
|
|
366
350
|
continue;
|
|
@@ -373,6 +357,171 @@ function refuseSilentSource(card, params) {
|
|
|
373
357
|
}
|
|
374
358
|
}
|
|
375
359
|
}
|
|
360
|
+
|
|
361
|
+
|
|
362
|
+
|
|
363
|
+
|
|
364
|
+
|
|
365
|
+
|
|
366
|
+
|
|
367
|
+
|
|
368
|
+
|
|
369
|
+
|
|
370
|
+
|
|
371
|
+
|
|
372
|
+
|
|
373
|
+
|
|
374
|
+
function stampH3SourceFrames(card, params, roots) {
|
|
375
|
+
if (card !== "h3-timeline")
|
|
376
|
+
return;
|
|
377
|
+
for (const lane of H3_SOUND_CARRYING_BAGS) {
|
|
378
|
+
const bag = params[lane];
|
|
379
|
+
if (!Array.isArray(bag) || bag.length === 0)
|
|
380
|
+
continue;
|
|
381
|
+
let cloned = null;
|
|
382
|
+
for (let i = 0; i < bag.length; i++) {
|
|
383
|
+
const row = bag[i];
|
|
384
|
+
if (row === null || typeof row !== "object" || Array.isArray(row))
|
|
385
|
+
continue;
|
|
386
|
+
const rec = row;
|
|
387
|
+
if (resumesPriorRun(rec))
|
|
388
|
+
continue;
|
|
389
|
+
const leaf = typeof rec["source_clip"] === "string" ? rec["source_clip"].trim() : "";
|
|
390
|
+
if (leaf === "")
|
|
391
|
+
continue;
|
|
392
|
+
const frames = probeSourceFrames(leaf, roots);
|
|
393
|
+
if (frames === null)
|
|
394
|
+
continue;
|
|
395
|
+
if (cloned === null)
|
|
396
|
+
cloned = bag.slice();
|
|
397
|
+
cloned[i] = { ...rec, __source_frames: frames };
|
|
398
|
+
}
|
|
399
|
+
if (cloned !== null)
|
|
400
|
+
params[lane] = cloned;
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
/** Probe a bag source's true frame count at the film clock: the
|
|
404
|
+
* video stream's stts sample count, else duration × 24 (the F36
|
|
405
|
+
* refusal's own spelling). Null = unresolvable or unreadable —
|
|
406
|
+
* never an invented length. */
|
|
407
|
+
function probeSourceFrames(leaf, roots) {
|
|
408
|
+
const bytes = bagSourceBytesViaRoots(leaf, roots);
|
|
409
|
+
if (bytes === null)
|
|
410
|
+
return null;
|
|
411
|
+
let probed;
|
|
412
|
+
try {
|
|
413
|
+
probed = probeMedia(bytes);
|
|
414
|
+
// an unreadable source throws in the probe — frames stay null and the caller stamps nothing rather than an invented length
|
|
415
|
+
}
|
|
416
|
+
catch {
|
|
417
|
+
return null;
|
|
418
|
+
}
|
|
419
|
+
const video = probed.streams.find((stream) => stream.codec_type === "video");
|
|
420
|
+
const frames = video?.frames ?? (probed.duration_s !== undefined ? Math.round(probed.duration_s * 24) : undefined);
|
|
421
|
+
if (frames === undefined || frames <= 0)
|
|
422
|
+
return null;
|
|
423
|
+
return frames;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
|
|
427
|
+
|
|
428
|
+
|
|
429
|
+
|
|
430
|
+
|
|
431
|
+
|
|
432
|
+
|
|
433
|
+
|
|
434
|
+
|
|
435
|
+
function refuseRefineWindowPastClip(card, params, roots) {
|
|
436
|
+
if (card !== "h3-timeline")
|
|
437
|
+
return;
|
|
438
|
+
const bag = params["refine"];
|
|
439
|
+
if (!Array.isArray(bag))
|
|
440
|
+
return;
|
|
441
|
+
for (const entry of bag) {
|
|
442
|
+
if (entry === null || typeof entry !== "object" || Array.isArray(entry))
|
|
443
|
+
continue;
|
|
444
|
+
const rec = entry;
|
|
445
|
+
const leaf = typeof rec["source_clip"] === "string" ? rec["source_clip"].trim() : "";
|
|
446
|
+
if (leaf === "")
|
|
447
|
+
continue;
|
|
448
|
+
const rawStart = rec["start_seconds"];
|
|
449
|
+
const start = typeof rawStart === "number" && Number.isFinite(rawStart) ? rawStart : 0;
|
|
450
|
+
if (!(start > 0))
|
|
451
|
+
continue;
|
|
452
|
+
const bytes = bagSourceBytesViaRoots(leaf, roots);
|
|
453
|
+
if (bytes === null)
|
|
454
|
+
continue;
|
|
455
|
+
let probed;
|
|
456
|
+
try {
|
|
457
|
+
probed = probeMedia(bytes);
|
|
458
|
+
// a clip the probe cannot read throws — no positive frame count means this door never refuses, and the engine's own belt keeps the clip
|
|
459
|
+
}
|
|
460
|
+
catch {
|
|
461
|
+
continue;
|
|
462
|
+
}
|
|
463
|
+
const video = probed.streams.find((stream) => stream.codec_type === "video");
|
|
464
|
+
const frames = video?.frames ?? (probed.duration_s !== undefined ? Math.round(probed.duration_s * 24) : undefined);
|
|
465
|
+
if (frames === undefined || frames <= 0)
|
|
466
|
+
continue;
|
|
467
|
+
const skip = Math.round(start * 24);
|
|
468
|
+
if (skip < frames)
|
|
469
|
+
continue;
|
|
470
|
+
const clipEndS = (frames / 24).toFixed(2);
|
|
471
|
+
throw new CardArmError(400, `the refine window starts at ${start}s (skip ${skip} frames at the film clock) but "${leaf}" carries ` +
|
|
472
|
+
`${frames} frame(s)${probed.duration_s !== undefined ? ` (${probed.duration_s}s)` : ""} — the loader's ` +
|
|
473
|
+
`skip_first_frames runs past the clip's end and the engine dies in the buffer arithmetic; start the ` +
|
|
474
|
+
`window inside the clip (start_seconds < ${clipEndS}s) or refine the longer source`, "invalid_request");
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
|
|
479
|
+
|
|
480
|
+
|
|
481
|
+
|
|
482
|
+
|
|
483
|
+
|
|
484
|
+
|
|
485
|
+
|
|
486
|
+
|
|
487
|
+
|
|
488
|
+
|
|
489
|
+
|
|
490
|
+
|
|
491
|
+
function refuseTrimStartPastClip(card, params, roots) {
|
|
492
|
+
if (card !== "trim")
|
|
493
|
+
return;
|
|
494
|
+
const leaf = typeof params["clip"] === "string" ? params["clip"].trim() : "";
|
|
495
|
+
if (leaf === "")
|
|
496
|
+
return;
|
|
497
|
+
const rawStart = params["start_seconds"];
|
|
498
|
+
const start = typeof rawStart === "number" && Number.isFinite(rawStart) ? rawStart : 0;
|
|
499
|
+
if (!(start > 0))
|
|
500
|
+
return;
|
|
501
|
+
const bytes = bagSourceBytesViaRoots(leaf, roots);
|
|
502
|
+
if (bytes === null)
|
|
503
|
+
return;
|
|
504
|
+
let probed;
|
|
505
|
+
try {
|
|
506
|
+
probed = probeMedia(bytes);
|
|
507
|
+
// a clip the probe cannot read throws — no positive frame count means this door never refuses, and the engine's own belt keeps the clip
|
|
508
|
+
}
|
|
509
|
+
catch {
|
|
510
|
+
return;
|
|
511
|
+
}
|
|
512
|
+
const video = probed.streams.find((stream) => stream.codec_type === "video");
|
|
513
|
+
const frames = video?.frames ?? (probed.duration_s !== undefined ? Math.round(probed.duration_s * 24) : undefined);
|
|
514
|
+
if (frames === undefined || frames <= 0)
|
|
515
|
+
return;
|
|
516
|
+
const skip = Math.round(start * 24);
|
|
517
|
+
if (skip < frames)
|
|
518
|
+
return;
|
|
519
|
+
const clipEndS = (frames / 24).toFixed(2);
|
|
520
|
+
throw new CardArmError(400, `the trim window starts at ${start}s (skip ${skip} frames at the trim card's 24 fps) but "${leaf}" carries ` +
|
|
521
|
+
`${frames} frame(s)${probed.duration_s !== undefined ? ` (${probed.duration_s}s)` : ""} — the loader's ` +
|
|
522
|
+
`skip_first_frames runs past the clip's last frame and the run composes an empty clip; trim inside the ` +
|
|
523
|
+
`clip (start_seconds < ${clipEndS}s) — end_seconds beyond the last frame stays the loader's own clamp`, "invalid_request");
|
|
524
|
+
}
|
|
376
525
|
/** The card-scope seat for the clip-geometry stamp: resolves the
|
|
377
526
|
* card the run addresses — the family route's famRow.card, or the
|
|
378
527
|
* familyless id itself — mirroring prepareCardParams's two arms,
|
|
@@ -480,6 +629,11 @@ function familyLawOfCard(def) {
|
|
|
480
629
|
|
|
481
630
|
|
|
482
631
|
|
|
632
|
+
|
|
633
|
+
|
|
634
|
+
|
|
635
|
+
|
|
636
|
+
|
|
483
637
|
export function familyLawDrift(laws) {
|
|
484
638
|
const drift = [];
|
|
485
639
|
for (const [family, law] of laws) {
|
|
@@ -489,6 +643,11 @@ export function familyLawDrift(laws) {
|
|
|
489
643
|
const orphan = Object.keys(law.deadKeys).filter((l) => !lanes.has(l));
|
|
490
644
|
if (orphan.length > 0)
|
|
491
645
|
drift.push(`${family}: deadKeys names undeclared lanes ${JSON.stringify(orphan)}`);
|
|
646
|
+
for (const [lane, keys] of Object.entries(law.deadKeys)) {
|
|
647
|
+
if (lanes.has(lane) && keys.length > 0) {
|
|
648
|
+
drift.push(`${family}: lane ${lane} declares dead keys ${JSON.stringify(keys)} — no lane dead letter may ship (cure the renderer or gate the shape)`);
|
|
649
|
+
}
|
|
650
|
+
}
|
|
492
651
|
}
|
|
493
652
|
return drift;
|
|
494
653
|
}
|
|
@@ -1062,9 +1221,24 @@ export class CardRegistryService extends Service {
|
|
|
1062
1221
|
|
|
1063
1222
|
|
|
1064
1223
|
admitStageRelations(card, params) {
|
|
1224
|
+
// THE STAGE-RESERVED LIFT AT THE WRITE DOOR (the F41 re-press
|
|
1225
|
+
|
|
1226
|
+
// the STAGE row, never the card surface — this door judged them
|
|
1227
|
+
// as undeclared card params and refused, so a knob the run
|
|
1228
|
+
// compose lifts (runsRegistry THE STAGE-RESERVED CARRY) could be
|
|
1229
|
+
// composed but never AUTHORED: every bench write door (add,
|
|
1230
|
+
// add-stages, patch, load) funnels here, and the live trellis
|
|
1231
|
+
// re-press died at each with the unknown-param refusal. The same
|
|
1232
|
+
// shared predicate the run carry rides (cardsFacts
|
|
1233
|
+
// liftStageReservedForAdmission / stageReservedKeyLifts) lifts
|
|
1234
|
+
// the policy keys out of the judged view — the STORED row keeps
|
|
1235
|
+
// its bag verbatim (the store is its truth home; only the judged
|
|
1236
|
+
// copy sheds them), and a declared reserved key (a card's own
|
|
1237
|
+
// output_name) stays judged.
|
|
1238
|
+
const judged = liftStageReservedForAdmission(this.cardDecls()[card], params);
|
|
1065
1239
|
// THE WRITE DOOR'S OWN CALL passes admitIncomplete — the ONLY
|
|
1066
1240
|
// seat that admits an unstated required word (the law above).
|
|
1067
|
-
const verdict = this.laneVerdict(card,
|
|
1241
|
+
const verdict = this.laneVerdict(card, judged, true);
|
|
1068
1242
|
return verdict === null ? { ok: true } : { ok: false, error: verdict };
|
|
1069
1243
|
}
|
|
1070
1244
|
|
|
@@ -1082,8 +1256,6 @@ export class CardRegistryService extends Service {
|
|
|
1082
1256
|
|
|
1083
1257
|
|
|
1084
1258
|
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
1259
|
admitStageFamily(card, params) {
|
|
1088
1260
|
const def = this.defsSync().get(card);
|
|
1089
1261
|
if (def === undefined || def.admitFamily === undefined)
|
|
@@ -1280,7 +1452,9 @@ export class CardRegistryService extends Service {
|
|
|
1280
1452
|
// truth has no live rows) — the null arm is the lane judge's
|
|
1281
1453
|
// own "declares nothing, judges nothing", exercised with
|
|
1282
1454
|
// literal sets at laneStaleCarry's wall.
|
|
1283
|
-
/* v8 ignore next
|
|
1455
|
+
/* v8 ignore next -- no live facts row ships surface: null;
|
|
1456
|
+
the arm is wallable only through laneStaleCarry's literal
|
|
1457
|
+
sets, which v8 does not count into this file's coverage. */
|
|
1284
1458
|
if (surface === null)
|
|
1285
1459
|
return null;
|
|
1286
1460
|
const taken = new Set(surface);
|
|
@@ -1582,26 +1756,13 @@ export class CardRegistryService extends Service {
|
|
|
1582
1756
|
// write seat, in the same voice the run door speaks.
|
|
1583
1757
|
if (e instanceof EnvelopeRefusal)
|
|
1584
1758
|
return { message: e.message, incomplete: false };
|
|
1759
|
+
// THE EMPTY-SELECTION LAW lives FIRST-CLASS above the prepare
|
|
1585
1760
|
|
|
1586
|
-
//
|
|
1587
|
-
//
|
|
1588
|
-
|
|
1589
|
-
//
|
|
1590
|
-
//
|
|
1591
|
-
// false admit the parity law forbids (the envelope GAP-1
|
|
1592
|
-
// shape, one axis over). Refuse HERE, in the run door's own
|
|
1593
|
-
// voice — one spelling, both seats. A stated WRONG selection
|
|
1594
|
-
// still passes (the tolerance below: repairable, the run
|
|
1595
|
-
// names it); an ABSENT one still passes (compose defaults
|
|
1596
|
-
// it). The form's own half of the law: seedAxisValues omits
|
|
1597
|
-
// an empty axis key (card-base/src/spec.ts) so the GUI never
|
|
1598
|
-
// authors the empty string in the first place.
|
|
1599
|
-
if (e instanceof CardArmError &&
|
|
1600
|
-
(params["variant"] === "" || params["quant"] === "" || params["model"] === "")) {
|
|
1601
|
-
return { message: e.message, incomplete: false };
|
|
1602
|
-
}
|
|
1603
|
-
// selection/dangling failures keep the run door's voice —
|
|
1604
|
-
// this seat judges only the DECL's own words
|
|
1761
|
+
// variant/quant/model never reaches this catch — the loop
|
|
1762
|
+
// refuses it before prepare runs, so the conversion arm this
|
|
1763
|
+
|
|
1764
|
+
// WRONG selection keeps the run door's voice — this seat
|
|
1765
|
+
// judges only the DECL's own words.
|
|
1605
1766
|
return null;
|
|
1606
1767
|
}
|
|
1607
1768
|
// THE UNDECLARED-KEY GATE, family side (a key no card declares
|
|
@@ -1829,7 +1990,20 @@ export class CardRegistryService extends Service {
|
|
|
1829
1990
|
if (typeof mid !== "string" || mid === "")
|
|
1830
1991
|
return null;
|
|
1831
1992
|
try {
|
|
1832
|
-
|
|
1993
|
+
const prep = prepareCardParams(this, body, mid, "serve");
|
|
1994
|
+
|
|
1995
|
+
// user have different input parameters"): the compose lanes
|
|
1996
|
+
// merge a card's legacyAliases engine-side, so a row carrying
|
|
1997
|
+
// image1/image_name RUNS with the image — but serving the
|
|
1998
|
+
// params verbatim left the canonical seat (input_images /
|
|
1999
|
+
// image) EMPTY on the drill's form and the user stared at a
|
|
2000
|
+
// BLANK input for an image the agent had attached. The serve
|
|
2001
|
+
// is the 1:1 law (the map the NEXT RUN composes): the same
|
|
2002
|
+
// fold the lane performs, served — one spelling on every
|
|
2003
|
+
// face, the stored doc untouched.
|
|
2004
|
+
const kinds = this.defsSync().get(prep.card)?.flowKinds;
|
|
2005
|
+
return foldLegacyAliases(kinds, prep.params);
|
|
2006
|
+
// an unservable body throws CardArmError from prepareCardParams — null lets the stage ride un-resolved (the serve is display-only) and the run door owns the refusal
|
|
1833
2007
|
}
|
|
1834
2008
|
catch {
|
|
1835
2009
|
return null;
|
|
@@ -2026,6 +2200,24 @@ export class CardRegistryService extends Service {
|
|
|
2026
2200
|
// and the file named (the run door's own envelope walk, so the
|
|
2027
2201
|
// validate seat hears the same sentence).
|
|
2028
2202
|
refuseSilentSource(prep.card, prep.params);
|
|
2203
|
+
// THE PROBED-LENGTH STAMP (defect board D-5): the same walk's
|
|
2204
|
+
// positive face — a locally readable source's TRUE frame count
|
|
2205
|
+
// rides the compose copy so the render judges the film, never
|
|
2206
|
+
// the blind clip_seconds plan slice (the 56 f clip's refine 2x
|
|
2207
|
+
// press refused "a 144 f window" before this stamp).
|
|
2208
|
+
stampH3SourceFrames(prep.card, prep.params, this.stateRoots());
|
|
2209
|
+
// THE REFINE WINDOW RANGE REFUSAL (F36): a window whose
|
|
2210
|
+
// start_seconds runs past its own source clip refuses here,
|
|
2211
|
+
// zero GPU, with the clip and the probed length named. The
|
|
2212
|
+
// source resolves through the estate's own roots first — a
|
|
2213
|
+
// produced clip (a prior stage's output) is a real posture,
|
|
2214
|
+
// not a probe deaf spot (F3-08).
|
|
2215
|
+
refuseRefineWindowPastClip(prep.card, prep.params, this.stateRoots());
|
|
2216
|
+
// THE TRIM START RANGE REFUSAL (F3-08): a trim whose start lands
|
|
2217
|
+
// past the source's last frame refuses here too — same belt,
|
|
2218
|
+
// zero GPU, the trim card's own 24 fps contract, the same
|
|
2219
|
+
// estate-roots resolution.
|
|
2220
|
+
refuseTrimStartPastClip(prep.card, prep.params, this.stateRoots());
|
|
2029
2221
|
// THE BOARD CHECK RIDES THE RUN SEAT TOO (the behavioural
|
|
2030
2222
|
// re-check's BYPASS 1: the bench refused an unoffered model
|
|
2031
2223
|
// address, but `validate` with the SAME address composed the
|
|
@@ -25,6 +25,11 @@ export interface FlowSummary {
|
|
|
25
25
|
readonly description: string;
|
|
26
26
|
readonly stages: number;
|
|
27
27
|
readonly skillRefs: readonly string[];
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
readonly initials: readonly string[];
|
|
28
33
|
}
|
|
29
34
|
/** The search surface a card def offers (the def itself satisfies
|
|
30
35
|
* this — structural, no import of the engine service). boarded is
|
package/lib/discloseRegistry.js
CHANGED
|
@@ -20,7 +20,7 @@ import { readFileSync } from "node:fs";
|
|
|
20
20
|
import { join } from "node:path";
|
|
21
21
|
import { Service } from "@deepseek-ai/cordis";
|
|
22
22
|
import { resolveRepoRoot } from "@melite/comfyui-cordis";
|
|
23
|
-
import { seedFlowsSeat } from "./flowsData.js";
|
|
23
|
+
import { flowInitialKeys, seedFlowsSeat } from "./flowsData.js";
|
|
24
24
|
/** The words a user sentence carries but no card owns — articles,
|
|
25
25
|
* pronouns, auxiliaries and request verbs. Ignored for scoring (the
|
|
26
26
|
* full-sentence miss was the transcript's first call: "Make an image
|
|
@@ -41,7 +41,7 @@ const MODALITY_WORDS = {
|
|
|
41
41
|
animation: "video", animate: "video", film: "video",
|
|
42
42
|
audio: "audio", sound: "audio", sounds: "audio", music: "audio", voice: "audio",
|
|
43
43
|
speech: "audio", talk: "audio", talking: "audio",
|
|
44
|
-
mesh: "mesh", "3d": "mesh",
|
|
44
|
+
mesh: "mesh", "3d": "mesh",
|
|
45
45
|
};
|
|
46
46
|
/** Request verbs → the OPERATION tag they mean. A card declares its
|
|
47
47
|
* operations in tags (generate/edit/upscale); the user's verb is the
|
|
@@ -184,7 +184,7 @@ export function flowSummaryRows(repo, flowsSeat) {
|
|
|
184
184
|
catch {
|
|
185
185
|
// no leaf — the registry row stands alone
|
|
186
186
|
}
|
|
187
|
-
out.push({ name, title, description: flow.description, stages: flow.stages.length, skillRefs: flow.skillRefs });
|
|
187
|
+
out.push({ name, title, description: flow.description, stages: flow.stages.length, skillRefs: flow.skillRefs, initials: flowInitialKeys(flow) });
|
|
188
188
|
}
|
|
189
189
|
return out;
|
|
190
190
|
}
|
package/lib/filmLead.js
CHANGED
|
@@ -10,7 +10,15 @@
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
const ENGINE_FILM_RE = /(?:^|[/_])h3_t4_film(?:_[a-z0-9][a-z0-9-]*)?_\d+_\.mp4$/;
|
|
14
22
|
/** The engine-composed film's name among a stage's artifacts, if
|
|
15
23
|
* any — presentation order only, never composition. */
|
|
16
24
|
export function engineFilmName(names) {
|
package/lib/filmMemoryWarn.js
CHANGED
|
@@ -88,6 +88,7 @@ export async function fetchEngineMem(baseUrl, fetchFn = globalThis.fetch, timeou
|
|
|
88
88
|
if (typeof free !== 'number' || typeof total !== 'number')
|
|
89
89
|
return null;
|
|
90
90
|
return { vramFree: free, vramTotal: total };
|
|
91
|
+
// an unreachable engine or an unparseable stats body has no reading — null is the caller's documented skip
|
|
91
92
|
}
|
|
92
93
|
catch {
|
|
93
94
|
return null;
|