@tangle-network/agent-runtime 0.233.0 → 0.234.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-C8fPmjWa.d.ts → activation-Cn46_olL.d.ts} +2 -2
- package/dist/{activation-D0_qcEXf.js → activation-CpOaRyAq.js} +2 -2
- package/dist/{activation-D0_qcEXf.js.map → activation-CpOaRyAq.js.map} +1 -1
- package/dist/agent.d.ts +2 -2
- package/dist/agent.js +2 -2
- package/dist/{coordination-driver-BR52Rt39.js → coordination-driver-DkFbin3_.js} +2 -2
- package/dist/{coordination-driver-BR52Rt39.js.map → coordination-driver-DkFbin3_.js.map} +1 -1
- package/dist/{delegate-CA-Tnr1_.js → delegate-WTGSrhP9.js} +2 -2
- package/dist/{delegate-CA-Tnr1_.js.map → delegate-WTGSrhP9.js.map} +1 -1
- package/dist/durable.d.ts +2 -2
- package/dist/durable.js +2 -2
- package/dist/{graph-BtMQMQin.js → graph-XtkRzpzm.js} +3 -3
- package/dist/{graph-BtMQMQin.js.map → graph-XtkRzpzm.js.map} +1 -1
- package/dist/{improvement-cycle-WJJALdil.js → improvement-cycle-DIMrY4Wn.js} +3 -3
- package/dist/{improvement-cycle-WJJALdil.js.map → improvement-cycle-DIMrY4Wn.js.map} +1 -1
- package/dist/{index-BwWBXoyq.d.ts → index-DLOc9m2k.d.ts} +4 -4
- 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 +3 -3
- package/dist/kernel.js +8 -8
- package/dist/{loop-runner-bin-7cS9NAmk.js → loop-runner-bin-B8YWfVxb.js} +3 -3
- package/dist/{loop-runner-bin-7cS9NAmk.js.map → loop-runner-bin-B8YWfVxb.js.map} +1 -1
- package/dist/{loop-runner-bin-DaOd42mA.d.ts → loop-runner-bin-D3vx1A5I.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-BdFqNlha.d.ts → openai-tools-Dw6nMy2Q.d.ts} +2 -2
- package/dist/profiles.d.ts +2 -2
- package/dist/{provision-supervisor-BME3OgTk.js → provision-supervisor-DaJybV0q.js} +3 -3
- package/dist/{provision-supervisor-BME3OgTk.js.map → provision-supervisor-DaJybV0q.js.map} +1 -1
- package/dist/{runtime-CcfA_ElB.js → runtime-Bp_mBC1J.js} +8 -8
- package/dist/{runtime-CcfA_ElB.js.map → runtime-Bp_mBC1J.js.map} +1 -1
- package/dist/{server-DU3nDuDb.js → server-eulZM_6a.js} +3 -3
- package/dist/{server-DU3nDuDb.js.map → server-eulZM_6a.js.map} +1 -1
- package/dist/{stream-agent-turn-aXpd9b_N.d.ts → stream-agent-turn-B1WIS5nm.d.ts} +2 -2
- package/dist/{structural-rollout-YlkrevWE.js → structural-rollout-mEcjW8yf.js} +2 -2
- package/dist/{structural-rollout-YlkrevWE.js.map → structural-rollout-mEcjW8yf.js.map} +1 -1
- package/dist/{substrate-B2Os0b0f.d.ts → substrate-B5F8VTD4.d.ts} +2 -2
- package/dist/{supervise-CAJWyXQ-.js → supervise-CI0H54R5.js} +3 -3
- package/dist/{supervise-CAJWyXQ-.js.map → supervise-CI0H54R5.js.map} +1 -1
- package/dist/{supervisor-C2xWmESG.js → supervisor-DMX3Ouel.js} +202 -74
- package/dist/supervisor-DMX3Ouel.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-F5MG_7Qq.d.ts → types-DWFoAk65.d.ts} +50 -12
- package/package.json +3 -3
- package/dist/supervisor-C2xWmESG.js.map +0 -1
|
@@ -19856,7 +19856,175 @@ function stableText(value, label) {
|
|
|
19856
19856
|
return text;
|
|
19857
19857
|
}
|
|
19858
19858
|
//#endregion
|
|
19859
|
+
//#region src/runtime/supervise/terminal-record.ts
|
|
19860
|
+
/** The settlement fields every writer copies, in the terminal record's key order. The
|
|
19861
|
+
* `reconciled` record is built from this same spread so it and the terminal record can never
|
|
19862
|
+
* disagree on a field. */
|
|
19863
|
+
function settlementFields(subject, settlement) {
|
|
19864
|
+
return {
|
|
19865
|
+
spent: subject.spent,
|
|
19866
|
+
infra: settlement.infra,
|
|
19867
|
+
reason: settlement.reason,
|
|
19868
|
+
...settlement.outRef ? { outRef: settlement.outRef } : {},
|
|
19869
|
+
...settlement.providerModel ? { providerModel: settlement.providerModel } : {},
|
|
19870
|
+
...subject.budgetViolation ? { budgetViolation: subject.budgetViolation } : {},
|
|
19871
|
+
trace: settlement.trace,
|
|
19872
|
+
...settlement.harnessTranscript ? { harnessTranscript: settlement.harnessTranscript } : {}
|
|
19873
|
+
};
|
|
19874
|
+
}
|
|
19875
|
+
/** `cancelled` keeps its `source` from the subject's own cancellation reason, so a released
|
|
19876
|
+
* cancelled child records the same source it settled with. */
|
|
19877
|
+
function terminalDownEvent(subject, settlement, seq, at, retainedExecution) {
|
|
19878
|
+
const cancellation = subject.cancellationReason;
|
|
19879
|
+
return {
|
|
19880
|
+
...cancellation === void 0 ? {
|
|
19881
|
+
kind: "settled",
|
|
19882
|
+
status: "down"
|
|
19883
|
+
} : {
|
|
19884
|
+
kind: "cancelled",
|
|
19885
|
+
source: cancellation.source
|
|
19886
|
+
},
|
|
19887
|
+
id: subject.id,
|
|
19888
|
+
...settlementFields(subject, settlement),
|
|
19889
|
+
...retainedExecution === void 0 ? {} : { retainedExecution },
|
|
19890
|
+
seq,
|
|
19891
|
+
at
|
|
19892
|
+
};
|
|
19893
|
+
}
|
|
19894
|
+
/**
|
|
19895
|
+
* The evidence a settled node carries beyond its status: the receipts that name what actually
|
|
19896
|
+
* ran, the own-inference spend the parent tree re-homes as a `metered` event, and the wall-clock
|
|
19897
|
+
* window. One builder feeds BOTH terminal paths, so an observer never sees a `down` node
|
|
19898
|
+
* described in different terms from a `done` one. Every field is omitted when the fact is
|
|
19899
|
+
* absent — an unreported receipt must not read as an empty one. Snapshots are detached because
|
|
19900
|
+
* an observer may serialize them after the live child has moved on.
|
|
19901
|
+
*/
|
|
19902
|
+
function settledNodeEvidence(subject, settlement, settledAt) {
|
|
19903
|
+
return {
|
|
19904
|
+
runtime: subject.runtime,
|
|
19905
|
+
startedAt: subject.startedAt,
|
|
19906
|
+
settledAt,
|
|
19907
|
+
...settlement.metered ? { metered: detachedSnapshot(settlement.metered, "metered") } : {},
|
|
19908
|
+
...subject.providerModel ? { providerModel: detachedSnapshot(subject.providerModel, "provider model evidence") } : {},
|
|
19909
|
+
...subject.materialization ? { materialization: detachedSnapshot(subject.materialization, "materialization receipt") } : {},
|
|
19910
|
+
...subject.executionBindings.length > 0 ? { executionBindings: detachedSnapshot([...subject.executionBindings], "execution binding receipts") } : {},
|
|
19911
|
+
...subject.budgetViolation ? { budgetViolation: detachedSnapshot(subject.budgetViolation, "budget violation") } : {},
|
|
19912
|
+
trace: detachedSnapshot(settlement.trace, "worker trace evidence")
|
|
19913
|
+
};
|
|
19914
|
+
}
|
|
19915
|
+
/** The `agent.child` payload of the release: the settlement restated as released, `settledAt`
|
|
19916
|
+
* kept at the settlement instant and `metered` omitted so the driver's inference is not summed
|
|
19917
|
+
* twice. The sweep and the resume heal emit it from the same builder. */
|
|
19918
|
+
function releasedChildPayload(subject, settlement, settledAt, releasedAt) {
|
|
19919
|
+
return {
|
|
19920
|
+
childId: subject.id,
|
|
19921
|
+
status: "down",
|
|
19922
|
+
retainedExecution: "released",
|
|
19923
|
+
releasedAt,
|
|
19924
|
+
...settlement.outRef === void 0 ? {} : { outRef: settlement.outRef },
|
|
19925
|
+
reason: settlement.reason,
|
|
19926
|
+
infra: settlement.infra,
|
|
19927
|
+
spent: subject.spent,
|
|
19928
|
+
...settledNodeEvidence(subject, {
|
|
19929
|
+
...settlement,
|
|
19930
|
+
metered: void 0
|
|
19931
|
+
}, settledAt)
|
|
19932
|
+
};
|
|
19933
|
+
}
|
|
19934
|
+
//#endregion
|
|
19859
19935
|
//#region src/runtime/supervise/recover-executors.ts
|
|
19936
|
+
/** The environment id the node's latest durable admission names — the executor's own rule
|
|
19937
|
+
* (`admittedEnvironmentId` in environment-provider.ts), read off the journal. */
|
|
19938
|
+
function journaledEnvironmentId(owned) {
|
|
19939
|
+
for (const event of [...owned].reverse()) {
|
|
19940
|
+
if (event.kind !== "execution-admitted") continue;
|
|
19941
|
+
if (event.admission.phase === "dispatched") return event.admission.controlRef.environmentId;
|
|
19942
|
+
if (event.admission.phase === "environment") return event.admission.environmentId;
|
|
19943
|
+
}
|
|
19944
|
+
}
|
|
19945
|
+
/**
|
|
19946
|
+
* Close the cursor slot of every node the release sweep destroyed but never recorded: the
|
|
19947
|
+
* settling process died between the last `environment-teardown` receipt and the terminal record
|
|
19948
|
+
* (the 0.233.0 crash window). The record is the sweep's own — the same builder, the cursor seq
|
|
19949
|
+
* `next()` stamped on the delivery and the settlement instant, all read back from the node's
|
|
19950
|
+
* latest `reconciled` record — so a healed journal replays as one the sweep completed.
|
|
19951
|
+
*
|
|
19952
|
+
* The gate is fail-closed, every clause required, because the heal cannot re-ask the executor
|
|
19953
|
+
* to confirm teardown the way the sweep does:
|
|
19954
|
+
* - the latest `reconciled` record carries `settledSeq`, `reason`, `infra` and `trace` (a record
|
|
19955
|
+
* written before those fields existed names no cursor position and is not healed);
|
|
19956
|
+
* - at least one receipt sits after that record and every such receipt reads `destroyed: true`
|
|
19957
|
+
* (an empty set must not close the slot vacuously, and a receipt from an earlier process
|
|
19958
|
+
* belongs to an earlier settlement);
|
|
19959
|
+
* - the environment the latest admission names is among those receipts, so a receipt for an
|
|
19960
|
+
* environment the journal never admitted, or a re-admitted node whose receipt names the
|
|
19961
|
+
* earlier environment, is left open where the live sweep would have closed it.
|
|
19962
|
+
* A node with an `execution-result` is left to the recorded-result branch of
|
|
19963
|
+
* {@link prepareInterruptedExecutors}, which settles it from the durable blob and takes
|
|
19964
|
+
* precedence. The walk is over the whole forest because a nested manager settled on the ordinary
|
|
19965
|
+
* path is never restored, so a per-tree heal inside the resume of its tree would never reach its
|
|
19966
|
+
* grandchild. Returns the number of records written.
|
|
19967
|
+
*/
|
|
19968
|
+
async function healReleasedSlots(opts, signal, now) {
|
|
19969
|
+
const forest = await loadSpawnForest(opts.journal, opts.runId);
|
|
19970
|
+
let healed = 0;
|
|
19971
|
+
for (const tree of forest.trees) {
|
|
19972
|
+
signal.throwIfAborted();
|
|
19973
|
+
const events = tree.events;
|
|
19974
|
+
const closed = new Set(events.filter(closesCursorSlot).map((event) => event.id));
|
|
19975
|
+
const recorded = new Set(events.flatMap((event) => event.kind === "execution-result" ? [event.id] : []));
|
|
19976
|
+
for (const spawned of events) {
|
|
19977
|
+
if (spawned.kind !== "spawned" || spawned.parent === void 0) continue;
|
|
19978
|
+
if (closed.has(spawned.id) || recorded.has(spawned.id)) continue;
|
|
19979
|
+
const owned = events.filter((event) => event.id === spawned.id);
|
|
19980
|
+
const floor = owned.reduce((latest, event) => event.kind === "reconciled" && (latest === void 0 || event.seq > latest.seq) ? event : latest, void 0);
|
|
19981
|
+
if (floor?.settledSeq === void 0 || floor.reason === void 0 || floor.infra === void 0 || floor.trace === void 0) continue;
|
|
19982
|
+
const receipts = owned.slice(owned.indexOf(floor) + 1).filter((event) => event.kind === "environment-teardown");
|
|
19983
|
+
if (receipts.length === 0 || !receipts.every((receipt) => receipt.destroyed)) continue;
|
|
19984
|
+
const held = journaledEnvironmentId(owned);
|
|
19985
|
+
if (held === void 0 || !receipts.some((receipt) => receipt.environmentId === held)) continue;
|
|
19986
|
+
const settledSeq = floor.settledSeq;
|
|
19987
|
+
if (events.some((event) => closesCursorSlot(event) && event.seq === settledSeq)) throw new RuntimeRunStateError(`retained child '${spawned.id}' cannot be released at cursor seq ${settledSeq}: tree '${tree.root}' already closes that seq`);
|
|
19988
|
+
const subject = {
|
|
19989
|
+
id: spawned.id,
|
|
19990
|
+
spent: floor.spent,
|
|
19991
|
+
...floor.budgetViolation ? { budgetViolation: floor.budgetViolation } : {},
|
|
19992
|
+
...floor.cancellation ? { cancellationReason: floor.cancellation } : {}
|
|
19993
|
+
};
|
|
19994
|
+
const settlement = {
|
|
19995
|
+
kind: "down",
|
|
19996
|
+
reason: floor.reason,
|
|
19997
|
+
infra: floor.infra,
|
|
19998
|
+
trace: floor.trace,
|
|
19999
|
+
...floor.outRef ? { outRef: floor.outRef } : {},
|
|
20000
|
+
...floor.providerModel ? { providerModel: floor.providerModel } : {},
|
|
20001
|
+
...floor.harnessTranscript ? { harnessTranscript: floor.harnessTranscript } : {}
|
|
20002
|
+
};
|
|
20003
|
+
await opts.journal.appendEvent(tree.root, terminalDownEvent(subject, settlement, settledSeq, floor.at, "released"));
|
|
20004
|
+
healed += 1;
|
|
20005
|
+
const materialized = owned.find((event) => event.kind === "materialized");
|
|
20006
|
+
const lastReceipt = receipts[receipts.length - 1];
|
|
20007
|
+
notifyRuntimeHookEvent(opts.hooks, {
|
|
20008
|
+
id: `${spawned.id}:released`,
|
|
20009
|
+
runId: tree.root,
|
|
20010
|
+
target: "agent.child",
|
|
20011
|
+
phase: "after",
|
|
20012
|
+
timestamp: now(),
|
|
20013
|
+
stepIndex: settledSeq,
|
|
20014
|
+
parentId: tree.ownerNodeId ?? opts.runId,
|
|
20015
|
+
payload: releasedChildPayload({
|
|
20016
|
+
...subject,
|
|
20017
|
+
runtime: materialized?.receipt.runtime ?? spawned.runtime,
|
|
20018
|
+
startedAt: Date.parse(spawned.at),
|
|
20019
|
+
...materialized === void 0 ? {} : { materialization: materialized.receipt },
|
|
20020
|
+
executionBindings: owned.flatMap((event) => event.kind === "execution-bound" ? [event.binding] : []),
|
|
20021
|
+
...floor.providerModel ? { providerModel: floor.providerModel } : {}
|
|
20022
|
+
}, settlement, Date.parse(floor.at), Date.parse(lastReceipt.at))
|
|
20023
|
+
}, { signal });
|
|
20024
|
+
}
|
|
20025
|
+
}
|
|
20026
|
+
return healed;
|
|
20027
|
+
}
|
|
19860
20028
|
/** Validate durable inputs without waiting for work that may need its resumed manager. */
|
|
19861
20029
|
async function prepareInterruptedExecutors(opts, events, signal, now, parentId = opts.runId) {
|
|
19862
20030
|
signal.throwIfAborted();
|
|
@@ -19929,7 +20097,7 @@ async function prepareInterruptedExecutors(opts, events, signal, now, parentId =
|
|
|
19929
20097
|
factory: prepared?.factory ?? opts.recoverExecutor
|
|
19930
20098
|
});
|
|
19931
20099
|
}
|
|
19932
|
-
let seq = events
|
|
20100
|
+
let seq = reservedCursorFloor(events) + 1;
|
|
19933
20101
|
for (const { result, fault, budgetViolation } of accepted) {
|
|
19934
20102
|
signal.throwIfAborted();
|
|
19935
20103
|
const failureReason = executorFailureReason(result);
|
|
@@ -20011,6 +20179,19 @@ function maxSeqOf(events, pred) {
|
|
|
20011
20179
|
for (const ev of events) if (pred(ev) && ev.seq > max) max = ev.seq;
|
|
20012
20180
|
return max;
|
|
20013
20181
|
}
|
|
20182
|
+
/**
|
|
20183
|
+
* The highest cursor seq any record in the journal already owns, closed OR reserved.
|
|
20184
|
+
*
|
|
20185
|
+
* A closed slot owns its seq outright. An open retained node owns the `settledSeq` its
|
|
20186
|
+
* `reconciled` record carries: that is the seq the driver already branched on, and the seq the
|
|
20187
|
+
* heal (or a later release sweep) writes the terminal record under. Every writer that mints a
|
|
20188
|
+
* new cursor seq in a resumed process — the recorded-result settlements below and the resumed
|
|
20189
|
+
* scope's own cursor — must start past BOTH, or a recovered result lands on a seq an open node
|
|
20190
|
+
* has reserved and the heal can only ever collide. One function so no writer can drift.
|
|
20191
|
+
*/
|
|
20192
|
+
function reservedCursorFloor(events) {
|
|
20193
|
+
return Math.max(maxSeqOf(events, closesCursorSlot), events.reduce((max, event) => event.kind === "reconciled" && event.settledSeq !== void 0 ? Math.max(max, event.settledSeq) : max, -1));
|
|
20194
|
+
}
|
|
20014
20195
|
/** Per-channel sum over a journaled event list: `settled` = spawned-child work (reconciled), plus
|
|
20015
20196
|
* the reconciled floor of every node still open, plus the declared ceiling of every open node
|
|
20016
20197
|
* nothing reconciled; `metered` = driver inference (re-homed up the tree, so a single root-tree
|
|
@@ -20060,6 +20241,7 @@ function sumMeasuredSpendFromEvents(events) {
|
|
|
20060
20241
|
}
|
|
20061
20242
|
/** Restore the same journal projection and accounting for root and nested scopes. @internal */
|
|
20062
20243
|
async function prepareScopeResume(opts, events, signal, now, parentId = opts.runId) {
|
|
20244
|
+
if (parentId === opts.runId && await healReleasedSlots(opts, signal, now) > 0) events = await opts.journal.loadTree(opts.runId) ?? events;
|
|
20063
20245
|
const prepared = await prepareInterruptedExecutors(opts, events, signal, now, parentId);
|
|
20064
20246
|
const prior = prepared.events;
|
|
20065
20247
|
const recovering = new Set(prepared.recoveries.map((item) => item.spawned.id));
|
|
@@ -20079,7 +20261,7 @@ async function prepareScopeResume(opts, events, signal, now, parentId = opts.run
|
|
|
20079
20261
|
settled,
|
|
20080
20262
|
view: materializeTreeView(prior),
|
|
20081
20263
|
maxSpawnOrdinal: maxSeqOf(prior, (event) => event.kind === "spawned"),
|
|
20082
|
-
maxCursorSeq:
|
|
20264
|
+
maxCursorSeq: reservedCursorFloor(prior),
|
|
20083
20265
|
maxWaitOrdinal: maxSeqOf(prior, (event) => event.kind === "waiting"),
|
|
20084
20266
|
waits: pendingWaits(prior),
|
|
20085
20267
|
keys: keyedAssignments(prior, settled),
|
|
@@ -21598,20 +21780,7 @@ function createScope(args) {
|
|
|
21598
21780
|
timestamp: releasedAt,
|
|
21599
21781
|
stepIndex: child.settledSeq,
|
|
21600
21782
|
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
|
-
}
|
|
21783
|
+
payload: releasedChildPayload(child, child.resolved, settledAt, releasedAt)
|
|
21615
21784
|
}, { signal: args.signal });
|
|
21616
21785
|
}
|
|
21617
21786
|
}
|
|
@@ -21897,14 +22066,18 @@ async function appendSettlementMetering(journal, root, id, spend, at) {
|
|
|
21897
22066
|
}
|
|
21898
22067
|
/** An open node's reconciled floor has the same per-child sequence discipline as its metering:
|
|
21899
22068
|
* outside the cursor namespace, monotonic per node, so a node reconciled once per process (a
|
|
21900
|
-
* retained failure, a recovery, a second retained failure) keeps its records ordered.
|
|
21901
|
-
|
|
21902
|
-
|
|
22069
|
+
* retained failure, a recovery, a second retained failure) keeps its records ordered. It carries
|
|
22070
|
+
* the whole settlement and the cursor seq (`settledSeq`) beside the floor, through the same
|
|
22071
|
+
* field spread the terminal record uses, so a resume that finds the release sweep died before
|
|
22072
|
+
* its record can write that record byte-for-byte instead of inventing one. */
|
|
22073
|
+
async function appendReconciledFloor(journal, root, subject, settlement, settledSeq, at) {
|
|
22074
|
+
const seq = await nextPerNodeSeq(journal, root, "reconciled", subject.id);
|
|
21903
22075
|
await appendAcknowledged(journal, root, {
|
|
21904
22076
|
kind: "reconciled",
|
|
21905
|
-
id,
|
|
21906
|
-
|
|
21907
|
-
...
|
|
22077
|
+
id: subject.id,
|
|
22078
|
+
...settlementFields(subject, settlement),
|
|
22079
|
+
...subject.cancellationReason === void 0 ? {} : { cancellation: { source: subject.cancellationReason.source } },
|
|
22080
|
+
settledSeq,
|
|
21908
22081
|
seq,
|
|
21909
22082
|
at
|
|
21910
22083
|
});
|
|
@@ -21953,7 +22126,12 @@ async function finalizeSettlement(child, settlement, seq, args, now) {
|
|
|
21953
22126
|
if (!retainedPending) await args.journal.appendEvent(args.root, terminalDownEvent(child, settlement, seq, at));
|
|
21954
22127
|
else {
|
|
21955
22128
|
child.retainedExecution = "pending";
|
|
21956
|
-
if (settlement.reconciled !== void 0) await appendReconciledFloor(args.journal, args.root,
|
|
22129
|
+
if (settlement.reconciled !== void 0) await appendReconciledFloor(args.journal, args.root, {
|
|
22130
|
+
id: child.id,
|
|
22131
|
+
spent: settlement.reconciled,
|
|
22132
|
+
...child.retainedViolation === void 0 ? {} : { budgetViolation: child.retainedViolation },
|
|
22133
|
+
...child.cancellationReason === void 0 ? {} : { cancellationReason: child.cancellationReason }
|
|
22134
|
+
}, settlement, seq, at);
|
|
21957
22135
|
}
|
|
21958
22136
|
const retainedExecution = retainedPending ? { retainedExecution: "pending" } : {};
|
|
21959
22137
|
notifyRuntimeHookEvent(args.hooks, {
|
|
@@ -22042,56 +22220,6 @@ async function finalizeSettlement(child, settlement, seq, args, now) {
|
|
|
22042
22220
|
seq
|
|
22043
22221
|
};
|
|
22044
22222
|
}
|
|
22045
|
-
/**
|
|
22046
|
-
* The evidence a settled node carries beyond its status: the receipts that name what actually
|
|
22047
|
-
* ran, the own-inference spend the parent tree re-homes as a `metered` event, and the wall-clock
|
|
22048
|
-
* window. One builder feeds BOTH terminal paths, so an observer never sees a `down` node
|
|
22049
|
-
* described in different terms from a `done` one. Every field is omitted when the fact is
|
|
22050
|
-
* absent — an unreported receipt must not read as an empty one. Snapshots are detached because
|
|
22051
|
-
* an observer may serialize them after the live child has moved on.
|
|
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
|
-
}
|
|
22082
|
-
function settledNodeEvidence(child, settlement, settledAt) {
|
|
22083
|
-
return {
|
|
22084
|
-
runtime: child.runtime,
|
|
22085
|
-
startedAt: child.startedAt,
|
|
22086
|
-
settledAt,
|
|
22087
|
-
...settlement.metered ? { metered: detachedSnapshot(settlement.metered, "metered") } : {},
|
|
22088
|
-
...child.providerModel ? { providerModel: detachedSnapshot(child.providerModel, "provider model evidence") } : {},
|
|
22089
|
-
...child.materialization ? { materialization: detachedSnapshot(child.materialization, "materialization receipt") } : {},
|
|
22090
|
-
...child.executionBindings.length > 0 ? { executionBindings: detachedSnapshot([...child.executionBindings], "execution binding receipts") } : {},
|
|
22091
|
-
...child.budgetViolation ? { budgetViolation: detachedSnapshot(child.budgetViolation, "budget violation") } : {},
|
|
22092
|
-
trace: detachedSnapshot(settlement.trace, "worker trace evidence")
|
|
22093
|
-
};
|
|
22094
|
-
}
|
|
22095
22223
|
/** Journal a wait-state's settlement as a `woken` event and project it onto the same `Settled`
|
|
22096
22224
|
* the driver branches on. `by` names WHY it woke — `fired` / `timeout` / `cancelled` — which is
|
|
22097
22225
|
* the fact a resumed reader needs and cannot recover from a payload it may never fetch. */
|
|
@@ -24306,4 +24434,4 @@ function isNonEmptySpend(s) {
|
|
|
24306
24434
|
//#endregion
|
|
24307
24435
|
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 };
|
|
24308
24436
|
|
|
24309
|
-
//# sourceMappingURL=supervisor-
|
|
24437
|
+
//# sourceMappingURL=supervisor-DMX3Ouel.js.map
|