@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.
Files changed (87) hide show
  1. package/README.md +0 -5
  2. package/lib/bench.js +30 -3
  3. package/lib/cardsCompose.d.ts +31 -0
  4. package/lib/cardsCompose.js +65 -1
  5. package/lib/cardsDangling.js +17 -7
  6. package/lib/cardsDroppable.d.ts +11 -0
  7. package/lib/cardsDroppable.js +50 -0
  8. package/lib/cardsFacts.d.ts +37 -0
  9. package/lib/cardsFacts.js +47 -1
  10. package/lib/cardsLanes.d.ts +18 -0
  11. package/lib/cardsLanes.js +2 -1
  12. package/lib/cardsRegistry.d.ts +12 -20
  13. package/lib/cardsRegistry.js +288 -96
  14. package/lib/discloseRegistry.d.ts +5 -0
  15. package/lib/discloseRegistry.js +3 -3
  16. package/lib/filmLead.js +9 -1
  17. package/lib/filmMemoryWarn.js +1 -0
  18. package/lib/flowsData.d.ts +110 -21
  19. package/lib/flowsData.js +201 -23
  20. package/lib/flowsFamilyCompose.js +1 -0
  21. package/lib/flowsParamsOverlay.d.ts +8 -1
  22. package/lib/flowsParamsOverlay.js +47 -2
  23. package/lib/flowsRegistryRows.d.ts +0 -4
  24. package/lib/flowsRegistryRows.js +177 -371
  25. package/lib/index.d.ts +0 -1
  26. package/lib/index.js +0 -4
  27. package/lib/ledgerTail.js +1 -0
  28. package/lib/loadPlane.d.ts +46 -4
  29. package/lib/loadPlane.js +109 -7
  30. package/lib/loadRegistry.js +9 -2
  31. package/lib/managePlane.d.ts +5 -0
  32. package/lib/managePlane.js +412 -51
  33. package/lib/managePreflight.js +38 -6
  34. package/lib/manageProbe.d.ts +35 -0
  35. package/lib/manageProbe.js +141 -2
  36. package/lib/manageRegistry.d.ts +10 -0
  37. package/lib/manageRegistry.js +7 -1
  38. package/lib/managerRail.js +1 -0
  39. package/lib/queueCore.js +3 -1
  40. package/lib/queueLock.js +22 -10
  41. package/lib/queueResurrect.d.ts +0 -3
  42. package/lib/queueResurrect.js +5 -3
  43. package/lib/queueRetry.d.ts +12 -10
  44. package/lib/queueRetry.js +2 -4
  45. package/lib/queueSidecar.d.ts +36 -1
  46. package/lib/queueSidecar.js +30 -2
  47. package/lib/queueSubmit.d.ts +4 -1
  48. package/lib/queueSubmit.js +28 -5
  49. package/lib/queueSweep.d.ts +38 -11
  50. package/lib/queueSweep.js +73 -16
  51. package/lib/runsChange.d.ts +5 -4
  52. package/lib/runsExecute.d.ts +16 -1
  53. package/lib/runsExecute.js +102 -50
  54. package/lib/runsGates.d.ts +11 -3
  55. package/lib/runsGates.js +12 -3
  56. package/lib/runsList.d.ts +59 -3
  57. package/lib/runsList.js +228 -36
  58. package/lib/runsRegistry.d.ts +87 -6
  59. package/lib/runsRegistry.js +664 -98
  60. package/lib/runsSourceEcho.js +9 -3
  61. package/lib/runsStart.d.ts +6 -4
  62. package/lib/runsStart.js +32 -25
  63. package/lib/runsTypes.d.ts +54 -1
  64. package/lib/runsTypes.js +82 -3
  65. package/lib/runsValidate.d.ts +1 -0
  66. package/lib/runsValidate.js +5 -0
  67. package/lib/runsValidateArms.js +48 -2
  68. package/lib/runsValidateServe.js +15 -12
  69. package/lib/runsValidateShared.d.ts +8 -10
  70. package/lib/runsValidateShared.js +41 -15
  71. package/lib/runsValidateStages.d.ts +1 -1
  72. package/lib/runsValidateStages.js +90 -50
  73. package/lib/runtimeProvision.js +10 -2
  74. package/lib/skillAuthored.d.ts +50 -0
  75. package/lib/skillAuthored.js +178 -0
  76. package/lib/skillFs.js +3 -0
  77. package/lib/skillPlane.d.ts +40 -2
  78. package/lib/skillPlane.js +63 -13
  79. package/lib/skillRegistry.d.ts +24 -1
  80. package/lib/skillRegistry.js +69 -5
  81. package/lib/skillRows.d.ts +13 -3
  82. package/lib/skillRows.js +52 -9
  83. package/lib/vocab.d.ts +29 -0
  84. package/lib/vocab.js +78 -0
  85. package/package.json +24 -14
  86. package/lib/resurrect.d.ts +0 -6
  87. package/lib/resurrect.js +0 -18
