@melite/estate-queue 0.1.4-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.
Files changed (106) hide show
  1. package/LICENSE +561 -457
  2. package/README.md +55 -0
  3. package/lib/bench.d.ts +19 -11
  4. package/lib/bench.js +47 -57
  5. package/lib/cardsArmError.d.ts +94 -2
  6. package/lib/cardsArmError.js +34 -4
  7. package/lib/cardsCompose.d.ts +13 -1
  8. package/lib/cardsCompose.js +151 -67
  9. package/lib/cardsDangling.d.ts +2 -2
  10. package/lib/cardsDangling.js +82 -37
  11. package/lib/cardsFacts.d.ts +32 -3
  12. package/lib/cardsFacts.js +39 -1
  13. package/lib/cardsLanes.d.ts +62 -4
  14. package/lib/cardsLanes.js +407 -20
  15. package/lib/cardsLanesCopy.d.ts +21 -0
  16. package/lib/cardsLanesCopy.js +22 -0
  17. package/lib/cardsRegistry.d.ts +195 -10
  18. package/lib/cardsRegistry.js +959 -67
  19. package/lib/cardsVariant.d.ts +22 -8
  20. package/lib/cardsVariant.js +243 -52
  21. package/lib/discloseRegistry.d.ts +42 -11
  22. package/lib/discloseRegistry.js +163 -23
  23. package/lib/filmLead.js +5 -3
  24. package/lib/flowsData.d.ts +68 -13
  25. package/lib/flowsData.js +236 -107
  26. package/lib/flowsFamilyCompose.d.ts +5 -8
  27. package/lib/flowsFamilyCompose.js +25 -14
  28. package/lib/flowsParamsOverlay.d.ts +55 -0
  29. package/lib/flowsParamsOverlay.js +197 -0
  30. package/lib/flowsRegistryRows.d.ts +4 -1
  31. package/lib/flowsRegistryRows.js +325 -25
  32. package/lib/index.d.ts +1 -3
  33. package/lib/index.js +20 -5
  34. package/lib/lifecycleLatch.d.ts +16 -0
  35. package/lib/lifecycleLatch.js +42 -0
  36. package/lib/loadPlane.d.ts +3 -2
  37. package/lib/loadPlane.js +34 -8
  38. package/lib/loadRegistry.js +1 -1
  39. package/lib/manageOps.d.ts +8 -2
  40. package/lib/manageOps.js +28 -7
  41. package/lib/managePlane.d.ts +42 -1
  42. package/lib/managePlane.js +911 -101
  43. package/lib/managePreflight.d.ts +26 -0
  44. package/lib/managePreflight.js +179 -0
  45. package/lib/manageProbe.d.ts +15 -7
  46. package/lib/manageProbe.js +79 -8
  47. package/lib/manageRegistry.d.ts +42 -4
  48. package/lib/manageRegistry.js +45 -7
  49. package/lib/mediaKinds.d.ts +1 -1
  50. package/lib/mediaKinds.js +1 -1
  51. package/lib/queue.js +14 -10
  52. package/lib/queueCore.d.ts +21 -5
  53. package/lib/queueCore.js +22 -5
  54. package/lib/queueLifecycle.d.ts +0 -24
  55. package/lib/queueLifecycle.js +9 -63
  56. package/lib/queueLock.d.ts +8 -2
  57. package/lib/queueLock.js +9 -6
  58. package/lib/queueResurrect.d.ts +7 -2
  59. package/lib/queueResurrect.js +25 -6
  60. package/lib/queueSidecar.d.ts +114 -1
  61. package/lib/queueSidecar.js +178 -7
  62. package/lib/queueSubmit.d.ts +124 -10
  63. package/lib/queueSubmit.js +251 -48
  64. package/lib/queueSweep.js +13 -2
  65. package/lib/runsChange.d.ts +8 -0
  66. package/lib/runsChange.js +21 -5
  67. package/lib/runsErrorCodes.d.ts +1 -1
  68. package/lib/runsErrorCodes.js +35 -0
  69. package/lib/runsExecute.d.ts +26 -0
  70. package/lib/runsExecute.js +184 -6
  71. package/lib/runsGates.d.ts +5 -1
  72. package/lib/runsGates.js +10 -5
  73. package/lib/runsList.d.ts +43 -3
  74. package/lib/runsList.js +172 -58
  75. package/lib/runsRefusalVoices.js +101 -0
  76. package/lib/runsRegistry.d.ts +188 -12
  77. package/lib/runsRegistry.js +1233 -179
  78. package/lib/runsSourceEcho.d.ts +27 -0
  79. package/lib/runsSourceEcho.js +84 -18
  80. package/lib/runsStart.d.ts +80 -17
  81. package/lib/runsStart.js +303 -49
  82. package/lib/runsTypes.d.ts +62 -2
  83. package/lib/runsTypes.js +30 -6
  84. package/lib/runsValidateArms.js +61 -7
  85. package/lib/runsValidateServe.d.ts +2 -2
  86. package/lib/runsValidateServe.js +46 -14
  87. package/lib/runsValidateShared.d.ts +10 -1
  88. package/lib/runsValidateShared.js +14 -0
  89. package/lib/runsValidateStages.d.ts +10 -3
  90. package/lib/runsValidateStages.js +44 -12
  91. package/lib/runtimeProvision.d.ts +119 -0
  92. package/lib/runtimeProvision.js +243 -0
  93. package/lib/service.d.ts +24 -6
  94. package/lib/service.js +19 -11
  95. package/lib/skillFs.d.ts +9 -4
  96. package/lib/skillFs.js +12 -14
  97. package/lib/skillPlane.d.ts +3 -2
  98. package/lib/skillPlane.js +12 -6
  99. package/lib/skillRegistry.js +1 -1
  100. package/lib/skillRows.d.ts +4 -3
  101. package/lib/skillRows.js +21 -14
  102. package/lib/toolProjection.d.ts +1 -1
  103. package/lib/toolProjection.js +1 -1
  104. package/package.json +18 -17
  105. package/lib/runStatus.d.ts +0 -7
  106. package/lib/runStatus.js +0 -21
