@melite/estate-queue 0.2.0-alpha → 0.2.2-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.
Files changed (61) hide show
  1. package/README.md +0 -5
  2. package/lib/cardsCompose.d.ts +31 -0
  3. package/lib/cardsCompose.js +55 -0
  4. package/lib/cardsRegistry.d.ts +5 -2
  5. package/lib/cardsRegistry.js +160 -3
  6. package/lib/discloseRegistry.d.ts +5 -0
  7. package/lib/discloseRegistry.js +3 -3
  8. package/lib/flowsData.d.ts +77 -21
  9. package/lib/flowsData.js +156 -21
  10. package/lib/flowsRegistryRows.d.ts +0 -4
  11. package/lib/flowsRegistryRows.js +137 -351
  12. package/lib/index.d.ts +0 -1
  13. package/lib/index.js +0 -4
  14. package/lib/loadPlane.d.ts +46 -4
  15. package/lib/loadPlane.js +107 -7
  16. package/lib/loadRegistry.js +9 -2
  17. package/lib/managePlane.d.ts +5 -0
  18. package/lib/managePlane.js +404 -49
  19. package/lib/managePreflight.js +38 -6
  20. package/lib/manageProbe.d.ts +35 -0
  21. package/lib/manageProbe.js +110 -0
  22. package/lib/queueLock.js +19 -10
  23. package/lib/queueResurrect.d.ts +0 -3
  24. package/lib/queueResurrect.js +0 -3
  25. package/lib/queueRetry.d.ts +12 -10
  26. package/lib/queueRetry.js +2 -4
  27. package/lib/queueSidecar.d.ts +12 -0
  28. package/lib/queueSidecar.js +15 -0
  29. package/lib/queueSubmit.d.ts +4 -1
  30. package/lib/queueSubmit.js +28 -5
  31. package/lib/runsExecute.d.ts +16 -1
  32. package/lib/runsExecute.js +63 -45
  33. package/lib/runsGates.d.ts +11 -3
  34. package/lib/runsGates.js +11 -3
  35. package/lib/runsList.d.ts +59 -3
  36. package/lib/runsList.js +217 -36
  37. package/lib/runsRegistry.d.ts +58 -3
  38. package/lib/runsRegistry.js +479 -92
  39. package/lib/runsStart.d.ts +6 -4
  40. package/lib/runsStart.js +32 -25
  41. package/lib/runsTypes.d.ts +19 -1
  42. package/lib/runsTypes.js +40 -3
  43. package/lib/runsValidate.d.ts +1 -0
  44. package/lib/runsValidate.js +5 -0
  45. package/lib/runsValidateArms.js +25 -0
  46. package/lib/runsValidateServe.js +15 -12
  47. package/lib/runsValidateShared.d.ts +8 -10
  48. package/lib/runsValidateShared.js +41 -15
  49. package/lib/runsValidateStages.d.ts +1 -1
  50. package/lib/runsValidateStages.js +90 -50
  51. package/lib/skillAuthored.d.ts +50 -0
  52. package/lib/skillAuthored.js +178 -0
  53. package/lib/skillPlane.d.ts +40 -2
  54. package/lib/skillPlane.js +63 -13
  55. package/lib/skillRegistry.d.ts +24 -1
  56. package/lib/skillRegistry.js +69 -5
  57. package/lib/skillRows.d.ts +13 -3
  58. package/lib/skillRows.js +42 -3
  59. package/package.json +24 -14
  60. package/lib/resurrect.d.ts +0 -6
  61. package/lib/resurrect.js +0 -18
@@ -46,10 +46,12 @@ export interface CompiledStage {
46
46
  readonly expected: Record<string, EngineJson>;
47
47
  readonly outputNodes: Record<string, EngineJson>;
48
48
  readonly inputNames: Record<string, string>;
49
- /** The stage DECLARED its outputs map (false = the engine-table
50
- * fill supplied {default: ...}). The replay judge judges only
51
- * fully-declared docs — a filled row's real channels live in the
52
- * card plane (validate + the compose own those verdicts). */
49
+ /** The stage DECLARED its outputs (true = the outputs map or the
50
+ * cardIo table rode the doc — both are the doc's own tables, so
51
+ * the replay judge can read the channels. False = a fill supplied
52
+ * them from outside the doc (pre-one-table docs, whose engine-fill
53
+ * {default: ...} channels live nowhere the doc names). The replay
54
+ * judge judges only fully-declared docs. */
53
55
  readonly outputsDeclared: boolean;
54
56
  }
