@tangle-network/agent-runtime 0.231.1 → 0.233.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/dist/{activation-Dltkq5S8.d.ts → activation-C8fPmjWa.d.ts} +2 -2
- package/dist/{activation-DVqSBfe1.js → activation-D0_qcEXf.js} +2 -2
- package/dist/{activation-DVqSBfe1.js.map → activation-D0_qcEXf.js.map} +1 -1
- package/dist/agent.d.ts +2 -2
- package/dist/agent.js +2 -2
- package/dist/{coordination-driver-CUdEC2Qh.js → coordination-driver-BR52Rt39.js} +14 -13
- package/dist/{coordination-driver-CUdEC2Qh.js.map → coordination-driver-BR52Rt39.js.map} +1 -1
- package/dist/{delegate-BN0cSSUT.js → delegate-CA-Tnr1_.js} +2 -2
- package/dist/{delegate-BN0cSSUT.js.map → delegate-CA-Tnr1_.js.map} +1 -1
- package/dist/durable.d.ts +11 -2
- package/dist/durable.js +13 -3
- package/dist/durable.js.map +1 -1
- package/dist/{graph-D4wgK3ns.js → graph-BtMQMQin.js} +3 -3
- package/dist/{graph-D4wgK3ns.js.map → graph-BtMQMQin.js.map} +1 -1
- package/dist/{improvement-cycle-CjIeWuyB.js → improvement-cycle-WJJALdil.js} +3 -3
- package/dist/{improvement-cycle-CjIeWuyB.js.map → improvement-cycle-WJJALdil.js.map} +1 -1
- package/dist/{index-BW6lJXnH.d.ts → index-BwWBXoyq.d.ts} +39 -24
- package/dist/index.d.ts +6 -6
- package/dist/index.js +7 -7
- package/dist/intelligence.d.ts +3 -3
- package/dist/intelligence.js +3 -3
- package/dist/kernel.d.ts +4 -4
- package/dist/kernel.js +9 -9
- package/dist/{loop-runner-bin-BodmUPOf.js → loop-runner-bin-7cS9NAmk.js} +3 -3
- package/dist/{loop-runner-bin-BodmUPOf.js.map → loop-runner-bin-7cS9NAmk.js.map} +1 -1
- package/dist/{loop-runner-bin-BcqlGNW-.d.ts → loop-runner-bin-DaOd42mA.d.ts} +3 -3
- package/dist/loop-runner-bin.d.ts +1 -1
- package/dist/loop-runner-bin.js +1 -1
- package/dist/mcp/bin.js +3 -3
- package/dist/mcp/index.d.ts +5 -5
- package/dist/mcp/index.js +4 -4
- package/dist/{openai-tools-avHT8eq3.d.ts → openai-tools-BdFqNlha.d.ts} +2 -2
- package/dist/profiles.d.ts +2 -2
- package/dist/{provision-supervisor-DyNDlA2I.js → provision-supervisor-BME3OgTk.js} +3 -3
- package/dist/{provision-supervisor-DyNDlA2I.js.map → provision-supervisor-BME3OgTk.js.map} +1 -1
- package/dist/{runtime-BxZHapmG.js → runtime-CcfA_ElB.js} +9 -8
- package/dist/{runtime-BxZHapmG.js.map → runtime-CcfA_ElB.js.map} +1 -1
- package/dist/{server-C9pa2tSq.js → server-DU3nDuDb.js} +3 -3
- package/dist/{server-C9pa2tSq.js.map → server-DU3nDuDb.js.map} +1 -1
- package/dist/{stream-agent-turn-hiU4vgGX.d.ts → stream-agent-turn-aXpd9b_N.d.ts} +2 -11
- package/dist/{structural-rollout-DQoLyth9.js → structural-rollout-YlkrevWE.js} +2 -2
- package/dist/{structural-rollout-DQoLyth9.js.map → structural-rollout-YlkrevWE.js.map} +1 -1
- package/dist/{substrate-CBo6TWOl.d.ts → substrate-B2Os0b0f.d.ts} +2 -2
- package/dist/{supervise-Cl_-IsVc.js → supervise-CAJWyXQ-.js} +13 -10
- package/dist/supervise-CAJWyXQ-.js.map +1 -0
- package/dist/{supervisor-DFsXULnE.js → supervisor-C2xWmESG.js} +517 -199
- package/dist/supervisor-C2xWmESG.js.map +1 -0
- package/dist/testing.d.ts +2 -2
- package/dist/testing.js +12 -12
- package/dist/tui/index.d.ts +1 -1
- package/dist/tui/index.js +1 -1
- package/dist/{types-DBovefLD.d.ts → types-F5MG_7Qq.d.ts} +228 -27
- package/package.json +1 -1
- package/dist/supervise-Cl_-IsVc.js.map +0 -1
- package/dist/supervisor-DFsXULnE.js.map +0 -1
|
@@ -5754,7 +5754,18 @@ function generateTraceId() {
|
|
|
5754
5754
|
return Array.from(bytes).map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
5755
5755
|
}
|
|
5756
5756
|
//#endregion
|
|
5757
|
-
//#region src/
|
|
5757
|
+
//#region src/durable/content-address.ts
|
|
5758
|
+
/** Stable content address shared by result and trace artifacts. */
|
|
5759
|
+
function contentAddress(artifact) {
|
|
5760
|
+
return `sha256:${createHash("sha256").update(stableStringify(artifact), "utf-8").digest("hex")}`;
|
|
5761
|
+
}
|
|
5762
|
+
function stableStringify(value) {
|
|
5763
|
+
if (value === null || typeof value !== "object") return JSON.stringify(value) ?? "null";
|
|
5764
|
+
if (Array.isArray(value)) return `[${value.map(stableStringify).join(",")}]`;
|
|
5765
|
+
return `{${Object.entries(value).filter(([, v]) => v !== void 0).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0).map(([k, v]) => `${JSON.stringify(k)}:${stableStringify(v)}`).join(",")}}`;
|
|
5766
|
+
}
|
|
5767
|
+
//#endregion
|
|
5768
|
+
//#region src/runtime/harness-transcript.ts
|
|
5758
5769
|
/**
|
|
5759
5770
|
* Read a sandbox child's own harness transcript out of its environment before the
|
|
5760
5771
|
* environment is destroyed, and persist it beside the tool-span `trace` receipt.
|
|
@@ -5777,9 +5788,11 @@ function generateTraceId() {
|
|
|
5777
5788
|
* `exec`. An environment with `read` but no `exec` cannot be enumerated and is also
|
|
5778
5789
|
* reported, not guessed at.
|
|
5779
5790
|
*
|
|
5780
|
-
* Storage is NOT
|
|
5781
|
-
*
|
|
5782
|
-
*
|
|
5791
|
+
* Storage is NOT the executor's business. The executor holds the in-memory capture and hands it
|
|
5792
|
+
* to the scope through `Executor.harnessTranscript()`; the scope persists it under its own
|
|
5793
|
+
* content ref with `persistHarnessTranscript` and settles the receipt. No provider or destroy
|
|
5794
|
+
* site learns about storage, the result blob never carries the files, and replay rehydrates a
|
|
5795
|
+
* pointer — the bytes are read only by `harnessTranscriptArtifact`, when someone opens them.
|
|
5783
5796
|
*
|
|
5784
5797
|
* Credentials are excluded by construction: enumeration lists only the transcript globs
|
|
5785
5798
|
* for the harness, and any path matching DENY is dropped even if a producer moved a
|
|
@@ -5805,9 +5818,15 @@ const HARNESS_ROOTS = Object.freeze({
|
|
|
5805
5818
|
*/
|
|
5806
5819
|
const DENY = /(^|\/)(auth\.json|\.credentials\.json|credentials|\.netrc|\.env(\..*)?|secrets?(\.|$)|.*\.(pem|key|p12|pfx)|id_[a-z0-9_]+)$/iu;
|
|
5807
5820
|
/**
|
|
5808
|
-
* Bounds per file and in total.
|
|
5809
|
-
*
|
|
5810
|
-
*
|
|
5821
|
+
* Bounds per file and in total, PER CHILD. They multiply by fleet width, and the next person
|
|
5822
|
+
* sizing a fleet must find that here: a 132-child pursuit (mech-interp-foundations-astra-20260911f,
|
|
5823
|
+
* the widest retained on one operator host) at the ceiling is 132 x 16 MiB = 2.1 GiB of transcript
|
|
5824
|
+
* for one run (#1248).
|
|
5825
|
+
*
|
|
5826
|
+
* That figure is a DISK number, not a replay number. The artifact is persisted under its own
|
|
5827
|
+
* content ref in the `ResultBlobStore` and the settlement carries only the receipt, so replay and
|
|
5828
|
+
* resume rehydrate a ref, never the files; nothing pays for a transcript until someone opens it.
|
|
5829
|
+
* The bound is enforced exactly, after each read, so a child settles at or under MAX_TOTAL_BYTES.
|
|
5811
5830
|
*/
|
|
5812
5831
|
const MAX_FILE_BYTES = 2 * 1024 * 1024;
|
|
5813
5832
|
const MAX_TOTAL_BYTES = 16 * 1024 * 1024;
|
|
@@ -5818,17 +5837,56 @@ function unavailable$2(reason) {
|
|
|
5818
5837
|
reason
|
|
5819
5838
|
});
|
|
5820
5839
|
}
|
|
5840
|
+
/** The one place an absent transcript is spelled, so every settlement reads the same — the
|
|
5841
|
+
* settle path needs it for the reasons only IT can know (an executor that offers no transcript,
|
|
5842
|
+
* a child that never started), which the capture itself never sees. */
|
|
5843
|
+
function harnessTranscriptUnavailable(reason) {
|
|
5844
|
+
return unavailable$2(reason);
|
|
5845
|
+
}
|
|
5821
5846
|
/**
|
|
5822
5847
|
* Enumerate candidate transcript paths inside the environment.
|
|
5823
5848
|
*
|
|
5824
|
-
* `find` is given the roots and prints one path per
|
|
5825
|
-
* a child that never used a harness has no directory for it.
|
|
5849
|
+
* `find -printf` is given the roots and prints one `size<TAB>path` line per file. A missing root
|
|
5850
|
+
* is not an error: a child that never used a harness has no directory for it. GNU find is the
|
|
5851
|
+
* target (the Tangle Linux box); BSD and BusyBox `find` have no `-printf`, their error is
|
|
5852
|
+
* discarded by `2>/dev/null`, and the empty listing then reads as `no-transcript` — that is a
|
|
5853
|
+
* known limit, not a fallback. A path-only line (no size) is still accepted and bounded after
|
|
5854
|
+
* the read, which is what a stub or a wrapped `find` produces, not what BSD does.
|
|
5855
|
+
*
|
|
5856
|
+
* Two omissions used to be silent, so `skippedCount` could read 0 on an incomplete capture: a
|
|
5857
|
+
* `-size` filter dropped oversized files before they were ever listed, and `head` cut the listing
|
|
5858
|
+
* at MAX_FILES with nothing saying so. Both are reported now: an oversized file is skipped by its
|
|
5859
|
+
* listed size WITHOUT being read, and a listing that overflows carries one
|
|
5860
|
+
* `enumeration-truncated` entry naming the bound.
|
|
5826
5861
|
*/
|
|
5827
5862
|
async function enumerate(environment, roots, signal) {
|
|
5828
5863
|
if (!environment.exec) return void 0;
|
|
5829
|
-
const command = `find ${roots.map((r) => `"$HOME/${r}"`).join(" ")} -type f -
|
|
5864
|
+
const command = `find ${roots.map((r) => `"$HOME/${r}"`).join(" ")} -type f -printf '%s\\t%p\\n' 2>/dev/null | head -1001`;
|
|
5830
5865
|
try {
|
|
5831
|
-
|
|
5866
|
+
const lines = ((await environment.exec(command, signal ? { signal } : void 0)).stdout ?? "").split("\n").map((l) => l.trim()).filter((l) => l.length > 0);
|
|
5867
|
+
const omitted = [];
|
|
5868
|
+
const paths = [];
|
|
5869
|
+
for (const line of lines.slice(0, MAX_FILES)) {
|
|
5870
|
+
const tab = line.indexOf(" ");
|
|
5871
|
+
const path = tab === -1 ? line : line.slice(tab + 1);
|
|
5872
|
+
const size = tab === -1 ? void 0 : Number(line.slice(0, tab));
|
|
5873
|
+
if (size !== void 0 && Number.isFinite(size) && size > MAX_FILE_BYTES) {
|
|
5874
|
+
omitted.push({
|
|
5875
|
+
path,
|
|
5876
|
+
reason: "file-exceeds-byte-bound"
|
|
5877
|
+
});
|
|
5878
|
+
continue;
|
|
5879
|
+
}
|
|
5880
|
+
paths.push(path);
|
|
5881
|
+
}
|
|
5882
|
+
if (lines.length > MAX_FILES) omitted.push({
|
|
5883
|
+
path: roots.join(" "),
|
|
5884
|
+
reason: `enumeration-truncated-at-${MAX_FILES}`
|
|
5885
|
+
});
|
|
5886
|
+
return {
|
|
5887
|
+
paths,
|
|
5888
|
+
omitted
|
|
5889
|
+
};
|
|
5832
5890
|
} catch {
|
|
5833
5891
|
return;
|
|
5834
5892
|
}
|
|
@@ -5841,16 +5899,17 @@ async function enumerate(environment, roots, signal) {
|
|
|
5841
5899
|
* must not fail because evidence could not be collected, and every failure mode is a named
|
|
5842
5900
|
* `reason` the settled receipt carries instead of an empty artifact that reads as coverage.
|
|
5843
5901
|
*/
|
|
5844
|
-
async function
|
|
5902
|
+
async function captureHarnessTranscript(environment, harness, signal) {
|
|
5845
5903
|
if (!environment?.read) return unavailable$2("unsupported-environment");
|
|
5846
5904
|
if (harness === void 0) return unavailable$2("unknown-harness");
|
|
5847
5905
|
const roots = HARNESS_ROOTS[harness];
|
|
5848
5906
|
if (!roots) return unavailable$2("unknown-harness");
|
|
5849
|
-
const
|
|
5850
|
-
if (
|
|
5851
|
-
|
|
5907
|
+
const enumerated = await enumerate(environment, roots, signal);
|
|
5908
|
+
if (enumerated === void 0) return unavailable$2("enumeration-failed");
|
|
5909
|
+
const { paths } = enumerated;
|
|
5910
|
+
if (paths.length === 0 && enumerated.omitted.length === 0) return unavailable$2("no-transcript");
|
|
5852
5911
|
const files = [];
|
|
5853
|
-
const skipped = [];
|
|
5912
|
+
const skipped = [...enumerated.omitted];
|
|
5854
5913
|
let total = 0;
|
|
5855
5914
|
for (const path of paths) {
|
|
5856
5915
|
if (signal?.aborted) {
|
|
@@ -5884,6 +5943,13 @@ async function captureNativeSessionEvidence(environment, harness, signal) {
|
|
|
5884
5943
|
});
|
|
5885
5944
|
continue;
|
|
5886
5945
|
}
|
|
5946
|
+
if (total + bytes > MAX_TOTAL_BYTES) {
|
|
5947
|
+
skipped.push({
|
|
5948
|
+
path,
|
|
5949
|
+
reason: "total-byte-budget-exhausted"
|
|
5950
|
+
});
|
|
5951
|
+
continue;
|
|
5952
|
+
}
|
|
5887
5953
|
files.push(Object.freeze({
|
|
5888
5954
|
path,
|
|
5889
5955
|
bytes,
|
|
@@ -5897,7 +5963,11 @@ async function captureNativeSessionEvidence(environment, harness, signal) {
|
|
|
5897
5963
|
});
|
|
5898
5964
|
}
|
|
5899
5965
|
}
|
|
5900
|
-
if (files.length === 0) return
|
|
5966
|
+
if (files.length === 0) return Object.freeze({
|
|
5967
|
+
status: "unavailable",
|
|
5968
|
+
reason: "nothing-carried",
|
|
5969
|
+
skipped: Object.freeze(skipped)
|
|
5970
|
+
});
|
|
5901
5971
|
const artifact = Object.freeze({
|
|
5902
5972
|
schemaVersion: 1,
|
|
5903
5973
|
harness,
|
|
@@ -5905,13 +5975,54 @@ async function captureNativeSessionEvidence(environment, harness, signal) {
|
|
|
5905
5975
|
skipped: Object.freeze(skipped)
|
|
5906
5976
|
});
|
|
5907
5977
|
return Object.freeze({
|
|
5908
|
-
status: "
|
|
5978
|
+
status: "captured",
|
|
5909
5979
|
artifact,
|
|
5910
5980
|
fileCount: files.length,
|
|
5911
5981
|
totalBytes: total,
|
|
5912
5982
|
skippedCount: skipped.length
|
|
5913
5983
|
});
|
|
5914
5984
|
}
|
|
5985
|
+
/**
|
|
5986
|
+
* Persist a capture under its own content ref and return the receipt a settlement carries.
|
|
5987
|
+
*
|
|
5988
|
+
* The scope calls this, not the executor: storage stays out of every provider and destroy site,
|
|
5989
|
+
* exactly as the tool-span trace is persisted by `captureWorkerTraceEvidence` and not by the
|
|
5990
|
+
* source that collected it. A capture that is already unavailable passes through untouched.
|
|
5991
|
+
*/
|
|
5992
|
+
async function persistHarnessTranscript(capture, blobs) {
|
|
5993
|
+
if (capture.status !== "captured") return capture;
|
|
5994
|
+
const transcriptRef = contentAddress(capture.artifact);
|
|
5995
|
+
try {
|
|
5996
|
+
await blobs.put(transcriptRef, capture.artifact);
|
|
5997
|
+
} catch {
|
|
5998
|
+
return unavailable$2("transcript-persistence-failed");
|
|
5999
|
+
}
|
|
6000
|
+
return Object.freeze({
|
|
6001
|
+
status: "available",
|
|
6002
|
+
transcriptRef,
|
|
6003
|
+
harness: capture.artifact.harness,
|
|
6004
|
+
fileCount: capture.fileCount,
|
|
6005
|
+
totalBytes: capture.totalBytes,
|
|
6006
|
+
skippedCount: capture.skippedCount
|
|
6007
|
+
});
|
|
6008
|
+
}
|
|
6009
|
+
/**
|
|
6010
|
+
* Rehydrate the exact persisted transcript a receipt points at, or `undefined` when the receipt
|
|
6011
|
+
* says there is none. Throws only when the receipt claims a blob the store does not hold — that
|
|
6012
|
+
* is corruption, not absence, and must not read as "no transcript".
|
|
6013
|
+
*/
|
|
6014
|
+
async function harnessTranscriptArtifact(evidence, blobs) {
|
|
6015
|
+
if (evidence.status !== "available") return void 0;
|
|
6016
|
+
const raw = await blobs.get(evidence.transcriptRef);
|
|
6017
|
+
if (!isHarnessTranscriptArtifact(raw)) throw new ValidationError$1(`harnessTranscriptArtifact: blob store has no transcript artifact for '${evidence.transcriptRef}'`);
|
|
6018
|
+
return raw;
|
|
6019
|
+
}
|
|
6020
|
+
/** Every entry, not just the arrays: a blob with `files: [null]` is corruption, not a transcript. */
|
|
6021
|
+
function isHarnessTranscriptArtifact(value) {
|
|
6022
|
+
if (value === null || typeof value !== "object") return false;
|
|
6023
|
+
const artifact = value;
|
|
6024
|
+
return artifact.schemaVersion === 1 && typeof artifact.harness === "string" && Array.isArray(artifact.files) && artifact.files.every((file) => file !== null && typeof file === "object" && typeof file.path === "string" && typeof file.content === "string" && Number.isSafeInteger(file.bytes) && file.bytes >= 0) && Array.isArray(artifact.skipped) && artifact.skipped.every((entry) => entry !== null && typeof entry === "object" && typeof entry.path === "string" && typeof entry.reason === "string");
|
|
6025
|
+
}
|
|
5915
6026
|
//#endregion
|
|
5916
6027
|
//#region src/runtime/provider-placement.ts
|
|
5917
6028
|
const placementMetadataKey = "runtimeProviderPlacement";
|
|
@@ -7563,6 +7674,7 @@ function createProviderExecutor(provider, profile, ctx, options, placement) {
|
|
|
7563
7674
|
let artifact;
|
|
7564
7675
|
let retained;
|
|
7565
7676
|
let pending = false;
|
|
7677
|
+
let harnessTranscript = harnessTranscriptUnavailable("execution-never-started");
|
|
7566
7678
|
const retention = retainedExecutorContext(ctx);
|
|
7567
7679
|
let destroyed = false;
|
|
7568
7680
|
const runtime = options.runtime ?? provider.name;
|
|
@@ -7639,6 +7751,7 @@ function createProviderExecutor(provider, profile, ctx, options, placement) {
|
|
|
7639
7751
|
},
|
|
7640
7752
|
onEnvironment: (env) => {
|
|
7641
7753
|
environment = env;
|
|
7754
|
+
if (harnessTranscript.status === "unavailable" && harnessTranscript.reason === "execution-never-started") harnessTranscript = harnessTranscriptUnavailable("capture-did-not-run");
|
|
7642
7755
|
finalizeRuntimeOwnedPendingExecutor(executor, {
|
|
7643
7756
|
...plannedDeclaration,
|
|
7644
7757
|
execution: {
|
|
@@ -7650,6 +7763,9 @@ function createProviderExecutor(provider, profile, ctx, options, placement) {
|
|
|
7650
7763
|
onArtifact: (next) => {
|
|
7651
7764
|
artifact = next;
|
|
7652
7765
|
},
|
|
7766
|
+
onHarnessTranscript: (next) => {
|
|
7767
|
+
harnessTranscript = next;
|
|
7768
|
+
},
|
|
7653
7769
|
onDestroyed: () => {
|
|
7654
7770
|
destroyed = true;
|
|
7655
7771
|
}
|
|
@@ -7735,7 +7851,8 @@ function createProviderExecutor(provider, profile, ctx, options, placement) {
|
|
|
7735
7851
|
if (!artifact) throw new ValidationError(`providerAsExecutor(${provider.name}): resultArtifact() read before stream drained`);
|
|
7736
7852
|
return artifact;
|
|
7737
7853
|
},
|
|
7738
|
-
traceSource: () => trace.source
|
|
7854
|
+
traceSource: () => trace.source,
|
|
7855
|
+
harnessTranscript: () => harnessTranscript
|
|
7739
7856
|
};
|
|
7740
7857
|
return attestRuntimeOwnedPendingExecutor(executor, runtime, plannedDeclaration, plannedBinding);
|
|
7741
7858
|
}
|
|
@@ -7832,10 +7949,10 @@ async function* streamProviderExecutor(args) {
|
|
|
7832
7949
|
}
|
|
7833
7950
|
if ((args.options.requireTerminalEvent ?? true) && !terminal) throw new ValidationError(`providerAsExecutor(${args.provider.name}): stream ended without a terminal result/done/status event`);
|
|
7834
7951
|
yield { kind: "iteration" };
|
|
7835
|
-
const
|
|
7952
|
+
const harnessTranscript = await captureHarnessTranscript(environment, args.profile.harness, linked);
|
|
7953
|
+
args.onHarnessTranscript(harnessTranscript);
|
|
7836
7954
|
const result = {
|
|
7837
7955
|
...resultFromEvents(archive.events(), text),
|
|
7838
|
-
nativeSession,
|
|
7839
7956
|
...archive.superseded > 0 ? { supersededPartUpdates: archive.superseded } : {},
|
|
7840
7957
|
...explicitFailure ? { outcome: outcomeTracker.finish() } : {}
|
|
7841
7958
|
};
|
|
@@ -7870,6 +7987,7 @@ async function* streamProviderExecutor(args) {
|
|
|
7870
7987
|
} catch (error) {
|
|
7871
7988
|
failure = source.retained ? new RetainedExecutionPendingError(error) : error;
|
|
7872
7989
|
failed = true;
|
|
7990
|
+
args.onHarnessTranscript(await captureHarnessTranscript(environment, args.profile.harness, linked));
|
|
7873
7991
|
} finally {
|
|
7874
7992
|
if ((!source.retained || settled !== void 0 && !failed) && !(source.retained && args.retention?.preserveEnvironment) && (args.options.destroyOnSettle ?? true)) try {
|
|
7875
7993
|
await environment.destroy?.();
|
|
@@ -15074,17 +15192,6 @@ function describeLeakedReservation(leak) {
|
|
|
15074
15192
|
return parts.join(", ");
|
|
15075
15193
|
}
|
|
15076
15194
|
//#endregion
|
|
15077
|
-
//#region src/durable/content-address.ts
|
|
15078
|
-
/** Stable content address shared by result and trace artifacts. */
|
|
15079
|
-
function contentAddress(artifact) {
|
|
15080
|
-
return `sha256:${createHash("sha256").update(stableStringify(artifact), "utf-8").digest("hex")}`;
|
|
15081
|
-
}
|
|
15082
|
-
function stableStringify(value) {
|
|
15083
|
-
if (value === null || typeof value !== "object") return JSON.stringify(value) ?? "null";
|
|
15084
|
-
if (Array.isArray(value)) return `[${value.map(stableStringify).join(",")}]`;
|
|
15085
|
-
return `{${Object.entries(value).filter(([, v]) => v !== void 0).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0).map(([k, v]) => `${JSON.stringify(k)}:${stableStringify(v)}`).join(",")}}`;
|
|
15086
|
-
}
|
|
15087
|
-
//#endregion
|
|
15088
15195
|
//#region src/runtime/supervise/trace-evidence.ts
|
|
15089
15196
|
/**
|
|
15090
15197
|
* Durable structured tool evidence for supervised workers.
|
|
@@ -15204,27 +15311,6 @@ function runtimeOwnedNestedDriverTreeRoot(owner, parentTreeRoot, driverNodeId) {
|
|
|
15204
15311
|
//#endregion
|
|
15205
15312
|
//#region src/durable/spawn-journal.ts
|
|
15206
15313
|
/**
|
|
15207
|
-
*
|
|
15208
|
-
* Event-sourced spawn journal for the recursive execution atom (build steps 3 + 7).
|
|
15209
|
-
*
|
|
15210
|
-
* The supervision tree is journaled as an append-only event log: every `spawned`,
|
|
15211
|
-
* `settled`, and `cancelled` is recorded AFTER it is observed-committed (never
|
|
15212
|
-
* speculative), mirroring `ConversationJournal`'s begin/append/load shape. The log
|
|
15213
|
-
* holds only the THIN decision record — ids, parentage, budget, the spend a decision
|
|
15214
|
-
* consumed, and a content-addressed `outRef`. The payloads the driver branched on
|
|
15215
|
-
* (the `out` artifacts) live in a separate `ResultBlobStore`, keyed by `outRef`, so
|
|
15216
|
-
* the journal stays small (decisions) and replay rehydrates the exact `Settled` from
|
|
15217
|
-
* the blob store (evidence). This is the decision/payload split the replay argument
|
|
15218
|
-
* rests on (B1/B2).
|
|
15219
|
-
*
|
|
15220
|
-
* Replay determinism (B2): `seq` is the monotonic cursor order `scope.next()` yielded
|
|
15221
|
-
* each settlement — NOT wall-clock. `replaySpawnTree` sorts strictly by `seq` before
|
|
15222
|
-
* touching the blob store, so the order in which rehydration `get`s resolve can never
|
|
15223
|
-
* reorder the replayed `Settled[]`; the result is identical regardless of blob latency.
|
|
15224
|
-
*
|
|
15225
|
-
* @stable
|
|
15226
|
-
*/
|
|
15227
|
-
/**
|
|
15228
15314
|
* Mint the content-addressed `outRef` for a result artifact: `sha256:<hex>` over a
|
|
15229
15315
|
* stable JSON encoding. Producers call this to derive the `outRef` they journal and
|
|
15230
15316
|
* `put`; the FS/in-mem stores re-derive it on `put` to verify the supplied ref
|
|
@@ -15337,14 +15423,17 @@ var InMemorySpawnJournal = class {
|
|
|
15337
15423
|
}
|
|
15338
15424
|
this.trees.set(root, {
|
|
15339
15425
|
begunAt: at,
|
|
15340
|
-
events: []
|
|
15426
|
+
events: [],
|
|
15427
|
+
index: new SpawnEventIndex(root)
|
|
15341
15428
|
});
|
|
15342
15429
|
}
|
|
15343
15430
|
async appendEvent(root, ev) {
|
|
15344
15431
|
const tree = this.trees.get(root);
|
|
15345
15432
|
if (!tree) throw new Error(`appendEvent called for unknown spawn tree '${root}'; call beginTree first`);
|
|
15346
|
-
|
|
15347
|
-
tree.
|
|
15433
|
+
const event = detachedSnapshot(ev, "spawn event");
|
|
15434
|
+
tree.index.assert(event);
|
|
15435
|
+
tree.events.push(event);
|
|
15436
|
+
tree.index.add(event);
|
|
15348
15437
|
}
|
|
15349
15438
|
};
|
|
15350
15439
|
/**
|
|
@@ -15359,6 +15448,7 @@ var InMemorySpawnJournal = class {
|
|
|
15359
15448
|
var FileSpawnJournal = class {
|
|
15360
15449
|
path;
|
|
15361
15450
|
appendTail = Promise.resolve();
|
|
15451
|
+
appendIndex;
|
|
15362
15452
|
constructor(path) {
|
|
15363
15453
|
this.path = path;
|
|
15364
15454
|
}
|
|
@@ -15373,12 +15463,14 @@ var FileSpawnJournal = class {
|
|
|
15373
15463
|
}
|
|
15374
15464
|
let begun = false;
|
|
15375
15465
|
const events = [];
|
|
15466
|
+
const index = new SpawnEventIndex(root);
|
|
15376
15467
|
for (const record of parseCommittedJsonLines(text, this.path)) {
|
|
15377
15468
|
if (record.root !== root) continue;
|
|
15378
15469
|
if (record.kind === "begin") begun = true;
|
|
15379
15470
|
else {
|
|
15380
15471
|
if (!begun) throw new Error(`spawn journal corrupted: event for tree '${root}' precedes its begin record`);
|
|
15381
|
-
|
|
15472
|
+
index.assert(record.event);
|
|
15473
|
+
index.add(record.event);
|
|
15382
15474
|
events.push(record.event);
|
|
15383
15475
|
}
|
|
15384
15476
|
}
|
|
@@ -15386,41 +15478,73 @@ var FileSpawnJournal = class {
|
|
|
15386
15478
|
}
|
|
15387
15479
|
async beginTree(root, at) {
|
|
15388
15480
|
return this.serializeAppend(async () => {
|
|
15389
|
-
const
|
|
15481
|
+
const state = await this.validationIndex();
|
|
15482
|
+
const existing = state.trees.get(root);
|
|
15390
15483
|
if (existing) {
|
|
15391
|
-
if (existing !== at) throw new Error(`spawn tree '${root}' already begun in ${this.path} at ${existing}; refusing to overwrite with ${at}`);
|
|
15484
|
+
if (existing.begunAt !== at) throw new Error(`spawn tree '${root}' already begun in ${this.path} at ${existing.begunAt}; refusing to overwrite with ${at}`);
|
|
15392
15485
|
return;
|
|
15393
15486
|
}
|
|
15394
|
-
await this.writeRecord({
|
|
15487
|
+
state.stamp = await this.writeRecord({
|
|
15395
15488
|
kind: "begin",
|
|
15396
15489
|
root,
|
|
15397
15490
|
at
|
|
15398
15491
|
});
|
|
15492
|
+
state.trees.set(root, {
|
|
15493
|
+
begunAt: at,
|
|
15494
|
+
index: new SpawnEventIndex(root)
|
|
15495
|
+
});
|
|
15399
15496
|
});
|
|
15400
15497
|
}
|
|
15401
15498
|
async appendEvent(root, ev) {
|
|
15402
15499
|
const event = detachedSnapshot(ev, "spawn event");
|
|
15403
15500
|
return this.serializeAppend(async () => {
|
|
15404
|
-
const
|
|
15405
|
-
|
|
15406
|
-
|
|
15407
|
-
|
|
15501
|
+
const state = await this.validationIndex();
|
|
15502
|
+
const tree = state.trees.get(root);
|
|
15503
|
+
if (tree === void 0) throw new Error(`appendEvent called for unknown spawn tree '${root}'; call beginTree first`);
|
|
15504
|
+
tree.index.assert(event);
|
|
15505
|
+
state.stamp = await this.writeRecord({
|
|
15408
15506
|
kind: "event",
|
|
15409
15507
|
root,
|
|
15410
15508
|
event
|
|
15411
15509
|
});
|
|
15510
|
+
tree.index.add(event);
|
|
15412
15511
|
});
|
|
15413
15512
|
}
|
|
15414
|
-
async
|
|
15513
|
+
async validationIndex() {
|
|
15514
|
+
const fs = await import("node:fs/promises");
|
|
15515
|
+
const stamp = await this.fileStamp();
|
|
15516
|
+
if (this.appendIndex && this.appendIndex.stamp === stamp) return this.appendIndex;
|
|
15517
|
+
this.appendIndex = void 0;
|
|
15518
|
+
const trees = /* @__PURE__ */ new Map();
|
|
15519
|
+
if (stamp !== void 0) {
|
|
15520
|
+
const text = await fs.readFile(this.path, "utf8");
|
|
15521
|
+
if (await this.fileStamp() !== stamp) throw new Error("spawn journal changed while rebuilding its append index");
|
|
15522
|
+
for (const record of parseCommittedJsonLines(text, this.path)) if (record.kind === "begin") {
|
|
15523
|
+
if (!trees.has(record.root)) trees.set(record.root, {
|
|
15524
|
+
begunAt: record.at,
|
|
15525
|
+
index: new SpawnEventIndex(record.root)
|
|
15526
|
+
});
|
|
15527
|
+
} else {
|
|
15528
|
+
const tree = trees.get(record.root);
|
|
15529
|
+
if (!tree) throw new Error(`spawn journal corrupted: event for tree '${record.root}' precedes its begin record`);
|
|
15530
|
+
tree.index.assert(record.event);
|
|
15531
|
+
tree.index.add(record.event);
|
|
15532
|
+
}
|
|
15533
|
+
}
|
|
15534
|
+
this.appendIndex = {
|
|
15535
|
+
stamp,
|
|
15536
|
+
trees
|
|
15537
|
+
};
|
|
15538
|
+
return this.appendIndex;
|
|
15539
|
+
}
|
|
15540
|
+
async fileStamp() {
|
|
15415
15541
|
const fs = await import("node:fs/promises");
|
|
15416
|
-
let text;
|
|
15417
15542
|
try {
|
|
15418
|
-
|
|
15419
|
-
} catch (
|
|
15420
|
-
if (isNoEntError(
|
|
15421
|
-
throw
|
|
15543
|
+
return journalFileStamp(await fs.stat(this.path, { bigint: true }));
|
|
15544
|
+
} catch (error) {
|
|
15545
|
+
if (isNoEntError(error)) return void 0;
|
|
15546
|
+
throw error;
|
|
15422
15547
|
}
|
|
15423
|
-
for (const record of parseCommittedJsonLines(text, this.path)) if (record.root === root && record.kind === "begin") return record.at;
|
|
15424
15548
|
}
|
|
15425
15549
|
async serializeAppend(operation) {
|
|
15426
15550
|
const append = this.appendTail.then(operation);
|
|
@@ -15430,17 +15554,29 @@ var FileSpawnJournal = class {
|
|
|
15430
15554
|
async writeRecord(record) {
|
|
15431
15555
|
const fs = await import("node:fs/promises");
|
|
15432
15556
|
const path = await import("node:path");
|
|
15433
|
-
await fs.mkdir(path.dirname(this.path), { recursive: true });
|
|
15434
|
-
const needsSeparator = await prepareJsonlAppend(this.path);
|
|
15435
|
-
const fh = await fs.open(this.path, "a");
|
|
15436
15557
|
try {
|
|
15437
|
-
await
|
|
15438
|
-
await
|
|
15439
|
-
|
|
15440
|
-
|
|
15558
|
+
await fs.mkdir(path.dirname(this.path), { recursive: true });
|
|
15559
|
+
const needsSeparator = await prepareJsonlAppend(this.path);
|
|
15560
|
+
const fh = await fs.open(this.path, "a");
|
|
15561
|
+
try {
|
|
15562
|
+
await writeAllBytes(fh, `${needsSeparator ? "\n" : ""}${JSON.stringify(record)}\n`);
|
|
15563
|
+
await fh.sync();
|
|
15564
|
+
const stamp = journalFileStamp(await fh.stat({ bigint: true }));
|
|
15565
|
+
if (await this.fileStamp() !== stamp) throw new Error("spawn journal changed while acknowledging its append");
|
|
15566
|
+
return stamp;
|
|
15567
|
+
} finally {
|
|
15568
|
+
await fh.close();
|
|
15569
|
+
}
|
|
15570
|
+
} catch (error) {
|
|
15571
|
+
this.appendIndex = void 0;
|
|
15572
|
+
throw error;
|
|
15441
15573
|
}
|
|
15442
15574
|
}
|
|
15443
15575
|
};
|
|
15576
|
+
/** Detect replacement, truncation, and same-size edits; this is not a cross-process write lock. */
|
|
15577
|
+
function journalFileStamp(stat) {
|
|
15578
|
+
return `${stat.dev}:${stat.ino}:${stat.size}:${stat.mtimeNs}:${stat.ctimeNs}`;
|
|
15579
|
+
}
|
|
15444
15580
|
/**
|
|
15445
15581
|
* Load every journal tree owned by one recursive supervision run and flatten its nodes/events.
|
|
15446
15582
|
*
|
|
@@ -15707,79 +15843,104 @@ function servedIdentityParts(model) {
|
|
|
15707
15843
|
snapshot
|
|
15708
15844
|
};
|
|
15709
15845
|
}
|
|
15710
|
-
/**
|
|
15711
|
-
|
|
15712
|
-
|
|
15713
|
-
|
|
15714
|
-
|
|
15715
|
-
|
|
15716
|
-
|
|
15717
|
-
|
|
15718
|
-
|
|
15719
|
-
|
|
15720
|
-
|
|
15721
|
-
|
|
15722
|
-
|
|
15723
|
-
|
|
15724
|
-
|
|
15725
|
-
if (
|
|
15726
|
-
|
|
15727
|
-
|
|
15728
|
-
|
|
15729
|
-
|
|
15730
|
-
|
|
15731
|
-
|
|
15732
|
-
|
|
15733
|
-
|
|
15734
|
-
|
|
15735
|
-
|
|
15736
|
-
|
|
15737
|
-
|
|
15738
|
-
|
|
15739
|
-
|
|
15740
|
-
|
|
15741
|
-
|
|
15742
|
-
|
|
15743
|
-
|
|
15744
|
-
|
|
15745
|
-
|
|
15746
|
-
|
|
15747
|
-
|
|
15748
|
-
|
|
15749
|
-
|
|
15750
|
-
|
|
15751
|
-
|
|
15752
|
-
|
|
15753
|
-
|
|
15754
|
-
|
|
15755
|
-
|
|
15756
|
-
|
|
15757
|
-
|
|
15758
|
-
|
|
15759
|
-
|
|
15760
|
-
|
|
15761
|
-
|
|
15762
|
-
|
|
15763
|
-
|
|
15764
|
-
|
|
15765
|
-
|
|
15766
|
-
|
|
15767
|
-
|
|
15768
|
-
|
|
15769
|
-
|
|
15770
|
-
|
|
15771
|
-
|
|
15772
|
-
|
|
15773
|
-
|
|
15774
|
-
if (
|
|
15775
|
-
|
|
15776
|
-
|
|
15777
|
-
|
|
15778
|
-
|
|
15846
|
+
/** One validation implementation for memory, durable append, and cold replay. */
|
|
15847
|
+
var SpawnEventIndex = class {
|
|
15848
|
+
root;
|
|
15849
|
+
nodes = /* @__PURE__ */ new Map();
|
|
15850
|
+
cursors = /* @__PURE__ */ new Set();
|
|
15851
|
+
constructor(root) {
|
|
15852
|
+
this.root = root;
|
|
15853
|
+
}
|
|
15854
|
+
assert(event) {
|
|
15855
|
+
const node = this.nodes.get(event.id);
|
|
15856
|
+
this.assertRetained(node, event);
|
|
15857
|
+
if (event.kind === "materialized") {
|
|
15858
|
+
if (node?.materialized) throw new Error(`spawn journal corrupted: duplicate materialization receipt for node '${event.id}' in tree '${this.root}'`);
|
|
15859
|
+
if (!node?.spawned) throw new Error(`spawn journal corrupted: materialization for node '${event.id}' precedes its spawn in tree '${this.root}'`);
|
|
15860
|
+
}
|
|
15861
|
+
if (event.kind === "execution-bound") {
|
|
15862
|
+
if (node?.bindings.has(event.binding.attemptId)) throw new Error(`spawn journal corrupted: duplicate execution binding for node '${event.id}' attempt '${event.binding.attemptId}' in tree '${this.root}'`);
|
|
15863
|
+
if (!node?.materialized) throw new Error(`spawn journal corrupted: execution binding for node '${event.id}' precedes materialization in tree '${this.root}'`);
|
|
15864
|
+
}
|
|
15865
|
+
if (!outsideCursorNamespace(event) && this.cursors.has(event.seq)) throw new Error(`spawn journal corrupted: duplicate cursor seq ${event.seq} in tree '${this.root}'; the cursor order replay relies on is not unique`);
|
|
15866
|
+
}
|
|
15867
|
+
/** Called only after validation and, for the file writer, a successful durable append. */
|
|
15868
|
+
add(event) {
|
|
15869
|
+
if (!outsideCursorNamespace(event)) this.cursors.add(event.seq);
|
|
15870
|
+
if (event.kind !== "spawned" && event.kind !== "materialized" && event.kind !== "execution-bound" && event.kind !== "execution-input" && event.kind !== "execution-admitted" && event.kind !== "execution-result" && !closesCursorSlot(event)) return;
|
|
15871
|
+
let node = this.nodes.get(event.id);
|
|
15872
|
+
if (!node) {
|
|
15873
|
+
node = {
|
|
15874
|
+
spawned: false,
|
|
15875
|
+
closed: false,
|
|
15876
|
+
materialized: false,
|
|
15877
|
+
bindings: /* @__PURE__ */ new Set(),
|
|
15878
|
+
inputs: /* @__PURE__ */ new Set(),
|
|
15879
|
+
input: false,
|
|
15880
|
+
result: false,
|
|
15881
|
+
admissions: /* @__PURE__ */ new Map()
|
|
15882
|
+
};
|
|
15883
|
+
this.nodes.set(event.id, node);
|
|
15884
|
+
}
|
|
15885
|
+
if (event.kind === "spawned") node.spawned = true;
|
|
15886
|
+
else if (event.kind === "materialized") node.materialized = true;
|
|
15887
|
+
else if (event.kind === "execution-bound") node.bindings.add(event.binding.attemptId);
|
|
15888
|
+
else if (event.kind === "execution-input") {
|
|
15889
|
+
node.inputs.add(event.seq);
|
|
15890
|
+
node.input = true;
|
|
15891
|
+
node.result = false;
|
|
15892
|
+
node.admissions.clear();
|
|
15893
|
+
} else if (event.kind === "execution-admitted") node.admissions.set(event.admission.phase, event.admission);
|
|
15894
|
+
else if (event.kind === "execution-result") node.result = true;
|
|
15895
|
+
if (closesCursorSlot(event)) node.closed = true;
|
|
15896
|
+
}
|
|
15897
|
+
assertRetained(node, event) {
|
|
15898
|
+
if (event.kind !== "execution-input" && event.kind !== "execution-admitted" && event.kind !== "execution-result") return;
|
|
15899
|
+
function fail(reason) {
|
|
15900
|
+
throw new Error(`spawn journal corrupted: retained execution '${event.id}' ${reason}`);
|
|
15901
|
+
}
|
|
15902
|
+
if (!node?.spawned) fail("precedes its spawn");
|
|
15903
|
+
if (node.closed) fail("follows its terminal settlement");
|
|
15904
|
+
if (event.kind === "execution-input") {
|
|
15905
|
+
if (!/^sha256:[0-9a-f]{64}$/.test(event.taskRef)) fail("has an invalid task reference");
|
|
15906
|
+
if (node.inputs.has(event.seq)) fail("has duplicate input sequence");
|
|
15907
|
+
if (node.input && !node.result) fail("input replaces an unfinished invocation");
|
|
15908
|
+
return;
|
|
15909
|
+
}
|
|
15910
|
+
if (event.kind === "execution-result") {
|
|
15911
|
+
if (node.result) fail("has duplicate result");
|
|
15912
|
+
if (!node.admissions.has("dispatched")) fail("result precedes dispatch");
|
|
15913
|
+
if (!/^sha256:[0-9a-f]{64}$/.test(event.outRef)) fail("has an invalid result reference");
|
|
15914
|
+
assertValidSpend(event.spent, "retained execution result");
|
|
15915
|
+
executorFailureReason(event);
|
|
15916
|
+
return;
|
|
15917
|
+
}
|
|
15918
|
+
const admission = event.admission;
|
|
15919
|
+
if (!admission || ![
|
|
15920
|
+
"intent",
|
|
15921
|
+
"environment",
|
|
15922
|
+
"dispatched"
|
|
15923
|
+
].includes(admission.phase)) fail("has an invalid admission phase");
|
|
15924
|
+
if (node.admissions.has(admission.phase)) fail("has duplicate admission phase");
|
|
15925
|
+
if (node.result) fail("admission follows result");
|
|
15926
|
+
if (!node.input) fail("admission precedes input");
|
|
15927
|
+
if (admission.phase === "intent") {
|
|
15928
|
+
if (node.admissions.size !== 0) fail("intent follows another admission");
|
|
15929
|
+
return;
|
|
15930
|
+
}
|
|
15931
|
+
const intent = node.admissions.get("intent");
|
|
15932
|
+
if (intent?.phase !== "intent") fail("admission precedes intent");
|
|
15933
|
+
if (admission.idempotencyKey !== intent.idempotencyKey || admission.turnId !== intent.turnId) fail("changes its admitted request identity");
|
|
15934
|
+
if (admission.phase === "environment") {
|
|
15935
|
+
if (admission.provider !== intent.provider || admission.sessionId !== intent.sessionId || admission.executionId !== intent.executionId) fail("changes its admitted execution identity");
|
|
15936
|
+
return;
|
|
15937
|
+
}
|
|
15938
|
+
const environment = node.admissions.get("environment");
|
|
15939
|
+
if (environment?.phase !== "environment") fail("dispatch precedes environment");
|
|
15940
|
+
const control = admission.controlRef;
|
|
15941
|
+
if (!control || control.provider !== intent.provider || control.environmentId !== environment.environmentId || control.sessionId !== intent.sessionId || control.executionId !== intent.executionId) fail("dispatch changes its admitted execution identity");
|
|
15779
15942
|
}
|
|
15780
|
-
|
|
15781
|
-
if (events.some((e) => !outsideCursorNamespace(e) && e.seq === ev.seq)) throw new Error(`spawn journal corrupted: duplicate cursor seq ${ev.seq} in tree '${root}'; the cursor order replay relies on is not unique`);
|
|
15782
|
-
}
|
|
15943
|
+
};
|
|
15783
15944
|
/**
|
|
15784
15945
|
* The records that CLOSE a node's cursor slot: a settlement, a cancellation, or a wait being
|
|
15785
15946
|
* woken. The complement question to {@link outsideCursorNamespace}, and the one a resume needs —
|
|
@@ -15922,6 +16083,8 @@ async function replaySpawnTree(journal, blobs, root) {
|
|
|
15922
16083
|
status: "unavailable",
|
|
15923
16084
|
reason: "execution-did-not-start"
|
|
15924
16085
|
},
|
|
16086
|
+
...ev.harnessTranscript === void 0 ? {} : { harnessTranscript: ev.harnessTranscript },
|
|
16087
|
+
...ev.retainedExecution === void 0 ? {} : { retainedExecution: ev.retainedExecution },
|
|
15925
16088
|
...settlementTime(ev.at),
|
|
15926
16089
|
seq: ev.seq
|
|
15927
16090
|
});
|
|
@@ -15939,6 +16102,8 @@ async function replaySpawnTree(journal, blobs, root) {
|
|
|
15939
16102
|
...ev.providerModel === void 0 ? {} : { providerModel: copyProviderModelEvidence(ev.providerModel) },
|
|
15940
16103
|
...budgetViolationOf(ev),
|
|
15941
16104
|
trace,
|
|
16105
|
+
...ev.harnessTranscript === void 0 ? {} : { harnessTranscript: ev.harnessTranscript },
|
|
16106
|
+
...ev.retainedExecution === void 0 ? {} : { retainedExecution: ev.retainedExecution },
|
|
15942
16107
|
...settlementTime(ev.at),
|
|
15943
16108
|
seq: ev.seq
|
|
15944
16109
|
});
|
|
@@ -15959,6 +16124,7 @@ async function replaySpawnTree(journal, blobs, root) {
|
|
|
15959
16124
|
...ev.providerModel === void 0 ? {} : { providerModel: copyProviderModelEvidence(ev.providerModel) },
|
|
15960
16125
|
...budgetViolationOf(ev),
|
|
15961
16126
|
trace,
|
|
16127
|
+
...ev.harnessTranscript === void 0 ? {} : { harnessTranscript: ev.harnessTranscript },
|
|
15962
16128
|
...settlementTime(ev.at),
|
|
15963
16129
|
seq: ev.seq
|
|
15964
16130
|
});
|
|
@@ -16039,6 +16205,7 @@ function materializeTreeView(events) {
|
|
|
16039
16205
|
node.outRef = ev.outRef;
|
|
16040
16206
|
node.trace = traceEvidenceFor(ev);
|
|
16041
16207
|
node.budgetViolation = budgetViolationOf(ev).budgetViolation;
|
|
16208
|
+
if (ev.retainedExecution !== void 0) node.retainedExecution = ev.retainedExecution;
|
|
16042
16209
|
const settledAt = Date.parse(ev.at);
|
|
16043
16210
|
if (Number.isFinite(settledAt)) node.settledAt = settledAt;
|
|
16044
16211
|
} else if (ev.kind === "woken") {
|
|
@@ -16062,6 +16229,7 @@ function materializeTreeView(events) {
|
|
|
16062
16229
|
node.providerModel = copyProviderModelEvidence(ev.providerModel);
|
|
16063
16230
|
node.outRef = ev.outRef;
|
|
16064
16231
|
node.budgetViolation = budgetViolationOf(ev).budgetViolation;
|
|
16232
|
+
if (ev.retainedExecution !== void 0) node.retainedExecution = ev.retainedExecution;
|
|
16065
16233
|
const settledAt = Date.parse(ev.at);
|
|
16066
16234
|
if (Number.isFinite(settledAt)) node.settledAt = settledAt;
|
|
16067
16235
|
}
|
|
@@ -16167,6 +16335,7 @@ function freezeSnapshot(node) {
|
|
|
16167
16335
|
outRef: node.outRef,
|
|
16168
16336
|
trace: node.trace,
|
|
16169
16337
|
...node.budgetViolation === void 0 ? {} : { budgetViolation: node.budgetViolation },
|
|
16338
|
+
...node.retainedExecution === void 0 ? {} : { retainedExecution: node.retainedExecution },
|
|
16170
16339
|
settledAt: node.settledAt,
|
|
16171
16340
|
spawnedAt: node.spawnedAt
|
|
16172
16341
|
};
|
|
@@ -20971,7 +21140,7 @@ function createScope(args) {
|
|
|
20971
21140
|
try {
|
|
20972
21141
|
await interactiveBindingCommitted;
|
|
20973
21142
|
} catch {
|
|
20974
|
-
resolution = downRecord("interactive worker binding persistence failed", true, s.trace, s.metered, s.providerModel, s.outRef);
|
|
21143
|
+
resolution = downRecord("interactive worker binding persistence failed", true, s.trace, s.metered, s.providerModel, s.outRef, s.harnessTranscript);
|
|
20975
21144
|
}
|
|
20976
21145
|
live.resolved = resolution;
|
|
20977
21146
|
return resolution;
|
|
@@ -21412,7 +21581,40 @@ function createScope(args) {
|
|
|
21412
21581
|
clearTimeout(timer);
|
|
21413
21582
|
}
|
|
21414
21583
|
}));
|
|
21415
|
-
|
|
21584
|
+
const prior = released.length > 0 ? await args.journal.loadTree(args.root) ?? [] : [];
|
|
21585
|
+
for (const { child, receipts } of released) {
|
|
21586
|
+
for (const receipt of receipts) await appendEnvironmentTeardown(args.journal, args.root, child.id, receipt, new Date(now()).toISOString());
|
|
21587
|
+
if (child.cleanupConfirmed && child.recoveryPending === true && child.resolved?.kind === "down" && child.settledSeq !== void 0 && child.settledAt !== void 0 && !prior.some((event) => event.id === child.id && closesCursorSlot(event))) {
|
|
21588
|
+
child.budgetViolation = child.retainedViolation;
|
|
21589
|
+
const settledAt = child.settledAt;
|
|
21590
|
+
await args.journal.appendEvent(args.root, terminalDownEvent(child, child.resolved, child.settledSeq, new Date(settledAt).toISOString(), "released"));
|
|
21591
|
+
child.retainedExecution = "released";
|
|
21592
|
+
const releasedAt = now();
|
|
21593
|
+
notifyRuntimeHookEvent(args.hooks, {
|
|
21594
|
+
id: `${child.id}:released`,
|
|
21595
|
+
runId: args.root,
|
|
21596
|
+
target: "agent.child",
|
|
21597
|
+
phase: "after",
|
|
21598
|
+
timestamp: releasedAt,
|
|
21599
|
+
stepIndex: child.settledSeq,
|
|
21600
|
+
parentId: args.parentId,
|
|
21601
|
+
payload: {
|
|
21602
|
+
childId: child.id,
|
|
21603
|
+
status: "down",
|
|
21604
|
+
retainedExecution: "released",
|
|
21605
|
+
releasedAt,
|
|
21606
|
+
...child.resolved.outRef === void 0 ? {} : { outRef: child.resolved.outRef },
|
|
21607
|
+
reason: child.resolved.reason,
|
|
21608
|
+
infra: child.resolved.infra,
|
|
21609
|
+
spent: child.spent,
|
|
21610
|
+
...settledNodeEvidence(child, {
|
|
21611
|
+
...child.resolved,
|
|
21612
|
+
metered: void 0
|
|
21613
|
+
}, settledAt)
|
|
21614
|
+
}
|
|
21615
|
+
}, { signal: args.signal });
|
|
21616
|
+
}
|
|
21617
|
+
}
|
|
21416
21618
|
});
|
|
21417
21619
|
registerScopeRetainedOwner(scope, {
|
|
21418
21620
|
rootId: args.root,
|
|
@@ -21696,12 +21898,14 @@ async function appendSettlementMetering(journal, root, id, spend, at) {
|
|
|
21696
21898
|
/** An open node's reconciled floor has the same per-child sequence discipline as its metering:
|
|
21697
21899
|
* outside the cursor namespace, monotonic per node, so a node reconciled once per process (a
|
|
21698
21900
|
* retained failure, a recovery, a second retained failure) keeps its records ordered. */
|
|
21699
|
-
async function appendReconciledFloor(journal, root, id, spent, at) {
|
|
21901
|
+
async function appendReconciledFloor(journal, root, id, spent, at, harnessTranscript) {
|
|
21902
|
+
const seq = await nextPerNodeSeq(journal, root, "reconciled", id);
|
|
21700
21903
|
await appendAcknowledged(journal, root, {
|
|
21701
21904
|
kind: "reconciled",
|
|
21702
21905
|
id,
|
|
21703
21906
|
spent,
|
|
21704
|
-
|
|
21907
|
+
...harnessTranscript ? { harnessTranscript } : {},
|
|
21908
|
+
seq,
|
|
21705
21909
|
at
|
|
21706
21910
|
});
|
|
21707
21911
|
}
|
|
@@ -21737,34 +21941,21 @@ async function finalizeSettlement(child, settlement, seq, args, now) {
|
|
|
21737
21941
|
if (child.wait) return finalizeWait(child, settlement, seq, args, now, handle);
|
|
21738
21942
|
const settledAt = now();
|
|
21739
21943
|
child.settledAt = settledAt;
|
|
21944
|
+
child.settledSeq = seq;
|
|
21740
21945
|
const at = new Date(settledAt).toISOString();
|
|
21741
21946
|
if (settlement.metered) await appendSettlementMetering(args.journal, args.root, child.id, settlement.metered, at);
|
|
21742
21947
|
if (settlement.kind === "down") {
|
|
21743
|
-
|
|
21744
|
-
child.status = cancellation === void 0 ? "failed" : "cancelled";
|
|
21948
|
+
child.status = child.cancellationReason === void 0 ? "failed" : "cancelled";
|
|
21745
21949
|
child.outRef = settlement.outRef;
|
|
21746
21950
|
child.trace = settlement.trace;
|
|
21747
21951
|
child.providerModel = settlement.providerModel;
|
|
21748
|
-
|
|
21749
|
-
|
|
21750
|
-
|
|
21751
|
-
|
|
21752
|
-
|
|
21753
|
-
|
|
21754
|
-
|
|
21755
|
-
},
|
|
21756
|
-
id: child.id,
|
|
21757
|
-
spent: child.spent,
|
|
21758
|
-
infra: settlement.infra,
|
|
21759
|
-
reason: settlement.reason,
|
|
21760
|
-
...settlement.outRef ? { outRef: settlement.outRef } : {},
|
|
21761
|
-
...settlement.providerModel ? { providerModel: settlement.providerModel } : {},
|
|
21762
|
-
...child.budgetViolation ? { budgetViolation: child.budgetViolation } : {},
|
|
21763
|
-
trace: settlement.trace,
|
|
21764
|
-
seq,
|
|
21765
|
-
at
|
|
21766
|
-
});
|
|
21767
|
-
else if (settlement.reconciled !== void 0) await appendReconciledFloor(args.journal, args.root, child.id, settlement.reconciled, at);
|
|
21952
|
+
const retainedPending = child.recoveryPending === true;
|
|
21953
|
+
if (!retainedPending) await args.journal.appendEvent(args.root, terminalDownEvent(child, settlement, seq, at));
|
|
21954
|
+
else {
|
|
21955
|
+
child.retainedExecution = "pending";
|
|
21956
|
+
if (settlement.reconciled !== void 0) await appendReconciledFloor(args.journal, args.root, child.id, settlement.reconciled, at, settlement.harnessTranscript);
|
|
21957
|
+
}
|
|
21958
|
+
const retainedExecution = retainedPending ? { retainedExecution: "pending" } : {};
|
|
21768
21959
|
notifyRuntimeHookEvent(args.hooks, {
|
|
21769
21960
|
id: `${child.id}:settled`,
|
|
21770
21961
|
runId: args.root,
|
|
@@ -21779,6 +21970,7 @@ async function finalizeSettlement(child, settlement, seq, args, now) {
|
|
|
21779
21970
|
...settlement.outRef === void 0 ? {} : { outRef: settlement.outRef },
|
|
21780
21971
|
reason: settlement.reason,
|
|
21781
21972
|
infra: settlement.infra,
|
|
21973
|
+
...retainedExecution,
|
|
21782
21974
|
spent: child.spent,
|
|
21783
21975
|
...settledNodeEvidence(child, settlement, settledAt)
|
|
21784
21976
|
}
|
|
@@ -21788,10 +21980,12 @@ async function finalizeSettlement(child, settlement, seq, args, now) {
|
|
|
21788
21980
|
handle,
|
|
21789
21981
|
reason: settlement.reason,
|
|
21790
21982
|
infra: settlement.infra,
|
|
21983
|
+
...retainedExecution,
|
|
21791
21984
|
...settlement.outRef === void 0 ? {} : { outRef: settlement.outRef },
|
|
21792
21985
|
...settlement.providerModel ? { providerModel: settlement.providerModel } : {},
|
|
21793
21986
|
...child.budgetViolation ? { budgetViolation: child.budgetViolation } : {},
|
|
21794
21987
|
trace: settlement.trace,
|
|
21988
|
+
...settlement.harnessTranscript ? { harnessTranscript: settlement.harnessTranscript } : {},
|
|
21795
21989
|
settledAt,
|
|
21796
21990
|
seq
|
|
21797
21991
|
};
|
|
@@ -21811,6 +22005,7 @@ async function finalizeSettlement(child, settlement, seq, args, now) {
|
|
|
21811
22005
|
...settlement.providerModel ? { providerModel: settlement.providerModel } : {},
|
|
21812
22006
|
...child.budgetViolation ? { budgetViolation: child.budgetViolation } : {},
|
|
21813
22007
|
trace: settlement.trace,
|
|
22008
|
+
...settlement.harnessTranscript ? { harnessTranscript: settlement.harnessTranscript } : {},
|
|
21814
22009
|
seq,
|
|
21815
22010
|
at
|
|
21816
22011
|
});
|
|
@@ -21842,6 +22037,7 @@ async function finalizeSettlement(child, settlement, seq, args, now) {
|
|
|
21842
22037
|
...settlement.providerModel ? { providerModel: settlement.providerModel } : {},
|
|
21843
22038
|
...child.budgetViolation ? { budgetViolation: child.budgetViolation } : {},
|
|
21844
22039
|
trace: settlement.trace,
|
|
22040
|
+
...settlement.harnessTranscript ? { harnessTranscript: settlement.harnessTranscript } : {},
|
|
21845
22041
|
settledAt,
|
|
21846
22042
|
seq
|
|
21847
22043
|
};
|
|
@@ -21854,6 +22050,35 @@ async function finalizeSettlement(child, settlement, seq, args, now) {
|
|
|
21854
22050
|
* absent — an unreported receipt must not read as an empty one. Snapshots are detached because
|
|
21855
22051
|
* an observer may serialize them after the live child has moved on.
|
|
21856
22052
|
*/
|
|
22053
|
+
/** The one builder of a down child's terminal record, for both its writers: the settle path at
|
|
22054
|
+
* the reconcile and the release sweep closing a retained slot later. Two hand-written literals
|
|
22055
|
+
* for one record shape is how a field lands on one path and not the other (#1244 was exactly
|
|
22056
|
+
* that for `harnessTranscript`). `cancelled` keeps its `source` from the child's own
|
|
22057
|
+
* cancellation reason, so a released cancelled child records the same source it settled with. */
|
|
22058
|
+
function terminalDownEvent(child, settlement, seq, at, retainedExecution) {
|
|
22059
|
+
const cancellation = child.cancellationReason;
|
|
22060
|
+
return {
|
|
22061
|
+
...cancellation === void 0 ? {
|
|
22062
|
+
kind: "settled",
|
|
22063
|
+
status: "down"
|
|
22064
|
+
} : {
|
|
22065
|
+
kind: "cancelled",
|
|
22066
|
+
source: cancellation.source
|
|
22067
|
+
},
|
|
22068
|
+
id: child.id,
|
|
22069
|
+
spent: child.spent,
|
|
22070
|
+
infra: settlement.infra,
|
|
22071
|
+
reason: settlement.reason,
|
|
22072
|
+
...settlement.outRef ? { outRef: settlement.outRef } : {},
|
|
22073
|
+
...settlement.providerModel ? { providerModel: settlement.providerModel } : {},
|
|
22074
|
+
...child.budgetViolation ? { budgetViolation: child.budgetViolation } : {},
|
|
22075
|
+
trace: settlement.trace,
|
|
22076
|
+
...settlement.harnessTranscript ? { harnessTranscript: settlement.harnessTranscript } : {},
|
|
22077
|
+
...retainedExecution === void 0 ? {} : { retainedExecution },
|
|
22078
|
+
seq,
|
|
22079
|
+
at
|
|
22080
|
+
};
|
|
22081
|
+
}
|
|
21857
22082
|
function settledNodeEvidence(child, settlement, settledAt) {
|
|
21858
22083
|
return {
|
|
21859
22084
|
runtime: child.runtime,
|
|
@@ -21974,6 +22199,11 @@ async function runChild(live, executor, childAbort, task, opts, pool, ticket, bl
|
|
|
21974
22199
|
traceEvidence ??= await captureWorkerTraceEvidence(live.readTraceSource, blobs, started);
|
|
21975
22200
|
return traceEvidence;
|
|
21976
22201
|
};
|
|
22202
|
+
let transcriptEvidence;
|
|
22203
|
+
const persistTranscriptOnce = async () => {
|
|
22204
|
+
transcriptEvidence ??= await persistHarnessTranscript(readHarnessTranscript(executor), blobs);
|
|
22205
|
+
return transcriptEvidence;
|
|
22206
|
+
};
|
|
21977
22207
|
const teardownOnce = async (grace) => {
|
|
21978
22208
|
if (teardownStarted) return;
|
|
21979
22209
|
teardownStarted = true;
|
|
@@ -22060,16 +22290,17 @@ async function runChild(live, executor, childAbort, task, opts, pool, ticket, bl
|
|
|
22060
22290
|
live.executorDone = true;
|
|
22061
22291
|
const ownMetered = executor.metered?.();
|
|
22062
22292
|
const trace = await captureTraceOnce();
|
|
22293
|
+
const childHarnessTranscript = await persistTranscriptOnce();
|
|
22063
22294
|
if (childAbort.signal.aborted && live.acceptedResult === void 0) {
|
|
22064
22295
|
await teardownOnce(opts.shutdown ?? "brutalKill");
|
|
22065
|
-
return downRecord("aborted before settle", true, trace, ownMetered, runtimeOwnedExecutorProviderEvidence(executor), retainedOutputRef);
|
|
22296
|
+
return downRecord("aborted before settle", true, trace, ownMetered, runtimeOwnedExecutorProviderEvidence(executor), retainedOutputRef, childHarnessTranscript);
|
|
22066
22297
|
}
|
|
22067
22298
|
const outRef = artifact.outRef;
|
|
22068
22299
|
const failureReason = executorFailureReason(artifact);
|
|
22069
22300
|
if (failureReason !== void 0) {
|
|
22070
22301
|
await teardownOnce(opts.shutdown ?? 5e3).catch(() => void 0);
|
|
22071
22302
|
return {
|
|
22072
|
-
...downRecord(failureReason, false, trace, ownMetered, runtimeOwnedExecutorProviderEvidence(executor)),
|
|
22303
|
+
...downRecord(failureReason, false, trace, ownMetered, runtimeOwnedExecutorProviderEvidence(executor), void 0, childHarnessTranscript),
|
|
22073
22304
|
outRef
|
|
22074
22305
|
};
|
|
22075
22306
|
}
|
|
@@ -22081,6 +22312,7 @@ async function runChild(live, executor, childAbort, task, opts, pool, ticket, bl
|
|
|
22081
22312
|
...artifact.verdict ? { verdict: artifact.verdict } : {},
|
|
22082
22313
|
spent: live.spent,
|
|
22083
22314
|
trace,
|
|
22315
|
+
harnessTranscript: childHarnessTranscript,
|
|
22084
22316
|
providerModel: runtimeOwnedExecutorProviderEvidence(executor),
|
|
22085
22317
|
...ownMetered ? { metered: ownMetered } : {}
|
|
22086
22318
|
};
|
|
@@ -22100,7 +22332,7 @@ async function runChild(live, executor, childAbort, task, opts, pool, ticket, bl
|
|
|
22100
22332
|
const metered = executor.metered?.();
|
|
22101
22333
|
const failureReason = executorFailureReason(accepted);
|
|
22102
22334
|
if (failureReason !== void 0) return {
|
|
22103
|
-
...downRecord(failureReason, false, trace, metered, runtimeOwnedExecutorProviderEvidence(executor)),
|
|
22335
|
+
...downRecord(failureReason, false, trace, metered, runtimeOwnedExecutorProviderEvidence(executor), void 0, await persistTranscriptOnce()),
|
|
22104
22336
|
outRef: accepted.outRef
|
|
22105
22337
|
};
|
|
22106
22338
|
return {
|
|
@@ -22110,6 +22342,7 @@ async function runChild(live, executor, childAbort, task, opts, pool, ticket, bl
|
|
|
22110
22342
|
...accepted.verdict ? { verdict: accepted.verdict } : {},
|
|
22111
22343
|
spent: live.spent,
|
|
22112
22344
|
trace,
|
|
22345
|
+
harnessTranscript: await persistTranscriptOnce(),
|
|
22113
22346
|
providerModel: runtimeOwnedExecutorProviderEvidence(executor),
|
|
22114
22347
|
...metered ? { metered } : {}
|
|
22115
22348
|
};
|
|
@@ -22133,9 +22366,10 @@ async function runChild(live, executor, childAbort, task, opts, pool, ticket, bl
|
|
|
22133
22366
|
ms
|
|
22134
22367
|
});
|
|
22135
22368
|
}
|
|
22369
|
+
live.retainedViolation = live.budgetViolation;
|
|
22136
22370
|
live.budgetViolation = void 0;
|
|
22137
22371
|
return {
|
|
22138
|
-
...downRecord(errMessage(err), true, trace, executor.metered?.(), void 0, retainedOutputRef),
|
|
22372
|
+
...downRecord(errMessage(err), true, trace, executor.metered?.(), void 0, retainedOutputRef, await persistTranscriptOnce()),
|
|
22139
22373
|
reconciled: live.spent
|
|
22140
22374
|
};
|
|
22141
22375
|
}
|
|
@@ -22159,7 +22393,7 @@ async function runChild(live, executor, childAbort, task, opts, pool, ticket, bl
|
|
|
22159
22393
|
const aborted = childAbort.signal.aborted || isAbortError(err);
|
|
22160
22394
|
if (started && !terminalTelemetryCaptured && accounting === void 0) live.spent = unknownFloor(live.spent);
|
|
22161
22395
|
const reconcileError = reconcileOnce(accounting?.reservation ?? live.spent);
|
|
22162
|
-
return downRecord(errMessage(err), evidenceError !== void 0 || teardownError !== void 0 || reconcileError !== void 0 || aborted || isInfraError(err), trace, executor.metered?.(), providerModel, retainedOutputRef);
|
|
22396
|
+
return downRecord(errMessage(err), evidenceError !== void 0 || teardownError !== void 0 || reconcileError !== void 0 || aborted || isInfraError(err), trace, executor.metered?.(), providerModel, retainedOutputRef, await persistTranscriptOnce());
|
|
22163
22397
|
} finally {
|
|
22164
22398
|
await closeRetainedWrites();
|
|
22165
22399
|
}
|
|
@@ -22227,7 +22461,8 @@ function makeTreeView(root, children) {
|
|
|
22227
22461
|
...c.outRef ? { outRef: c.outRef } : {},
|
|
22228
22462
|
...c.trace ? { trace: c.trace } : {},
|
|
22229
22463
|
...c.providerModel ? { providerModel: c.providerModel } : {},
|
|
22230
|
-
...c.budgetViolation ? { budgetViolation: c.budgetViolation } : {}
|
|
22464
|
+
...c.budgetViolation ? { budgetViolation: c.budgetViolation } : {},
|
|
22465
|
+
...c.retainedExecution ? { retainedExecution: c.retainedExecution } : {}
|
|
22231
22466
|
}));
|
|
22232
22467
|
return {
|
|
22233
22468
|
root,
|
|
@@ -22397,17 +22632,47 @@ function unknownFloor(spend) {
|
|
|
22397
22632
|
}])) }
|
|
22398
22633
|
};
|
|
22399
22634
|
}
|
|
22400
|
-
function downRecord(reason, infra, trace, metered, providerModel, outRef) {
|
|
22635
|
+
function downRecord(reason, infra, trace, metered, providerModel, outRef, harnessTranscript) {
|
|
22401
22636
|
return {
|
|
22402
22637
|
kind: "down",
|
|
22403
22638
|
reason,
|
|
22404
22639
|
infra,
|
|
22405
22640
|
trace,
|
|
22641
|
+
...harnessTranscript ? { harnessTranscript } : {},
|
|
22406
22642
|
...providerModel ? { providerModel } : {},
|
|
22407
22643
|
...metered ? { metered } : {},
|
|
22408
22644
|
...outRef === void 0 ? {} : { outRef }
|
|
22409
22645
|
};
|
|
22410
22646
|
}
|
|
22647
|
+
/**
|
|
22648
|
+
* Read one executor's harness-transcript receipt without letting a broken port escape.
|
|
22649
|
+
*
|
|
22650
|
+
* The three answers this has to keep apart, because #1214 and #1244 are both about an artifact
|
|
22651
|
+
* that reads as coverage without being coverage:
|
|
22652
|
+
* - `available` the transcript survived;
|
|
22653
|
+
* - a reason the CAPTURE produced a box existed and could not be read;
|
|
22654
|
+
* - `executor-exposes-no-transcript` this runtime has no transcript to offer at all;
|
|
22655
|
+
* - `execution-never-started` no environment was ever created (the executor's
|
|
22656
|
+
* own seed, set before `create`);
|
|
22657
|
+
* - `capture-did-not-run` the port answered nothing, so the capture was
|
|
22658
|
+
* skipped rather than attempted and failed.
|
|
22659
|
+
*
|
|
22660
|
+
* Mirrors `readInteractiveSession` above: an absence is always a named reason, never `undefined`.
|
|
22661
|
+
*/
|
|
22662
|
+
function readHarnessTranscript(executor) {
|
|
22663
|
+
if (!executor.harnessTranscript) return harnessTranscriptUnavailable("executor-exposes-no-transcript");
|
|
22664
|
+
let reported;
|
|
22665
|
+
try {
|
|
22666
|
+
reported = executor.harnessTranscript();
|
|
22667
|
+
} catch {
|
|
22668
|
+
return harnessTranscriptUnavailable("executor-exposes-no-transcript");
|
|
22669
|
+
}
|
|
22670
|
+
if (reported === void 0) return harnessTranscriptUnavailable("capture-did-not-run");
|
|
22671
|
+
const capture = reported;
|
|
22672
|
+
if (capture.status === "captured" && capture.artifact) return capture;
|
|
22673
|
+
if (capture.status === "unavailable" && capture.reason) return capture;
|
|
22674
|
+
return harnessTranscriptUnavailable("executor-exposes-no-transcript");
|
|
22675
|
+
}
|
|
22411
22676
|
/** The one place an absent interactive process is spelled, so every refusal reads the same. */
|
|
22412
22677
|
function noInteractiveSession(reason) {
|
|
22413
22678
|
return Object.freeze({
|
|
@@ -22866,7 +23131,8 @@ function unreportedSpend(total, prior) {
|
|
|
22866
23131
|
* ended on this loop's own `stop: 'completed'`, with the completion gate left to label the result
|
|
22867
23132
|
* rather than to change it. A completed drive whose contract is unmet is now a first-class moment:
|
|
22868
23133
|
* `reprompt.maxReprompts` re-enters the SAME live session with the unmet items, and every re-entry
|
|
22869
|
-
* crosses the same budget, deadline,
|
|
23134
|
+
* crosses the same budget, deadline, and abort bounds. Successful continuations do not consume
|
|
23135
|
+
* the failure retry allowance.
|
|
22870
23136
|
*/
|
|
22871
23137
|
/**
|
|
22872
23138
|
* The instruction a completed-but-undelivered drive is re-entered with when the caller supplies no
|
|
@@ -22983,9 +23249,14 @@ async function runDriverWithRetry(run) {
|
|
|
22983
23249
|
const maxAttempts = Math.max(1, policy.maxAttempts ?? DEFAULT_MAX_ATTEMPTS);
|
|
22984
23250
|
const initialBackoff = Math.max(0, policy.initialBackoffMs ?? DEFAULT_INITIAL_BACKOFF_MS);
|
|
22985
23251
|
const maxBackoff = Math.max(initialBackoff, policy.maxBackoffMs ?? DEFAULT_MAX_BACKOFF_MS);
|
|
22986
|
-
const maxReprompts =
|
|
23252
|
+
const maxReprompts = run.reprompt?.maxReprompts ?? 0;
|
|
23253
|
+
if (maxReprompts === "until-complete") {
|
|
23254
|
+
const deadline = run.budget().deadlineMs;
|
|
23255
|
+
if (!Number.isFinite(deadline) || deadline <= 0) throw new ValidationError$1("runDriverWithRetry: until-complete requires a finite positive deadline");
|
|
23256
|
+
}
|
|
22987
23257
|
const attempts = [];
|
|
22988
23258
|
let consecutiveBarren = 0;
|
|
23259
|
+
let failures = 0;
|
|
22989
23260
|
let reprompts = 0;
|
|
22990
23261
|
let reentry;
|
|
22991
23262
|
const emit = async (record) => {
|
|
@@ -22998,11 +23269,10 @@ async function runDriverWithRetry(run) {
|
|
|
22998
23269
|
* the caller's hook is consulted last, so no hook can talk the loop past a deadline.
|
|
22999
23270
|
*/
|
|
23000
23271
|
const decideReprompt = async (attempt, after) => {
|
|
23001
|
-
if (reprompts >= maxReprompts) return { refusedBy: "reprompts-exhausted" };
|
|
23272
|
+
if (maxReprompts !== "until-complete" && reprompts >= maxReprompts) return { refusedBy: "reprompts-exhausted" };
|
|
23002
23273
|
if (run.signal.aborted) return { refusedBy: "aborted" };
|
|
23003
23274
|
const byBudget = budgetStop(run.budget(), now());
|
|
23004
23275
|
if (byBudget === "deadline" || byBudget === "budget-exhausted") return { refusedBy: byBudget };
|
|
23005
|
-
if (attempt >= maxAttempts) return { refusedBy: "max-attempts" };
|
|
23006
23276
|
const context = {
|
|
23007
23277
|
attempt,
|
|
23008
23278
|
reprompts,
|
|
@@ -23031,6 +23301,7 @@ async function runDriverWithRetry(run) {
|
|
|
23031
23301
|
try {
|
|
23032
23302
|
await run.drive(attempt, reentry);
|
|
23033
23303
|
} catch (error) {
|
|
23304
|
+
failures += 1;
|
|
23034
23305
|
const durationMs = now() - startedAt;
|
|
23035
23306
|
const classification = classifyDriverFailure(error, run.signal);
|
|
23036
23307
|
const progressed = madeProgress(before, run.progress());
|
|
@@ -23040,7 +23311,7 @@ async function runDriverWithRetry(run) {
|
|
|
23040
23311
|
if (run.signal.aborted) return "aborted";
|
|
23041
23312
|
const byBudget = budgetStop(run.budget(), now());
|
|
23042
23313
|
if (byBudget) return byBudget;
|
|
23043
|
-
if (
|
|
23314
|
+
if (failures >= maxAttempts) return "max-attempts";
|
|
23044
23315
|
if (progressed) return void 0;
|
|
23045
23316
|
return consecutiveBarren + 1 >= maxConsecutive ? "no-progress" : void 0;
|
|
23046
23317
|
})();
|
|
@@ -23072,12 +23343,13 @@ async function runDriverWithRetry(run) {
|
|
|
23072
23343
|
if (afterWait) throw new DriverAttemptsExhaustedError(error, attempts, afterWait);
|
|
23073
23344
|
continue;
|
|
23074
23345
|
}
|
|
23346
|
+
consecutiveBarren = 0;
|
|
23075
23347
|
const durationMs = now() - startedAt;
|
|
23076
23348
|
const after = run.progress();
|
|
23077
23349
|
const progressed = madeProgress(before, after);
|
|
23078
23350
|
const contract = contractOf(after);
|
|
23079
23351
|
const contractField = contract === "none" ? {} : { contract };
|
|
23080
|
-
if (contract === "unmet" && maxReprompts > 0) {
|
|
23352
|
+
if (contract === "unmet" && (maxReprompts === "until-complete" || maxReprompts > 0)) {
|
|
23081
23353
|
const decision = await decideReprompt(attempt, after);
|
|
23082
23354
|
if ("steer" in decision) {
|
|
23083
23355
|
reprompts += 1;
|
|
@@ -23632,7 +23904,7 @@ function createSupervisor() {
|
|
|
23632
23904
|
pool.assertNoOpenTickets();
|
|
23633
23905
|
const outRef = contentAddress(out);
|
|
23634
23906
|
await opts.blobs.put(outRef, out);
|
|
23635
|
-
const { spentTotal, childWork, driverInference, gaps, providerModel } = await terminalAccounting(journal, opts.runId, now() - runEpochMs);
|
|
23907
|
+
const { spentTotal, childWork, driverInference, gaps, providerModel, fleetYield } = await terminalAccounting(journal, opts.runId, now() - runEpochMs);
|
|
23636
23908
|
return {
|
|
23637
23909
|
kind: "winner",
|
|
23638
23910
|
out,
|
|
@@ -23642,6 +23914,7 @@ function createSupervisor() {
|
|
|
23642
23914
|
providerModel,
|
|
23643
23915
|
...teardownUnconfirmed.length > 0 ? { teardownUnconfirmed } : {},
|
|
23644
23916
|
...gaps.length > 0 ? { spendGaps: gaps } : {},
|
|
23917
|
+
fleetYield,
|
|
23645
23918
|
...isNonEmptySpend(driverInference) ? { spentBreakdown: {
|
|
23646
23919
|
driverInference,
|
|
23647
23920
|
childWork
|
|
@@ -23652,7 +23925,7 @@ function createSupervisor() {
|
|
|
23652
23925
|
}
|
|
23653
23926
|
return noWinner({ error: actOutcome.error });
|
|
23654
23927
|
async function noWinner(rejection) {
|
|
23655
|
-
const { spentTotal, gaps, providerModel } = await terminalAccounting(journal, opts.runId, now() - runEpochMs);
|
|
23928
|
+
const { spentTotal, gaps, providerModel, fleetYield } = await terminalAccounting(journal, opts.runId, now() - runEpochMs);
|
|
23656
23929
|
const common = {
|
|
23657
23930
|
kind: "no-winner",
|
|
23658
23931
|
tree,
|
|
@@ -23661,7 +23934,8 @@ function createSupervisor() {
|
|
|
23661
23934
|
providerModel,
|
|
23662
23935
|
...teardownUnconfirmed.length > 0 ? { teardownUnconfirmed } : {},
|
|
23663
23936
|
...leakedReservations.length > 0 ? { leakedReservations } : {},
|
|
23664
|
-
...gaps.length > 0 ? { spendGaps: gaps } : {}
|
|
23937
|
+
...gaps.length > 0 ? { spendGaps: gaps } : {},
|
|
23938
|
+
fleetYield
|
|
23665
23939
|
};
|
|
23666
23940
|
const lifecycle = classifyNoWinner(executionAborted, pool, opts, breaker, deadlineExceeded, allChildrenDownAtSettle, downCountAtSettle);
|
|
23667
23941
|
if (controller.signal.reason instanceof RunCancellationReason) {
|
|
@@ -23793,13 +24067,21 @@ function createIntensityBreaker(opts, trip) {
|
|
|
23793
24067
|
}
|
|
23794
24068
|
/** Decorate the journal so the breaker observes every `settled`-`down` event the scope
|
|
23795
24069
|
* appends, without the supervisor intercepting `scope.next()`. The decorator is
|
|
23796
|
-
* transparent — it forwards every method verbatim and only reads the down events.
|
|
24070
|
+
* transparent — it forwards every method verbatim and only reads the down events.
|
|
24071
|
+
*
|
|
24072
|
+
* A record marked `retainedExecution: 'released'` is skipped: it is the driver's earlier down
|
|
24073
|
+
* re-stated by the release sweep, which runs AFTER the join barrier and before the result is
|
|
24074
|
+
* classified. Counting it would trip an armed breaker on a run that has already settled and turn
|
|
24075
|
+
* a delivered winner into `all-children-down`, and its backdated `at` (the settlement instant)
|
|
24076
|
+
* would sit out of order in the sliding window. A retained child was never counted at its
|
|
24077
|
+
* settlement either (it writes no `settled` record then), so `downCount` stays what it was:
|
|
24078
|
+
* ordinary downs only; `fleetYield.down` is where a retained child is counted. */
|
|
23797
24079
|
function wrapJournalForBreaker(journal, breaker) {
|
|
23798
24080
|
return {
|
|
23799
24081
|
loadTree: (root) => journal.loadTree(root),
|
|
23800
24082
|
beginTree: (root, at) => journal.beginTree(root, at),
|
|
23801
24083
|
appendEvent: (root, ev) => {
|
|
23802
|
-
if (ev.kind === "settled" && ev.status === "down") breaker.recordDown(Date.parse(ev.at));
|
|
24084
|
+
if (ev.kind === "settled" && ev.status === "down" && ev.retainedExecution === void 0) breaker.recordDown(Date.parse(ev.at));
|
|
23803
24085
|
return journal.appendEvent(root, ev);
|
|
23804
24086
|
}
|
|
23805
24087
|
};
|
|
@@ -23909,7 +24191,9 @@ async function terminalAccounting(journal, root, elapsedMs) {
|
|
|
23909
24191
|
if (events === void 0) throw new RuntimeRunStateError(`supervisor: spawn tree '${root}' is missing from the journal after run (corrupted log)`);
|
|
23910
24192
|
const { childWork, driverInference } = sumSpendFromEvents(events);
|
|
23911
24193
|
const gaps = spendGapsFromEvents(events);
|
|
23912
|
-
const
|
|
24194
|
+
const forest = await loadSpawnForest(journal, root);
|
|
24195
|
+
const providerModel = aggregateProviderModelEvidence(forest);
|
|
24196
|
+
const fleetYield = fleetYieldFromForest(forest);
|
|
23913
24197
|
const summed = addSpend(childWork, driverInference);
|
|
23914
24198
|
return {
|
|
23915
24199
|
spentTotal: {
|
|
@@ -23921,8 +24205,42 @@ async function terminalAccounting(journal, root, elapsedMs) {
|
|
|
23921
24205
|
childWork,
|
|
23922
24206
|
driverInference,
|
|
23923
24207
|
gaps,
|
|
23924
|
-
providerModel
|
|
23925
|
-
|
|
24208
|
+
providerModel,
|
|
24209
|
+
fleetYield
|
|
24210
|
+
};
|
|
24211
|
+
}
|
|
24212
|
+
/** How the run's spawned children ended, by node id across every tree of the forest. Read after
|
|
24213
|
+
* the join barrier and the release sweep, so the terminal records the sweep wrote are in it.
|
|
24214
|
+
* Spawned records without a parent are exempt: the run root, and the re-rooted owner copy a
|
|
24215
|
+
* nested driver writes as its tree's first record (`ownedTreeRootSpawn` strips the parent), so
|
|
24216
|
+
* a manager is counted once, in its parent's tree. Buckets are id sets rather than record counts
|
|
24217
|
+
* because the journal guards seq uniqueness, not one-terminal-per-node, and the invariant
|
|
24218
|
+
* `spawned === done + down + cancelled + neverSettled` must not rest on scope discipline alone;
|
|
24219
|
+
* it is asserted here so a future root-id terminal record cannot silently break the tally. */
|
|
24220
|
+
function fleetYieldFromForest(forest) {
|
|
24221
|
+
const spawned = /* @__PURE__ */ new Set();
|
|
24222
|
+
const terminal = /* @__PURE__ */ new Map();
|
|
24223
|
+
const released = /* @__PURE__ */ new Set();
|
|
24224
|
+
for (const { event } of forest.events) if (event.kind === "spawned") {
|
|
24225
|
+
if (event.parent !== void 0) spawned.add(event.id);
|
|
24226
|
+
} else if (event.kind === "settled" || event.kind === "cancelled") {
|
|
24227
|
+
const bucket = event.kind === "cancelled" ? "cancelled" : event.status;
|
|
24228
|
+
terminal.set(event.id, bucket);
|
|
24229
|
+
if (event.retainedExecution === "released" && bucket !== "done") released.add(event.id);
|
|
24230
|
+
else released.delete(event.id);
|
|
24231
|
+
}
|
|
24232
|
+
const count = (bucket) => [...terminal.values()].filter((value) => value === bucket).length;
|
|
24233
|
+
const fleetYield = {
|
|
24234
|
+
spawned: spawned.size,
|
|
24235
|
+
done: count("done"),
|
|
24236
|
+
down: count("down"),
|
|
24237
|
+
cancelled: count("cancelled"),
|
|
24238
|
+
neverSettled: forest.inDoubt.length,
|
|
24239
|
+
releasedUnrecovered: released.size
|
|
24240
|
+
};
|
|
24241
|
+
if (fleetYield.done + fleetYield.down + fleetYield.cancelled + fleetYield.neverSettled !== fleetYield.spawned) throw new RuntimeRunStateError(`supervisor: fleet yield does not partition the spawned children of '${forest.root}' (${JSON.stringify(fleetYield)})`);
|
|
24242
|
+
if (fleetYield.releasedUnrecovered > fleetYield.down + fleetYield.cancelled) throw new RuntimeRunStateError(`supervisor: released children exceed down + cancelled for '${forest.root}' (${JSON.stringify(fleetYield)})`);
|
|
24243
|
+
return fleetYield;
|
|
23926
24244
|
}
|
|
23927
24245
|
/** The journaled nodes whose usage accounting is incomplete — one `SpendGap` per node+kind,
|
|
23928
24246
|
* channels merged. A spawn with no terminal record (`settled`/`cancelled`/`woken`) is
|
|
@@ -23986,6 +24304,6 @@ function isNonEmptySpend(s) {
|
|
|
23986
24304
|
return s.iterations > 0 || s.tokens.input > 0 || s.tokens.output > 0 || s.usd > 0 || s.ms > 0 || s.tokensKnown === false || s.usdKnown === false || Object.values(s.resources ?? {}).some((resource) => resource.amount > 0 || !resource.known);
|
|
23987
24305
|
}
|
|
23988
24306
|
//#endregion
|
|
23989
|
-
export {
|
|
24307
|
+
export { bindReusableExecutorExecutionId as $, providerMessageText as $i, buildRuntimeEventOtelSpans as $n, providerAttemptEvidence as $r, addHarnessUsage as $t, waitUntil as A, deleteBoxSafe as Ai, RunCancellationReason as An, profileMaterializationAxes$1 as Ar, spendFromUsageTotals as At, attachWorker as B, withTimeout as Bi, defaultRedactorIdentityMaterial as Bn, worktreeCliProfileMaterialization as Br, createInbox as Bt, scopeOwnerExecutorNodeContext as C, notifySandboxEventObserver as Ci, resolveAgentEnvironmentProvider as Cn, parseCodexTokenUsage as Cr, workerTraceAnalysisStore as Ct, pollFor as D, addSpend as Di, sandboxSessionTraceSource as Dn, controlProfileMaterialization as Dr, meterUsageEvent as Dt, isWaitOutcome as E, sumSandboxUsage as Ei, decodeToolPart as En, assertProfileMaterialization as Er, createBudgetPool as Et, scopeRetainedOwnerPriorSpend as F, sleep as Fi, recoverRetainedRun as Fn, renderProfileMaterializationIssues as Fr, workerTraceSeamKey as Ft, recoverRetainedInteractiveRun as G, decodeHarnessUsage as Gi, contentAddress as Gn, attestRuntimeOwnedPendingExecutor as Gr, createPeerMailbox as Gt, workerInteractiveBindingFile as H, addResourceSpend as Hi, captureHarnessTranscript as Hn, parseCommittedJsonLines as Hr, DEFAULT_PEER_MAIL_LIMITS as Ht, scopeRetainedOwnerResult as I, stringifySafe as Ii, startRetainedRun as In, renderUnsupported as Ir, taskToPrompt as It, errMessage as J, DEFAULT_SUCCESSFUL_SHUTDOWN_MS as Ji, readTraceContextFromEnv as Jn, finalizeRuntimeOwnedPendingExecutor as Jr, peerMailVerbNames as Jt, startRetainedInteractiveRun as K, abortError$2 as Ki, createPropagatingTraceEmitter as Kn, attestRuntimeOwnedScopeOwner as Kr, isPeerMailEnvelope as Kt, interactiveAdmissionSeamKey as L, throwAbort as Li, startRetainedRunInEnvironment as Ln, sandboxActProfileMaterialization as Lr, DEFAULT_STALL_AFTER_MS as Lt, consumeScopeRetainedOwnerResult as M, isAbortError$2 as Mi, linkAbort as Mn, promptModelProfileMaterialization as Mr, readWorkerTraceContext as Mt, prepareScopeRetainedOwnerTask as N, promptCacheTokenClasses as Ni, runAbortable as Nn, promptOnlyProfileMaterialization as Nr, workerTraceEnv as Nt, timerAt as O, chargedTokens as Oi, registerRetainedExecutorPreparation as On, defineProfileMaterializationContract as Or, newUsageTotals as Ot, scopeRetainedOwnerContext as P, randomSuffix as Pi, reconnectRetainedRun as Pn, promptResourceProfileMaterialization as Pr, workerTraceHeaders as Pt, rollingDispatch as Q, promptOptionsFromAgentTurnInput as Qi, buildLoopSpanNodes as Qn, newExecutionAttemptId as Qr, bridgeModelRouteRefusal as Qt, readWorkerInteractiveAdmissions as R, throwIfAborted as Ri, retainedCreateMaterial as Rn, unsupportedProfileDimensions as Rr, createActivityLog as Rt, restoreScopeOwnerAcceptedExecution as S, mapSandboxToolEvent as Si, providerAsSandboxClient as Sn, localHarnessExecutable as Sr, parseWorkerToolTraceArtifact as St, createWaitProbes as T, sandboxProgressEvents as Ti, createPushTraceSource as Tn, AGENT_PROFILE_MATERIALIZATION_AXES as Tr, assertValidBudget as Tt, workerInteractiveBindingsDir as U, resourceTelemetry as Ui, harnessTranscriptArtifact as Un, prepareJsonlAppend as Ur, PEER_MAIL_WIRE_KEY as Ut, readWorkerInteractiveBinding as V, zeroSpend as Vi, resolveRedactor as Vn, isNoEntError as Vr, AUTHORITY_MARKERS as Vt, reconnectRetainedInteractiveRun as W, withBudgetResources as Wi, persistHarnessTranscript as Wn, writeAllBytes as Wr, claimsAuthority as Wt, freeSlots as X, teardownExecutor as Xi, INTELLIGENCE_WIRE_VERSION as Xn, knownExecutionBindingReceipt as Xr, isTerminalNodeStatus as Xt, effectiveConcurrency as Y, armDeadlineTimer as Yi, traceContextToEnv as Yn, inheritRuntimeOwnedExecutorAttestation as Yr, isLiveNodeStatus as Yt, queueOf as Z, promptFromAgentTurnInput as Zi, buildLoopOtelSpans as Zn, knownMaterializationReceipt as Zr, bridgeAdmissionRefusal as Zt, createScope as _, createSandboxToolPartState as _i, canonicalObservedModelParts as _n, createWorktree as _r, pendingWaits as _t, pickBestDelivered as a, runtimeOwnedPendingExecutorMaterialization as ai, TERMINAL_DECISIONS as an, loopEventToOtelSpan as ar, snapshotExecutorConfig as at, meterRuntimeOwnedProviderAttempt as b, isSandboxTerminalEvent as bi, createAgentEnvironmentProviderRegistry as bn, LOCAL_HARNESSES as br, captureWorkerTraceEvidence as bt, DriverAttemptsExhaustedError as c, unknownMaterializationReceipt as ci, isTerminalDecision as cn, toOtelAttributes as cr, createSteerableSandboxSession as ct, runDriverWithRetry as d, detachedFrozen as di, probeSandboxCapabilities as dn, sanitizeAgentRuntimeEvent as dr, FileSpawnJournal as dt, recordRuntimeOwnedDriveHarnessProviderEvidence as ei, createCodexRolloutStoreReader as en, createOpenInferenceFileExporter as er, captureReusableExecutorConfig as et, driverChild as f, detachedSnapshot as fi, acquireSandbox as fn, sanitizeKnowledgeReadinessReport as fr, InMemoryResultBlobStore as ft, beginScopeOwnerAttempt as g, canonicalStreamEventFromSandboxEvent as gi, runBrainLoop as gn, captureWorktreeDiff as gr, materializeTreeView as gt, withDriverExecutor as h, assertSandboxServedModel as hi, routerBrain as hn, runWorktreeHarness as hr, loadSpawnForest as ht, collectDelivered as i, runtimeOwnedExecutorProviderEvidence as ii, bridgeStopSignalKey as in, generateSpanId as ir, createExecutorRegistry as it, bindScopeRetainedOwnerProvider as j, hasCompleteCacheBreakdown as ji, abortError as jn, promptControlProfileMaterialization as jr, WORKER_TRACE_PROPAGATION as jt, validateWaitSpec as k, cloneSpend as ki, retainedExecutorSeamKey as kn, fullProfileMaterialization as kr, spendFromUsageEvents as kt, classifyDriverFailure as l, executableAgentProfileSnapshot as li, runAgentRounds as ln, createRuntimeEventCollector as lr, createInPlaceCliExecutor as lt, isDriverSpec as m, readSandboxOutcome as mi, readPromptOptions as mn, runSettledCommand as mr, insideCursorNamespace as mt, createSupervisor as n, runtimeOwnedExecutorExecutionBinding as ni, readCodexRolloutSession as nn, exportEvalRuns as nr, cliWorktreeExecutor as nt, runFinalizer as o, runtimeOwnedScopeOwnerRuntime as oi, createSandboxForSpec as on, padSpanId as or, createWorktreeCliExecutor as ot, driverExecutorFactory as p, projectSandboxOutcome as pi, assertBoxlessPromptOptions as pn, sanitizeRuntimeStreamEvent as pr, InMemorySpawnJournal as pt, destroyInteractiveEnvironment as q, awaitAbortable$1 as qi, mergeTraceEnv as qn, authoredProfileDigest as qr, peerMailTools as qt, bestDelivered as r, runtimeOwnedExecutorMaterialization as ri, bridgeRuntimeAttachmentsKey as rn, flatOtelSpan as rr, createExecutor as rt, runTree as s, unknownExecutionBindingReceipt as si, defaultSelectWinner as sn, padTraceId as sr, DEFAULT_SANDBOX_STEERING_MAX_TURNS as st, createRootHandle as t, runtimeOwnedDriveHarnessProviderEvidence as ti, harnessUsageIsEmpty as tn, createOtelExporter as tr, cliInPlaceExecutor as tt, defaultUnmetContractSteer as u, executableAgentSpecSnapshot as ui, createSandboxLineage as un, createRuntimeStreamEventCollector as ur, FileResultBlobStore as ut, deriveNodeExecutionIdentity as v, createSandboxUsageLedger as vi, observedModelMatchesDeclared as vn, removeWorktree as vr, replaySpawnTree as vt, settledToIteration as w, sandboxEventServedBackend as wi, sandboxClientAsProvider as wn, CodexExecutionDiagnosticError as wr, BudgetReconcileFault as wt, recordScopeOwnerMaterialization as x, mapSandboxEvent as xi, providerAsExecutor as xn, harnessSupportsReasoningEffort as xr, isTraceAnalysisStore as xt, meterRuntimeOwnedAccounting as y, extractLlmCallEvent as yi, DEFAULT_SANDBOX_IDLE_TIMEOUT_SECONDS as yn, DEFAULT_LOCAL_HARNESS as yr, WORKER_TOOL_TRACE_SCHEMA_VERSION as yt, workerInteractiveAdmissionFile as z, unmeteredSpend as zi, defaultRedactor as zn, validateProfileMaterialization as zr, readWorkerProgress as zt };
|
|
23990
24308
|
|
|
23991
|
-
//# sourceMappingURL=supervisor-
|
|
24309
|
+
//# sourceMappingURL=supervisor-C2xWmESG.js.map
|