@@ -15,6 +15,32 @@ import { type RunRecord } from "./runsTypes.js";
15
15
 
16
16
 
17
17
 
18
+
19
+
20
+ export declare const LIVENESS_NOTIFY_MS = 300;
21
+ export declare const LIVENESS_WATCHDOG_MS = 5000;
22
+ export interface RunLiveness {
23
+ /** The report fold's tail: silence resets + a throttled notify. */
24
+ report(): void;
25
+ /** Clears the watchdog tick — the finally of every execute path. */
26
+ stop(): void;
27
+ }
28
+ export declare function startRunLiveness(run: RunRecord): RunLiveness;
29
+
30
+
31
+
32
+
33
+
34
+
35
+
36
+
37
+
38
+
39
+
40
+
41
+
42
+
43
+
18
44
  export declare function declaredPrimaryFirst(names: string[], stem: string | undefined): string[];
19
45
  export type SettleFn = (run: RunRecord) => void | Promise<void>;
20
46
  /** One run through the merged path (door-verbatim: stages ->
@@ -1,5 +1,6 @@
1
1
  import { CARD_PLANE_ENGINE } from "@melite/contracts/benchStage";
2
2
  import { loadCardDefs, needComfyUI, spliceWorkflow } from "@melite/comfyui-cordis";
3
+ import { deadline } from "@deepseek-ai/dsh-timeout";
3
4
  import { errText, runRel } from "./runsTypes.js";
4
5
  import { notifyRunChanged } from "./runsChange.js";
5
6
  import { engineFilmName } from "./filmLead.js";
@@ -16,6 +17,100 @@ import { engineFilmName } from "./filmLead.js";
16
17
 
17
18
 
18
19
 
20
+ async function raceExecuteFuse(p, ceilMs, what) {
21
+ const ceil = ceilMs ?? 0; // undefined (a minimal fake seat) = disabled, like <= 0
22
+ const dl = deadline(undefined, ceil, "RUN_EXECUTE_HUNG");
23
+ try {
24
+ return await Promise.race([
25
+ p,
26
+ new Promise((_, reject) => {
27
+ dl.signal.addEventListener("abort", () => {
28
+ const shown = ceil < 60_000
29
+ ? Math.round(ceil) + "ms"
30
+ : Math.round(ceil / 60_000) + " min";
31
+ reject(new Error("runs/execute-hung: " + what + " exceeded the execute ceiling (" +
32
+ shown +
33
+ ") — a hung engine call must never strand the serial queue; raise the queue config's executeCeilMs, set it <= 0 to disable, or state the run's own execute_ceil_ms"));
34
+ }, { once: true });
35
+ }),
36
+ ]);
37
+ }
38
+ finally {
39
+ dl[Symbol.dispose]();
40
+ void p.catch(() => { }); // the losing promise's rejection is already handled
41
+ }
42
+ }
43
+
44
+
45
+
46
+
47
+
48
+
49
+
50
+
51
+
52
+
53
+
54
+
55
+
56
+
57
+
58
+
59
+
60
+ export const LIVENESS_NOTIFY_MS = 300;
61
+ export const LIVENESS_WATCHDOG_MS = 5_000;
62
+ export function startRunLiveness(run) {
63
+ let lastNotify = 0;
64
+ let lastReportAt = Date.now();
65
+ const stampWaiting = () => {
66
+ const waitedS = Math.round((Date.now() - lastReportAt) / 1000);
67
+ for (const stage of run.stages) {
68
+ if (stage["status"] === "running") {
69
+ stage["activity"] =
70
+ "waiting on engine (" + waitedS + "s — no engine events)";
71
+ }
72
+ }
73
+ };
74
+ const tick = () => {
75
+ // settled runs own no stamp (the terminal writer deleted the
76
+ // activity lines); only a still-running row may move.
77
+ if (run.status !== "running")
78
+ return;
79
+ if (Date.now() - lastReportAt < LIVENESS_WATCHDOG_MS)
80
+ return;
81
+ stampWaiting();
82
+ lastNotify = Date.now();
83
+ notifyRunChanged(run.runId);
84
+ };
85
+ const handle = setInterval(tick, LIVENESS_WATCHDOG_MS);
86
+ handle.unref?.();
87
+ return {
88
+ report() {
89
+ lastReportAt = Date.now();
90
+ const now = Date.now();
91
+ if (now - lastNotify < LIVENESS_NOTIFY_MS)
92
+ return;
93
+ lastNotify = now;
94
+ notifyRunChanged(run.runId);
95
+ },
96
+ stop() {
97
+ clearInterval(handle);
98
+ },
99
+ };
100
+ }
101
+
102
+
103
+
104
+
105
+
106
+
107
+
108
+
109
+
110
+
111
+
112
+
113
+
19
114
 
20
115
 
21
116
  export function declaredPrimaryFirst(names, stem) {
@@ -59,6 +154,24 @@ export async function runOne(run, ctx, settle) {
59
154
  // tryDequeue returned null — all inference bricked until
60
155
  // restart (audit R1, stroke 82).
61
156
  try {
157
+
158
+ // EVERY stage row to the ONE executor resolved from the first
159
+ // stage's engine (runEngine's rule below) — a flow whose
160
+ // stages name two engines would mis-submit rows to the wrong
161
+ // engine. Refuse loud at claim, inside this same settle-failed
162
+ // scope, never mid-flight.
163
+ const seen = [];
164
+ for (const stage of run.stages) {
165
+ const e = stage["engine"];
166
+ const name = typeof e === "string" && e !== "" ? e : CARD_PLANE_ENGINE;
167
+ if (!seen.includes(name))
168
+ seen.push(name);
169
+ }
170
+ if (seen.length > 1) {
171
+ throw new Error("runs/mixed-engines: the flow's stages name " +
172
+ seen.join(" + ") +
173
+ " — the seat submits every row to one executor (the first stage's engine); a mixed-engine flow is refused, never mis-dispatched");
174
+ }
62
175
  seatExecutor = enginesSeat.resolve(runEngine(run)).executor;
63
176
  }
64
177
  catch (exc) {
@@ -208,6 +321,10 @@ export async function runOne(run, ctx, settle) {
208
321
  }
209
322
  }
210
323
  }
324
+ // THE LIVE ROW's owner: created before the submit path, stopped
325
+ // in the finally — every execute path (success, throw, fuse)
326
+ // retires the watchdog exactly once.
327
+ const live = startRunLiveness(run);
211
328
  try {
212
329
 
213
330
  // the comfyui progress webhooks like before"): the engine
@@ -230,6 +347,9 @@ export async function runOne(run, ctx, settle) {
230
347
  stage["progress"] = { value: pRec["value"], max: pRec["max"] };
231
348
  }
232
349
  }
350
+ // THE LIVE ROW (the module law above): the stamps are memory
351
+ // until this notify — the push-only tail never re-reads.
352
+ live.report();
233
353
  };
234
354
  const shouldStop = () => run.stopFlag;
235
355
  let result;
@@ -251,18 +371,22 @@ export async function runOne(run, ctx, settle) {
251
371
  outputs: { ...stage.outputs },
252
372
  params: { ...run.params[i] },
253
373
  }));
254
- const outcome = await seatExecutor.executeStages(genericRows, run.dir, inputNames, { shouldStop, report },
374
+ const outcome = await raceExecuteFuse(seatExecutor.executeStages(genericRows, run.dir, inputNames, { shouldStop, report, stateRoots: ctx.queue.stateRoots },
255
375
  // The run's request initials ride every engine submit: the
256
376
  // gate-blessed values the start door extracted for this
257
377
  // flow's declared initials, so `$spell` params resolve at
258
378
  // the engine's merge. Engines whose param dialect has no
259
379
  // `$spells` ignore the record.
260
- run.initials);
380
+ run.initials), run.executeCeilMs ?? ctx.queue.executeCeilMs, "the seat executor");
261
381
  result = {
262
382
  stages: Object.fromEntries(outcome.stages.map((s) => [
263
383
  s.stageId,
264
384
  { outputs: s.outputs, artifacts: [...s.artifacts] },
265
385
  ])),
386
+ // THE REPLAY VERDICT (D11): forwarded, never re-derived —
387
+ // the executor's seated tap is the only witness.
388
+ replaySuspect: outcome.replaySuspect,
389
+ promptId: String(outcome.engineRef),
266
390
  };
267
391
  }
268
392
  else {
@@ -273,14 +397,36 @@ export async function runOne(run, ctx, settle) {
273
397
  "merged submit (" + rows.length + " stages, " + nodeCount + " nodes)";
274
398
  }
275
399
  // Same law as the seat path above: the run's request initials
276
- // resolve the `$spells` at this merge.
277
- result = await engine.executeFlow(rows, run.dir, inputNames, run.initials, {
400
+ // resolve the `$spells` at this merge. The hung-run fuse wraps
401
+ // BOTH executors (one law, no escape hatch).
402
+ result = await raceExecuteFuse(engine.executeFlow(rows, run.dir, inputNames, run.initials, {
278
403
  shouldStop,
279
404
  report,
280
- });
405
+ stateRoots: ctx.queue.stateRoots,
406
+ }), run.executeCeilMs ?? ctx.queue.executeCeilMs, "the engine submit");
407
+ }
408
+ // THE PROMPT STAMP (P1): the executed prompt's id folds onto
409
+ // the receipt here — the seat path carried it on the merged
410
+ // result from outcome.engineRef, the legacy path reads
411
+ // FlowResult.promptId (the SAME POST /prompt answer), before
412
+ // the harvest below; settle's sidecar rewrite carries it to
413
+ // disk.
414
+ stampReceiptPromptId(run, result.promptId);
415
+ // THE MISSING-STAGE REFUSAL (P7 B1): the engine answered for a
416
+ // submitted stage id or it did not — there is no empty success.
417
+ // Judge the whole harvest BEFORE touching a stage row, so one
418
+ // missing id fails every running stage instead of leaving the
419
+ // answered stages completed beside it.
420
+ const missingStageIds = run.stages
421
+ .map((stage) => stage.id)
422
+ .filter((id) => result.stages[id] === undefined);
423
+ if (missingStageIds.length > 0) {
424
+ throw new Error("runs/missing-stage-result: the engine result has no row for " +
425
+ missingStageIds.map((id) => `stage "${id}"`).join(", ") +
426
+ " — a submitted stage with no result fails, never settles completed/empty");
281
427
  }
282
428
  for (const stage of run.stages) {
283
- const row = result.stages[stage.id] ?? { outputs: {}, artifacts: [] };
429
+ const row = result.stages[stage.id];
284
430
  const arts = row.artifacts.filter((a) => a !== "");
285
431
  run.artifacts.push(...arts);
286
432
  notifyRunChanged(run.runId);
@@ -325,6 +471,18 @@ export async function runOne(run, ctx, settle) {
325
471
  delete stage["activity"];
326
472
  }
327
473
  run.status = run.stopFlag ? "stopped" : "completed";
474
+
475
+ // folded zero engine events before settlement — the engine
476
+ // served memo'd outputs without executing (byte-identical
477
+ // graphs replay the previous film in ~0.01s, no ws events, the
478
+ // tile frozen at "merged submit"). The run still completes —
479
+ // the harvest is what the engine said — but the row tells the
480
+ // truth: this film may predate the request. A dead tap
481
+ // withholds the verdict (its own warn, never a replay claim).
482
+ if (result.replaySuspect === true) {
483
+ run.replaySuspect = true;
484
+ console.warn(`[runs] ${run.runId} completed with no engine progress events — the film may be a replay of an earlier identical submit (the request's inputs never executed)`);
485
+ }
328
486
  await settle(run);
329
487
  }
330
488
  catch (exc) {
@@ -346,6 +504,9 @@ export async function runOne(run, ctx, settle) {
346
504
  run.error = text;
347
505
  await settle(run);
348
506
  }
507
+ finally {
508
+ live.stop();
509
+ }
349
510
  }
350
511
  export function runEngine(run) {
351
512
  const first = run.stages[0];
@@ -353,4 +514,21 @@ export function runEngine(run) {
353
514
  // the card plane engine is the contract value (one owner per token)
354
515
  return typeof engine === "string" && engine !== "" ? engine : CARD_PLANE_ENGINE;
355
516
  }
517
+ /** THE GRAPH-RECEIPT PROMPT STAMP (the silent UI-drop purge's P1):
518
+ * the receipt is stamped at QUEUE time, but the engine mints the
519
+ * prompt_id at POST /prompt — inside the execute — so the claim
520
+ * rewrite (which runs BEFORE the submit) cannot carry it. The
521
+ * earliest estate seat that CAN see it is the execute outcome:
522
+ * the seat path's engineRef (comfyui-engine's brand) and the
523
+ * legacy path's FlowResult.promptId (the same POST /prompt
524
+ * answer). The stamp folds here, before settle — settle's sidecar
525
+ * rewrite carries `graph_receipt.prompt_id` to disk. Runs with no
526
+ * receipt (inline envelopes) stamp nothing. */
527
+ function stampReceiptPromptId(run, promptId) {
528
+ if (run.graphReceipt === undefined)
529
+ return;
530
+ if (typeof promptId !== "string" || promptId === "")
531
+ return;
532
+ run.graphReceipt = { ...run.graphReceipt, prompt_id: promptId };
533
+ }
356
534
  //# sourceMappingURL=runsExecute.js.map