package/README.md CHANGED
@@ -1,8 +1,3 @@
1
- ---
2
- description: The estate's run core as Cordis services — serial queue, live-run registry, manage and flows seats, the skill plane, and the runs gate vocabulary.
3
- kind: package-library
4
- ---
5
-
6
1
  # @melite/estate-queue
7
2
 
8
3
  `@melite/estate-queue` is the run-queue core of the estate: the serial-GPU
package/lib/bench.js CHANGED
@@ -14,7 +14,7 @@
14
14
  // PROCESS on globalThis so the estate's re-apply churn (fresh
15
15
  // module instances every ~21s) can never reset it.
16
16
  import { readFileSync, readdirSync, statSync } from "node:fs";
17
- import { join } from "node:path";
17
+ import { dirname, join } from "node:path";
18
18
  /** The process's melite boot instant — pinned once, survives the
19
19
  * estate's re-apply churn (each re-apply re-imports modules; the
20
20
  * globalThis pin keeps ONE cutoff per process). */
@@ -41,6 +41,29 @@ export function benchDir(storageRoot) {
41
41
  // caller and the store resolve the SAME tree.
42
42
  return join(storageRoot ?? benchStorageRoot(), "drafts", "docs");
43
43
  }
44
+ /** Through-a-file probe: true when some existing prefix of `p` is a
45
+ * FILE — `p` can never resolve to a directory. The errno taxonomy
46
+ * splits by platform here (ENOTDIR on posix, ENOENT on Windows), so
47
+ * the roster catch consults this instead of trusting the code alone:
48
+ * a blocked roster is never the tolerated absence on any lane. */
49
+ function blockedByFileAncestor(p) {
50
+ let cur = p;
51
+ for (;;) {
52
+ try {
53
+ return statSync(cur).isFile();
54
+ }
55
+ catch (e) {
56
+ /* v8 ignore next 1 -- windows-only reach: inside the ENOENT climb a foreign errno (EACCES on a locked ancestor) answers "not blocked", never crashes the roster read; posix hands foreign errnos to the outer catch before this helper runs */
57
+ if (e.code !== "ENOENT")
58
+ return false;
59
+ }
60
+ const parent = dirname(cur);
61
+ /* v8 ignore next 2 -- windows-only reach: the climb exhausts at a drive/UNC root (stat of a bare drive letter throws); posix always resolves a dir before the root stop */
62
+ if (parent === cur)
63
+ return false;
64
+ cur = parent;
65
+ }
66
+ }
44
67
 
45
68
 
46
69
 
