@melite/estate-queue 0.2.2-alpha → 0.3.0-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/bakeParams.d.ts +2 -1
- package/lib/bench.js +30 -3
- package/lib/cardsCompose.js +10 -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 +7 -18
- package/lib/cardsRegistry.js +132 -93
- package/lib/filmLead.js +9 -1
- package/lib/filmMemoryWarn.js +1 -0
- package/lib/flowsData.d.ts +33 -0
- package/lib/flowsData.js +45 -2
- package/lib/flowsFamilyCompose.js +1 -0
- package/lib/flowsParamsOverlay.d.ts +8 -1
- package/lib/flowsParamsOverlay.js +47 -2
- package/lib/flowsRegistryRows.js +40 -20
- package/lib/ledgerTail.js +1 -0
- package/lib/loadPlane.js +2 -0
- package/lib/managePlane.js +53 -12
- package/lib/manageProbe.js +33 -4
- 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 +3 -0
- package/lib/queueResurrect.js +5 -0
- package/lib/queueSidecar.d.ts +43 -3
- package/lib/queueSidecar.js +33 -4
- package/lib/queueSweep.d.ts +38 -11
- package/lib/queueSweep.js +73 -16
- package/lib/runsChange.d.ts +5 -4
- package/lib/runsExecute.js +98 -5
- package/lib/runsGates.js +1 -0
- package/lib/runsList.js +11 -0
- package/lib/runsRegistry.d.ts +29 -3
- package/lib/runsRegistry.js +187 -8
- package/lib/runsSourceEcho.d.ts +2 -1
- package/lib/runsSourceEcho.js +9 -3
- package/lib/runsTypes.d.ts +46 -0
- package/lib/runsTypes.js +44 -0
- package/lib/runsValidateArms.js +23 -2
- package/lib/runsValidateStages.js +18 -1
- package/lib/runtimeProvision.js +10 -2
- package/lib/skillFs.js +3 -0
- package/lib/skillRows.js +10 -6
- package/lib/vocab.d.ts +44 -0
- package/lib/vocab.js +96 -0
- package/package.json +15 -15
package/lib/runsRegistry.js
CHANGED
|
@@ -11,7 +11,7 @@ import { isEstateSidecarName, mediaKindOf } from "./mediaKinds.js";
|
|
|
11
11
|
// RemoteError with the runs/* codes declared HERE (the producing
|
|
12
12
|
// package, next to the throws).
|
|
13
13
|
import { CARD_PLANE_ENGINE, RUN_MEDIA_PREFIX } from "@melite/contracts/benchStage";
|
|
14
|
-
import { join, relative } from "node:path";
|
|
14
|
+
import { isAbsolute, join, relative, sep } from "node:path";
|
|
15
15
|
import { Service } from "@deepseek-ai/cordis";
|
|
16
16
|
import { RemoteError } from "@deepseek-ai/dsh-typert-protocol";
|
|
17
17
|
import { stageEngineOf } from "@melite/contracts/benchStage";
|
|
@@ -21,6 +21,7 @@ import { remoteErrorOf } from "@deepseek-ai/dsh-typert-protocol";
|
|
|
21
21
|
import { needComfyUI } from "@melite/comfyui-cordis";
|
|
22
22
|
import { STAGE_RESERVED_PARAMS } from "@melite/comfyui-cordis";
|
|
23
23
|
import { expandRegistryFlow, extractRequestInitials, initialFileCandidates, registryFlowToInline, inlineStagesNameCards, registryInitialsError, } from "./flowsData.js";
|
|
24
|
+
import { stageReservedKeyLifts } from "./cardsFacts.js";
|
|
24
25
|
import { isFile } from "./skillFs.js";
|
|
25
26
|
import { kindsOk } from "./runsValidateStages.js";
|
|
26
27
|
import { replayJudgeRows } from "./runsStart.js";
|
|
@@ -32,6 +33,7 @@ import { fetchEngineMem, filmLoadOf, filmMemoryWarn } from "./filmMemoryWarn.js"
|
|
|
32
33
|
import { searchedVoice } from "./rootsManifest.js";
|
|
33
34
|
import { newRunId, outRootFor, pipelineOf, strictBodyCheck, planResurrect, bootSweep, appendLedger, refusal, walkSubmitEnvelope } from "./queue.js";
|
|
34
35
|
import { graphReceiptOf, graphReceiptStageOf } from "./queueSidecar.js";
|
|
36
|
+
import { attributionPersist, galleryLabelPersist } from "./runsTypes.js";
|
|
35
37
|
import { sweepRunIds } from "./queueCore.js";
|
|
36
38
|
import { cardRefusal, toRemoteError, refusePreview } from "./runsRefusalVoices.js";
|
|
37
39
|
import { lifecycleInFlight } from "./lifecycleLatch.js";
|
|
@@ -62,6 +64,10 @@ import { BENCH_DRAFT_PREFIX_RE, benchDraftIdOf } from '@melite/contracts/benchSt
|
|
|
62
64
|
// both sides — which no program did until the walls did.
|
|
63
65
|
/** The refusal codes this remote serves, folded to the
|
|
64
66
|
* protocol's vocabulary — a literal table, no dynamic key. */
|
|
67
|
+
|
|
68
|
+
// served artifact tail normalizes at the mint — a native separator
|
|
69
|
+
// never rides a url or gallery name.
|
|
70
|
+
const wireTail = (tail) => tail.split(sep).join('/');
|
|
65
71
|
export function enrichDiskRow(row) {
|
|
66
72
|
const stages = Array.isArray(row['stages']) ? row['stages'] : [];
|
|
67
73
|
const artifacts = Array.isArray(row['artifacts'])
|
|
@@ -98,7 +104,24 @@ export function enrichDiskRow(row) {
|
|
|
98
104
|
const relative = (value) => {
|
|
99
105
|
const marker = `/${runId}/`;
|
|
100
106
|
const at = value.lastIndexOf(marker);
|
|
101
|
-
|
|
107
|
+
if (at >= 0)
|
|
108
|
+
return wireTail(value.slice(at + marker.length));
|
|
109
|
+
|
|
110
|
+
// artifacts bound the run-id segment with backslashes (often
|
|
111
|
+
// mixed with posix tails stored earlier) — the posix marker
|
|
112
|
+
// never matches there and the absolute rode the wire raw. On a
|
|
113
|
+
// Windows-rooted value, hunt the segment bounded by either
|
|
114
|
+
// separator; a posix value is never drive- or UNC-rooted, so it
|
|
115
|
+
// keeps the old miss path byte-for-byte.
|
|
116
|
+
if (!/^(?:[A-Za-z]:[\\/]|[\\/]{2}[^\\/])/u.test(value))
|
|
117
|
+
return value.replace(/^\/+/, '');
|
|
118
|
+
const seg = (c) => c === '/' || c === '\\';
|
|
119
|
+
for (let at = value.lastIndexOf(runId); at > 0; at = value.lastIndexOf(runId, at - 1)) {
|
|
120
|
+
if (seg(value[at - 1]) && seg(value[at + runId.length])) {
|
|
121
|
+
return wireTail(value.slice(at + runId.length + 1));
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
return value.replace(/^\/+/, '');
|
|
102
125
|
};
|
|
103
126
|
|
|
104
127
|
// hero's ONLY media law — it carried avif|m4v|avi the contract's
|
|
@@ -144,6 +167,7 @@ export function sidecarReaderFor(dir) {
|
|
|
144
167
|
return (name) => {
|
|
145
168
|
try {
|
|
146
169
|
return readFileSync(join(dir, name), 'utf8');
|
|
170
|
+
// a missing or unreadable sidecar file means there is nothing to mount — absence is a valid decorate answer, so the miss reads as null and never throws
|
|
147
171
|
}
|
|
148
172
|
catch {
|
|
149
173
|
return null;
|
|
@@ -411,6 +435,7 @@ export class RunsRuntimeService extends Service {
|
|
|
411
435
|
const comfy = this.engineSeat ?? (() => {
|
|
412
436
|
try {
|
|
413
437
|
return needComfyUI(this.ctx, "runsRemote teardown");
|
|
438
|
+
// needComfyUI throws when no ComfyUI seat is registered — undefined only skips the interrupt and the stopFlags still converge the worker loop (teardown must not fail)
|
|
414
439
|
}
|
|
415
440
|
catch {
|
|
416
441
|
return undefined;
|
|
@@ -647,14 +672,36 @@ export class RunsRuntimeService extends Service {
|
|
|
647
672
|
// bag the bench stored. The copy above keeps the original row
|
|
648
673
|
// untouched; the graph receipt below still judges the doc
|
|
649
674
|
// verbatim.
|
|
675
|
+
|
|
676
|
+
// reserved key the card's own DECLARATION admits is NOT a policy
|
|
677
|
+
// key on this stage — it is the card's param, and it WALKS (h3's
|
|
678
|
+
// declared output_name threads the deliverable save prefixes at
|
|
679
|
+
// compose; the settle's label mint reads it from the composed row
|
|
680
|
+
// either way). The spared truth is the same one admission judges
|
|
681
|
+
// (the DECL's schemaNames + admits — cardAdmits via cardsFacts
|
|
682
|
+
// stageReservedKeyLifts, the ONE spelling this loop and the write
|
|
683
|
+
// door's lift both ride); an undeclared reserved key on any other
|
|
684
|
+
// family keeps lifting verbatim, so the all-families label
|
|
685
|
+
// blanket survives.
|
|
650
686
|
const reserved = {};
|
|
687
|
+
const spared = {};
|
|
688
|
+
const card = String(row["card"] ?? "");
|
|
689
|
+
const decl = card !== "" ? this.ctx.cardRegistry.cardDecls()[card] : undefined;
|
|
651
690
|
for (const k of STAGE_RESERVED_PARAMS) {
|
|
652
|
-
if (params[k]
|
|
691
|
+
if (params[k] === undefined)
|
|
692
|
+
continue;
|
|
693
|
+
if (!stageReservedKeyLifts(decl, k)) {
|
|
694
|
+
// A declared reserved key WALKS (the card's own param) — and
|
|
695
|
+
// still rides the composed row's params bag below, so the
|
|
696
|
+
// settle's label mint and planMerge's paramsByStage read the
|
|
697
|
+
// same stem the compose threaded into the prefixes.
|
|
698
|
+
spared[k] = params[k];
|
|
699
|
+
}
|
|
700
|
+
else {
|
|
653
701
|
reserved[k] = params[k];
|
|
654
702
|
delete params[k];
|
|
655
703
|
}
|
|
656
704
|
}
|
|
657
|
-
const card = String(row["card"] ?? "");
|
|
658
705
|
// STROKE 3'S FALLBACK (the validate walk's own shape —
|
|
659
706
|
// runsValidateArms: a family-less card stage composes by its OWN
|
|
660
707
|
// card id — mid alone, never an injected body.model, which would
|
|
@@ -916,7 +963,11 @@ export class RunsRuntimeService extends Service {
|
|
|
916
963
|
output_nodes: (renamedAny ? renamedNodes : cardNodes),
|
|
917
964
|
// THE STAGE-RESERVED CARRY (F-C): the merge plane's own keys
|
|
918
965
|
// ride beside the composed graph — additive, never a card key.
|
|
966
|
+
// A SPARED reserved key (declared on the card — h3's
|
|
967
|
+
// output_name) rides the same bag: the label mint and the
|
|
968
|
+
// file-plane compose read ONE stem.
|
|
919
969
|
...reserved,
|
|
970
|
+
...spared,
|
|
920
971
|
},
|
|
921
972
|
|
|
922
973
|
// `expected` for its kindsOk walk and defaults an absent bag to
|
|
@@ -1772,9 +1823,19 @@ export class RunsRuntimeService extends Service {
|
|
|
1772
1823
|
// F-6(b): the admission warn computes pre-registration so
|
|
1773
1824
|
// it rides the record AND the queued sidecar (disk rows
|
|
1774
1825
|
// carry it after a reload).
|
|
1826
|
+
// THE PROMPT GATE'S RECEIPT HALF (the VID GEN handoff,
|
|
1827
|
+
|
|
1828
|
+
// prompt gate's warn severities and every NAMED waiver
|
|
1829
|
+
// (params.prompt_waivers) as one line each — rides the same
|
|
1830
|
+
// stamp: a waived rule passes the press and is recorded,
|
|
1831
|
+
// never silent. The lines derive from the card's own gate
|
|
1832
|
+
// over the admitted doc (cardRequestBody — the same doc the
|
|
1833
|
+
// compose judged), so the receipt and the refusal can never
|
|
1834
|
+
// disagree.
|
|
1775
1835
|
warnings: [
|
|
1776
1836
|
...benchWarnings,
|
|
1777
1837
|
...(await this.filmAdmissionWarnings(p1.card, body)),
|
|
1838
|
+
...((cards.defsSync().get(p1.card)?.admissionWarns?.(cardRequestBody)) ?? []),
|
|
1778
1839
|
],
|
|
1779
1840
|
door: {
|
|
1780
1841
|
runId,
|
|
@@ -1901,9 +1962,23 @@ export class RunsRuntimeService extends Service {
|
|
|
1901
1962
|
// the flow door. The overlay law is SHARED (round-21 flows
|
|
1902
1963
|
// audit F1): applyFlowParamsOverride below, the same helper the
|
|
1903
1964
|
// validate door rides.
|
|
1965
|
+
|
|
1966
|
+
// a {flow:} press reads card knobs from params — a seed at
|
|
1967
|
+
// the top lands in NO stage (every stage mints fresh) while
|
|
1968
|
+
// _request.json carries it like a promise, so the flow cannot
|
|
1969
|
+
// reproduce. Refuse LOUD with the corrected spelling, never
|
|
1970
|
+
// mint behind a knob that died silently.
|
|
1971
|
+
if (body["seed"] !== undefined) {
|
|
1972
|
+
throw new RemoteError("runs/invalid-request", "flow " + JSON.stringify(name) + " carries a top-level " +
|
|
1973
|
+
JSON.stringify("seed") + " — a {flow:} press reads card " +
|
|
1974
|
+
"knobs from params, so a top-level seed reaches no stage. " +
|
|
1975
|
+
"State it inside params ({seed: N}) to pin every stage " +
|
|
1976
|
+
"this flow's tool overlay names; the flow's initials " +
|
|
1977
|
+
"stay top-level.", { loc: "params" });
|
|
1978
|
+
}
|
|
1904
1979
|
const overrideRaw = body["params"];
|
|
1905
1980
|
if (overrideRaw !== undefined) {
|
|
1906
|
-
applyFlowParamsOverride(name, expanded.stages, overrideRaw, overlayDecls(this.ctx.cardRegistry), String(body["model"] ?? ""));
|
|
1981
|
+
applyFlowParamsOverride(name, expanded.stages, overrideRaw, overlayDecls(this.ctx.cardRegistry), String(body["model"] ?? ""), decl.tool?.overlays ?? []);
|
|
1907
1982
|
const rest = { ...body };
|
|
1908
1983
|
delete rest["params"];
|
|
1909
1984
|
body = rest;
|
|
@@ -2336,6 +2411,7 @@ export class RunsRuntimeService extends Service {
|
|
|
2336
2411
|
const cfg = loadEndpointConfig();
|
|
2337
2412
|
if (typeof cfg["url"] === "string")
|
|
2338
2413
|
url = cfg["url"];
|
|
2414
|
+
// an unreadable endpoint config leaves the engine url empty — the admission stats read is best-effort and a stats failure never blocks admission
|
|
2339
2415
|
}
|
|
2340
2416
|
catch {
|
|
2341
2417
|
url = "";
|
|
@@ -2488,8 +2564,14 @@ export class RunsRuntimeService extends Service {
|
|
|
2488
2564
|
// prefixing runId again served `<run-id>/<run-id>/<rel>` —
|
|
2489
2565
|
// the receipt printed a path that exists nowhere. Relativize
|
|
2490
2566
|
// off the RUN DIR: the join restores exactly <run-id>/<rel>.
|
|
2491
|
-
artifacts: [...run.artifacts].map((a) =>
|
|
2492
|
-
|
|
2567
|
+
artifacts: [...run.artifacts].map((a) =>
|
|
2568
|
+
// isAbsolute, not startsWith("/"): a Windows-harvested
|
|
2569
|
+
// artifact is drive-rooted — the posix-only gate served it
|
|
2570
|
+
|
|
2571
|
+
// tail re-spells to posix: the wire face never carries a
|
|
2572
|
+
// native separator.
|
|
2573
|
+
isAbsolute(a)
|
|
2574
|
+
? [run.runId, wireTail(relative(join(outRootFor(this.ctx.queue.stateRoot, run.testFlag), run.runId), a))].join("/")
|
|
2493
2575
|
: a),
|
|
2494
2576
|
error: run.error,
|
|
2495
2577
|
// F-6(b): admission warnings ride the row (additive — older
|
|
@@ -2511,6 +2593,11 @@ export class RunsRuntimeService extends Service {
|
|
|
2511
2593
|
// fallback spreads the sidecar row, which carries it).
|
|
2512
2594
|
// Absent on inline runs (no card composed).
|
|
2513
2595
|
...(run.graphReceipt !== undefined ? { graph_receipt: run.graphReceipt } : {}),
|
|
2596
|
+
// THE ATTRIBUTION MARKER, SERVED (D3-07, same law: a missed
|
|
2597
|
+
// stamp-back rides the live row — additive, same spelling as
|
|
2598
|
+
// the sidecar; absent means the stamp landed or was never
|
|
2599
|
+
// owed).
|
|
2600
|
+
...(run.attribution !== undefined && run.attribution !== "" ? { attribution: run.attribution } : {}),
|
|
2514
2601
|
|
|
2515
2602
|
// exact card + authoring body that ran rides the live row —
|
|
2516
2603
|
// restore rebuilds the recipe from THIS, never from the
|
|
@@ -2640,7 +2727,7 @@ export class RunsRuntimeService extends Service {
|
|
|
2640
2727
|
if (run.status === "running")
|
|
2641
2728
|
run.status = "stopping";
|
|
2642
2729
|
run.stopFlag = true;
|
|
2643
|
-
notifyRunChanged(runId);
|
|
2730
|
+
notifyRunChanged(run.runId);
|
|
2644
2731
|
// The interrupt rides the injected engine service when the
|
|
2645
2732
|
// seat exists (best-effort — the flag is the authority).
|
|
2646
2733
|
try {
|
|
@@ -2656,6 +2743,98 @@ export class RunsRuntimeService extends Service {
|
|
|
2656
2743
|
}
|
|
2657
2744
|
return { run_id: runId, status: "stopping" };
|
|
2658
2745
|
}
|
|
2746
|
+
/** THE ATTRIBUTION DOOR (F3 D3-07, the 15 s bound's third burn —
|
|
2747
|
+
* RIG s_94: a green run whose cards-tab stamp died at the bench
|
|
2748
|
+
* plane's bound). The stamp-back's bounded retry lives client-side
|
|
2749
|
+
* (melite-flow); when every take dies, THIS door carries the miss
|
|
2750
|
+
* on the run row — a different plane than the wedged drafts
|
|
2751
|
+
* PATCH, so the fact lands even when the stamp could not. The
|
|
2752
|
+
* status door and the press receipt then answer "completed — NOT
|
|
2753
|
+
* shown on the tab (stamp missed; re-stamp)" instead of a bare
|
|
2754
|
+
* done. Idempotent: a re-stamp that landed clears it
|
|
2755
|
+
* (value "" unstamps), the persist is best-effort by the
|
|
2756
|
+
* claim/settle law, and the change rides notifyRunChanged so the
|
|
2757
|
+
* tab's poller re-fires on the truth. */
|
|
2758
|
+
async attribute(runId, value, signal) {
|
|
2759
|
+
signal.throwIfAborted();
|
|
2760
|
+
const run = this.liveRun(runId);
|
|
2761
|
+
if (run === undefined) {
|
|
2762
|
+
// the same miss voice as stop: the door names the trees it
|
|
2763
|
+
// searched, never a bare unknown.
|
|
2764
|
+
throw new RemoteError("runs/run-unknown", "unknown run_id " + JSON.stringify(runId) + " " +
|
|
2765
|
+
searchedVoice(this.ctx.queue.stateRoots), { runId });
|
|
2766
|
+
}
|
|
2767
|
+
if (value === "")
|
|
2768
|
+
delete run.attribution;
|
|
2769
|
+
else
|
|
2770
|
+
run.attribution = value;
|
|
2771
|
+
notifyRunChanged(run.runId);
|
|
2772
|
+
await attributionPersist(run);
|
|
2773
|
+
return { run_id: runId, attribution: run.attribution ?? "" };
|
|
2774
|
+
}
|
|
2775
|
+
/** THE OUTPUT-RENAME DOOR (queue 12 Phase B): a settled run's
|
|
2776
|
+
* gallery row gets a new display `label`, post-run — the output_name
|
|
2777
|
+
* mint at settle named the rows once; this door owns every rename
|
|
2778
|
+
* after. The `name` (the machine file key the media route and every
|
|
2779
|
+
* dedup law ride) NEVER moves — the patch rewrites the addressed
|
|
2780
|
+
* row's label alone: no sibling renumbering, no `stem · 2…n`
|
|
2781
|
+
* auto-repair; a caller with several rows to rename patches each
|
|
2782
|
+
* row it wants. Guards speak before any write: unknown run
|
|
2783
|
+
* (runs/run-unknown, the searched-trees voice), a live row (rename
|
|
2784
|
+
* waits for settle), an empty/whitespace label, an out-of-range
|
|
2785
|
+
* stage or gallery index. The patch lands in the live row, the
|
|
2786
|
+
* change rides notifyRunChanged (the tab's poller re-fires), and
|
|
2787
|
+
* the sidecar rewrite persists it (the disk fallback and every
|
|
2788
|
+
* boot re-read spread the new label). */
|
|
2789
|
+
async renameOutput(runId, stageIndex, galleryIndex, label, signal) {
|
|
2790
|
+
signal.throwIfAborted();
|
|
2791
|
+
const run = this.liveRun(runId);
|
|
2792
|
+
if (run === undefined) {
|
|
2793
|
+
// the same miss voice as stop/attribute: the door names the
|
|
2794
|
+
// trees it searched, never a bare unknown.
|
|
2795
|
+
throw new RemoteError("runs/run-unknown", "unknown run_id " + JSON.stringify(runId) + " " +
|
|
2796
|
+
searchedVoice(this.ctx.queue.stateRoots), { runId });
|
|
2797
|
+
}
|
|
2798
|
+
if (run.status === "queued" || run.status === "running" || run.status === "stopping") {
|
|
2799
|
+
// THE SETTLE GUARD: the gallery is the settle's own build — a
|
|
2800
|
+
// rename pressed mid-execution would patch rows the executor
|
|
2801
|
+
// is still minting. The refusal names the wait, never a silent
|
|
2802
|
+
// no-op.
|
|
2803
|
+
throw new RemoteError("runs/invalid-request", "run " + JSON.stringify(runId) + " still executing — rename waits for settle", { loc: "run_id", expected: "a settled run (completed/failed/stopped)", got: run.status });
|
|
2804
|
+
}
|
|
2805
|
+
const trimmed = label.trim();
|
|
2806
|
+
if (trimmed === "") {
|
|
2807
|
+
throw new RemoteError("runs/invalid-request", "rename refused — the label is empty (whitespace is emptiness; a gallery row needs display words)", { loc: "label", expected: "non-empty text", got: JSON.stringify(label) });
|
|
2808
|
+
}
|
|
2809
|
+
const stage = run.stages[stageIndex];
|
|
2810
|
+
if (stage === undefined) {
|
|
2811
|
+
throw new RemoteError("runs/invalid-request", "stage index " + String(stageIndex) + " out of range — run " + JSON.stringify(runId) +
|
|
2812
|
+
" carries " + String(run.stages.length) + " stage(s)", { loc: "stage", expected: "0.." + String(run.stages.length - 1), got: String(stageIndex) });
|
|
2813
|
+
}
|
|
2814
|
+
const gallery = stage["gallery"];
|
|
2815
|
+
if (!Array.isArray(gallery) || gallery.length === 0) {
|
|
2816
|
+
throw new RemoteError("runs/invalid-request", "stage " + String(stageIndex) + " carries no gallery — nothing to rename", { loc: "gallery", expected: "a settled stage with artifacts", got: String(stageIndex) });
|
|
2817
|
+
}
|
|
2818
|
+
if (!Number.isInteger(galleryIndex) || galleryIndex < 0 || galleryIndex >= gallery.length) {
|
|
2819
|
+
throw new RemoteError("runs/invalid-request", "gallery index " + String(galleryIndex) + " out of range — stage " + String(stageIndex) +
|
|
2820
|
+
" carries " + String(gallery.length) + " artifact row(s)", { loc: "gallery", expected: "0.." + String(gallery.length - 1), got: String(galleryIndex) });
|
|
2821
|
+
}
|
|
2822
|
+
const row = gallery[galleryIndex];
|
|
2823
|
+
const name = typeof row["name"] === "string" ? row["name"] : "";
|
|
2824
|
+
// label-only patch: the row keeps its name and position; the
|
|
2825
|
+
// spread rebuilds the row with exactly one field changed.
|
|
2826
|
+
gallery[galleryIndex] = { ...row, label: trimmed };
|
|
2827
|
+
notifyRunChanged(run.runId);
|
|
2828
|
+
await galleryLabelPersist(run);
|
|
2829
|
+
return {
|
|
2830
|
+
run_id: runId,
|
|
2831
|
+
stage: stageIndex,
|
|
2832
|
+
gallery: galleryIndex,
|
|
2833
|
+
name,
|
|
2834
|
+
label: trimmed,
|
|
2835
|
+
status: run.status,
|
|
2836
|
+
};
|
|
2837
|
+
}
|
|
2659
2838
|
/** The live map (the queue seat's core registry — rich rows). */
|
|
2660
2839
|
liveRun(runId) {
|
|
2661
2840
|
return this.core.runs.get(runId);
|
package/lib/runsSourceEcho.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ export declare const GALLERY_ARTIFACT_PATH = "/infer-gallery/artifact";
|
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
export declare function galleryTail(t: string): string | null;
|
|
33
|
-
|
|
33
|
+
type SourceFace = "run" | "abs";
|
|
34
34
|
/** A collected pointer: the VERBATIM string (history stamps what
|
|
35
35
|
* the params held — the engine trims for staging, the record
|
|
36
36
|
* keeps the author's spelling) plus its parsed face. */
|
|
@@ -78,4 +78,5 @@ export declare function resolveSourceRefs(refs: readonly string[], roots: readon
|
|
|
78
78
|
/** Backward face (roots-only walk — the first law's signature).
|
|
79
79
|
* New code prefers resolveSourceRefs. */
|
|
80
80
|
export declare function resolveMediaRefs(refs: readonly string[], roots: readonly string[]): SourceEchoRef[];
|
|
81
|
+
export {};
|
|
81
82
|
//# sourceMappingURL=runsSourceEcho.d.ts.map
|
package/lib/runsSourceEcho.js
CHANGED
|
@@ -42,7 +42,7 @@ import { segmentConfined, servableLeaf } from "@melite/contracts/mediaKinds";
|
|
|
42
42
|
// enums, import type for types, .ts specifiers for relative imports.
|
|
43
43
|
import { LEGACY_RUN_MEDIA_PREFIX, RUN_MEDIA_PREFIX, RUN_ID_RE } from "@melite/contracts/benchStage";
|
|
44
44
|
import { statSync } from "node:fs";
|
|
45
|
-
import { join } from "node:path";
|
|
45
|
+
import { isAbsolute, join } from "node:path";
|
|
46
46
|
/** The serving prefixes the estate owns (comfyui-upload's
|
|
47
47
|
* MEDIA/ASSET_ROUTE_PREFIX twins — detection is case-insensitive
|
|
48
48
|
* like the engine's; the sliced tail keeps its case). */
|
|
@@ -89,6 +89,7 @@ export function galleryTail(t) {
|
|
|
89
89
|
let path = null;
|
|
90
90
|
try {
|
|
91
91
|
path = new URL(t, "http://source-echo.invalid").searchParams.get("path");
|
|
92
|
+
// a string the URL parser refuses is not a well-formed gallery pointer — null falls through to the caller's absolute face where a bad pointer still refuses loud
|
|
92
93
|
}
|
|
93
94
|
catch {
|
|
94
95
|
return null;
|
|
@@ -121,7 +122,10 @@ function detectFace(t) {
|
|
|
121
122
|
const tail = galleryTail(t);
|
|
122
123
|
if (tail !== null)
|
|
123
124
|
return { face: "run", rest: tail, decoded: true };
|
|
124
|
-
|
|
125
|
+
// (isAbsolute, not startsWith("/"): a win32-absolute disk path
|
|
126
|
+
// carries a drive prefix and misfiled as prose — no "/" anywhere —
|
|
127
|
+
// so staging refused it "not a source pointer")
|
|
128
|
+
if (isAbsolute(t))
|
|
125
129
|
return { face: "abs", rest: t, decoded: false };
|
|
126
130
|
|
|
127
131
|
// `t.includes("..")` substring ban refused a LEGAL name the engine
|
|
@@ -137,6 +141,7 @@ function detectFace(t) {
|
|
|
137
141
|
let decodedHead;
|
|
138
142
|
try {
|
|
139
143
|
decodedHead = decodeURIComponent(head);
|
|
144
|
+
// a bad percent-escape means the head is not a minted run id — null sends the pointer to the caller's loud not-a-source refusal instead of a parser crash
|
|
140
145
|
}
|
|
141
146
|
catch {
|
|
142
147
|
return null;
|
|
@@ -256,6 +261,7 @@ export function parseMediaRef(ref) {
|
|
|
256
261
|
function isDir(p) {
|
|
257
262
|
try {
|
|
258
263
|
return statSync(p).isDirectory();
|
|
264
|
+
// statSync fails on a missing or unreadable path — a path that stats as nothing is not a directory, so false is the caller's exact answer
|
|
259
265
|
}
|
|
260
266
|
catch {
|
|
261
267
|
return false;
|
|
@@ -310,7 +316,7 @@ export function resolveSourceRefs(refs, roots, cwd = process.cwd(), selfRunId =
|
|
|
310
316
|
// THE CWD FALL-THROUGH (the stager's own order — a tail the
|
|
311
317
|
// trees miss still stages from the lane's cwd, so the guard
|
|
312
318
|
// honors it too; same process, same cwd, no drift).
|
|
313
|
-
if (file === "" && !parsed.url.trim()
|
|
319
|
+
if (file === "" && !isAbsolute(parsed.url.trim())) {
|
|
314
320
|
const cand = join(cwd, parsed.rel);
|
|
315
321
|
if (isFile(cand))
|
|
316
322
|
file = cand;
|
package/lib/runsTypes.d.ts
CHANGED
|
@@ -86,6 +86,16 @@ export interface RunRecord {
|
|
|
86
86
|
|
|
87
87
|
|
|
88
88
|
pressKey?: string;
|
|
89
|
+
/** THE ATTRIBUTION MARKER (F3 D3-07, the 15 s bound's third
|
|
90
|
+
* burn): 'missed' when the bench-plane stamp-back died at its
|
|
91
|
+
* bound AFTER the run settled — the run row, not the wedged
|
|
92
|
+
* draft door, carries the fact so run_status and the press
|
|
93
|
+
* receipt can say "completed — NOT shown on the tab" instead of
|
|
94
|
+
* a bare done. Written by the runs attribute door (the live-run
|
|
95
|
+
* registry plane, never the bench plane that died); a landed
|
|
96
|
+
* re-stamp clears it. Absent on runs whose stamp landed (or was
|
|
97
|
+
* never owed). */
|
|
98
|
+
attribution?: string;
|
|
89
99
|
/** THE CARD SNAPSHOT (stroke 45): the exact card + body that ran
|
|
90
100
|
* ({card, params}) — the wand restores from this, never from the
|
|
91
101
|
* living bench. Stamped at registration, carried through settle
|
|
@@ -164,6 +174,17 @@ export interface RunRecord {
|
|
|
164
174
|
|
|
165
175
|
|
|
166
176
|
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
engineRetryCount?: number;
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
|
|
167
188
|
loudness?: {
|
|
168
189
|
loudness_lufs: number;
|
|
169
190
|
peak_db: number;
|
|
@@ -249,6 +270,31 @@ export declare function settlePersist(run: RunRecord, stateRoot: string): Promis
|
|
|
249
270
|
|
|
250
271
|
|
|
251
272
|
export declare function claimPersist(run: RunRecord): Promise<void>;
|
|
273
|
+
/** THE ATTRIBUTION PERSIST (F3 D3-07, the 15 s bound's third burn):
|
|
274
|
+
* the runs registry's attribute door rewrites the run's
|
|
275
|
+
* _flow.json the moment it marks a stamp-miss — the marker must
|
|
276
|
+
* survive a registry reload (the status door's disk fallback
|
|
277
|
+
* spreads this row) and outlive the wedged bench plane that
|
|
278
|
+
* dropped the stamp. Best-effort by the claim/settle law: the
|
|
279
|
+
* in-memory row is the truth, a persist failure never blocks the
|
|
280
|
+
* mark. No ledger row: the ledger carries dispositions, and the
|
|
281
|
+
* stamp's own miss voice is the press receipt's job.
|
|
282
|
+
* @param run the marked row (the caller already set
|
|
283
|
+
* run.attribution in memory).
|
|
284
|
+
* @returns when the write completed or self-swallowed its fault. */
|
|
285
|
+
export declare function attributionPersist(run: RunRecord): Promise<void>;
|
|
286
|
+
/** THE RENAME PERSIST (queue 12 Phase B): the runs registry's rename
|
|
287
|
+
* door rewrites the run's _flow.json the moment a gallery row's
|
|
288
|
+
* `label` lands — the display name must survive a registry reload
|
|
289
|
+
* (the status door's disk fallback spreads this row) and every
|
|
290
|
+
* later boot's re-read. Best-effort by the claim/settle law: the
|
|
291
|
+
* in-memory row is the truth, a persist failure never blocks the
|
|
292
|
+
* rename. The row's `name` is untouched — this write carries the
|
|
293
|
+
* patched row only because sidecarFacesOf mirrors the live stages.
|
|
294
|
+
* @param run the patched row (the caller already rewrote the gallery
|
|
295
|
+
* label in memory).
|
|
296
|
+
* @returns when the write completed or self-swallowed its fault. */
|
|
297
|
+
export declare function galleryLabelPersist(run: RunRecord): Promise<void>;
|
|
252
298
|
/** The synthesized log tail (door-verbatim port: the retired
|
|
253
299
|
* oracle's status voice, synthesized from the live row). */
|
|
254
300
|
export declare function runLogTail(obj: {
|
package/lib/runsTypes.js
CHANGED
|
@@ -256,6 +256,11 @@ function sidecarFacesOf(run) {
|
|
|
256
256
|
// THE REPLAY VERDICT rides every rewrite too (D11 — a disk row
|
|
257
257
|
// keeps what the executor's tap witnessed).
|
|
258
258
|
replaySuspect: run.replaySuspect,
|
|
259
|
+
// THE ATTRIBUTION MARKER rides every rewrite too (D3-07 — a
|
|
260
|
+
// disk row keeps the stamp-miss the tab never showed).
|
|
261
|
+
attribution: run.attribution,
|
|
262
|
+
// THE COLD-LOAD RETRY LEDGER (A1) — same carry law.
|
|
263
|
+
engineRetryCount: run.engineRetryCount,
|
|
259
264
|
};
|
|
260
265
|
}
|
|
261
266
|
|
|
@@ -282,6 +287,45 @@ export async function claimPersist(run) {
|
|
|
282
287
|
/* the sidecar must never take the claim down (settlePersist law) */
|
|
283
288
|
}
|
|
284
289
|
}
|
|
290
|
+
/** THE ATTRIBUTION PERSIST (F3 D3-07, the 15 s bound's third burn):
|
|
291
|
+
* the runs registry's attribute door rewrites the run's
|
|
292
|
+
* _flow.json the moment it marks a stamp-miss — the marker must
|
|
293
|
+
* survive a registry reload (the status door's disk fallback
|
|
294
|
+
* spreads this row) and outlive the wedged bench plane that
|
|
295
|
+
* dropped the stamp. Best-effort by the claim/settle law: the
|
|
296
|
+
* in-memory row is the truth, a persist failure never blocks the
|
|
297
|
+
* mark. No ledger row: the ledger carries dispositions, and the
|
|
298
|
+
* stamp's own miss voice is the press receipt's job.
|
|
299
|
+
* @param run the marked row (the caller already set
|
|
300
|
+
* run.attribution in memory).
|
|
301
|
+
* @returns when the write completed or self-swallowed its fault. */
|
|
302
|
+
export async function attributionPersist(run) {
|
|
303
|
+
try {
|
|
304
|
+
await writeJsonAtomic(join(run.dir, "_flow.json"), sidecarDoc(sidecarFacesOf(run)));
|
|
305
|
+
}
|
|
306
|
+
catch {
|
|
307
|
+
/* the sidecar must never take the mark down (claimPersist law) */
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
/** THE RENAME PERSIST (queue 12 Phase B): the runs registry's rename
|
|
311
|
+
* door rewrites the run's _flow.json the moment a gallery row's
|
|
312
|
+
* `label` lands — the display name must survive a registry reload
|
|
313
|
+
* (the status door's disk fallback spreads this row) and every
|
|
314
|
+
* later boot's re-read. Best-effort by the claim/settle law: the
|
|
315
|
+
* in-memory row is the truth, a persist failure never blocks the
|
|
316
|
+
* rename. The row's `name` is untouched — this write carries the
|
|
317
|
+
* patched row only because sidecarFacesOf mirrors the live stages.
|
|
318
|
+
* @param run the patched row (the caller already rewrote the gallery
|
|
319
|
+
* label in memory).
|
|
320
|
+
* @returns when the write completed or self-swallowed its fault. */
|
|
321
|
+
export async function galleryLabelPersist(run) {
|
|
322
|
+
try {
|
|
323
|
+
await writeJsonAtomic(join(run.dir, "_flow.json"), sidecarDoc(sidecarFacesOf(run)));
|
|
324
|
+
}
|
|
325
|
+
catch {
|
|
326
|
+
/* the sidecar must never take the rename down (claimPersist law) */
|
|
327
|
+
}
|
|
328
|
+
}
|
|
285
329
|
/** The synthesized log tail (door-verbatim port: the retired
|
|
286
330
|
* oracle's status voice, synthesized from the live row). */
|
|
287
331
|
export function runLogTail(obj) {
|
package/lib/runsValidateArms.js
CHANGED
|
@@ -7,6 +7,7 @@ import { composeFamilyStages, liveFamilySeat } from "./flowsFamilyCompose.js";
|
|
|
7
7
|
import { resolveRepoRoot } from "@melite/comfyui-cordis";
|
|
8
8
|
import { inlineArm, strictBody } from "./runsValidate.js";
|
|
9
9
|
import { FLOW_ID_RE } from "./runsGates.js";
|
|
10
|
+
import { liftStageReservedForAdmission } from "./cardsFacts.js";
|
|
10
11
|
import { CardArmError } from "./cardsArmError.js";
|
|
11
12
|
import { prepareCardParams } from "./cardsCompose.js";
|
|
12
13
|
export async function validate(doc, signal, ctx) {
|
|
@@ -71,9 +72,17 @@ export async function validate(doc, signal, ctx) {
|
|
|
71
72
|
// gate gets the same first refusal from both doors, never
|
|
72
73
|
// params-voice here and stages-voice at start (or the
|
|
73
74
|
// reverse).
|
|
75
|
+
if (body["seed"] !== undefined) {
|
|
76
|
+
throw new RemoteError("runs/invalid-request", "flow " + JSON.stringify(name) + " carries a top-level " +
|
|
77
|
+
JSON.stringify("seed") + " — a {flow:} press reads card " +
|
|
78
|
+
"knobs from params, so a top-level seed reaches no stage. " +
|
|
79
|
+
"State it inside params ({seed: N}) to pin every stage " +
|
|
80
|
+
"this flow's tool overlay names; the flow's initials " +
|
|
81
|
+
"stay top-level.", { loc: "params" });
|
|
82
|
+
}
|
|
74
83
|
const overrideRaw = body["params"];
|
|
75
84
|
if (overrideRaw !== undefined) {
|
|
76
|
-
applyFlowParamsOverride(name, expanded.stages, overrideRaw, overlayDecls(ctx.cardRegistry), String(body["model"] ?? ""));
|
|
85
|
+
applyFlowParamsOverride(name, expanded.stages, overrideRaw, overlayDecls(ctx.cardRegistry), String(body["model"] ?? ""), decl.tool?.overlays ?? []);
|
|
77
86
|
}
|
|
78
87
|
// The same compile-time gate at validate (REBUILD-21).
|
|
79
88
|
const badInitial = registryInitialsError(expanded, body, {
|
|
@@ -244,7 +253,18 @@ async function composeCardStagesAtValidate(liveDoc, svc) {
|
|
|
244
253
|
// before any phase1Card resolution folds the stated model
|
|
245
254
|
// into a stranger's lane (trim + krea-2 lived as image-gen).
|
|
246
255
|
refuseFamilylessHijack(svc, String(st["card"]), params["model"] ?? service);
|
|
247
|
-
|
|
256
|
+
// THE STAGE-RESERVED LIFT AT THE VALIDATE WALK (the F41
|
|
257
|
+
|
|
258
|
+
// bench write doors' PRE-MINT GATE (composeVerdictOf rides
|
|
259
|
+
// it) — the run compose lifts the stage-policy keys before
|
|
260
|
+
// ITS phase1Card (composeCardStageRow's carry), and this
|
|
261
|
+
// walk judged the raw bag, so the add door's own compose
|
|
262
|
+
// check refused the knob the run would carry. The same
|
|
263
|
+
// judged copy the write door's admission rides
|
|
264
|
+
// (liftStageReservedForAdmission): policy keys out, the
|
|
265
|
+
// row's own bag never touched, a declared reserved key still
|
|
266
|
+
// judged.
|
|
267
|
+
await svc.phase1Card(liftStageReservedForAdmission(svc.cardDecls()[String(st["card"])], body), mid);
|
|
248
268
|
}
|
|
249
269
|
catch (e) {
|
|
250
270
|
if (e instanceof CardArmError) {
|
|
@@ -316,6 +336,7 @@ export async function modelValidateArm(body, ctx) {
|
|
|
316
336
|
let facts;
|
|
317
337
|
try {
|
|
318
338
|
facts = svc.modelFacts();
|
|
339
|
+
// a thrown model-facts read (absent or unreadable facts file) is the door's pinned degradation — the empty table reads as facts-absent, so prepare judges the catalog alone
|
|
319
340
|
}
|
|
320
341
|
catch {
|
|
321
342
|
facts = {};
|
|
@@ -210,7 +210,24 @@ export function cardGate(flowId, st, cards) {
|
|
|
210
210
|
" is not a registered card (the card set boots from " +
|
|
211
211
|
"src/cards — see GET /v1/tools for the served surface)");
|
|
212
212
|
}
|
|
213
|
-
|
|
213
|
+
|
|
214
|
+
// same requiresModel-keyed exemption B5 burned on at the tool's
|
|
215
|
+
// stamp): a card boarding MORE THAN ONE family cannot infer its
|
|
216
|
+
// lane at the engine (the model-less arm infers only a single-board
|
|
217
|
+
// card's boarded[0]), so a row with no params.model composes
|
|
218
|
+
// familyless and dies at the card's dispatch — historically at
|
|
219
|
+
// PRESS time, in a voice citing a session the caller never touched
|
|
220
|
+
// (image-edit's "no declared action for family ''", session 7a82).
|
|
221
|
+
// The gate demands the seat HERE, at every compile seat, naming the
|
|
222
|
+
// CURRENT bench and stage — the compose-time refusal the handoff
|
|
223
|
+
// ordered. A single-family board keeps its inference (sfx, motion,
|
|
224
|
+
// input-prep infer boarded[0] engine-side) and a boards-empty card
|
|
225
|
+
// composes by its own card id (F56's law: the trim+krea-2 hijack
|
|
226
|
+
// must stay dead). h3-timeline's variant-address board
|
|
227
|
+
// (['h3', 'h3-timeline', 'h3-singularity']) counts multi: its
|
|
228
|
+
// dispatch is family-keyed too, and F27's mint folds 'h3' for it.
|
|
229
|
+
const boardsManyFamilies = (def.boarded ?? []).length > 1;
|
|
230
|
+
if (def.requiresModel !== false || boardsManyFamilies) {
|
|
214
231
|
const model = st.params["model"];
|
|
215
232
|
if (!model || !String(model).trim()) {
|
|
216
233
|
throw new FlowError("flow " +
|
package/lib/runtimeProvision.js
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
// fixtures (fixture seed + fixture sentinel files, never the real
|
|
16
16
|
// 7.4G tree; symlink creation against tmp dirs is fine).
|
|
17
17
|
import { existsSync, lstatSync, mkdirSync, readFileSync, readlinkSync, symlinkSync } from "node:fs";
|
|
18
|
-
import { dirname, join, resolve } from "node:path";
|
|
18
|
+
import { dirname, isAbsolute, join, resolve } from "node:path";
|
|
19
19
|
import { loadEndpointConfig } from "@melite/comfyui-cordis";
|
|
20
20
|
/** One sentinel's safe join: a sentinel escaping its home (.. or
|
|
21
21
|
* empty) is a declaration bug — false, never a filesystem escape. */
|
|
@@ -54,6 +54,7 @@ export function engineRootOf() {
|
|
|
54
54
|
let cfg;
|
|
55
55
|
try {
|
|
56
56
|
cfg = loadEndpointConfig();
|
|
57
|
+
// an unreadable endpoint machine statement declares no engine root — null is the not-declared answer and the decision core refuses loudly downstream
|
|
57
58
|
}
|
|
58
59
|
catch {
|
|
59
60
|
return null;
|
|
@@ -80,7 +81,10 @@ export function engineOutputDir(root) {
|
|
|
80
81
|
if (typeof raw !== "string" || raw.trim() === "")
|
|
81
82
|
return join(root, "output");
|
|
82
83
|
const v = raw.trim();
|
|
83
|
-
|
|
84
|
+
// (isAbsolute, not startsWith("/"): a win32-absolute output_dir
|
|
85
|
+
// carries a drive prefix and was resolved INTO the engine tree,
|
|
86
|
+
// putting the walk-up inside it)
|
|
87
|
+
return isAbsolute(v) ? v : join(root, v);
|
|
84
88
|
}
|
|
85
89
|
|
|
86
90
|
|
|
@@ -97,6 +101,7 @@ export function lanesEnvFileOf() {
|
|
|
97
101
|
let cfg;
|
|
98
102
|
try {
|
|
99
103
|
cfg = loadEndpointConfig();
|
|
104
|
+
// an unreadable endpoint config states no lanes_env_file — null is the key-absent behavior and the process env still answers the check
|
|
100
105
|
}
|
|
101
106
|
catch {
|
|
102
107
|
return null;
|
|
@@ -120,6 +125,7 @@ export function lanesEnvValue(file, key, read) {
|
|
|
120
125
|
let text;
|
|
121
126
|
try {
|
|
122
127
|
text = read(file);
|
|
128
|
+
// an unreadable env file arms no override — present: false is truthful and the caller still judges the process env leg
|
|
123
129
|
}
|
|
124
130
|
catch {
|
|
125
131
|
return { value: "", present: false };
|
|
@@ -153,6 +159,7 @@ export const nodeRuntimeFs = {
|
|
|
153
159
|
isSymlink: (p) => {
|
|
154
160
|
try {
|
|
155
161
|
return lstatSync(p).isSymbolicLink();
|
|
162
|
+
// lstatSync fails on a missing or unreadable path — a path that lstats as nothing is not a symlink, so false is the chipped-target check's exact answer
|
|
156
163
|
}
|
|
157
164
|
catch {
|
|
158
165
|
return false;
|
|
@@ -161,6 +168,7 @@ export const nodeRuntimeFs = {
|
|
|
161
168
|
readlink: (p) => {
|
|
162
169
|
try {
|
|
163
170
|
return readlinkSync(p);
|
|
171
|
+
// readlinkSync fails on a missing path or a non-symlink — null is the seam's not-a-symlink answer and the decision judges the real dir instead
|
|
164
172
|
}
|
|
165
173
|
catch {
|
|
166
174
|
return null;
|