@tangle-network/agent-runtime 7.0.0 → 8.0.0
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/CHANGELOG.md +68 -0
- package/README.md +0 -3
- package/dist/{activation-Ba9IAgQ3.js → activation-Ce4zUcu8.js} +4 -4
- package/dist/{activation-Ba9IAgQ3.js.map → activation-Ce4zUcu8.js.map} +1 -1
- package/dist/{activation-DIkTEBWF.d.ts → activation-xxvLF1-1.d.ts} +2 -2
- package/dist/agent.d.ts +1 -1
- package/dist/agent.js +3 -3
- package/dist/{bundle-Cy5igJdv.js → bundle-CcpL2lfr.js} +2 -2
- package/dist/{bundle-Cy5igJdv.js.map → bundle-CcpL2lfr.js.map} +1 -1
- package/dist/candidate-execution/index.js +4 -4
- package/dist/continuation-CIyKnS1Q.js +451 -0
- package/dist/continuation-CIyKnS1Q.js.map +1 -0
- package/dist/{coordination-manager-DQZ2u6L-.js → coordination-manager-sa_PkISw.js} +194 -148
- package/dist/coordination-manager-sa_PkISw.js.map +1 -0
- package/dist/{coordination-map-routing-CKRNZSaV.js → coordination-map-routing-XZXTlCmn.js} +2 -4
- package/dist/coordination-map-routing-XZXTlCmn.js.map +1 -0
- package/dist/{delegate-DFLSVjFG.js → delegate-DhTkJIta.js} +3 -3
- package/dist/{delegate-DFLSVjFG.js.map → delegate-DhTkJIta.js.map} +1 -1
- package/dist/durable.d.ts +1 -1
- package/dist/durable.js +13 -12
- package/dist/durable.js.map +1 -1
- package/dist/{errors-AzSuGI23.js → errors-DG8yufqX.js} +8 -1
- package/dist/errors-DG8yufqX.js.map +1 -0
- package/dist/{failure-cause-rJTm_Tx8.js → failure-cause-CVB-YE88.js} +12 -8
- package/dist/{failure-cause-rJTm_Tx8.js.map → failure-cause-CVB-YE88.js.map} +1 -1
- package/dist/{graph-registry-7X2nrreR.js → graph-registry-czAwYwNj.js} +133 -9
- package/dist/graph-registry-czAwYwNj.js.map +1 -0
- package/dist/{graph-registry-gYbq4L5Z.js → graph-registry-uTIyyy7A.js} +1 -1
- package/dist/graph-tSIT_eWK.js +1793 -0
- package/dist/graph-tSIT_eWK.js.map +1 -0
- package/dist/{improve-BolbYegO.js → improve-H08hiIw9.js} +19 -48
- package/dist/improve-H08hiIw9.js.map +1 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.js +16 -16
- package/dist/intelligence.d.ts +2 -2
- package/dist/intelligence.js +8 -8
- package/dist/intelligence.js.map +1 -1
- package/dist/kernel.d.ts +2 -2
- package/dist/kernel.js +16 -15
- package/dist/{loop-runner-Cs9IJ6Nk.d.ts → loop-runner-BGwhcn1p.d.ts} +2 -2
- package/dist/{loop-runner-C9W3T_3T.js → loop-runner-ChqK8kSz.js} +3 -3
- package/dist/{loop-runner-C9W3T_3T.js.map → loop-runner-ChqK8kSz.js.map} +1 -1
- package/dist/loop-runner-bin.d.ts +1 -1
- package/dist/loop-runner-bin.js +1 -1
- package/dist/mcp/bin.js +7 -5
- package/dist/mcp/bin.js.map +1 -1
- package/dist/mcp/index.d.ts +1 -1
- package/dist/mcp/index.js +9 -9
- package/dist/mcp/memory-bin.js +2 -2
- package/dist/{model-policy-JOcg3NRs.js → model-policy-yxOrDTTj.js} +9 -9
- package/dist/model-policy-yxOrDTTj.js.map +1 -0
- package/dist/{prepare-Dtfk_Wi_.js → prepare-BnF8nGIg.js} +4 -4
- package/dist/{prepare-Dtfk_Wi_.js.map → prepare-BnF8nGIg.js.map} +1 -1
- package/dist/{profile-CNSQjOes.js → profile-CD25rTJF.js} +4 -4
- package/dist/{profile-CNSQjOes.js.map → profile-CD25rTJF.js.map} +1 -1
- package/dist/profiles.d.ts +1 -1
- package/dist/profiles.js +2 -2
- package/dist/{provision-supervisor-BQFHjCtN.js → provision-supervisor-Dx4TXTMM.js} +8 -8
- package/dist/{provision-supervisor-BQFHjCtN.js.map → provision-supervisor-Dx4TXTMM.js.map} +1 -1
- package/dist/{run-cancellation-B84X8ZAP.js → run-cancellation-DYszFJtQ.js} +4 -4
- package/dist/{run-cancellation-B84X8ZAP.js.map → run-cancellation-DYszFJtQ.js.map} +1 -1
- package/dist/{run-state-Dh1bGERI.js → run-state-DHBoJjaF.js} +5 -5
- package/dist/{run-state-Dh1bGERI.js.map → run-state-DHBoJjaF.js.map} +1 -1
- package/dist/{runtime-C9F1PG2A.js → runtime-CaM5Gbbv.js} +76 -987
- package/dist/runtime-CaM5Gbbv.js.map +1 -0
- package/dist/{sandbox-profile-compat-oFGWESLn.js → sandbox-profile-compat-l-SLQnGb.js} +2 -2
- package/dist/{sandbox-profile-compat-oFGWESLn.js.map → sandbox-profile-compat-l-SLQnGb.js.map} +1 -1
- package/dist/{search-executor-CKR9_6NR.js → search-executor-B9L8W_1O.js} +17 -46
- package/dist/search-executor-B9L8W_1O.js.map +1 -0
- package/dist/{server-Dh3SQGQT.js → server-BlDV8sj_.js} +32 -8
- package/dist/{server-Dh3SQGQT.js.map → server-BlDV8sj_.js.map} +1 -1
- package/dist/{settle-record-C6LdVvok.js → settle-record-WWQasnDq.js} +2 -2
- package/dist/{settle-record-C6LdVvok.js.map → settle-record-WWQasnDq.js.map} +1 -1
- package/dist/{snapshot-Cgj2Wzi6.js → snapshot-BKI_w3JD.js} +19 -5
- package/dist/snapshot-BKI_w3JD.js.map +1 -0
- package/dist/{structural-rollout-Dapf2aZY.js → structural-rollout-C1xxoWcN.js} +18 -54
- package/dist/structural-rollout-C1xxoWcN.js.map +1 -0
- package/dist/{supervise-xwl2D6q3.js → supervise-DWiSgPLB.js} +101 -111
- package/dist/supervise-DWiSgPLB.js.map +1 -0
- package/dist/{supervision-discovery-B47U8TH5.js → supervision-discovery-C9kfBLKy.js} +4 -4
- package/dist/{supervision-discovery-B47U8TH5.js.map → supervision-discovery-C9kfBLKy.js.map} +1 -1
- package/dist/{supervisor-gC-u_PRk.js → supervisor-Dpeu7rnZ.js} +206 -693
- package/dist/supervisor-Dpeu7rnZ.js.map +1 -0
- package/dist/{supervisor-accounting-DxLQ_TQe.js → supervisor-accounting-Bw4MJk-b.js} +434 -423
- package/dist/supervisor-accounting-Bw4MJk-b.js.map +1 -0
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +13 -13
- package/dist/{tool-server-Dg350Bgz.js → tool-server-DYwRbi0I.js} +3 -3
- package/dist/{tool-server-Dg350Bgz.js.map → tool-server-DYwRbi0I.js.map} +1 -1
- package/dist/{top-web-BJLnFQdr.js → top-web-B3HOAtrZ.js} +9 -7
- package/dist/{top-web-BJLnFQdr.js.map → top-web-B3HOAtrZ.js.map} +1 -1
- package/dist/tui/bin.js +3 -3
- package/dist/tui/index.d.ts +1 -1
- package/dist/tui/index.js +2 -2
- package/dist/{types-Jg274chm.d.ts → types-C_qbnw9N.d.ts} +1335 -1413
- package/dist/{util-C_cdPNC4.js → util-fcckrkKp.js} +39 -113
- package/dist/util-fcckrkKp.js.map +1 -0
- package/dist/{workspace-streams-B7yNMahl.js → workspace-streams-DA9R3j-p.js} +2 -2
- package/dist/{workspace-streams-B7yNMahl.js.map → workspace-streams-DA9R3j-p.js.map} +1 -1
- package/package.json +1 -1
- package/dist/coordination-manager-DQZ2u6L-.js.map +0 -1
- package/dist/coordination-map-routing-CKRNZSaV.js.map +0 -1
- package/dist/errors-AzSuGI23.js.map +0 -1
- package/dist/graph-BjQF2syl.js +0 -579
- package/dist/graph-BjQF2syl.js.map +0 -1
- package/dist/graph-registry-7X2nrreR.js.map +0 -1
- package/dist/improve-BolbYegO.js.map +0 -1
- package/dist/model-policy-JOcg3NRs.js.map +0 -1
- package/dist/runtime-C9F1PG2A.js.map +0 -1
- package/dist/search-executor-CKR9_6NR.js.map +0 -1
- package/dist/snapshot-Cgj2Wzi6.js.map +0 -1
- package/dist/structural-rollout-Dapf2aZY.js.map +0 -1
- package/dist/supervise-xwl2D6q3.js.map +0 -1
- package/dist/supervisor-accounting-DxLQ_TQe.js.map +0 -1
- package/dist/supervisor-gC-u_PRk.js.map +0 -1
- package/dist/util-C_cdPNC4.js.map +0 -1
|
@@ -1,10 +1,102 @@
|
|
|
1
|
-
import { m as ValidationError } from "./errors-
|
|
1
|
+
import { m as ValidationError } from "./errors-DG8yufqX.js";
|
|
2
|
+
import { t as detachedFrozen } from "./snapshot-BKI_w3JD.js";
|
|
2
3
|
import { i as readCommittedJsonFile, l as sha256, o as upsertCommittedJsonLine, s as withJsonlFileLock, t as isNoEntError } from "./jsonl-file-DsxVI0E_.js";
|
|
4
|
+
import { n as admitContinuationPolicy } from "./continuation-CIyKnS1Q.js";
|
|
3
5
|
import { a as writeAtomicDurableFile } from "./durable-file-DstVeHcj.js";
|
|
4
|
-
import { n as resolveJsonPointer } from "./coordination-map-routing-
|
|
6
|
+
import { n as resolveJsonPointer } from "./coordination-map-routing-XZXTlCmn.js";
|
|
5
7
|
import { z } from "zod";
|
|
6
8
|
import { join } from "node:path";
|
|
7
9
|
import { mkdir, readFile, readdir } from "node:fs/promises";
|
|
10
|
+
// src/json-data.ts
|
|
11
|
+
/** Inspect descriptors instead of invoking accessors; JSON has no getters, symbols, prototypes,
|
|
12
|
+
* sparse arrays, undefined, closures or cycles. Repeated non-cyclic references remain JSON data. */
|
|
13
|
+
function assertJsonData(value, context, visiting = /* @__PURE__ */ new Set()) {
|
|
14
|
+
function fail(message) {
|
|
15
|
+
throw new ValidationError(`${context}: ${message}`);
|
|
16
|
+
}
|
|
17
|
+
if (value === null || typeof value === "string" || typeof value === "boolean") return;
|
|
18
|
+
if (typeof value === "number" && Number.isFinite(value)) return;
|
|
19
|
+
if (!value || typeof value !== "object" || visiting.has(value)) fail("expected finite, acyclic JSON data without executable values");
|
|
20
|
+
const array = Array.isArray(value);
|
|
21
|
+
const prototype = Object.getPrototypeOf(value);
|
|
22
|
+
if (array ? prototype !== Array.prototype : prototype !== Object.prototype && prototype !== null) fail("expected plain JSON objects and arrays");
|
|
23
|
+
visiting.add(value);
|
|
24
|
+
const descriptors = Object.getOwnPropertyDescriptors(value);
|
|
25
|
+
const keys = Reflect.ownKeys(descriptors);
|
|
26
|
+
if (array && keys.length !== value.length + 1) fail("sparse arrays are not canonical JSON");
|
|
27
|
+
for (const key of keys) {
|
|
28
|
+
if (array && key === "length") continue;
|
|
29
|
+
const property = typeof key === "string" ? descriptors[key] : void 0;
|
|
30
|
+
if (!property || !property.enumerable || !("value" in property)) fail("JSON data cannot contain symbols, hidden properties or accessors");
|
|
31
|
+
if (array && (!/^(0|[1-9]\d*)$/.test(key) || Number(key) >= value.length)) fail("arrays may contain only indexed JSON values");
|
|
32
|
+
assertJsonData(property.value, context, visiting);
|
|
33
|
+
}
|
|
34
|
+
visiting.delete(value);
|
|
35
|
+
}
|
|
36
|
+
// src/runtime/supervise/continuation-data.ts
|
|
37
|
+
/** The canonical policy admission, restricted to portable JSON rather than host callbacks. */
|
|
38
|
+
const portableContinuationPolicySchema = z.unknown().transform((value, context) => {
|
|
39
|
+
try {
|
|
40
|
+
assertJsonData(value, "graph continuation");
|
|
41
|
+
const policy = value;
|
|
42
|
+
admitContinuationPolicy(policy, "graph continuation");
|
|
43
|
+
if (policy.panel !== "off" || "append" in policy || "runPanel" in policy || "panelUsd" in policy) throw new ValidationError("graph continuation: portable policies cannot carry host callbacks or panel execution");
|
|
44
|
+
for (const [record, keys, name] of [
|
|
45
|
+
[
|
|
46
|
+
policy,
|
|
47
|
+
[
|
|
48
|
+
"deadline",
|
|
49
|
+
"maxBarren",
|
|
50
|
+
"profile",
|
|
51
|
+
"failures",
|
|
52
|
+
"panel",
|
|
53
|
+
"bar",
|
|
54
|
+
"reference",
|
|
55
|
+
"session"
|
|
56
|
+
],
|
|
57
|
+
"policy"
|
|
58
|
+
],
|
|
59
|
+
[
|
|
60
|
+
policy.profile,
|
|
61
|
+
[
|
|
62
|
+
"id",
|
|
63
|
+
"opening",
|
|
64
|
+
"plan",
|
|
65
|
+
"rules",
|
|
66
|
+
"headings",
|
|
67
|
+
"barRule",
|
|
68
|
+
"questions",
|
|
69
|
+
"panelModel",
|
|
70
|
+
"review"
|
|
71
|
+
],
|
|
72
|
+
"profile"
|
|
73
|
+
],
|
|
74
|
+
[
|
|
75
|
+
policy.profile.headings,
|
|
76
|
+
[
|
|
77
|
+
"failures",
|
|
78
|
+
"protected",
|
|
79
|
+
"changed",
|
|
80
|
+
"findings",
|
|
81
|
+
"bar",
|
|
82
|
+
"plan",
|
|
83
|
+
"rules"
|
|
84
|
+
],
|
|
85
|
+
"headings"
|
|
86
|
+
]
|
|
87
|
+
]) {
|
|
88
|
+
const allowed = new Set(keys);
|
|
89
|
+
for (const key of Object.keys(record)) if (!allowed.has(key)) throw new ValidationError(`graph continuation: unknown ${name} field '${key}'`);
|
|
90
|
+
}
|
|
91
|
+
return detachedFrozen(policy);
|
|
92
|
+
} catch (error) {
|
|
93
|
+
context.addIssue({
|
|
94
|
+
code: "custom",
|
|
95
|
+
message: error instanceof Error ? error.message : String(error)
|
|
96
|
+
});
|
|
97
|
+
return z.NEVER;
|
|
98
|
+
}
|
|
99
|
+
});
|
|
8
100
|
// src/runtime/supervise/graph-file-schema.ts
|
|
9
101
|
const scalar = z.union([
|
|
10
102
|
z.string(),
|
|
@@ -53,6 +145,19 @@ const command = z.strictObject({
|
|
|
53
145
|
timeoutMs: z.number().int().positive().optional()
|
|
54
146
|
});
|
|
55
147
|
const nonnegativeInteger = z.number().int().nonnegative();
|
|
148
|
+
/** A check node's command: no model, no seat. Params substitute as elsewhere. */
|
|
149
|
+
const graphCheckNodeSchema = z.strictObject({
|
|
150
|
+
command: z.string().min(1),
|
|
151
|
+
timeoutMs: z.number().int().positive().optional(),
|
|
152
|
+
environment: z.string().min(1).optional(),
|
|
153
|
+
egress: z.array(z.string().min(1)).optional(),
|
|
154
|
+
secrets: z.array(z.string().regex(/^[A-Z_][A-Z0-9_]*$/)).optional(),
|
|
155
|
+
resources: z.strictObject({
|
|
156
|
+
cpuCores: z.number().positive().optional(),
|
|
157
|
+
memoryMB: z.number().int().positive().optional(),
|
|
158
|
+
diskGB: z.number().positive().optional()
|
|
159
|
+
}).optional()
|
|
160
|
+
});
|
|
56
161
|
/** Authoring envelope. Canonical profiles and topology are validated by their existing owners. */
|
|
57
162
|
const graphFileSchema = z.strictObject({
|
|
58
163
|
digest: z.string().min(1).optional(),
|
|
@@ -63,8 +168,11 @@ const graphFileSchema = z.strictObject({
|
|
|
63
168
|
id: z.string().min(1),
|
|
64
169
|
profile: z.record(z.string(), z.unknown()).optional(),
|
|
65
170
|
seat: z.union([z.string().min(1), z.array(z.string().min(1)).min(1)]).optional(),
|
|
66
|
-
needs: z.array(z.string().min(1)).optional()
|
|
171
|
+
needs: z.array(z.string().min(1)).optional(),
|
|
172
|
+
check: graphCheckNodeSchema.optional()
|
|
67
173
|
})).min(1),
|
|
174
|
+
workspace: z.enum(["cwd", "fresh"]).optional(),
|
|
175
|
+
continuation: portableContinuationPolicySchema.optional(),
|
|
68
176
|
entry: z.array(z.union([z.string().min(1), z.strictObject({
|
|
69
177
|
node: z.string().min(1),
|
|
70
178
|
task: z.unknown()
|
|
@@ -263,7 +371,13 @@ function canonicalJson(value) {
|
|
|
263
371
|
* entry and gates). An absent key is not serialized, so a graph without `entry` keeps the digest
|
|
264
372
|
* it had before flow graphs were stored. */
|
|
265
373
|
function graphDigest(graph) {
|
|
266
|
-
|
|
374
|
+
const { continuation, ...content } = graph;
|
|
375
|
+
const policy = continuation === void 0 ? void 0 : portableContinuationPolicySchema.parse(continuation);
|
|
376
|
+
if (policy !== void 0 && content.entry !== void 0) throw new ValidationError("graph continuation with entry has no root manager");
|
|
377
|
+
return sha256(canonicalJson({
|
|
378
|
+
...content,
|
|
379
|
+
...policy === void 0 ? {} : { continuation: policy }
|
|
380
|
+
}));
|
|
267
381
|
}
|
|
268
382
|
/** Digest of the normalized task shape a designer looks records up by. */
|
|
269
383
|
function taskShapeDigest(taskShape) {
|
|
@@ -277,6 +391,7 @@ function digestOfGraph(graph) {
|
|
|
277
391
|
}
|
|
278
392
|
function storeGraph(graph) {
|
|
279
393
|
const { describe, checkRef, command, when } = graph.deliverable;
|
|
394
|
+
const continuation = graph.continuation;
|
|
280
395
|
const content = {
|
|
281
396
|
nodes: graph.nodes,
|
|
282
397
|
edges: graph.edges,
|
|
@@ -289,7 +404,9 @@ function storeGraph(graph) {
|
|
|
289
404
|
...when ? { when } : {}
|
|
290
405
|
},
|
|
291
406
|
...graph.entry === void 0 ? {} : { entry: graph.entry },
|
|
292
|
-
...graph.gates === void 0 ? {} : { gates: graph.gates }
|
|
407
|
+
...graph.gates === void 0 ? {} : { gates: graph.gates },
|
|
408
|
+
...graph.workspace === void 0 ? {} : { workspace: graph.workspace },
|
|
409
|
+
...continuation === void 0 ? {} : { continuation: portableContinuationPolicySchema.parse(continuation) }
|
|
293
410
|
};
|
|
294
411
|
return {
|
|
295
412
|
digest: graphDigest(content),
|
|
@@ -342,7 +459,11 @@ async function recordGraphRun(reg, graph, record) {
|
|
|
342
459
|
* A reader refreshing facts can preserve independently joined labels; an explicit
|
|
343
460
|
* correction leaves preserveLabels unset and replaces the record. */
|
|
344
461
|
async function recordStoredGraphRun(reg, definition, record, options = {}) {
|
|
345
|
-
const { digest, ...
|
|
462
|
+
const { digest, continuation, ...topology } = definition;
|
|
463
|
+
const content = {
|
|
464
|
+
...topology,
|
|
465
|
+
...continuation === void 0 ? {} : { continuation: portableContinuationPolicySchema.parse(continuation) }
|
|
466
|
+
};
|
|
346
467
|
const stored = {
|
|
347
468
|
...content,
|
|
348
469
|
digest: digest ?? graphDigest(content)
|
|
@@ -549,7 +670,10 @@ function graphFromStored(stored, environment = {}) {
|
|
|
549
670
|
const { digest: _digest, observed: _observed, triggerBindings: _triggerBindings, deliverable, ...topology } = stored.triggerBindings !== void 0 ? bindCompiledGraphTriggers(stored, stored.triggerBindings, typeof environment === "function" ? void 0 : environment.trigger ?? {}) : typeof environment === "function" ? stored : bindGraphParameters(stored, { trigger: environment.trigger ?? {} });
|
|
550
671
|
const selected = typeof environment === "function" ? environment : environment.checks && Object.hasOwn(environment.checks, deliverable.checkRef ?? "") ? environment.checks[deliverable.checkRef] : deliverable.checkRef === "command" ? deliverable.command : deliverable.checkRef === "route" && deliverable.when ? ((out, context) => context ? context.originalVerdict?.valid !== false : checkGraphRoute(deliverable.when, out)) : void 0;
|
|
551
672
|
if (!selected) throw new ValidationError(`graphFromStored: unknown checkRef ${deliverable.checkRef ?? "(missing)"}`);
|
|
552
|
-
const materialized =
|
|
673
|
+
const materialized = {
|
|
674
|
+
...stored.triggerBindings === void 0 ? {} : { triggerBindings: [] },
|
|
675
|
+
...topology.continuation === void 0 ? {} : { continuation: portableContinuationPolicySchema.parse(topology.continuation) }
|
|
676
|
+
};
|
|
553
677
|
if (typeof selected === "function") {
|
|
554
678
|
const { command: _command, ...description } = deliverable;
|
|
555
679
|
return {
|
|
@@ -580,6 +704,6 @@ async function storedGraphDigests(reg) {
|
|
|
580
704
|
return [];
|
|
581
705
|
}
|
|
582
706
|
}
|
|
583
|
-
export { compileGraphParameters as _, graphRegistry as a,
|
|
707
|
+
export { assertJsonData as C, portableContinuationPolicySchema as S, compileGraphParameters as _, graphRegistry as a, graphFileSchema as b, loadGraph as c, recordGraphRun as d, recordStoredGraphRun as f, bindGraphParameters as g, assertGraphTriggerBindings as h, graphFromStored as i, lookupGraph as l, taskShapeDigest as m, graphCorpusSummary as n, graphRunsFor as o, storedGraphDigests as p, graphDigest as r, listGraphRuns as s, digestOfGraph as t, pickBestGraph as u, graphTriggerBindingsSchema as v, graphRouteWhenSchema as x, graphCheckNodeSchema as y };
|
|
584
708
|
|
|
585
|
-
//# sourceMappingURL=graph-registry-
|
|
709
|
+
//# sourceMappingURL=graph-registry-czAwYwNj.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph-registry-czAwYwNj.js","names":[],"sources":["../src/json-data.ts","../src/runtime/supervise/continuation-data.ts","../src/runtime/supervise/graph-file-schema.ts","../src/runtime/supervise/graph-parameters.ts","../src/runtime/supervise/graph-registry.ts"],"sourcesContent":["import { ValidationError } from './errors'\n\n/** Inspect descriptors instead of invoking accessors; JSON has no getters, symbols, prototypes,\n * sparse arrays, undefined, closures or cycles. Repeated non-cyclic references remain JSON data. */\nexport function assertJsonData(\n value: unknown,\n context: string,\n visiting = new Set<object>(),\n): void {\n function fail(message: string): never {\n throw new ValidationError(`${context}: ${message}`)\n }\n if (value === null || typeof value === 'string' || typeof value === 'boolean') return\n if (typeof value === 'number' && Number.isFinite(value)) return\n if (!value || typeof value !== 'object' || visiting.has(value))\n fail('expected finite, acyclic JSON data without executable values')\n const array = Array.isArray(value)\n const prototype = Object.getPrototypeOf(value)\n if (array ? prototype !== Array.prototype : prototype !== Object.prototype && prototype !== null)\n fail('expected plain JSON objects and arrays')\n visiting.add(value)\n const descriptors = Object.getOwnPropertyDescriptors(value)\n const keys = Reflect.ownKeys(descriptors)\n if (array && keys.length !== value.length + 1) fail('sparse arrays are not canonical JSON')\n for (const key of keys) {\n if (array && key === 'length') continue\n const property = typeof key === 'string' ? descriptors[key] : undefined\n if (!property || !property.enumerable || !('value' in property))\n fail('JSON data cannot contain symbols, hidden properties or accessors')\n if (array && (!/^(0|[1-9]\\d*)$/.test(key as string) || Number(key) >= value.length))\n fail('arrays may contain only indexed JSON values')\n assertJsonData(property.value, context, visiting)\n }\n visiting.delete(value)\n}\n","import { z } from 'zod'\nimport { ValidationError } from '../../errors'\nimport { assertJsonData } from '../../json-data'\nimport { admitContinuationPolicy, type ContinuationPolicy } from './continuation'\nimport { detachedFrozen } from './snapshot'\n\n/** Record-owned policy data; callbacks, panel execution and a host-computed best stay outside. */\nexport type PortableContinuationPolicy = Omit<\n ContinuationPolicy,\n 'append' | 'runPanel' | 'panel' | 'panelUsd' | 'best'\n> & { readonly panel: 'off' }\n\n/** The canonical policy admission, restricted to portable JSON rather than host callbacks. */\nexport const portableContinuationPolicySchema = z\n .unknown()\n .transform<PortableContinuationPolicy>((value, context) => {\n try {\n assertJsonData(value, 'graph continuation')\n const policy = value as unknown as PortableContinuationPolicy\n admitContinuationPolicy(policy, 'graph continuation')\n if (\n policy.panel !== 'off' ||\n 'append' in policy ||\n 'runPanel' in policy ||\n 'panelUsd' in policy\n )\n throw new ValidationError(\n 'graph continuation: portable policies cannot carry host callbacks or panel execution',\n )\n for (const [record, keys, name] of [\n [\n policy,\n ['deadline', 'maxBarren', 'profile', 'failures', 'panel', 'bar', 'reference', 'session'],\n 'policy',\n ],\n [\n policy.profile,\n [\n 'id',\n 'opening',\n 'plan',\n 'rules',\n 'headings',\n 'barRule',\n 'questions',\n 'panelModel',\n 'review',\n ],\n 'profile',\n ],\n [\n policy.profile.headings,\n ['failures', 'protected', 'changed', 'findings', 'bar', 'plan', 'rules'],\n 'headings',\n ],\n ] as const) {\n const allowed = new Set<string>(keys)\n for (const key of Object.keys(record))\n if (!allowed.has(key))\n throw new ValidationError(`graph continuation: unknown ${name} field '${key}'`)\n }\n return detachedFrozen(policy)\n } catch (error) {\n context.addIssue({\n code: 'custom',\n message: error instanceof Error ? error.message : String(error),\n })\n return z.NEVER\n }\n })\n","import { z } from 'zod'\nimport { resolveJsonPointer } from '../../mcp/tools/coordination-map-routing'\nimport type { RouteWhen } from '../../mcp/tools/coordination-route-contracts'\nimport { portableContinuationPolicySchema } from './continuation-data'\n\nconst scalar = z.union([z.string(), z.number().finite(), z.boolean(), z.null()])\nconst pointer = z.string().regex(/^(?:\\/(?:[^~]|~[01])*)*$/)\nconst matchBase = { node: z.string().min(1).optional(), pointer }\nconst equals = z.strictObject({ ...matchBase, equals: scalar })\nconst oneOf = z.strictObject({ ...matchBase, in: z.array(scalar) })\nconst exists = z.strictObject({ ...matchBase, exists: z.boolean() })\nconst match = z.union([equals, oneOf, exists])\n\n/** The same data grammar as routes; no executable expressions or additional operators. */\nexport const graphRouteWhenSchema = z.union([match, z.strictObject({ all: z.array(match).min(1) })])\n\nconst parameter = z.strictObject({\n default: z.unknown().optional(),\n type: z.enum(['string', 'number', 'integer', 'boolean', 'object', 'array', 'null']).optional(),\n})\nconst command = z.strictObject({\n command: z.string().min(1),\n timeoutMs: z.number().int().positive().optional(),\n})\nconst nonnegativeInteger = z.number().int().nonnegative()\n\n/** A check node's command: no model, no seat. Params substitute as elsewhere. */\nexport const graphCheckNodeSchema = z.strictObject({\n command: z.string().min(1),\n timeoutMs: z.number().int().positive().optional(),\n environment: z.string().min(1).optional(),\n egress: z.array(z.string().min(1)).optional(),\n secrets: z.array(z.string().regex(/^[A-Z_][A-Z0-9_]*$/)).optional(),\n resources: z\n .strictObject({\n cpuCores: z.number().positive().optional(),\n memoryMB: z.number().int().positive().optional(),\n diskGB: z.number().positive().optional(),\n })\n .optional(),\n})\n\n/** Authoring envelope. Canonical profiles and topology are validated by their existing owners. */\nexport const graphFileSchema = z.strictObject({\n digest: z.string().min(1).optional(),\n graph: z.string().min(1).optional(),\n describe: z.string().optional(),\n params: z.record(z.string().min(1), parameter).optional(),\n nodes: z\n .array(\n z.strictObject({\n id: z.string().min(1),\n profile: z.record(z.string(), z.unknown()).optional(),\n seat: z.union([z.string().min(1), z.array(z.string().min(1)).min(1)]).optional(),\n needs: z.array(z.string().min(1)).optional(),\n check: graphCheckNodeSchema.optional(),\n }),\n )\n .min(1),\n workspace: z.enum(['cwd', 'fresh']).optional(),\n continuation: portableContinuationPolicySchema.optional(),\n entry: z\n .array(\n z.union([z.string().min(1), z.strictObject({ node: z.string().min(1), task: z.unknown() })]),\n )\n .min(1)\n .optional(),\n edges: z.array(z.record(z.string(), z.unknown())),\n gates: z.array(z.unknown()).optional(),\n budget: z.strictObject({\n maxIterations: nonnegativeInteger.optional(),\n maxTokens: nonnegativeInteger.optional(),\n maxUsd: z.number().finite().nonnegative().optional(),\n deadlineMs: nonnegativeInteger.optional(),\n resources: z\n .record(z.string(), z.strictObject({ unit: z.string().min(1), limit: nonnegativeInteger }))\n .optional(),\n }),\n check: z\n .union([\n equals.extend({ describe: z.string().optional() }),\n oneOf.extend({ describe: z.string().optional() }),\n exists.extend({ describe: z.string().optional() }),\n z.strictObject({ describe: z.string().optional(), all: z.array(match).min(1) }),\n z.strictObject({ describe: z.string().optional(), command }),\n ])\n .optional(),\n deliverable: z\n .strictObject({\n describe: z.string().optional(),\n checkRef: z.string().min(1),\n command: command.optional(),\n when: graphRouteWhenSchema.optional(),\n })\n .optional(),\n on: z.unknown().optional(),\n})\n\n/** Judge the flow's terminal-output map with RouteWhen's own JSON-pointer semantics. */\nexport function checkGraphRoute(when: RouteWhen, output: unknown): boolean {\n return ('all' in when ? when.all : [when]).every((condition) => {\n let document = output\n if (condition.node !== undefined) {\n if (!output || typeof output !== 'object' || !Object.hasOwn(output, condition.node))\n return false\n document = (output as Record<string, unknown>)[condition.node]\n }\n const selected = resolveJsonPointer(document, condition.pointer)\n if ('exists' in condition) return selected.found === condition.exists\n if (!selected.found) return false\n return 'equals' in condition\n ? selected.value === condition.equals\n : condition.in.some((value) => value === selected.value)\n })\n}\n","import { z } from 'zod'\nimport { ValidationError } from '../../errors'\n\nexport interface GraphParameterBindings {\n readonly params?: Readonly<Record<string, unknown>>\n readonly trigger?: Readonly<Record<string, unknown>>\n}\n\nconst triggerPart = z.strictObject({ trigger: z.array(z.string()).min(1) })\nconst literalPart = z.strictObject({ literal: z.string() })\n/** Explicit authored trigger slots in compiled graph data. An empty list marks fully bound data. */\nexport const graphTriggerBindingsSchema = z.array(\n z\n .strictObject({\n path: z.array(z.union([z.string(), z.number().int().nonnegative()])).min(1),\n mode: z.enum(['value', 'text']),\n parts: z.array(z.union([literalPart, triggerPart])).min(1),\n })\n .superRefine((slot, context) => {\n if (\n !slot.parts.some((part) => 'trigger' in part) ||\n (slot.mode === 'value' && (slot.parts.length !== 1 || !('trigger' in slot.parts[0]!)))\n )\n context.addIssue({\n code: 'custom',\n message: 'binding requires authored trigger parts; value slots require one trigger',\n })\n }),\n)\n/** @useDeclaredType */\nexport type GraphTriggerBinding = z.infer<typeof graphTriggerBindingsSchema>[number]\n\ntype Part = GraphTriggerBinding['parts'][number]\n\nfunction readBinding(\n namespace: keyof GraphParameterBindings,\n keys: readonly string[],\n bindings: GraphParameterBindings,\n): unknown {\n let found: unknown = bindings[namespace]\n for (const key of keys) {\n if (!found || typeof found !== 'object' || !Object.hasOwn(found, key))\n throw new ValidationError(`graph parameters: missing ${[namespace, ...keys].join('.')}`)\n found = (found as Record<string, unknown>)[key]\n }\n if (found === undefined)\n throw new ValidationError(`graph parameters: missing ${[namespace, ...keys].join('.')}`)\n return structuredClone(found)\n}\n\nfunction textValue(value: unknown, expression: string): string {\n if (value !== null && typeof value === 'object')\n throw new ValidationError(`graph parameters: ${expression} needs a whole JSON slot`)\n return String(value)\n}\n\nfunction pendingText(parts: readonly Part[]): string {\n return parts\n .map((part) => ('literal' in part ? part.literal : `\\${trigger.${part.trigger.join('.')}}`))\n .join('')\n}\n\n/** Compile authored slots once. Inserted values are data, never recursively parsed templates. */\nexport function compileGraphParameters(\n value: unknown,\n bindings: GraphParameterBindings,\n options: { readonly defer?: readonly (keyof GraphParameterBindings)[] } = {},\n): { value: unknown; triggerBindings: GraphTriggerBinding[] } {\n const visiting = new Set<object>()\n const triggerBindings: GraphTriggerBinding[] = []\n const bind = (item: unknown, path: Array<string | number>): unknown => {\n if (typeof item === 'string') {\n if (item.replace(/\\$\\{[^{}]+\\}/g, '').includes('${'))\n throw new ValidationError('graph parameters: malformed reference')\n const whole = /^\\$\\{([^{}]+)\\}$/.exec(item)\n const parts: Part[] = []\n let cursor = 0\n let wholeValue: unknown\n let boundWhole = false\n for (const match of item.matchAll(/\\$\\{([^{}]+)\\}/g)) {\n if (match.index > cursor) parts.push({ literal: item.slice(cursor, match.index) })\n const [namespace, ...keys] = match[1]!.split('.')\n if ((namespace !== 'params' && namespace !== 'trigger') || keys.length === 0)\n throw new ValidationError(`graph parameters: unsupported reference \\${${match[1]}}`)\n if (options.defer?.includes(namespace)) {\n if (namespace === 'trigger') parts.push({ trigger: keys })\n else parts.push({ literal: match[0] })\n } else {\n const found = readBinding(namespace, keys, bindings)\n if (whole) {\n wholeValue = found\n boundWhole = true\n } else parts.push({ literal: textValue(found, match[1]!) })\n }\n cursor = match.index + match[0].length\n }\n if (boundWhole) return wholeValue\n if (cursor === 0) return item\n if (cursor < item.length) parts.push({ literal: item.slice(cursor) })\n if (parts.some((part) => 'trigger' in part))\n triggerBindings.push({ path, mode: whole ? 'value' : 'text', parts })\n return pendingText(parts)\n }\n if (!item || typeof item !== 'object') return item\n if (visiting.has(item)) throw new ValidationError('graph parameters: cyclic data is not JSON')\n visiting.add(item)\n const bound = Array.isArray(item)\n ? item.map((child, index) => bind(child, [...path, index]))\n : Object.fromEntries(\n Object.entries(item).map(([key, child]) => [key, bind(child, [...path, key])]),\n )\n visiting.delete(item)\n return bound\n }\n return { value: bind(value, []), triggerBindings }\n}\n\n/** Legacy authored-data binding. Compiled graphs use bindCompiledGraphTriggers instead. */\nexport function bindGraphParameters(\n value: unknown,\n bindings: GraphParameterBindings,\n options: { readonly defer?: readonly (keyof GraphParameterBindings)[] } = {},\n): unknown {\n return compileGraphParameters(value, bindings, options).value\n}\n\n/** Check provenance against the exact provisional values without reading trigger data. */\nexport function assertGraphTriggerBindings(\n value: unknown,\n slots: readonly GraphTriggerBinding[],\n): void {\n const seen = new Set<string>()\n for (const slot of graphTriggerBindingsSchema.parse(slots)) {\n const key = JSON.stringify(slot.path.map(String))\n if (seen.has(key)) throw new ValidationError('graph parameters: duplicate trigger binding path')\n seen.add(key)\n let found: unknown = value\n for (const key of slot.path) {\n if (!found || typeof found !== 'object' || !Object.hasOwn(found, key))\n throw new ValidationError('graph parameters: trigger binding path does not exist')\n found = (found as Record<string | number, unknown>)[key]\n }\n if (found !== pendingText(slot.parts))\n throw new ValidationError(\n 'graph parameters: trigger binding does not match its provisional value',\n )\n }\n}\n\n/** Only explicitly recorded authored slots bind. Literal parameter/trigger values are untouched. */\nexport function bindCompiledGraphTriggers<T>(\n value: T,\n slots: readonly GraphTriggerBinding[],\n trigger: GraphParameterBindings['trigger'],\n): T {\n assertGraphTriggerBindings(value, slots)\n const bound = structuredClone(value)\n for (const slot of slots) {\n let parent = bound as Record<string | number, unknown>\n for (const key of slot.path.slice(0, -1)) parent = parent[key] as typeof parent\n parent[slot.path.at(-1)!] =\n slot.mode === 'value'\n ? readBinding('trigger', (slot.parts[0]! as { trigger: string[] }).trigger, { trigger })\n : slot.parts\n .map((part) =>\n 'literal' in part\n ? part.literal\n : textValue(\n readBinding('trigger', part.trigger, { trigger }),\n `trigger.${part.trigger.join('.')}`,\n ),\n )\n .join('')\n }\n return bound\n}\n","/**\n * `graph-registry` — the designer's memory: graphs and their outcomes as files.\n *\n * The AgentGraph algebra makes a graph PLAIN DATA (nodes with pinned profiles,\n * edges with registry-versioned directives, a budget, a deliverable\n * description), which is the property that lets a graph be stored, replayed\n * byte-identical, and mutated like code. This module is the thin durable layer\n * on top: one JSONL record per run, the exact graph content-addressed beside\n * it. The natural home is a SANDBOX WORKSPACE — the platform's snapshot story\n * (Firecracker restore, warm leases, `continuity: 'resume'`) then makes the\n * registry the agent's compounding execution memory across runs: a rerun over\n * the same sandbox finds every graph the designer ever ran, what each cost,\n * and whether it delivered.\n *\n * ORACLES STAY ENVIRONMENT-OWNED. `DeliverableSpec.check` is a function and is\n * deliberately NOT stored: a stored graph keeps the deliverable's `describe`\n * and an optional `checkRef`, and replay re-binds the check from the caller's\n * environment. This is the graph contract's own doctrine — graders are\n * environment, never workers — applied to persistence.\n *\n * Scoring is a documented heuristic, not a learned model: delivered beats\n * failed, then cheaper (tokens, then iterations), then most recent. A designer\n * that needs better selection replaces `pickBest`, not the records.\n */\n\nimport { mkdir, readdir, readFile } from 'node:fs/promises'\nimport { join } from 'node:path'\nimport type { AgentProfile } from '@tangle-network/agent-interface'\nimport { sha256 } from '../../content-digest'\nimport {\n isNoEntError,\n readCommittedJsonFile,\n upsertCommittedJsonLine,\n withJsonlFileLock,\n} from '../../durable/jsonl-file'\nimport { ValidationError } from '../../errors'\nimport { portableContinuationPolicySchema } from './continuation-data'\nimport { writeAtomicDurableFile } from './durable-file'\nimport type { AgentGraph, GraphEdge } from './graph'\nimport { checkGraphRoute } from './graph-file-schema'\nimport {\n bindCompiledGraphTriggers,\n bindGraphParameters,\n type GraphTriggerBinding,\n} from './graph-parameters'\n\nexport type { GraphTriggerBinding } from './graph-parameters'\n\nimport type { GraphCheckNode, GraphFromStoredOptions } from './stored-graph-check'\n\nexport type {\n GraphCheckNode,\n GraphCheckNodes,\n GraphCheckOutput,\n GraphCheckPlacement,\n GraphCommandCheck,\n GraphFromStoredOptions,\n} from './stored-graph-check'\n\n/** @inline */\ninterface StoredGraphContent {\n readonly digest: string\n /** Authored trigger-slot provenance; present (even empty) on compiled loader output. */\n readonly triggerBindings?: readonly GraphTriggerBinding[]\n readonly nodes: ReadonlyArray<{\n readonly id: string\n readonly profile: AgentProfile\n /** A check node; its profile is `{ name: id }`. */\n readonly check?: GraphCheckNode\n }>\n readonly deliverable: Pick<\n AgentGraph['deliverable'],\n 'describe' | 'checkRef' | 'command' | 'when'\n >\n /** A flow graph's entry and gates; absent for any other graph. */\n readonly entry?: AgentGraph['entry']\n readonly gates?: AgentGraph['gates']\n readonly workspace?: AgentGraph['workspace']\n readonly continuation?: AgentGraph['continuation']\n}\n\n/** A graph as stored. Observed imports retain unknown directives and budgets;\n * they describe what happened and cannot be replayed as executable graphs. */\nexport type StoredGraph = StoredGraphContent &\n (\n | {\n readonly observed?: false\n readonly edges: ReadonlyArray<GraphEdge>\n readonly budget: AgentGraph['budget']\n }\n | {\n readonly observed: true\n readonly edges: ReadonlyArray<\n | GraphEdge\n | {\n readonly from: string\n readonly to: string\n }\n >\n readonly budget?: AgentGraph['budget']\n }\n )\n\n/** Editable graph data; registration computes its digest when it is omitted. */\nexport type StoredGraphInput = Omit<\n Extract<StoredGraph, { readonly observed?: false }>,\n 'digest'\n> & {\n readonly digest?: string\n}\n\n/** One run or an explicitly incomplete observation of a graph, for one task shape. */\nexport interface GraphRunRecord {\n /** Content-address of the exact graph that ran. */\n readonly graphDigest: string\n /** Digest of the normalized task shape the designer computed for lookup. */\n readonly taskDigest: string\n readonly startedAt: string\n /** Absent while running or when completion was not established. */\n readonly finishedAt?: string\n readonly outcome:\n | { readonly kind: 'delivered'; readonly summary?: string }\n | { readonly kind: 'no-winner'; readonly reason?: string }\n | { readonly kind: 'unknown' | 'running'; readonly reason: string }\n /** Measured accounting; running observations are to date. Unknown channels omitted. */\n readonly cost: {\n readonly iterations?: number\n readonly tokens?: number\n readonly usd?: number\n readonly ms?: number\n readonly inputTokens?: number\n readonly outputTokens?: number\n readonly humanMessages?: number\n readonly leadMessages?: number\n /** Elapsed wall time from the task start to an independently verified merge. */\n readonly mergeMs?: number\n }\n /** Metered ledger size, absent when a source exposes relationships without traversals. */\n readonly traversals?: number\n readonly exhaustedEdges?: ReadonlyArray<string>\n /** Explicit source metadata, never classified from transcript or PR prose. */\n readonly taskType?: 'feature' | 'bugfix' | 'consolidation' | 'investigation' | 'ops'\n /** Stable run identity; re-ingesting this source replaces its observation. */\n readonly source?: { readonly kind: string; readonly id: string; readonly url?: string }\n readonly observedAt?: string\n /** Link to the canonical trace run; execution trees remain trace-owned. */\n readonly traceRunId?: string\n /** Canonical ordered adjacency. This is not a graph-isomorphism claim. */\n readonly topologyDigest?: string\n readonly evidence?: ReadonlyArray<{\n readonly kind: string\n readonly url: string\n readonly at?: string\n }>\n readonly nodeUsage?: ReadonlyArray<{\n readonly nodeId: string\n readonly sourceId?: string\n readonly startedAt?: string\n /** Latest recorded activity, not a claim that the node finished. */\n readonly lastRecordAt?: string\n readonly finishedAt?: string\n readonly inputTokens?: number\n readonly outputTokens?: number\n readonly humanMessages?: number\n readonly leadMessages?: number\n }>\n /** Missing or partial evidence, including incomplete accounting channels. */\n readonly unknowns?: ReadonlyArray<string>\n}\n\nexport interface GraphRegistryDir {\n readonly root: string\n}\n\nconst RECORDS_FILE = 'records.jsonl'\nconst GRAPHS_DIR = 'graphs'\n\n/** Canonical serialization for content-addressing: stable key order, sorted. */\nfunction canonicalJson(value: unknown): string {\n if (Array.isArray(value)) return `[${value.map(canonicalJson).join(',')}]`\n if (value && typeof value === 'object') {\n const entries = Object.entries(value as Record<string, unknown>)\n .filter(([, v]) => v !== undefined)\n .sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0))\n return `{${entries.map(([k, v]) => `${JSON.stringify(k)}:${canonicalJson(v)}`).join(',')}}`\n }\n return JSON.stringify(value)\n}\n\n/** Digest of the exact graph (nodes + edges + budget + deliverable describe, and a flow graph's\n * entry and gates). An absent key is not serialized, so a graph without `entry` keeps the digest\n * it had before flow graphs were stored. */\nexport function graphDigest(graph: Omit<StoredGraph, 'digest'>): string {\n const { continuation, ...content } = graph\n const policy =\n continuation === undefined ? undefined : portableContinuationPolicySchema.parse(continuation)\n if (policy !== undefined && content.entry !== undefined)\n throw new ValidationError('graph continuation with entry has no root manager')\n return sha256(\n canonicalJson({ ...content, ...(policy === undefined ? {} : { continuation: policy }) }),\n )\n}\n\n/** Digest of the normalized task shape a designer looks records up by. */\nexport function taskShapeDigest(taskShape: Record<string, unknown>): string {\n return sha256(canonicalJson(taskShape))\n}\n\n/** Digest of a runnable graph exactly as the registry stores it — the value\n * `recordGraphRun` demands. Callers recording real runs hash through this,\n * never hand-rolled, so a record always matches its graph. */\nexport function digestOfGraph(graph: AgentGraph): string {\n return storeGraph(graph).digest\n}\n\nfunction storeGraph(graph: AgentGraph): StoredGraph {\n const { describe, checkRef, command, when } = graph.deliverable\n const continuation = graph.continuation\n const content = {\n nodes: graph.nodes,\n edges: graph.edges,\n budget: graph.budget,\n ...(graph.triggerBindings === undefined ? {} : { triggerBindings: graph.triggerBindings }),\n deliverable: {\n ...(describe ? { describe } : {}),\n ...(checkRef ? { checkRef } : {}),\n ...(command ? { command } : {}),\n ...(when ? { when } : {}),\n },\n ...(graph.entry === undefined ? {} : { entry: graph.entry }),\n ...(graph.gates === undefined ? {} : { gates: graph.gates }),\n ...(graph.workspace === undefined ? {} : { workspace: graph.workspace }),\n ...(continuation === undefined\n ? {}\n : { continuation: portableContinuationPolicySchema.parse(continuation) }),\n }\n return { digest: graphDigest(content), ...content }\n}\n\nfunction assertRecord(record: GraphRunRecord): void {\n if (typeof record.graphDigest !== 'string' || record.graphDigest.length === 0)\n throw new ValidationError('graph-registry: record.graphDigest is required')\n if (typeof record.taskDigest !== 'string' || record.taskDigest.length === 0)\n throw new ValidationError('graph-registry: record.taskDigest is required')\n if (!Number.isFinite(Date.parse(record.startedAt)))\n throw new ValidationError('graph-registry: record.startedAt must be a timestamp')\n if (!['delivered', 'no-winner', 'unknown', 'running'].includes(record.outcome.kind))\n throw new ValidationError('graph-registry: invalid record.outcome.kind')\n if (\n (record.outcome.kind === 'delivered' || record.outcome.kind === 'no-winner') &&\n (!record.finishedAt || !Number.isFinite(Date.parse(record.finishedAt)))\n )\n throw new ValidationError('graph-registry: terminal outcomes require record.finishedAt')\n if (\n (record.outcome.kind === 'unknown' || record.outcome.kind === 'running') &&\n !record.outcome.reason\n )\n throw new ValidationError('graph-registry: incomplete outcomes require a reason')\n if (record.source && (!record.source.kind || !record.source.id))\n throw new ValidationError('graph-registry: source.kind and source.id are required')\n if (\n record.finishedAt &&\n (!Number.isFinite(Date.parse(record.finishedAt)) ||\n Date.parse(record.finishedAt) < Date.parse(record.startedAt))\n )\n throw new ValidationError('graph-registry: finishedAt precedes startedAt or is invalid')\n for (const [channel, value] of Object.entries(record.cost)) {\n if (value !== undefined && (typeof value !== 'number' || !Number.isFinite(value) || value < 0))\n throw new ValidationError(`graph-registry: invalid cost.${channel}`)\n }\n}\n\nfunction recordKey(record: GraphRunRecord): string {\n assertRecord(record)\n if (record.source) return JSON.stringify(['source', record.source.kind, record.source.id])\n return JSON.stringify([record.taskDigest, record.graphDigest, record.startedAt])\n}\n\n/** Open (or lazily create) a registry rooted at a workspace directory. The\n * directory is the sandbox workspace; snapshots carry it across runs. */\nexport function graphRegistry(root: string): GraphRegistryDir {\n if (!root || root.trim().length === 0)\n throw new ValidationError('graphRegistry: root directory is required')\n return { root }\n}\n\n/** Append one run record; the exact graph is content-addressed beside it.\n * Idempotent per (taskDigest, graphDigest, startedAt): a replayed append with\n * the same key replaces the prior row rather than duplicating it. */\nexport async function recordGraphRun(\n reg: GraphRegistryDir,\n graph: AgentGraph,\n record: GraphRunRecord,\n): Promise<StoredGraph> {\n const stored = storeGraph(graph)\n return recordStoredGraphRun(reg, stored, record)\n}\n\n/** Store an executable graph or an observed external topology in the same registry.\n * Imported observations retain their source identity and never authorize replay.\n * A reader refreshing facts can preserve independently joined labels; an explicit\n * correction leaves preserveLabels unset and replaces the record. */\nexport async function recordStoredGraphRun(\n reg: GraphRegistryDir,\n definition: StoredGraph | StoredGraphInput,\n record?: GraphRunRecord,\n options: { readonly preserveLabels?: boolean } = {},\n): Promise<StoredGraph> {\n const { digest, continuation, ...topology } = definition\n const content = {\n ...topology,\n ...(continuation === undefined\n ? {}\n : { continuation: portableContinuationPolicySchema.parse(continuation) }),\n }\n const stored = { ...content, digest: digest ?? graphDigest(content) } as StoredGraph\n if (stored.observed && !record)\n throw new ValidationError('graph-registry: observed graphs require a source run identity')\n if (record) {\n assertRecord(record)\n if (stored.observed && !record.source)\n throw new ValidationError('graph-registry: observed graphs require a source run identity')\n if (!stored.observed && !record.finishedAt)\n throw new ValidationError('graph-registry: native graph runs require a completion timestamp')\n if (\n (!stored.observed || record.traversals !== undefined) &&\n (!Number.isSafeInteger(record.traversals) || record.traversals! < 0)\n )\n throw new ValidationError(\n 'graph-registry: native graphs require metered traversals; observed counts must be non-negative integers',\n )\n if (stored.digest !== record.graphDigest) {\n throw new ValidationError(\n `graph-registry: record.graphDigest ${record.graphDigest} does not match the supplied graph (${stored.digest}) — record the graph that actually ran`,\n )\n }\n }\n if (graphDigest(content) !== stored.digest)\n throw new ValidationError('graph-registry: stored graph content does not match its digest')\n await mkdir(join(reg.root, GRAPHS_DIR), { recursive: true })\n const file = join(reg.root, RECORDS_FILE)\n return withJsonlFileLock(file, async (canonicalPath) => {\n if (!record) {\n await persistGraph(reg, stored)\n return stored\n }\n let persisted = record\n if (options.preserveLabels && record.source) {\n const prior = (await readCommittedJsonFile<GraphRunRecord>(canonicalPath)).find(\n (row) => row.source?.kind === record.source!.kind && row.source.id === record.source!.id,\n )\n if (prior) {\n const taskType = record.taskType ?? prior.taskType\n const priorTerminal =\n prior.outcome.kind === 'delivered' || prior.outcome.kind === 'no-winner'\n const incomingUnassessed =\n record.outcome.kind === 'unknown' || record.outcome.kind === 'running'\n if (priorTerminal && incomingUnassessed && prior.startedAt !== record.startedAt)\n throw new ValidationError(\n 'graph-registry: preserving labels requires the same task start and source identity',\n )\n const evidence = [...(prior.evidence ?? []), ...(record.evidence ?? [])]\n persisted = {\n ...record,\n ...(taskType ? { taskType } : {}),\n ...(record.unknowns\n ? {\n unknowns: record.unknowns.filter(\n (reason) => !(taskType && reason === 'task type not explicitly labeled'),\n ),\n }\n : {}),\n ...(evidence.length\n ? {\n evidence: [\n ...new Map(evidence.map((entry) => [canonicalJson(entry), entry])).values(),\n ],\n }\n : {}),\n ...(priorTerminal && incomingUnassessed\n ? {\n outcome: prior.outcome,\n finishedAt: prior.finishedAt,\n cost: {\n ...record.cost,\n ...(prior.cost.ms === undefined ? {} : { ms: prior.cost.ms }),\n ...(prior.cost.mergeMs === undefined ? {} : { mergeMs: prior.cost.mergeMs }),\n },\n }\n : {}),\n }\n }\n }\n assertRecord(persisted)\n await persistGraph(reg, stored)\n await upsertCommittedJsonLine(canonicalPath, persisted, recordKey)\n return stored\n })\n}\n\nasync function persistGraph(reg: GraphRegistryDir, stored: StoredGraph): Promise<void> {\n const revisionPath = join(reg.root, GRAPHS_DIR, `${stored.digest}.json`)\n try {\n const { digest: existingDigest, ...existing } = JSON.parse(\n await readFile(revisionPath, 'utf8'),\n ) as StoredGraph\n if (existingDigest !== stored.digest || graphDigest(existing) !== stored.digest)\n throw new ValidationError(\n 'graph-registry: stored graph revision is immutable but its content differs',\n )\n } catch (error) {\n if (!isNoEntError(error)) throw error\n // Content-addressed revisions are immutable. Rewriting one on every run adds\n // an unnecessary durable publication to the record lock's critical section.\n writeAtomicDurableFile(revisionPath, JSON.stringify(stored), { preserveMode: true })\n }\n}\n\n/** All records, newest last. */\nexport async function listGraphRuns(reg: GraphRegistryDir): Promise<GraphRunRecord[]> {\n return readCommittedJsonFile<GraphRunRecord>(join(reg.root, RECORDS_FILE))\n}\n\n/** Filters over the existing graph run records. Missing source kind is native. */\nexport interface GraphRunQuery {\n readonly taskDigest?: string\n readonly taskType?: GraphRunRecord['taskType'] | 'unknown'\n readonly topologyDigest?: string\n readonly sourceKind?: string\n}\n\nfunction observedTopology(record: GraphRunRecord): string {\n return record.topologyDigest ?? (record.source ? 'unknown' : record.graphDigest)\n}\n\n/** Records for one task shape or deterministic label query, newest last. */\nexport async function graphRunsFor(\n reg: GraphRegistryDir,\n query: string | GraphRunQuery = {},\n): Promise<GraphRunRecord[]> {\n const filters = typeof query === 'string' ? { taskDigest: query } : query\n return (await listGraphRuns(reg)).filter(\n (row) =>\n (filters.taskDigest === undefined || row.taskDigest === filters.taskDigest) &&\n (filters.taskType === undefined || (row.taskType ?? 'unknown') === filters.taskType) &&\n (filters.topologyDigest === undefined || observedTopology(row) === filters.topologyDigest) &&\n (filters.sourceKind === undefined || (row.source?.kind ?? 'native') === filters.sourceKind),\n )\n}\n\n/** Descriptive task-type/topology measurements, with every population explicit.\n * Unknown and running runs never enter the assessed denominator or medians. */\nexport interface GraphCorpusGroup {\n readonly taskType: NonNullable<GraphRunRecord['taskType']> | 'unknown'\n readonly topologyDigest: string\n readonly delivered: number\n readonly assessed: number\n readonly unknown: number\n readonly deliveredRate: number | null\n readonly medianWallMs: number | null\n readonly wallMsCount: number\n readonly medianMergeMs: number | null\n readonly mergeMsCount: number\n readonly medianTokens: number | null\n readonly tokenCount: number\n readonly medianHumanMessages: number | null\n readonly humanMessageCount: number\n readonly runs: readonly GraphRunRecord[]\n}\n\n/** The registry's observational view. It neither authorizes replay nor proves a causal win. */\nexport interface GraphCorpusSummary {\n readonly recordCount: number\n readonly groups: readonly GraphCorpusGroup[]\n}\n\nfunction medianKnown(values: readonly (number | undefined)[]): {\n median: number | null\n count: number\n} {\n const known = values\n .filter((value): value is number => value !== undefined && Number.isFinite(value) && value >= 0)\n .sort((a, b) => a - b)\n const middle = Math.floor(known.length / 2)\n return {\n count: known.length,\n median:\n known.length === 0\n ? null\n : known.length % 2\n ? known[middle]!\n : (known[middle - 1]! + known[middle]!) / 2,\n }\n}\n\n// The single observational policy used by both query and pickBestGraph. Native\n// selection below remains unchanged; this policy is an explicit descriptive opt-in.\nfunction observedGraphSummary(records: readonly GraphRunRecord[]): GraphCorpusSummary {\n const groups = new Map<string, GraphRunRecord[]>()\n for (const record of records) {\n const key = JSON.stringify([record.taskType ?? 'unknown', observedTopology(record)])\n const rows = groups.get(key)\n if (rows) rows.push(record)\n else groups.set(key, [record])\n }\n const summaries: GraphCorpusGroup[] = [...groups.values()].map((runs) => {\n const assessed = runs.filter(\n (run) => run.outcome.kind === 'delivered' || run.outcome.kind === 'no-winner',\n )\n const delivered = assessed.filter((run) => run.outcome.kind === 'delivered')\n const wall = medianKnown(assessed.map((run) => run.cost.ms))\n const merge = medianKnown(\n delivered\n .filter((run) => run.evidence?.some((entry) => entry.kind === 'pr-merged'))\n .map((run) => run.cost.mergeMs),\n )\n const tokens = medianKnown(assessed.map((run) => run.cost.tokens))\n const human = medianKnown(assessed.map((run) => run.cost.humanMessages))\n return {\n taskType: runs[0]!.taskType ?? 'unknown',\n topologyDigest: observedTopology(runs[0]!),\n delivered: delivered.length,\n assessed: assessed.length,\n unknown: runs.length - assessed.length,\n deliveredRate: assessed.length ? delivered.length / assessed.length : null,\n medianWallMs: wall.median,\n wallMsCount: wall.count,\n medianMergeMs: merge.median,\n mergeMsCount: merge.count,\n medianTokens: tokens.median,\n tokenCount: tokens.count,\n medianHumanMessages: human.median,\n humanMessageCount: human.count,\n runs,\n }\n })\n summaries.sort((a, b) => {\n const delivered = (b.deliveredRate ?? -1) - (a.deliveredRate ?? -1)\n if (delivered) return delivered\n for (const key of ['medianWallMs', 'medianTokens', 'medianHumanMessages'] as const) {\n if (a[key] === b[key]) continue\n if (a[key] === null) return 1\n if (b[key] === null) return -1\n return a[key]! - b[key]!\n }\n return a.taskType.localeCompare(b.taskType) || a.topologyDigest.localeCompare(b.topologyDigest)\n })\n return { recordCount: records.length, groups: summaries }\n}\n\n/** Query and rank the same registry records using the opt-in observational\n * policy: delivery rate, wall time, tokens, then human messages; unknowns last. */\nexport async function graphCorpusSummary(\n reg: GraphRegistryDir,\n query: GraphRunQuery = {},\n): Promise<GraphCorpusSummary> {\n return observedGraphSummary(await graphRunsFor(reg, query))\n}\n\nexport type GraphSelection =\n | { readonly kind: 'replay'; readonly graph: StoredGraph; readonly record: GraphRunRecord }\n | { readonly kind: 'author'; readonly reason: string }\n\n/** The documented heuristic: delivered beats failed; among delivered, cheaper\n * (tokens, then iterations) wins; ties go to the most recent. */\nexport function pickBestGraph(\n records: ReadonlyArray<GraphRunRecord>,\n options: { readonly policy?: 'native' | 'observed' } = {},\n): GraphRunRecord | undefined {\n if (options.policy === 'observed') {\n const group = observedGraphSummary(records).groups[0]\n return group && pickBestGraph(group.runs)\n }\n const delivered = records.filter((row) => row.outcome.kind === 'delivered')\n if (delivered.length === 0) return undefined\n const better = (a: GraphRunRecord, b: GraphRunRecord): GraphRunRecord => {\n const aTokens = a.cost.tokens ?? Number.POSITIVE_INFINITY\n const bTokens = b.cost.tokens ?? Number.POSITIVE_INFINITY\n if (aTokens !== bTokens) return aTokens < bTokens ? a : b\n const aIter = a.cost.iterations ?? Number.POSITIVE_INFINITY\n const bIter = b.cost.iterations ?? Number.POSITIVE_INFINITY\n if (aIter !== bIter) return aIter < bIter ? a : b\n return a.finishedAt! >= b.finishedAt! ? a : b\n }\n return delivered.reduce((best, row) => (better(best, row) === best ? best : row))\n}\n\n/** Load a stored graph by digest. */\nexport async function loadGraph(\n reg: GraphRegistryDir,\n digest: string,\n): Promise<StoredGraph | undefined> {\n try {\n return JSON.parse(\n await readFile(join(reg.root, GRAPHS_DIR, `${digest}.json`), 'utf8'),\n ) as StoredGraph\n } catch {\n return undefined\n }\n}\n\n/** The designer's lookup: replay the known-good graph for this task shape, or\n * author a new one — with the reason stated either way (the decision is data). */\nexport async function lookupGraph(\n reg: GraphRegistryDir,\n taskDigest: string,\n): Promise<GraphSelection> {\n const records = await graphRunsFor(reg, taskDigest)\n const candidates: GraphRunRecord[] = []\n const loaded = new Map<string, StoredGraph | undefined>()\n for (const record of records) {\n if (!loaded.has(record.graphDigest))\n loaded.set(record.graphDigest, await loadGraph(reg, record.graphDigest))\n const graph = loaded.get(record.graphDigest)\n if (!graph?.observed) candidates.push(record)\n }\n if (records.length && !candidates.length)\n return {\n kind: 'author',\n reason: 'only observed topologies are available; author an executable graph',\n }\n const best = pickBestGraph(candidates)\n if (best) {\n const graph = await loadGraph(reg, best.graphDigest)\n if (graph) return { kind: 'replay', graph, record: best }\n return {\n kind: 'author',\n reason: `best record's graph ${best.graphDigest.slice(0, 12)} is missing from the registry`,\n }\n }\n return {\n kind: 'author',\n reason:\n records.length === 0\n ? 'first run for this task shape'\n : 'no graph delivered for this task shape yet',\n }\n}\n\n/** Rehydrate a stored graph, binding trigger data and an environment-owned named check. */\nexport function graphFromStored(\n stored: StoredGraph | StoredGraphInput,\n environment: AgentGraph['deliverable']['check'] | GraphFromStoredOptions = {},\n): AgentGraph {\n if (stored.observed)\n throw new ValidationError('graphFromStored: observed topology cannot be replayed')\n const {\n digest: _digest,\n observed: _observed,\n triggerBindings: _triggerBindings,\n deliverable,\n ...topology\n } = (\n stored.triggerBindings !== undefined\n ? bindCompiledGraphTriggers(\n stored,\n stored.triggerBindings,\n typeof environment === 'function' ? undefined : (environment.trigger ?? {}),\n )\n : typeof environment === 'function'\n ? stored\n : bindGraphParameters(stored, { trigger: environment.trigger ?? {} })\n ) as typeof stored\n const selected =\n typeof environment === 'function'\n ? environment\n : environment.checks && Object.hasOwn(environment.checks, deliverable.checkRef ?? '')\n ? environment.checks[deliverable.checkRef!]\n : deliverable.checkRef === 'command'\n ? deliverable.command\n : deliverable.checkRef === 'route' && deliverable.when\n ? (((out, context) =>\n context\n ? context.originalVerdict?.valid !== false\n : checkGraphRoute(\n deliverable.when!,\n out,\n )) satisfies AgentGraph['deliverable']['check'])\n : undefined\n if (!selected)\n throw new ValidationError(\n `graphFromStored: unknown checkRef ${deliverable.checkRef ?? '(missing)'}`,\n )\n const materialized = {\n ...(stored.triggerBindings === undefined ? {} : { triggerBindings: [] as const }),\n ...(topology.continuation === undefined\n ? {}\n : { continuation: portableContinuationPolicySchema.parse(topology.continuation) }),\n }\n if (typeof selected === 'function') {\n const { command: _command, ...description } = deliverable\n return { ...topology, ...materialized, deliverable: { ...description, check: selected } }\n }\n const command =\n selected === deliverable.command\n ? selected\n : (bindGraphParameters(selected, {\n trigger: (environment as GraphFromStoredOptions).trigger ?? {},\n }) as typeof selected)\n return {\n ...topology,\n ...materialized,\n deliverable: {\n ...deliverable,\n command,\n check: () => false, // runGraph binds the independent command authority before execution.\n },\n }\n}\n\n/** Digests present on disk (integrity probe for tests and audits). */\nexport async function storedGraphDigests(reg: GraphRegistryDir): Promise<string[]> {\n try {\n return (await readdir(join(reg.root, GRAPHS_DIR)))\n .filter((name) => name.endsWith('.json'))\n .map((name) => name.slice(0, -'.json'.length))\n .sort()\n } catch {\n return []\n }\n}\n"],"mappings":";;;;;;;;;;;;AAIA,SAAgB,eACd,OACA,SACA,2BAAW,IAAI,IAAY,GACrB;CACN,SAAS,KAAK,SAAwB;EACpC,MAAM,IAAI,gBAAgB,GAAG,QAAQ,IAAI,SAAS;CACpD;CACA,IAAI,UAAU,QAAQ,OAAO,UAAU,YAAY,OAAO,UAAU,WAAW;CAC/E,IAAI,OAAO,UAAU,YAAY,OAAO,SAAS,KAAK,GAAG;CACzD,IAAI,CAAC,SAAS,OAAO,UAAU,YAAY,SAAS,IAAI,KAAK,GAC3D,KAAK,8DAA8D;CACrE,MAAM,QAAQ,MAAM,QAAQ,KAAK;CACjC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B,CAAC,IACD,EAAE,cAAc,iCAAiC,MAAM,SAAS,YAAY,EAAE;CACpF;CACA,IAAI,OAAO,aAAa,YAAY;EAClC,MAAM,EAAE,SAAS,UAAU,GAAG,gBAAgB;EAC9C,OAAO;GAAE,GAAG;GAAU,GAAG;GAAc,aAAa;IAAE,GAAG;IAAa,OAAO;GAAS;EAAE;CAC1F;CACA,MAAM,UACJ,aAAa,YAAY,UACrB,WACC,oBAAoB,UAAU,EAC7B,SAAU,YAAuC,WAAW,CAAC,EAC/D,CAAC;CACP,OAAO;EACL,GAAG;EACH,GAAG;EACH,aAAa;GACX,GAAG;GACH;GACA,aAAa;EACf;CACF;AACF;;AAGA,eAAsB,mBAAmB,KAA0C;CACjF,IAAI;EACF,QAAQ,MAAM,QAAQ,KAAK,IAAI,MAAM,UAAU,CAAC,EAAA,CAC7C,QAAQ,SAAS,KAAK,SAAS,OAAO,CAAC,CAAC,CACxC,KAAK,SAAS,KAAK,MAAM,GAAG,EAAe,CAAC,CAAC,CAC7C,KAAK;CACV,QAAQ;EACN,OAAO,CAAC;CACV;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { s as listGraphRuns, c as loadGraph } from "./graph-registry-
|
|
1
|
+
export { s as listGraphRuns, c as loadGraph } from "./graph-registry-czAwYwNj.js";
|