@@ -80,8 +103,12 @@ export function benchPicksSync(storageRoot) {
80
103
  // the roster dir may not exist yet (first bench, nothing
81
104
  // persisted) or may be unreadable — both mean "no picks to
82
105
  // list", the function's own empty answer, never a crash of a
83
- // census/read path that must degrade to nothing
84
- if (error.code !== "ENOENT") {
106
+ // census/read path that must degrade to nothing.
107
+ // ENOENT taxonomy split (windows-portability): a through-a-FILE
108
+ // roster path reports ENOENT on Windows (ENOTDIR on posix) — a
109
+ // blocked roster is never the tolerated absence on any lane.
110
+ const code = error.code;
111
+ if (code !== "ENOENT" || blockedByFileAncestor(dir)) {
85
112
  console.error("[benchPicksSync] roster read failed:", error);
86
113
  }
87
114
  return [];
@@ -11,6 +11,20 @@ export interface ComposeSeat {
11
11
  primeObjectInfo(): Promise<boolean>;
12
12
  readsSync(): FactsReads;
13
13
  resolveCardFamily(mid: string, facts?: Record<string, import("./cardsFacts.js").ModelFactsRow>): string;
14
+
15
+
16
+
17
+
18
+
19
+
20
+
21
+
22
+ admitStageFamily?(card: string, params: Record<string, unknown>): {
23
+ ok: true;
24
+ } | {
25
+ ok: false;
26
+ error: string;
27
+ };
14
28
  /** The §23 cross-roots manifest (the queue seat's stateRoots —
15
29
  * the dangling sweep's trees; J12: config-named, never env). */
16
30
  stateRoots(): readonly string[];
@@ -35,6 +49,23 @@ export declare function composeOnce(deps: ComposeSeat, card: string, fam: string
35
49
 
36
50
 
37
51
  export declare function admissionRefusal(deps: ComposeSeat, card: string, fam: string, lifted: Record<string, unknown>, phase: string, facts?: Record<string, ModelFactsRow>): void;
52
+
53
+
54
+
55
+
56
+
57
+
58
+
59
+
60
+
61
+
62
+
63
+
64
+
65
+
66
+
67
+
68
+ export declare function refuseFamilylessHijack(deps: ComposeSeat, card: string, seat: unknown, facts?: Record<string, ModelFactsRow>): void;
38
69
  /** Resolve + sweep + select + overlay + lift (steps 2-6):
39
70
  * everything before compose. Throws CardArmError (the door maps
40
71
  * it to the refusal envelope). `phase` stamps the phase-N voice
@@ -4,6 +4,7 @@
4
4
  // deps; no Service state beyond the accessors the seat passes.
5
5
  import { ComfyUIService, resolveEngineBaseUrl, composeCards, ComposeRefusal, checkModelPresent, owningAtom } from "@melite/comfyui-cordis";
6
6
  import { cardAdmits, familyLanesOf } from "./cardsFacts.js";
7
+ import { ESTATE_NAMING_ROW } from "@melite/contracts/formSpec";
7
8
  export { cardAdmits };
8
9
  import { EngineContext, composeModPlane, loadFacts, theService } from "@melite/comfyui-cordis";
9
10
  import { CardArmError, phaseRefusal } from "./cardsArmError.js";
@@ -199,7 +200,15 @@ export function admissionRefusal(deps, card, fam, lifted, phase, facts) {
199
200
  // surface is empty here; the knobs+admits rows still gate
200
201
  // (compose's own admission gate re-judges with the fold).
201
202
  }
202
- const admitted = (key) => cardAdmits(decl, modNames, key);
203
+ // THE ESTATE NAMING ROW'S ADMISSION (queue 12's ONE SEAT law): the
204
+ // faces teach the row on every card declaring none of its own (the
205
+ // UI naming seat + the agent params_schema property, one spelling
206
+ // ESTATE_NAMING_ROW), and the stage plane already carries the key —
207
+ // STAGE_RESERVED_PARAMS lifts it beside the graph, the settle mints
208
+ // the gallery labels from it. A face that teaches a knob this door
209
+ // refuses is the no-cheat lie; the declared row (h3's slug) already
210
+ // admits through schemaNames — this arm serves every OTHER card.
211
+ const admitted = (key) => key === ESTATE_NAMING_ROW.name || cardAdmits(decl, modNames, key);
203
212
  const unknown = Object.keys(lifted).filter((k) => !admitted(k)).sort();
204
213
  if (unknown.length > 0) {
205
214
  const hints = unknown
@@ -222,6 +231,34 @@ export function admissionRefusal(deps, card, fam, lifted, phase, facts) {
222
231
  (fieldHints.length > 0 ? " Mod-field families:" + fieldHints.join(";") : ""));
223
232
  }
224
233
  }
234
+
235
+
236
+
237
+
238
+
239
+
240
+
241
+
242
+
243
+
244
+
245
+
246
+
247
+
248
+
249
+
250
+ export function refuseFamilylessHijack(deps, card, seat, facts) {
251
+ if (card === "")
252
+ return;
253
+ const decl = deps.cardDecls(facts)[card];
254
+ if (decl === undefined || decl.boarded.length > 0)
255
+ return;
256
+ if (typeof seat !== "string" || seat === "" || seat === card)
257
+ return;
258
+ throw new CardArmError(400, "card " + JSON.stringify(card) + " declares no model family (a family-less tool card — it composes by its own id), so the stated model " +
259
+ JSON.stringify(seat) + " is a lane hijack: the row would compose " +
260
+ JSON.stringify(seat) + "'s card instead and this card's params would be judged by a stranger's admission. Drop the model key — the card's own surface owns every default.", "invalid_request");
261
+ }
225
262
  /** Resolve + sweep + select + overlay + lift (steps 2-6):
226
263
  * everything before compose. Throws CardArmError (the door maps
227
264
  * it to the refusal envelope). `phase` stamps the phase-N voice
@@ -251,6 +288,20 @@ export function prepareCardParams(deps, body, mid, phase, factsArg) {
251
288
  if (!FLOW_ID_RE.test(mid)) {
252
289
  throw new CardArmError(400, "model id " + JSON.stringify(mid) + " is not a legal identifier", "invalid_request");
253
290
  }
291
+
292
+ // add_stage misrouted into the krea-2/turbo image lane demanding a
293
+ // prompt. The family-less tool card never reached its own surface"):
294
+ // a stage row that names a REGISTERED family-less card (boarded: [])
295
+ // composes by its own id — the card-unit arm below. But `mid` folds a
296
+ // stated params.model/service FIRST, so trim + model 'krea-2' resolved
297
+ // KREA's family and composed the image-gen card instead (live receipt:
298
+ // /v1/flows/validate answered "unknown param(s) on the image-gen card:
299
+ // clip, end_seconds, start_seconds" — the trim params judged by a
300
+ // stranger's admission, and with prompt-shaped params the row would
301
+ // have validated GREEN as a krea image). ONE LAW, TWO SEATS: the
302
+ // validate walk's own phase1Card call carries no `card` key in its
303
+ // body, so the helper is exported and called there too.
304
+ refuseFamilylessHijack(deps, typeof body["card"] === "string" ? body["card"] : "", body["model"] ?? body["service"], facts);
254
305
  const resolves = mid in facts || deps.resolveCardFamily(mid, facts) in facts || deps.modelMids().has(mid);
255
306
  if (!resolves) {
256
307
 
@@ -303,6 +354,19 @@ export function prepareCardParams(deps, body, mid, phase, factsArg) {
303
354
  " (no registered card definition for the card model " + JSON.stringify(mid) + " names)", "card_compose");
304
355
  }
305
356
  const sel = selectCardVariant(mid, famRow, body, phase, familyLanesOf(decl.boarded), fam);
357
+
358
+ // SAYING ONE BENCH. BUT THAT IS *never* TRUE"; RETIRED as a
359
+
360
+ // the RENDERER, not by a refusal — renderH3Window now hoists
361
+ // the post chain above the family branch, so every finish key
362
+ // fires on every lane and h3-timeline declares no admission
363
+ // face. The seat still runs when a card declares one, on the
364
+ // RAW lifted body (pre-stamp), so a genuine family clause keeps
365
+ // one voice across write, serve and compose.
366
+ const famVerdict = deps.admitStageFamily?.(famRow.card, liftCardParams(body));
367
+ if (famVerdict !== undefined && !famVerdict.ok) {
368
+ throw new CardArmError(400, famVerdict.error, "invalid_request");
369
+ }
306
370
  const stamped = stampCardOverlay(body, famRow, decl, sel, phase, fam);
307
371
  return {
308
372
  mid,
@@ -19,7 +19,7 @@
19
19
  // or the gallery's artifact face (/infer-gallery/artifact?path=
20
20
  // — the same tail the guard and the engine stage).
21
21
  import { isFile } from "./skillFs.js";
22
- import { join, relative, resolve, sep } from "node:path";
22
+ import { isAbsolute, join, relative, resolve, sep } from "node:path";
23
23
  import { ASSET_RUNS_PREFIX, MEDIA_RUNS_PREFIX, galleryTail } from "./runsSourceEcho.js";
24
24
  import { segmentConfined } from "@melite/contracts/mediaKinds";
25
25
  import { searchedVoice } from "./rootsManifest.js";
@@ -112,12 +112,17 @@ export function resolveArtifactFile(ref, outRoot) {
112
112
  }
113
113
  cand = join(outRoot, rel.join("/"));
114
114
  }
115
- else if (raw.includes("/") && !raw.startsWith("/")) {
116
- cand = join(outRoot, raw);
117
- }
118
- else if (raw.startsWith("/")) {
115
+ else if (isAbsolute(raw)) {
116
+ // isAbsolute, not startsWith("/"): a Windows-harvested ref is
117
+ // drive-rooted — the posix-only gate misfiled it as a bare name
118
+
119
+ // candidate on either platform; the runs-relative face below
120
+ // keeps its wire spelling.
119
121
  cand = raw;
120
122
  }
123
+ else if (raw.includes("/")) {
124
+ cand = join(outRoot, raw);
125
+ }
121
126
  else {
122
127
  throw new Error("artifact ref is a bare " +
123
128
  JSON.stringify(raw) +
@@ -130,14 +135,19 @@ export function resolveArtifactFile(ref, outRoot) {
130
135
  const absCand = resolve(cand);
131
136
  const absRoot = resolve(outRoot);
132
137
  const relToRoot = relative(absRoot, absCand);
133
- if (relToRoot === ".." || relToRoot.startsWith(".." + sep)) {
138
+ // isAbsolute(relToRoot): relative() cannot cross a Windows drive —
139
+ // a candidate on another drive comes back ABSOLUTE, and the old
140
+ // ".."-only test passed it as inside (the drive-join cure,
141
+
142
+ // added disjunct is inert there.
143
+ if (isAbsolute(relToRoot) || relToRoot === ".." || relToRoot.startsWith(".." + sep)) {
134
144
  throw new Error("artifact ref escapes the output root: " + JSON.stringify(raw));
135
145
  }
136
146
  if (!isFile(absCand)) {
137
147
  // The run id rides the ref's own first segment for every
138
148
  // prefix-URL, gallery-URL and runs-relative shape; an absolute
139
149
  // path carries no run, so "?" names that absence.
140
- const run = prefix !== null || gallery !== null || (raw.includes("/") && !raw.startsWith("/"))
150
+ const run = prefix !== null || gallery !== null || (raw.includes("/") && !isAbsolute(raw))
141
151
  ? (prefix !== null ? raw.slice(prefix.length) : gallery !== null ? gallery : raw).split("/", 2)[0] // split yields >= 1
142
152
  : "?";
143
153
  throw new Error("artifact not found on disk: " + JSON.stringify(raw) + " (looked up " + absCand + ") — the " +
@@ -0,0 +1,11 @@
1
+ export declare const CARD_DROPPABLE: Readonly<Record<string, Readonly<Record<string, string>>>>;
2
+ /** The unjustified drops: receipt dropped[] keys NOT declared for
3
+ * the card — the exact keys the wall reds on. Empty = every drop
4
+ * carries a declared reason.
5
+ * @param pair the receipt (any GraphReceiptPair-shaped row — the
6
+ * run fold or a per-stage row)
7
+ * @param card the card id the registry serves */
8
+ export declare function unjustifiedDropped(pair: {
9
+ readonly dropped: readonly string[];
10
+ }, card: string): string[];
11
+ //# sourceMappingURL=cardsDroppable.d.ts.map
@@ -0,0 +1,50 @@
1
+ // cardsDroppable.ts — THE DROPPED-KNOB ALLOWABILITY LAW (F3-04,
2
+
3
+ // `dropped:["mode"]` — a declared param fell out of compilation,
4
+ // receipted but judged by nothing).
5
+ //
6
+ // THE LAW: a doc scalar the compose drops is a receipt FACT (verdict
7
+ // "partial", the key named) — but a knob that falls out of
8
+ // compilation UNDECLARED is exactly the silent-drop class the
9
+ // receipt exists to police. Every card that knowingly drops a
10
+ // scalar declares it here, WITH THE REASON it can never ride the
11
+ // graph; the receipt wall reds any served receipt whose dropped[]
12
+ // holds a key outside its card's declared set. The declaration is
13
+ // the ALLOWLIST, never the receipt: an undeclared drop is a finding
14
+ // (a wall red or an operator's watch), not a compose refusal — the
15
+ // compose gate owns refusals (queueSidecar's own law).
16
+ //
17
+ // SEAT: beside the receipt's estate home, keyed by the card id the
18
+ // registry serves (defsSync) — the wall sweeps every entry against
19
+ // the card's own schema dict, so a declaration for a card that does
20
+ // not exist, or a knob the card does not serve, reds (D1: the
21
+ // declaration can never drift off the served surface).
22
+ export const CARD_DROPPABLE = {
23
+ // RIG-P0-15 (friction3): mode:"auto" dropped, nodes:2 — harmless
24
+ // ONLY because mode is the lane router, not a knob the graph
25
+ // reads: compose selects the auto/copy LANE by it (card.ts
26
+ // `when: mode === 'auto'` / `!== 'auto'`), so no graph input ever
27
+ // spells it. Declared so the receipt's partial verdict carries its
28
+ // reason instead of reading as a fall-out-of-compilation.
29
+ rig: {
30
+ mode: "the lane router: compose selects the auto/copy lane by it (visible_when/when), never a graph scalar — no node input spells it",
31
+ },
32
+ // The receipt wall's ARM-e control (the real music door): the
33
+ // admitted body carries model but no graph input spells the bare
34
+ // family id — the routing residue, named there and here, never
35
+ // hidden.
36
+ music: {
37
+ model: "the routing residue: the admitted body carries the family id but no graph input spells the bare id (the receipt wall's ARM-e control names it)",
38
+ },
39
+ };
40
+ /** The unjustified drops: receipt dropped[] keys NOT declared for
41
+ * the card — the exact keys the wall reds on. Empty = every drop
42
+ * carries a declared reason.
43
+ * @param pair the receipt (any GraphReceiptPair-shaped row — the
44
+ * run fold or a per-stage row)
45
+ * @param card the card id the registry serves */
46
+ export function unjustifiedDropped(pair, card) {
47
+ const declared = CARD_DROPPABLE[card] ?? {};
48
+ return pair.dropped.filter((k) => !(k in declared));
49
+ }
50
+ //# sourceMappingURL=cardsDroppable.js.map
@@ -100,4 +100,41 @@ export declare function deriveDecls(defs: Map<string, CardDefinition>, facts: Re
100
100
  * what a card admits. Lives on the leaf: every consumer already
101
101
  * imports these row types, no seat-to-seat cycle. */
102
102
  export declare function cardAdmits(decl: CardDeclRow | undefined, modNames: ReadonlySet<string>, key: string): boolean;
103
+
104
+
105
+
106
+
107
+
108
+
109
+
110
+
111
+
112
+
113
+
114
+
115
+
116
+
117
+
118
+
119
+
120
+
121
+
122
+
123
+ export declare function stageReservedKeyLifts(decl: CardDeclRow | undefined, key: string): boolean;
124
+ /** THE JUDGED COPY a compose/admission seat hands its card walk when
125
+ * the row carries stage-reserved policy keys (stageReservedKeyLifts
126
+ * above): the reserved set lifts OUT, everything else rides verbatim.
127
+ * The stored row is NEVER this copy's business — the store is its
128
+ * own truth home; only the judged view sheds the policy keys. The
129
+ * seats: the write door's admission (cardsRegistry
130
+ * admitStageRelations) and the validate walk's phase1Card call
131
+ * (runsValidateArms — the pre-mint compose gate's dry walk, the
132
+ * bench add door's second judge). The run compose's own carry
133
+ * (runsRegistry composeCardStageRow) splits its bags on the same
134
+ * predicate.
135
+ * @param decl the card's DECL projection (undefined lifts all
136
+ * reserved keys — no card admits a policy key by default).
137
+ * @param params the row's params bag.
138
+ * @returns the judged copy (never the caller's record). */
139
+ export declare function liftStageReservedForAdmission(decl: CardDeclRow | undefined, params: Record<string, unknown>): Record<string, unknown>;
103
140
  //# sourceMappingURL=cardsFacts.d.ts.map
package/lib/cardsFacts.js CHANGED
@@ -3,7 +3,7 @@
3
3
  // facts/decl plane owns model-facts.json reads and the pure
4
4
  // defs+facts->rows derivation. No Service state — module truth.
5
5
  import { join } from "node:path";
6
- import { getModel, resolveRepoRoot } from "@melite/comfyui-cordis";
6
+ import { getModel, resolveRepoRoot, STAGE_RESERVED_PARAMS } from "@melite/comfyui-cordis";
7
7
  /** The window-family lanes a card's boarded families derive — the
8
8
  * vocabulary an agent confuses for a variant (the transcript's
9
9
  * step-8 burn: variant 't4r' read "unknown variant"). Reads the
@@ -99,4 +99,50 @@ export function cardAdmits(decl, modNames, key) {
99
99
  modNames.has(key) ||
100
100
  decl.admits.some((a) => a === key || (a.endsWith("*") && key.startsWith(a.slice(0, -1)))));
101
101
  }
102
+
103
+
104
+
105
+
106
+
107
+
108
+
109
+
110
+
111
+
112
+
113
+
114
+
115
+
116
+
117
+
118
+
119
+
120
+
121
+
122
+ export function stageReservedKeyLifts(decl, key) {
123
+ return STAGE_RESERVED_PARAMS.includes(key) && !cardAdmits(decl, new Set(), key);
124
+ }
125
+ /** THE JUDGED COPY a compose/admission seat hands its card walk when
126
+ * the row carries stage-reserved policy keys (stageReservedKeyLifts
127
+ * above): the reserved set lifts OUT, everything else rides verbatim.
128
+ * The stored row is NEVER this copy's business — the store is its
129
+ * own truth home; only the judged view sheds the policy keys. The
130
+ * seats: the write door's admission (cardsRegistry
131
+ * admitStageRelations) and the validate walk's phase1Card call
132
+ * (runsValidateArms — the pre-mint compose gate's dry walk, the
133
+ * bench add door's second judge). The run compose's own carry
134
+ * (runsRegistry composeCardStageRow) splits its bags on the same
135
+ * predicate.
136
+ * @param decl the card's DECL projection (undefined lifts all
137
+ * reserved keys — no card admits a policy key by default).
138
+ * @param params the row's params bag.
139
+ * @returns the judged copy (never the caller's record). */
140
+ export function liftStageReservedForAdmission(decl, params) {
141
+ const judged = { ...params };
142
+ for (const k of Object.keys(judged)) {
143
+ if (stageReservedKeyLifts(decl, k))
144
+ delete judged[k];
145
+ }
146
+ return judged;
147
+ }
102
148
  //# sourceMappingURL=cardsFacts.js.map
@@ -37,6 +37,24 @@ export declare function lanePresenceRefusal(fam: string, body?: Record<string, u
37
37
 
38
38
 
39
39
  type LaneCheck = (folder: string, name: string) => string | null;
40
+ type LaneMiss = {
41
+ readonly key: string;
42
+ readonly name: string;
43
+ readonly folders: readonly string[];
44
+ };
45
+
46
+
47
+
48
+
49
+
50
+
51
+
52
+
53
+ export declare function laneMisses(decl: Pick<ModelDecl, "lane_inputs" | "provisions" | "snapshot_provisions" | "lane_homes">, check: LaneCheck, variantRow?: {
54
+ lane_inputs?: Record<string, unknown>;
55
+ }, cellRow?: {
56
+ lane_inputs?: Record<string, unknown>;
57
+ }): LaneMiss[];
40
58
  export declare function laneFilesStatus(decl: Pick<ModelDecl, "lane_inputs" | "provisions" | "snapshot_provisions" | "lane_homes">, check?: LaneCheck): boolean | null;
41
59
 
42
60
 
package/lib/cardsLanes.js CHANGED
@@ -51,6 +51,7 @@ export function lanePackFolders() {
51
51
  let cfg;
52
52
  try {
53
53
  cfg = loadEndpointConfig();
54
+ // a missing or malformed config file throws — the read yields no pack folders and the stock lane sets stand alone
54
55
  }
55
56
  catch {
56
57
  return [];
@@ -105,7 +106,7 @@ function homeProbes(home, name) {
105
106
 
106
107
 
107
108
 
108
- function laneMisses(decl, check, variantRow, cellRow) {
109
+ export function laneMisses(decl, check, variantRow, cellRow) {
109
110
  // THE VARIANT-LANE PRESENCE LAW (h¹ remainder — the one-parameter
110
111
  // switch): the probe judges the RESOLVED lane inputs — the family's
111
112
  // rows under the STATED variant's per-key override (the same merge
@@ -9,24 +9,13 @@ import { type FamilyLaw } from "@melite/contracts/familyLane";
9
9
  export { selectCardVariant, stampCardOverlay, liftCardParams } from "./cardsVariant.js";
10
10
  export type { VariantSelection } from "./cardsVariant.js";
11
11
  export type { CardDeclRow, ModelFactsRow, VariantCellRow, ResolvedVariantRow } from "./cardsFacts.js";
12
-
13
-
14
-
15
-
16
-
17
-
18
-
19
-
20
-
21
-
22
-
23
-
24
-
25
-
26
-
27
-
28
-
29
- export declare const CARD_ENVELOPE_KEYS: readonly string[];
12
+ /** The card-envelope keys: SELECT the graph, never ride it —
13
+ * re-exported from the vocabulary's own home (vocab.ts) so the
14
+ * compose door and the graph receipt's scope gate read the ONE
15
+ * list (D-11: envelope keys are never knobs; the receipt never
16
+ * judges them). The list's derivation law and its reasons live
17
+ * beside the list. */
18
+ export { CARD_ENVELOPE_KEYS } from "./vocab.js";
30
19
  /** The card-lane refusal: status + the _refusal envelope shape
31
20
  * (error, code, then loc/expected/got) — the door maps it through
32
21
  * the local refusal path. */
@@ -78,6 +67,11 @@ export declare const FAMILY_RESEAT_CARVE: readonly string[];
78
67
 
79
68
 
80
69
 
70
+
71
+
72
+
73
+
74
+
81
75
  export declare function familyLawDrift(laws: ReadonlyMap<string, FamilyLaw>): string[];
82
76
  export declare class CardRegistryService extends Service {
83
77
  static inject: string[];
@@ -291,8 +285,6 @@ export declare class CardRegistryService extends Service {
291
285
 
292
286
 
293
287
 
294
-
295
-
296
288
  admitStageFamily(card: string, params: Record<string, unknown>): {
297
289
  ok: true;
298
290
  } | {