55
57
  /** flow_inline structural compile — door-verbatim (structure via
package/lib/runsStart.js CHANGED
@@ -22,7 +22,6 @@ import { FLOW_INLINE_TOP_VOICE, INLINE_TOP_KEYS, STAGE_KEYS, checkFlowInlineTop,
22
22
  import { appendLedger, graphReceiptFoldOf, outRootFor, refusal, sidecarDoc, sidecarStageOf, variantOfBodies, writeJsonAtomic } from "./queue.js";
23
23
  import { lifecycleInFlight } from "./lifecycleLatch.js";
24
24
  import { toRemoteError } from "./runsRefusalVoices.js";
25
- import { engineDefaultOutput } from "./runsValidateShared.js";
26
25
  import { rootsManifest } from "./rootsManifest.js";
27
26
  // the envelope-refusal SSOT lives in queueSubmit.ts (beside
28
27
  // walkSubmitEnvelope, the one walker the registry delegates to) —
@@ -293,38 +292,32 @@ export function compileFlowInline(inline, knownEngines = [CARD_PLANE_ENGINE]) {
293
292
  "output_nodes makes the run register without it", "invalid_request");
294
293
  }
295
294
 
296
- // latent: one read, both doors): validate's lattice treats an
297
- // EMPTY outputs map as stageless and judges the stage by the
298
- // engine's table def (craft->image, agent->text) — start's old
299
- // flat "image" bound a different kind than the lattice judged,
300
- // by coincidence agreeing on every reachable engine. The fill
301
- // now reads engineDefaultOutput (the lattice's own rule: mcp leg
302
- // + table). The undefined leg is the future-split guard: the
303
- // engine gate above admits only grammatical, registered ids, so
304
- // no reachable engine reads it — a grammar id the table has not
305
- // learned yet refuses HERE, in the door's voice, instead of
306
- // validating-refuse/start-accepting.
295
+ // "undeclared" — the compiler reads the stage's OWN card_io
296
+ // table (the card's declared output channels, carried on the
297
+ // row), never the engine registry (membership-only since the
298
+ // cure: it names no kinds). A stage with neither refuses here,
299
+ // in the door's voice, naming the fix — a fabricated
300
+ // {default: <engine kind>} once bound the retired music-native
301
+
307
302
  const declaredOutputs = st["outputs"];
308
303
  const outputsDeclared = typeof declaredOutputs === "object" && declaredOutputs !== null &&
309
304
  !Array.isArray(declaredOutputs) &&
310
305
  Object.keys(declaredOutputs).length > 0;
306
+ const rawCardIo = st["card_io"];
307
+ const cardIoDeclared = typeof rawCardIo === "object" && rawCardIo !== null &&
308
+ !Array.isArray(rawCardIo) &&
309
+ Object.keys(rawCardIo).length > 0;
311
310
  let outputs;
312
311
  if (outputsDeclared) {
313
312
  outputs = declaredOutputs;
314
313
  }
314
+ else if (cardIoDeclared) {
315
+ outputs = rawCardIo;
316
+ }
315
317
  else {
316
- const kind = engineDefaultOutput(engine);
317
- /* v8 ignore next -- the engine gate above admits only grammatical,
318
- registered ids (all table- or mcp-leg-covered); the undefined
319
- leg is the future-split guard, unreachable until the grammar
320
- grows a table-unknown id. */
321
- if (kind === undefined) {
322
- return refusal(400, "flow_inline stage " + JSON.stringify(sid) + ": engine " +
323
- JSON.stringify(engine) +
324
- " has no default output kind — the engine table names no row for it" +
325
- " (a grammar id the table has not learned yet); name it in the table", "invalid_request");
326
- }
327
- outputs = { default: kind };
318
+ return refusal(400, "flow_inline stage " + JSON.stringify(sid) + " declares no outputs and carries no card_io — " +
319
+ "name every produced channel on the stage (outputs={'<channel>': <Kind>}) or carry the card's " +
320
+ "declared cardIo table; the engine registry names engines, never their outputs", "invalid_request");
328
321
  }