@@ -1,4 +1,6 @@
1
1
  export { RETIRED_RUNNER_KNOBS, RETIRED_CARRY_KEYS, DOOR_KEYS } from "./vocab.js";
2
+ import { executeCeilOf, type ExecuteCeilVerdict } from "./queueSubmit.js";
3
+ export { executeCeilOf, type ExecuteCeilVerdict };
2
4
  import { STAGE_PATCH_KEYS } from "@melite/contracts/benchStage";
3
5
  export { STAGE_PATCH_KEYS };
4
6
  /** flow_inline top-level keys (the served shape). */
@@ -91,7 +93,9 @@ export type FlowsStartEnvelope = {
91
93
  kind: "malformed-draft";
92
94
  draftId: string;
93
95
  };
94
- /** Structure-gate one start doc (draft lookup stays in the door). */
96
+ /** Structure-gate one start doc (draft lookup stays in the door).
97
+ * The test-flag default rides the single seat (resolveTestFlag in
98
+ * ./queueSubmit.ts — purge §7 P7 F-1): no twin `??` here. */
95
99
  export declare function checkFlowsStartEnvelope(doc: unknown): FlowsStartEnvelope;
96
100
  /** The flow_inline top-structure verdict. */
97
101
  export type FlowInlineTop = {
package/lib/runsGates.js CHANGED
@@ -61,6 +61,8 @@ import z from "@deepseek-ai/schemastery";
61
61
  // ./vocab.ts — re-exported here for the gates' callers.
62
62
  export { RETIRED_RUNNER_KNOBS, RETIRED_CARRY_KEYS, DOOR_KEYS } from "./vocab.js";
63
63
  import { RETIRED_RUNNER_KNOBS, RETIRED_CARRY_KEYS, DOOR_KEYS } from "./vocab.js";
64
+ import { resolveTestFlag, executeCeilOf } from "./queueSubmit.js";
65
+ export { executeCeilOf };
64
66
  import { WIRE_STAGE_KEYS, STAGE_PATCH_KEYS } from "@melite/contracts/benchStage";
65
67
  export { STAGE_PATCH_KEYS };
66
68
  /** flow_inline top-level keys (the served shape). */
@@ -82,9 +84,10 @@ export const FLOW_ID_RE = /^[a-z_][a-z0-9_-]*$/;
82
84
  // OWNS the rule (DRAFT_ID_RE, 1..96) and this module re-exports that
83
85
  // exact object — the drafts spec's own JSDoc says the queue
84
86
  // re-exports it, which was false while the queue kept its own
85
- // byte-identical copy. draft-id-grammar.spec.ts still pins the two
86
- // as equal, and now that equality is the identity of one object
87
- // rather than the luck of two copies.
87
+ // byte-identical copy. (The draft-id-grammar wall's old equality
88
+ // arm is deleted — with the mirror gone it compared one object
89
+ // with itself; the one-declaration law lives in closure-gate
90
+ // RULE 4d, and the sampling arms exercise the ONE grammar.)
88
91
  export { DRAFT_ID_RE };
89
92
  /** Decode one strict body: "" decodes as {} (body.decode() or
90
93
  * "{}"). The TEXT embeds the host parser's message — walls assert
@@ -211,11 +214,13 @@ export const UPLOADS_VOICE = {
211
214
  "bad-filename": "uploads: filename is required",
212
215
  "bad-data": "uploads: data must be a FileReader data: URL",
213
216
  };
214
- /** Structure-gate one start doc (draft lookup stays in the door). */
217
+ /** Structure-gate one start doc (draft lookup stays in the door).
218
+ * The test-flag default rides the single seat (resolveTestFlag in
219
+ * ./queueSubmit.ts — purge §7 P7 F-1): no twin `??` here. */
215
220
  export function checkFlowsStartEnvelope(doc) {
216
221
  if (!isRecord(doc))
217
222
  return { kind: "not-object", doc };
218
- const testFlag = doc["test"] ?? false;
223
+ const testFlag = resolveTestFlag(doc);
219
224
  if (!isBoolField(testFlag))
220
225
  return { kind: "bad-test", testFlag };
221
226
  const draftId = doc["draft_id"];
package/lib/runsList.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { type DraftId } from "@melite/contracts/benchStage";
1
2
  /** Leading-int read (sidecar tails): optional space, optional
2
3
  * sign, then digits; 0 when no digits lead. */
3
4
  export declare function parseLeadingInt(s: string): number;
@@ -17,7 +18,19 @@ export declare function mediaCandidates(runDir: string): MediaCand[];
17
18
  /** run_artifacts: image/video/audio/model rows (image capped at _MAX_IMGS — counted but unlisted past it), everything else skipped; the {truncated,listed,total} marker when entries went unlisted. */
18
19
  /** path keeps the "./output/<run>/" literal. */
19
20
  export declare function runArtifacts(runDir: string, outDirLiteral: string): Record<string, unknown>[];
20
- /** _run_thumbnail: cached poster wins, else the first image candidate (same one-level rule, so nested-only runs still get a poster). */
21
+
22
+
23
+
24
+
25
+
26
+
27
+
28
+
29
+
30
+
31
+
32
+
33
+
21
34
  export declare function runThumbnail(runDir: string, runId: string): string;
22
35
  /** _run_dir_has_media: the media-FIRST sort key — top-level names, then one level down. */
23
36
  /** NOTE the absences: NO `_` skip (a lone `_poster.jpg` counts), NO inner isdir check (a nested DIR named x.mp4 counts) — probed live, mirrored exactly. */
@@ -48,6 +61,14 @@ export declare function runRowOrNull(row: {
48
61
  * engine-reported minted .qvoice absolute path; older sidecars
49
62
  * predate it, load lanes stamp nothing. */
50
63
  export_path?: string;
64
+
65
+
66
+
67
+
68
+ truncated?: {
69
+ listed: number;
70
+ total: number;
71
+ };
51
72
  }): Record<string, unknown> | null;
52
73
  /** Strict int parse: surrounding whitespace stripped, one optional
53
74
  * sign, ASCII digits with single internal underscores ("1_0" ->
@@ -57,9 +78,28 @@ export declare function parseIntOrNull(s: string): number | null;
57
78
  * value wins; the shared ctx parseQuery keeps blanks, so the
58
79
  * filter lives here (parse_qs default). */
59
80
  export declare function firstQuery(qs: Record<string, string[]>, name: string, dflt: string): string;
81
+
82
+
83
+
84
+
85
+
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+
98
+
99
+ export declare function noteRunTreeChanged(mutatedPath: string): void;
60
100
  /** The runs-list envelope (the restore port): the output-root scan, media-first + newest sort, the limit parse (raw STRING — the lane/remote pass the raw text; underscores parse, non-ints refuse), refused cards SKIPPED but counted. */
61
101
  /** url/thumbnail are run-RELATIVE (the /v1/assets prefix died with the app — the header's law). */
62
- export declare function listRuns(stateRoot: string, limit: number, hasDraft: (draftId: string) => Promise<boolean>): Promise<{
102
+ export declare function listRuns(stateRoot: string, limit: number, hasDraft: (draftId: DraftId) => Promise<boolean>): Promise<{
63
103
  count: number;
64
104
  runs: Record<string, unknown>[];
65
105
  }>;
@@ -70,7 +110,7 @@ export declare function listRuns(stateRoot: string, limit: number, hasDraft: (dr
70
110
 
71
111
 
72
112
 
73
- export declare function listRunsAcross(roots: string[], limit: number, hasDraft: (draftId: string) => Promise<boolean>): Promise<{
113
+ export declare function listRunsAcross(roots: string[], limit: number, hasDraft: (draftId: DraftId) => Promise<boolean>): Promise<{
74
114
  count: number;
75
115
  runs: Record<string, unknown>[];
76
116
  }>;