329
322
  const expected = typeof st["expected"] === "object" && st["expected"] !== null && !Array.isArray(st["expected"])
330
323
  ? st["expected"]
@@ -380,7 +373,7 @@ export function compileFlowInline(inline, knownEngines = [CARD_PLANE_ENGINE]) {
380
373
  JSON.stringify([...new Set(ghosts)].sort()) +
381
374
  " but the stage wires no input of that name — the merge would refuse it at run time ('$name' must name a FromStage-wired input or a request initial; name it or wire it)", "invalid_request");
382
375
  }
383
- stages.push({ id: sid, engine, params, outputs, outputsDeclared, expected, outputNodes, inputNames });
376
+ stages.push({ id: sid, engine, params, outputs, outputsDeclared: outputsDeclared || cardIoDeclared, expected, outputNodes, inputNames });
384
377
  }
385
378
  return { stages };
386
379
  }
@@ -447,6 +440,14 @@ export async function registerCompiledRun(args) {
447
440
  outputs: { ...st.outputs },
448
441
  params: { ...st.params },
449
442
  }));
443
+
444
+ // door's bench doc read is the run's incarnation — both register
445
+ // arms carry the same doc they judged (benchStageIdOf), so the
446
+ // stamp rides the door, never a re-read. Stamped once here; every
447
+ // sidecar rewrite carries it (sidecarFacesOf). Absent on pre-cure
448
+ // benches (no epoch, no key — never guessed).
449
+ const benchEpochRaw = door.benchDoc?.["epoch"];
450
+ const benchEpoch = typeof benchEpochRaw === "string" && benchEpochRaw !== "" ? benchEpochRaw : undefined;
450
451
  const run = {
451
452
  runId,
452
453
  status: "queued",
@@ -477,6 +478,9 @@ export async function registerCompiledRun(args) {
477
478
  ...(door.initialFileKeys !== undefined && door.initialFileKeys.length > 0
478
479
  ? { initialFileKeys: [...door.initialFileKeys] }
479
480
  : {}),
481
+ // THE BENCH INCARNATION rides the row (W-3 / F3-11) — the queued
482
+ // sidecar stamps it, the claim/settle rewrites carry it verbatim.
483
+ ...(benchEpoch !== undefined ? { benchEpoch } : {}),
480
484
  };
481
485
  run.inputNames = Object.fromEntries(compiled.stages.map((st) => [st.id, { ...st.inputNames }]));
482
486
  if (args.warnings !== undefined && args.warnings.length > 0) {
@@ -759,6 +763,9 @@ function sidecarDocFor(run) {
759
763
  testFlag: run.testFlag,
760
764
  draftId: run.draftId,
761
765
  pipeline: run.pipeline,
766
+ // THE BENCH INCARNATION rides the queued sidecar too (W-3 /
767
+ // F3-11 — the wand/restore and the list read disk, not memory).
768
+ benchEpoch: run.benchEpoch,
762
769
  graph: run.graphRows,
763
770
  cardSnapshot: run.cardSnapshot,
764
771
  benchSnapshot: run.benchSnapshot,
@@ -104,6 +104,14 @@ export interface RunRecord {
104
104
  * at Run press ({stages, intent}) — same carry law as the card
105
105
  * snapshot. */
106
106
  benchSnapshot?: unknown;
107
+
108
+
109
+
110
+
111
+
112
+
113
+
114
+ benchEpoch?: string;
107
115
  /** F-6(b) ADMISSION WARNINGS (stamped post-registration by the
108
116
  * start door — the film lane's VRAM-pressure warn): served on
109
117
  * run_status rows, never a refusal. Absent means none. */
@@ -206,7 +214,17 @@ export interface RunRecord {
206
214
  }
207
215
  /** The engine's path relative to the run dir (runRel, door-verbatim). */
208
216
  export declare function runRel(run: RunRecord, art: string): string;
209
- /** "<Type>: <msg>" — the worker's terminal error text. */
217
+ /** THE THROWN-VALUE FOLD (qa8 F38): run_status once served
218
+ * "Error: [object Object]" for a real OOM because a plain-object
219
+ * throw met String(). A thrown non-Error renders by its own words —
220
+ * a bare string verbatim; an object's message/error string fields
221
+ * first, then its JSON; a circular or unserializable value folds to
222
+ * its key roster. The vacuous "[object Object]" can never leave this
223
+ * door. */
224
+ export declare function foldThrownValue(value: unknown): string;
225
+ /** "<Type>: <msg>" — the worker's terminal error text. The message
226
+ * half rides the thrown-value fold (F38): a thrown object reaches
227
+ * the run's error column as its own words. */
210
228
  export declare function errText(err: unknown): string;
211
229
  /** The settle persist (the R3 durable-queue mirror of registration,
212
230
  * door-verbatim): the terminal status rewrites the run's
package/lib/runsTypes.js CHANGED
@@ -43,10 +43,43 @@ function errName(err) {
43
43
  }
44
44
  return "Error";
45
45
  }
46
- /** "<Type>: <msg>" — the worker's terminal error text. */
46
+ /** THE THROWN-VALUE FOLD (qa8 F38): run_status once served
47
+ * "Error: [object Object]" for a real OOM because a plain-object
48
+ * throw met String(). A thrown non-Error renders by its own words —
49
+ * a bare string verbatim; an object's message/error string fields
50
+ * first, then its JSON; a circular or unserializable value folds to
51
+ * its key roster. The vacuous "[object Object]" can never leave this
52
+ * door. */
53
+ export function foldThrownValue(value) {
54
+ if (typeof value === "string")
55
+ return value;
56
+ if (value instanceof Error)
57
+ return value.message;
58
+ if (typeof value === "object" && value !== null) {
59
+ const rec = value;
60
+ for (const key of ["message", "error", "detail", "reason"]) {
61
+ const v = rec[key];
62
+ if (typeof v === "string" && v.trim() !== "")
63
+ return v;
64
+ }
65
+ try {
66
+ const json = JSON.stringify(value);
67
+ if (json !== "{}" && json !== "[]")
68
+ return json;
69
+ }
70
+ catch {
71
+ // circular or BigInt — the key roster below still names it
72
+ }
73
+ const keys = Object.keys(rec);
74
+ return keys.length > 0 ? "{ " + keys.join(", ") + " }" : "{}";
75
+ }
76
+ return String(value);
77
+ }
78
+ /** "<Type>: <msg>" — the worker's terminal error text. The message
79
+ * half rides the thrown-value fold (F38): a thrown object reaches
80
+ * the run's error column as its own words. */
47
81
  export function errText(err) {
48
- const msg = err instanceof Error ? err.message : String(err);
49
- return errName(err) + ": " + msg;
82
+ return errName(err) + ": " + foldThrownValue(err);
50
83
  }
51
84
  /** The settle persist (the R3 durable-queue mirror of registration,
52
85
  * door-verbatim): the terminal status rewrites the run's
@@ -204,6 +237,10 @@ function sidecarFacesOf(run) {
204
237
  cardSnapshot: run.cardSnapshot,
205
238
  cardRecipe: run.cardRecipe,
206
239
  benchSnapshot: run.benchSnapshot,
240
+ // THE BENCH INCARNATION rides every rewrite too (W-3 / F3-11 —
241
+ // a disk row keeps the incarnation it was pressed in; the claim
242
+ // and settle rewrites carry the queued stamp verbatim).
243
+ benchEpoch: run.benchEpoch,
207
244
  // F-6(b): the admission warnings ride every rewrite too (a disk
208
245
  // row keeps what the live row warned).
209
246
  warnings: run.warnings,
@@ -1,5 +1,6 @@
1
1
  export { FlowError } from "./runsValidateShared.js";
2
2
  export type { CardRegistryLike, FlowsValidateAnswer } from "./runsValidateShared.js";
3
+ export { KIND_VOCAB } from "./runsValidateShared.js";
3
4
  export { strictBody } from "./runsValidateStages.js";
4
5
  export { inlineArm, serveSubject } from "./runsValidateServe.js";
5
6
  //# sourceMappingURL=runsValidate.d.ts.map
@@ -25,6 +25,11 @@
25
25
  // public import surface below is UNCHANGED — existing importers keep
26
26
  // importing these names from ./runsValidate.ts.
27
27
  export { FlowError } from "./runsValidateShared.js";
28
+
29
+ // teaching voices DERIVE from KIND_VOCAB (melite-tools' fold refusal
30
+ // rode a hand copy that had already dropped `data`) — the enforcer
31
+ // and every voice must enumerate the same closed set.
32
+ export { KIND_VOCAB } from "./runsValidateShared.js";
28
33
  export { strictBody } from "./runsValidateStages.js";
29
34
  export { inlineArm, serveSubject } from "./runsValidateServe.js";
30
35
  // ── the door ────────────────────────────────────────────────────
@@ -1,5 +1,6 @@
1
1
  import { RemoteError } from "@deepseek-ai/dsh-typert-protocol";
2
2
  import { RUNS_ERROR_CODES } from "./runsErrorCodes.js";
3
+ import { refuseFamilylessHijack } from "./cardsCompose.js";
3
4
  import { expandRegistryFlow, registryFlowToInline, registryInitialsError } from "./flowsData.js";
4
5
  import { applyFlowParamsOverride, overlayDecls } from "./flowsParamsOverlay.js";
5
6
  import { composeFamilyStages, liveFamilySeat } from "./flowsFamilyCompose.js";
@@ -236,10 +237,34 @@ async function composeCardStagesAtValidate(liveDoc, svc) {
236
237
  ? (service !== undefined ? { ...params, model: service } : { ...params })
237
238
  : { ...params, model: mid };
238
239
  try {
240
+
241
+ // this walk's body carries no `card` key (the model-door
242
+ // shape), so prepareCardParams cannot see the row's own card —
243
+ // the shared law fires HERE too, on the walk's own card name,
244
+ // before any phase1Card resolution folds the stated model
245
+ // into a stranger's lane (trim + krea-2 lived as image-gen).
246
+ refuseFamilylessHijack(svc, String(st["card"]), params["model"] ?? service);
239
247
  await svc.phase1Card(body, mid);
240
248
  }
241
249
  catch (e) {
242
250
  if (e instanceof CardArmError) {
251
+ // THE INCOMPLETE CLASS KEEPS ITS CODE (the GUI-add burn,
252
+
253
+ // into one string, so the pre-mint WRITE gate downstream
254
+ // read the class as a terminal refusal — and no card whose
255
+ // lane declares a required word the add door does not seed
256
+ // (tts's `text` — the GUI seeds axes only) could ever be
257
+ // ADDED from the cards tab. The frictionless-authoring
258
+
259
+ // not hacking the mainframe") drops the authoring-
260
+ // incomplete class at every write seat; the class rides the
261
+ // door's own throw pattern here, under the wire code the
262
+ // table already carries (runs/card-compose-incomplete —
263
+ // the client's heal-vs-carry split reads the same key).
264
+ // Every other refusal keeps the wall-pinned note voice.
265
+ if (e.code === "card_compose_incomplete") {
266
+ throw new RemoteError(RUNS_ERROR_CODES["card_compose_incomplete"], "stage " + JSON.stringify(String(st["id"])) + ": " + e.message, { loc: "stages" });
267
+ }
243
268
  return "REFUSED stage " + JSON.stringify(String(st["id"])) + ": " + e.message;
244
269
  }
245
270
  throw e;
@@ -1,7 +1,7 @@
1
1
  // runsValidateServe.ts — the shared compile-serve tail split from
2
2
  // runsValidate.ts (pure move, zero logic changes): branch prune, to_graph,
3
3
  // the $channel gate, cost preview, and the inline/named serve arms.
4
- import { FlowError, engineDefaultOutput } from "./runsValidateShared.js";
4
+ import { FlowError, engineKnown } from "./runsValidateShared.js";
5
5
  import { edgeRef } from "./runsValidateInline.js";
6
6
  import { flowFromBody, kindsOk, wiresResolve } from "./runsValidateStages.js";
7
7
  import { batchRows, sweepWorkflows } from "./runsValidateSweeps.js";
@@ -63,9 +63,9 @@ export function prunedFor(flow, body, cards) {
63
63
  merged.push({ ...st, inputs: newInputs });
64
64
  }
65
65
  // RECONSTRUCTED — every construction validator re-runs (TS scope:
66
- // wires + deferred kinds; card/tool/validators are no-ops here).
66
+ // wires + kinds; card/tool/validators are no-ops here).
67
67
  wiresResolve(flow.id, merged);
68
- kindsOk(flow.id, merged, {}, cards);
68
+ kindsOk(flow.id, merged, cards);
69
69
  return { flow: { id: flow.id, description: flow.description, stages: merged }, pruned: [...pruned.keys()] };
70
70
  }
71
71
  export function toGraph(flow) {
@@ -80,14 +80,12 @@ export function toGraph(flow) {
80
80
  outputs.push({ ...o });
81
81
  }
82
82
  else {
83
- // THE SHARED DEFAULT READ (P7 latent): validateEngines refused
84
- // unknown engines upstream, so this hit is proven — but the
85
- // rule (mcp leg + table) is still read here, not retyped, so
86
- // the day the table grows this seat cannot disagree. The
87
- // undefined leg is the defense-in-depth voice for a guarantee
88
- // missed, in the lattice's own words.
89
- const def = engineDefaultOutput(st.engine);
90
- if (def === undefined) {
83
+
84
+ // with neither refuses LOUD, in the lattice's own voice for a
85
+ // missed guarantee (unknown engine) or the declaration voice
86
+ // (a known engine names no channels). The engine registry is
87
+ // membership-only: it fills nothing.
88
+ if (!engineKnown(st.engine)) {
91
89
  throw new FlowError("flow " +
92
90
  JSON.stringify(flow.id) +
93
91
  " stage " +
@@ -98,7 +96,12 @@ export function toGraph(flow) {
98
96
  JSON.stringify(st.engine) +
99
97
  " (no engine plugin declares it)");
100
98
  }
101
- outputs.push({ name: "default", kind: def });
99
+ throw new FlowError("flow " +
100
+ JSON.stringify(flow.id) +
101
+ " stage " +
102
+ JSON.stringify(st.id) +
103
+ " declares no outputs and names no card — " +
104
+ "add outputs={'<channel>': <Kind>} on the stage");
102
105
  }
103
106
  return {
104
107
  id: st.id,
@@ -14,17 +14,15 @@ export interface CardRegistryLike {
14
14
  }
15
15
  export declare const ENGINE_TABLE: Record<string, {
16
16
  plugin: string;
17
- def: string;
18
17
  }>;
19
- /** THE ENGINE TABLE'S DEFAULT READ (P7 latent): the lattice's own
20
- * rule, owned once — mcp:<server> grammar ids read the mcp-client
21
- * row ("image"), table rows read their def, anything else reads
22
- * undefined (unknown: no fill — the caller's door refuses, never
23
- * guesses). Both doors derive from this one read (validate's
24
- * lattice below, start's empty-outputs fill): a future grammar id
25
- * absent from the table makes BOTH refuse instead of splitting
26
- * validate-refuses/start-accepts. */
27
- export declare function engineDefaultOutput(engine: string): string | undefined;
18
+
19
+
20
+
21
+
22
+
23
+
24
+
25
+ export declare function engineKnown(engine: string): boolean;
28
26
  export declare const KIND_VOCAB: readonly string[];
29
27
  export declare const SKIP_VOCAB: readonly string[];
30
28
  export declare const INLINE_TOP_SORTED: readonly string[];
@@ -4,7 +4,19 @@
4
4
  import { WIRE_STAGE_KEYS } from "@melite/contracts/benchStage";
5
5
  import { engineIdOk } from "@melite/engine-contract";
6
6
  import { INLINE_TOP_KEYS } from "./runsGates.js";
7
- // ENGINE_TABLE: engine_type -> {plugin_id, default_output kind}.
7
+ // ENGINE_TABLE: engine_type -> {plugin_id} — THE KIND-FREE
8
+
9
+ // engine ids exist, never what they produce. The old per-engine
10
+ // `def` output kind was the bench's SECOND output table —
11
+ // validate's lattice judged a stage by the table's kind while the
12
+ // card's own cardIo table declared another (the retired
13
+ // music-native wrapper's {default: "image"} mislabel over the
14
+
15
+ // flows-are-compositions),
16
+ // and start's empty-outputs fill bound yet a third. One table now:
17
+ // the stage's own declared outputs, else its card_io, else the
18
+ // card's declared output kinds. An engine row with none of those
19
+ // refuses — a missing declaration is never filled from here.
8
20
 
9
21
  // api caller for comfyui, not having engines anymore"): ComfyUI is
10
22
  // the only engine. The old engine tiers (cpp/audio-cpp,
@@ -14,31 +26,42 @@ import { INLINE_TOP_KEYS } from "./runsGates.js";
14
26
  // rebirth as vendored ComfyUI custom nodes. Probed live from
15
27
  // scan_engines(); re-derived per run.
16
28
  export const ENGINE_TABLE = {
17
- comfyui: { plugin: "comfyui", def: "image" },
29
+ comfyui: { plugin: "comfyui" },
18
30
  // Stroke 55 (the engine-generics seam): the craft loop engine +
19
31
  // the MCP grammar arm — any mcp:<server> id matching the seat's
20
32
  // grammar admits (membership stays the runs door's registry arm).
21
- craft: { plugin: "craft", def: "image" },
33
+ craft: { plugin: "craft" },
22
34
  // Stroke 60 (plan §5): the agent engine — the spawner loop. Its
23
35
  // stage is validated like any engine stage (params carry the four
24
36
  // pinned fields); outputs are arbitrary (artifacts land in the
25
37
  // run dir).
26
- agent: { plugin: "agent", def: "text" },
38
+ agent: { plugin: "agent" },
27
39
  };
28
- /** THE ENGINE TABLE'S DEFAULT READ (P7 latent): the lattice's own
29
- * rule, owned once — mcp:<server> grammar ids read the mcp-client
30
- * row ("image"), table rows read their def, anything else reads
31
- * undefined (unknown: no fill — the caller's door refuses, never
32
- * guesses). Both doors derive from this one read (validate's
33
- * lattice below, start's empty-outputs fill): a future grammar id
34
- * absent from the table makes BOTH refuse instead of splitting
35
- * validate-refuses/start-accepts. */
36
- export function engineDefaultOutput(engine) {
40
+
41
+
42
+
43
+
44
+
45
+
46
+
47
+ export function engineKnown(engine) {
37
48
  if (engine.startsWith("mcp:") && engineIdOk(engine))
38
- return "image";
39
- return ENGINE_TABLE[engine]?.def;
49
+ return true;
50
+ return engine in ENGINE_TABLE;
40
51
  }
41
52
  // ── closed vocabularies (Kind / SkipWhen order) ──────
53
+
54
+ // `_list` seats the naming law contracts (image_list ← image,
55
+ // video_list ← video, audio_list ← audio — runsValidateStages' list
56
+ // law and contract-law's LAW 9 edge pin are the same closed set) are
57
+ // Kind members here, not a derived suffix: a derived `k + "_list"`
58
+ // admission would open text_list/mesh_list — kinds no wire carries.
59
+ // The DECL is the truth: h3's ref_audios is an array seat (cap 3,
60
+ // per-producer window stamps ref_audio_i), so the connect door must
61
+ // be able to STATE its declared kind — before this, every spelling
62
+ // refused (audio_list here, audio at the card-contradiction sweep)
63
+ // and the tts→film conditioning wire was unkindable at every flow
64
+ // door. A new kind is a contract act.
42
65
  export const KIND_VOCAB = [
43
66
  "text",
44
67
  "image",
@@ -49,6 +72,9 @@ export const KIND_VOCAB = [
49
72
  "lora",
50
73
  "seg",
51
74
  "data",
75
+ "image_list",
76
+ "video_list",
77
+ "audio_list",
52
78
  ];
53
79
  export const SKIP_VOCAB = ["present", "absent"];
54
80
  // _INLINE_TOP_KEYS sorted (dead/allowed messages) — DERIVED, not
@@ -19,7 +19,7 @@ export declare function cardGate(flowId: string, st: FlowStageRow, cards?: CardR
19
19
 
20
20
 
21
21
  export declare function coerceSnapshotBody(def: CardDefinition | undefined, body: Record<string, unknown>): Record<string, unknown>;
22
- export declare function kindsOk(flowId: string, stages: FlowStageRow[], engineDefaults: Record<string, string | null>, cards?: CardRegistryLike | null): void;
22
+ export declare function kindsOk(flowId: string, stages: FlowStageRow[], cards?: CardRegistryLike | null): void;
23
23
  export declare function validateEngines(flow: Flow, cards?: CardRegistryLike | null,
24
24
 
25
25