@tangle-network/agent-runtime 7.0.0 → 8.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +68 -0
- package/README.md +0 -3
- package/dist/{activation-Ba9IAgQ3.js → activation-Ce4zUcu8.js} +4 -4
- package/dist/{activation-Ba9IAgQ3.js.map → activation-Ce4zUcu8.js.map} +1 -1
- package/dist/{activation-DIkTEBWF.d.ts → activation-xxvLF1-1.d.ts} +2 -2
- package/dist/agent.d.ts +1 -1
- package/dist/agent.js +3 -3
- package/dist/{bundle-Cy5igJdv.js → bundle-CcpL2lfr.js} +2 -2
- package/dist/{bundle-Cy5igJdv.js.map → bundle-CcpL2lfr.js.map} +1 -1
- package/dist/candidate-execution/index.js +4 -4
- package/dist/continuation-CIyKnS1Q.js +451 -0
- package/dist/continuation-CIyKnS1Q.js.map +1 -0
- package/dist/{coordination-manager-DQZ2u6L-.js → coordination-manager-sa_PkISw.js} +194 -148
- package/dist/coordination-manager-sa_PkISw.js.map +1 -0
- package/dist/{coordination-map-routing-CKRNZSaV.js → coordination-map-routing-XZXTlCmn.js} +2 -4
- package/dist/coordination-map-routing-XZXTlCmn.js.map +1 -0
- package/dist/{delegate-DFLSVjFG.js → delegate-DhTkJIta.js} +3 -3
- package/dist/{delegate-DFLSVjFG.js.map → delegate-DhTkJIta.js.map} +1 -1
- package/dist/durable.d.ts +1 -1
- package/dist/durable.js +13 -12
- package/dist/durable.js.map +1 -1
- package/dist/{errors-AzSuGI23.js → errors-DG8yufqX.js} +8 -1
- package/dist/errors-DG8yufqX.js.map +1 -0
- package/dist/{failure-cause-rJTm_Tx8.js → failure-cause-CVB-YE88.js} +12 -8
- package/dist/{failure-cause-rJTm_Tx8.js.map → failure-cause-CVB-YE88.js.map} +1 -1
- package/dist/{graph-registry-7X2nrreR.js → graph-registry-czAwYwNj.js} +133 -9
- package/dist/graph-registry-czAwYwNj.js.map +1 -0
- package/dist/{graph-registry-gYbq4L5Z.js → graph-registry-uTIyyy7A.js} +1 -1
- package/dist/graph-tSIT_eWK.js +1793 -0
- package/dist/graph-tSIT_eWK.js.map +1 -0
- package/dist/{improve-BolbYegO.js → improve-H08hiIw9.js} +19 -48
- package/dist/improve-H08hiIw9.js.map +1 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.js +16 -16
- package/dist/intelligence.d.ts +2 -2
- package/dist/intelligence.js +8 -8
- package/dist/intelligence.js.map +1 -1
- package/dist/kernel.d.ts +2 -2
- package/dist/kernel.js +16 -15
- package/dist/{loop-runner-Cs9IJ6Nk.d.ts → loop-runner-BGwhcn1p.d.ts} +2 -2
- package/dist/{loop-runner-C9W3T_3T.js → loop-runner-ChqK8kSz.js} +3 -3
- package/dist/{loop-runner-C9W3T_3T.js.map → loop-runner-ChqK8kSz.js.map} +1 -1
- package/dist/loop-runner-bin.d.ts +1 -1
- package/dist/loop-runner-bin.js +1 -1
- package/dist/mcp/bin.js +7 -5
- package/dist/mcp/bin.js.map +1 -1
- package/dist/mcp/index.d.ts +1 -1
- package/dist/mcp/index.js +9 -9
- package/dist/mcp/memory-bin.js +2 -2
- package/dist/{model-policy-JOcg3NRs.js → model-policy-yxOrDTTj.js} +9 -9
- package/dist/model-policy-yxOrDTTj.js.map +1 -0
- package/dist/{prepare-Dtfk_Wi_.js → prepare-BnF8nGIg.js} +4 -4
- package/dist/{prepare-Dtfk_Wi_.js.map → prepare-BnF8nGIg.js.map} +1 -1
- package/dist/{profile-CNSQjOes.js → profile-CD25rTJF.js} +4 -4
- package/dist/{profile-CNSQjOes.js.map → profile-CD25rTJF.js.map} +1 -1
- package/dist/profiles.d.ts +1 -1
- package/dist/profiles.js +2 -2
- package/dist/{provision-supervisor-BQFHjCtN.js → provision-supervisor-Dx4TXTMM.js} +8 -8
- package/dist/{provision-supervisor-BQFHjCtN.js.map → provision-supervisor-Dx4TXTMM.js.map} +1 -1
- package/dist/{run-cancellation-B84X8ZAP.js → run-cancellation-DYszFJtQ.js} +4 -4
- package/dist/{run-cancellation-B84X8ZAP.js.map → run-cancellation-DYszFJtQ.js.map} +1 -1
- package/dist/{run-state-Dh1bGERI.js → run-state-DHBoJjaF.js} +5 -5
- package/dist/{run-state-Dh1bGERI.js.map → run-state-DHBoJjaF.js.map} +1 -1
- package/dist/{runtime-C9F1PG2A.js → runtime-CaM5Gbbv.js} +76 -987
- package/dist/runtime-CaM5Gbbv.js.map +1 -0
- package/dist/{sandbox-profile-compat-oFGWESLn.js → sandbox-profile-compat-l-SLQnGb.js} +2 -2
- package/dist/{sandbox-profile-compat-oFGWESLn.js.map → sandbox-profile-compat-l-SLQnGb.js.map} +1 -1
- package/dist/{search-executor-CKR9_6NR.js → search-executor-B9L8W_1O.js} +17 -46
- package/dist/search-executor-B9L8W_1O.js.map +1 -0
- package/dist/{server-Dh3SQGQT.js → server-BlDV8sj_.js} +32 -8
- package/dist/{server-Dh3SQGQT.js.map → server-BlDV8sj_.js.map} +1 -1
- package/dist/{settle-record-C6LdVvok.js → settle-record-WWQasnDq.js} +2 -2
- package/dist/{settle-record-C6LdVvok.js.map → settle-record-WWQasnDq.js.map} +1 -1
- package/dist/{snapshot-Cgj2Wzi6.js → snapshot-BKI_w3JD.js} +19 -5
- package/dist/snapshot-BKI_w3JD.js.map +1 -0
- package/dist/{structural-rollout-Dapf2aZY.js → structural-rollout-C1xxoWcN.js} +18 -54
- package/dist/structural-rollout-C1xxoWcN.js.map +1 -0
- package/dist/{supervise-xwl2D6q3.js → supervise-DWiSgPLB.js} +101 -111
- package/dist/supervise-DWiSgPLB.js.map +1 -0
- package/dist/{supervision-discovery-B47U8TH5.js → supervision-discovery-C9kfBLKy.js} +4 -4
- package/dist/{supervision-discovery-B47U8TH5.js.map → supervision-discovery-C9kfBLKy.js.map} +1 -1
- package/dist/{supervisor-gC-u_PRk.js → supervisor-Dpeu7rnZ.js} +206 -693
- package/dist/supervisor-Dpeu7rnZ.js.map +1 -0
- package/dist/{supervisor-accounting-DxLQ_TQe.js → supervisor-accounting-Bw4MJk-b.js} +434 -423
- package/dist/supervisor-accounting-Bw4MJk-b.js.map +1 -0
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +13 -13
- package/dist/{tool-server-Dg350Bgz.js → tool-server-DYwRbi0I.js} +3 -3
- package/dist/{tool-server-Dg350Bgz.js.map → tool-server-DYwRbi0I.js.map} +1 -1
- package/dist/{top-web-BJLnFQdr.js → top-web-B3HOAtrZ.js} +9 -7
- package/dist/{top-web-BJLnFQdr.js.map → top-web-B3HOAtrZ.js.map} +1 -1
- package/dist/tui/bin.js +3 -3
- package/dist/tui/index.d.ts +1 -1
- package/dist/tui/index.js +2 -2
- package/dist/{types-Jg274chm.d.ts → types-C_qbnw9N.d.ts} +1335 -1413
- package/dist/{util-C_cdPNC4.js → util-fcckrkKp.js} +39 -113
- package/dist/util-fcckrkKp.js.map +1 -0
- package/dist/{workspace-streams-B7yNMahl.js → workspace-streams-DA9R3j-p.js} +2 -2
- package/dist/{workspace-streams-B7yNMahl.js.map → workspace-streams-DA9R3j-p.js.map} +1 -1
- package/package.json +1 -1
- package/dist/coordination-manager-DQZ2u6L-.js.map +0 -1
- package/dist/coordination-map-routing-CKRNZSaV.js.map +0 -1
- package/dist/errors-AzSuGI23.js.map +0 -1
- package/dist/graph-BjQF2syl.js +0 -579
- package/dist/graph-BjQF2syl.js.map +0 -1
- package/dist/graph-registry-7X2nrreR.js.map +0 -1
- package/dist/improve-BolbYegO.js.map +0 -1
- package/dist/model-policy-JOcg3NRs.js.map +0 -1
- package/dist/runtime-C9F1PG2A.js.map +0 -1
- package/dist/search-executor-CKR9_6NR.js.map +0 -1
- package/dist/snapshot-Cgj2Wzi6.js.map +0 -1
- package/dist/structural-rollout-Dapf2aZY.js.map +0 -1
- package/dist/supervise-xwl2D6q3.js.map +0 -1
- package/dist/supervisor-accounting-DxLQ_TQe.js.map +0 -1
- package/dist/supervisor-gC-u_PRk.js.map +0 -1
- package/dist/util-C_cdPNC4.js.map +0 -1
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { f as RuntimeRunStateError, i as ConfigError, m as ValidationError } from "./errors-
|
|
3
|
-
import { A as withBudgetResources, D as addResourceSpend, I as armDeadlineTimer, P as DEFAULT_SUCCESSFUL_SHUTDOWN_MS, S as unmeteredSpend, T as zeroSpend, V as teardownExecutor, c as errorMessage, f as isAsyncIterable, i as chargedTokens, k as resourceTelemetry, m as promptCacheTokenClasses, n as addSpend, v as sleep, w as withTimeout, z as isDeadlineAbortReason } from "./util-
|
|
4
|
-
import { $ as
|
|
5
|
-
import { a as errMessage, c as
|
|
6
|
-
import {
|
|
7
|
-
import { _ as agentHarness, a as concreteProfileModel, c as profileModelExecutionSettings, l as profileProviderModel, n as assertModelAllowed, o as enforceTokenLimits, r as assertProfileModelsAllowed, s as profileBridgeWireModel, t as assertExecutableAgentProfile, v as harnessRunsAgent } from "./model-policy-
|
|
8
|
-
import { n as
|
|
1
|
+
import { Ar as providerAttemptEvidence, At as noteScopeOwnerPlannedExecution, Br as runtimeOwnedPendingExecutorMaterialization, Cr as authoredAgentIdentity, Ct as abandonScopeRetainedOwnerInvocation, Dt as scopeRetainedOwnerResult, Et as scopeRetainedOwnerPriorSpend, F as parseWorkerToolTraceArtifact, Ft as coordinationMcpAlias, Gt as noteScopeRetainedOwnerCoordination, Hr as runtimeOwnedScopeOwnerRuntime, Ht as assertRetainedOwnerCoordinationRekey, Ir as runtimeOwnedDriveHarnessProviderEvidence, It as coordinationProfileToolPrefix, Jt as bindScopeRetainedOwnerProvider, Lr as runtimeOwnedExecutorExecutionBinding, Lt as providerVisibleProfile, Mt as restoreScopeOwnerAcceptedExecution, Nt as scopeOwnerExecutionObservation, Ot as beginScopeOwnerAttempt, Pt as scopeOwnerExecutorNodeContext, Rr as runtimeOwnedExecutorMaterialization, Rt as runtimeGraphMetadataKey, Sr as attestRuntimeOwnedScopeOwner, Tt as prepareScopeRetainedOwnerTask, Un as generateSpanId, Ut as reconcileScopeRetainedOwnerEnvironment, Vn as createOtelExporter, Vt as scopeRetainedOwnerTurnEnded, Wt as scopeRetainedOwnerRestorePoint, X as assertRecursiveReservationPolicy, Xr as runtimeFlowBrain, Xt as scopeRetainedOwnerContext, Yr as runtimeFlowAgent, Yt as owners, Zt as scopeRetainedOwnerJournalRoot, _r as seatExecutionProfile, a as createRootStreamSink, at as meterRuntimeOwnedProviderAttempt, bt as scopeRetainedOwnerResourceReader, cr as createActivityLog, ct as recordScopeOwnerDriverAttempt, dr as isLiveNodeStatus, fr as isTerminalNodeStatus, gr as authoredSeatStages, hr as SeatPauseError, i as ROOT_STREAM_FILE, ii as RunCancellationReason, it as meterRuntimeOwnedAccounting, jn as WORKER_TRACE_PROPAGATION, jr as recordRuntimeOwnedDriveHarnessProviderEvidence, jt as recordScopeOwnerMaterialization, ln as executorObservationSeamKey, lt as recordScopeOwnerPause, mr as SeatChain, nr as readHarnessTranscript, oi as linkAbort, ot as pauseScopeSeatAdmission, pr as SEAT_RECHECK_MS, qr as isRuntimeFlowBrain, qt as bindScopeRetainedOwnerEnvironmentId, s as readRootStream, si as runAbortable, st as recordScopeOwnerBarrenPause, tr as persistHarnessTranscript, vt as prepareScopeRetainedOwnerSeatSwitch, wt as consumeScopeRetainedOwnerResult, yt as releaseScopeRetainedOwnerForSeatPause, zr as runtimeOwnedExecutorProviderEvidence, zt as beginScopeRetainedOwnerDrive } from "./supervisor-accounting-Bw4MJk-b.js";
|
|
2
|
+
import { f as RuntimeRunStateError, i as ConfigError, m as ValidationError } from "./errors-DG8yufqX.js";
|
|
3
|
+
import { A as withBudgetResources, D as addResourceSpend, I as armDeadlineTimer, P as DEFAULT_SUCCESSFUL_SHUTDOWN_MS, S as unmeteredSpend, T as zeroSpend, V as teardownExecutor, c as errorMessage, f as isAsyncIterable, i as chargedTokens, k as resourceTelemetry, m as promptCacheTokenClasses, n as addSpend, v as sleep, w as withTimeout, z as isDeadlineAbortReason } from "./util-fcckrkKp.js";
|
|
4
|
+
import { $ as spendFromUsageTotals, C as jitteredMs, D as unavailableResumeAt, E as unavailablePauseMs, L as harnessProcessDied, M as contentAddress, P as executorFailure, R as turnFailureOf, S as cappedDoublingMs, T as reportedResetAt, Tt as recordValue, X as meterUsageEvent, Z as newUsageTotals, _ as registerRetainedExecutorPreparation, et as assertValidBudget, u as RetainedExecutionPendingError, y as retainedExecutorSeamKey, z as turnFailurePolicy } from "./failure-cause-CVB-YE88.js";
|
|
5
|
+
import { a as errMessage, c as errorStack, i as causeChain, l as errorText, n as detachedSnapshot, o as errorHttpStatus, u as defaultRedactor } from "./snapshot-BKI_w3JD.js";
|
|
6
|
+
import { At as bridgeRuntimeAttachmentsKey, B as createRouterTranscript, Bt as controlProfileMaterialization, C as createExecutor, F as codeModeArguments, Gt as promptModelProfileMaterialization, Ht as fullProfileMaterialization, I as codeModeModelOutput, Jt as sandboxProfileMaterialization, Kt as renderUnsupported, L as createCodeModeTools, Rt as assertProfileMaterialization, S as captureReusableExecutorConfig, St as bridgeModelRouteRefusal, U as resolveAgentEnvironmentProvider, Ut as profileMaterializationAxes$1, V as routerBrain, Vt as defineProfileMaterializationContract, Wt as promptControlProfileMaterialization, X as createInbox, Xt as worktreeCliProfileMaterialization, Y as INBOX_RECEIPT_KEY, Yt as unsupportedProfileDimensions, _t as gateFactoryOnDeliverable, a as assertRunParking, c as sleepScopeWait, ct as HarnessTurnFailedError, d as runFinalizer, dt as summarizeDriverAttempts, et as PEER_MAIL_WIRE_KEY, f as runTree, ft as transientFailureKind, g as isDriverSpec, gt as CheckUnavailableError, h as driverExecutorFactory, ht as preflightPublicCoordination, i as RunParkedError, jt as bridgeStopSignalKey, l as withRunParking, lt as abandonablePending, m as driverChild, mt as upstreamUnavailableSignal, n as createSupervisor, o as bindScopeParkingDrain, p as createRootHandle, pt as undispatchedCredentialExit, rt as isPeerMailEnvelope, st as DriverAttemptsExhaustedError, u as bestDelivered, ut as classifyDriverFailure, w as snapshotExecutorConfig, x as bindReusableExecutorExecutionId, xt as bridgeAdmissionRefusal, z as toolResultText } from "./supervisor-Dpeu7rnZ.js";
|
|
7
|
+
import { _ as agentHarness, a as concreteProfileModel, c as profileModelExecutionSettings, l as profileProviderModel, n as assertModelAllowed, o as enforceTokenLimits, r as assertProfileModelsAllowed, s as profileBridgeWireModel, t as assertExecutableAgentProfile, v as harnessRunsAgent } from "./model-policy-yxOrDTTj.js";
|
|
8
|
+
import { a as createContinuationKeeper, i as checkVerdictOf, n as admitContinuationPolicy, r as bestComposite, t as CONTINUATIONS_DIR } from "./continuation-CIyKnS1Q.js";
|
|
9
|
+
import { n as createStdioToolServer } from "./tool-server-DYwRbi0I.js";
|
|
9
10
|
import { t as composeRuntimeHooks } from "./runtime-hooks-CsW2pfFk.js";
|
|
10
|
-
import { _ as workerAssignmentNamespace, c as writeRunCancellation, d as coordinationEventId, f as externalExecutionId, g as supervisionRunNamespace, h as rootCoordinationOwner, i as readRunCancellation, l as canonicalExecution, m as freezeDetachedProfile, p as freezeDetached, r as readRunCancelRequest, s as watchRunCancellation, t as applyRunCancellation, u as childCoordinationOwner } from "./run-cancellation-
|
|
11
|
-
import { c as createSteerAcknowledger, d as coordinationVerbNames, f as createFileRunContext, l as budgetOverspendText, m as withRunContext, n as createCoordinationToolsForManager, p as createInMemoryRunContext, s as createCancelAcknowledger, t as createCoordinationTools, u as normalizeAnalyzeOnSettle } from "./coordination-manager-
|
|
12
|
-
import { o as safeJsonText } from "./coordination-map-routing-
|
|
13
|
-
import { a as graphRegistry, c as loadGraph } from "./graph-registry-
|
|
11
|
+
import { _ as workerAssignmentNamespace, c as writeRunCancellation, d as coordinationEventId, f as externalExecutionId, g as supervisionRunNamespace, h as rootCoordinationOwner, i as readRunCancellation, l as canonicalExecution, m as freezeDetachedProfile, p as freezeDetached, r as readRunCancelRequest, s as watchRunCancellation, t as applyRunCancellation, u as childCoordinationOwner } from "./run-cancellation-DYszFJtQ.js";
|
|
12
|
+
import { c as createSteerAcknowledger, d as coordinationVerbNames, f as createFileRunContext, l as budgetOverspendText, m as withRunContext, n as createCoordinationToolsForManager, p as createInMemoryRunContext, s as createCancelAcknowledger, t as createCoordinationTools, u as normalizeAnalyzeOnSettle } from "./coordination-manager-sa_PkISw.js";
|
|
13
|
+
import { o as safeJsonText } from "./coordination-map-routing-XZXTlCmn.js";
|
|
14
|
+
import { a as graphRegistry, c as loadGraph } from "./graph-registry-czAwYwNj.js";
|
|
14
15
|
import { ATTR, LINK_KIND_ATTR, agentIdentityAttributes } from "@tangle-network/agent-trace-contract";
|
|
15
16
|
import { ProxySecretScopeSchema, ProxySecretsSchema, agentProfileSchema, canonicalAgentProfileDigest, canonicalCandidateDigest, canonicalCandidateJson, mergeProxySecretBindings, validateAgentProfileSecurity } from "@tangle-network/agent-interface";
|
|
16
17
|
import { toolSpansToTraceAnalysisStore } from "@tangle-network/agent-eval";
|
|
@@ -30,6 +31,7 @@ const superviseOptionKeySet = /* @__PURE__ */ new Set([
|
|
|
30
31
|
"analyzeOnSettle",
|
|
31
32
|
"mapOnSettle",
|
|
32
33
|
"routeFlow",
|
|
34
|
+
"checkNodes",
|
|
33
35
|
"decideGate",
|
|
34
36
|
"authorizeMessage",
|
|
35
37
|
"authorizeSpawn",
|
|
@@ -179,6 +181,7 @@ Object.freeze([...superviseExecutableOptionKeys]);
|
|
|
179
181
|
const superviseReferenceOptionKeys = /* @__PURE__ */ new Set([
|
|
180
182
|
...superviseExecutableOptionKeys,
|
|
181
183
|
"blobs",
|
|
184
|
+
"checkNodes",
|
|
182
185
|
"hooks",
|
|
183
186
|
"journal",
|
|
184
187
|
"otel",
|
|
@@ -943,39 +946,9 @@ function renderAnytimeTable(report) {
|
|
|
943
946
|
}
|
|
944
947
|
// src/runtime/supervise/stop-rules.ts
|
|
945
948
|
/**
|
|
946
|
-
*
|
|
947
|
-
*
|
|
948
|
-
*
|
|
949
|
-
* Every existing bound is a CEILING: iterations, tokens, dollars, an absolute deadline, a turn
|
|
950
|
-
* cap. A ceiling answers "may this run continue?" and never "is this run still getting anywhere?".
|
|
951
|
-
* So a supervision tree that stopped learning at settle 4 keeps buying workers until it hits a
|
|
952
|
-
* wall — the run ends on exhaustion, and the operator cannot tell a run that finished from a run
|
|
953
|
-
* that ran out.
|
|
954
|
-
*
|
|
955
|
-
* A stop rule reads the run's own PROGRESS and decides. Three signals feed it:
|
|
956
|
-
* - the objective curve over settled work (best-so-far, from `anytime.ts` — see below),
|
|
957
|
-
* - the LIVE worker feed (`WorkerProgress`: `idleMs`, `stalled`, `turns`, `tokens`),
|
|
958
|
-
* - tree-level shape (how many are in flight, when the last settle landed).
|
|
959
|
-
*
|
|
960
|
-
* ── Two boundaries this module holds deliberately ───────────────────────────────────────────────
|
|
961
|
-
*
|
|
962
|
-
* ENFORCEMENT lives here; THRESHOLDS do not. "Stop after 5 settles with no improvement" is a
|
|
963
|
-
* judgment about a domain — how noisy its scores are, how expensive a worker is, how much a late
|
|
964
|
-
* breakthrough is worth. That belongs to the caller (a loop, a bench, a product). Every rule below
|
|
965
|
-
* takes its thresholds as required options with no hidden defaults for the numbers that decide;
|
|
966
|
-
* the module ships the MECHANISM and refuses to ship the judgment.
|
|
967
|
-
*
|
|
968
|
-
* A stop rule can only ADD a stop, never remove one. The driver evaluates the hard ceilings
|
|
969
|
-
* (`poolStarved`, `deadlinePassed`, abort, the driver's own stop) FIRST and independently; the
|
|
970
|
-
* rule is consulted only when they all say "continue". So no rule can talk a run past its budget.
|
|
971
|
-
*
|
|
972
|
-
* ── What is reused, not re-derived ──────────────────────────────────────────────────────────────
|
|
973
|
-
*
|
|
974
|
-
* `anytime.ts` already computed best-so-far curves, their area, and plateau detection — but only
|
|
975
|
-
* after a run was over, from waterfall spans. Rather than write a second copy for the live path,
|
|
976
|
-
* `bestSoFar` / `areaUnderCurve` / `plateauLength` were extracted there and are imported here. A
|
|
977
|
-
* stop rule that calls a run plateaued therefore agrees, number for number, with the report that
|
|
978
|
-
* later judges whether stopping was right.
|
|
949
|
+
* Stop rules only add a stop, and only after the hard ceilings say continue. Thresholds are
|
|
950
|
+
* required caller options. `bestSoFar`, `areaUnderCurve`, and `plateauLength` come from
|
|
951
|
+
* `anytime.ts`.
|
|
979
952
|
*
|
|
980
953
|
* @experimental
|
|
981
954
|
*/
|
|
@@ -1466,8 +1439,8 @@ function validateGraphTopology(nodes, edges, registry, analysts) {
|
|
|
1466
1439
|
const roots = [...new Set(delegates.map((edge) => edge.from))].filter((id) => !delegatedTo.has(id));
|
|
1467
1440
|
if (roots.length !== 1) throw new ValidationError(`runGraph: expected exactly ONE root (a node that delegates and is never delegated to), found ${roots.length === 0 ? "none — delegates edges form a cycle with no entry" : roots.join(", ")}. P0 executes driver↔worker(s); nested driver graphs are P3.`);
|
|
1468
1441
|
const root = requireNode(roots[0], "root resolution");
|
|
1469
|
-
|
|
1470
|
-
for (const edge of delegates) if (edge.from !==
|
|
1442
|
+
const spawnTool = `${coordinationProfileToolPrefix}spawn_worker`;
|
|
1443
|
+
for (const edge of delegates) if (requireNode(edge.from, edgeId(edge)).profile.tools?.[spawnTool] !== true) throw new ValidationError(`runGraph: ${edgeId(edge)} delegates from '${edge.from}', which does not declare ${JSON.stringify(spawnTool)} — only a node holding the spawn tool can start workers`);
|
|
1471
1444
|
const analystIds = /* @__PURE__ */ new Set();
|
|
1472
1445
|
const analystNodes = /* @__PURE__ */ new Map();
|
|
1473
1446
|
for (const edge of analyzes) {
|
|
@@ -1575,8 +1548,8 @@ function validateMaps(maps, graph) {
|
|
|
1575
1548
|
function graphRootProfile(validated, registry) {
|
|
1576
1549
|
const { root, workers, delegatesByWorker, analyzes, analystNodes, maps, mapItemNames } = validated;
|
|
1577
1550
|
const driverAnalyzesBriefs = analyzes.filter((edge) => edge.to === root.id).map((edge) => analystNodes.has(edge.analyst) ? `Findings from analyst '${edge.analyst}' (a tool-equipped analyst agent node, over: ${edge.over.join(", ")}) will arrive as finding events.` : `Findings from analyst '${edge.analyst}' (over: ${edge.over.join(", ")}) will arrive as finding events.\n${registry.resolve(edge.directive).text}`);
|
|
1578
|
-
const workerLines = [...
|
|
1579
|
-
const
|
|
1551
|
+
const workerLines = [...delegatesByWorker.values()].filter((edge) => edge.from === root.id).map((edge) => {
|
|
1552
|
+
const node = workers.get(edge.to);
|
|
1580
1553
|
const cap = edge.maxTraversals ?? 32;
|
|
1581
1554
|
const description = typeof node.profile.description === "string" && node.profile.description.length > 0 ? ` — ${node.profile.description}` : "";
|
|
1582
1555
|
const continuityNote = edge.continuity === "resume" ? "; continuity: resume — each spawn after the first re-attaches to this node's latest settled session (spawn again to continue it; steer while it is live)" : "";
|
|
@@ -2320,6 +2293,8 @@ function pinDelegatesSpawn({ validated, registry, ledger }, input, requested) {
|
|
|
2320
2293
|
const node = requested !== void 0 ? validated.workers.get(requested) : void 0;
|
|
2321
2294
|
if (!node) throw new ValidationError(`runGraph: spawn_worker named profile ${JSON.stringify(requested)} which is not a worker node of this graph (nodes: ${[...validated.workers.keys()].join(", ")}). Spawn by node id: profile.name selects the node; the node profile itself is pinned by the graph.`);
|
|
2322
2295
|
const edge = validated.delegatesByWorker.get(node.id);
|
|
2296
|
+
const spawner = ledger.nodeByWorkerId.get(input.parentNodeId ?? "") ?? validated.root?.id;
|
|
2297
|
+
if (spawner !== edge.from) throw new ValidationError(`runGraph: '${spawner}' spawned '${node.id}', but its delegates edge starts at '${edge.from}'`);
|
|
2323
2298
|
const id = edgeId(edge);
|
|
2324
2299
|
const cap = edge.maxTraversals ?? 32;
|
|
2325
2300
|
const spawnContinuity = input.continuity ?? "fresh";
|
|
@@ -2381,7 +2356,8 @@ function pinRouteSpawn({ validated: { flow }, registry }, input, requested) {
|
|
|
2381
2356
|
const edge = flow?.routes.get(marker.edge);
|
|
2382
2357
|
const starts = flow?.starts.get(marker.edge)?.has(requested) === true;
|
|
2383
2358
|
if (node === void 0 || marker.node !== requested || !starts) throw new ValidationError(`runGraph: route spawn for ${JSON.stringify(marker.edge)} names ${JSON.stringify(requested)}, which is not the node that edge starts`);
|
|
2384
|
-
|
|
2359
|
+
const reentry = edge?.continuity === "resume" && flow?.entries.some((e) => e.node === requested);
|
|
2360
|
+
return edge === void 0 || reentry ? node.profile : withDirective(node.profile, registry.resolve(edge.directive).text);
|
|
2385
2361
|
}
|
|
2386
2362
|
function analystRoutes({ analyzes, analystNodes, root }, registry) {
|
|
2387
2363
|
return analyzes.map((edge) => {
|
|
@@ -4371,12 +4347,10 @@ function bindServedTools(opts, coord, fenceMs) {
|
|
|
4371
4347
|
if (!Array.isArray(opts.toolNames)) throw new ValidationError("serveCoordinationMcp: toolNames must name every granted tool explicitly");
|
|
4372
4348
|
const selectedNames = opts.toolNames;
|
|
4373
4349
|
if (new Set(selectedNames).size !== selectedNames.length) throw new ValidationError("serveCoordinationMcp: toolNames contains a duplicate name");
|
|
4350
|
+
const missing = selectedNames.filter((name) => !availableByName.has(name));
|
|
4351
|
+
if (missing.length > 0) throw new ValidationError(`serveCoordinationMcp: requested tools ${missing.map((n) => JSON.stringify(n)).join(", ")} are unavailable; served: ${[...availableByName.keys()].join(", ")}`);
|
|
4374
4352
|
return {
|
|
4375
|
-
servedTools: selectedNames.map((name) =>
|
|
4376
|
-
const tool = availableByName.get(name);
|
|
4377
|
-
if (tool === void 0) throw new ValidationError(`serveCoordinationMcp: requested tool ${JSON.stringify(name)} is unavailable`);
|
|
4378
|
-
return tool;
|
|
4379
|
-
}),
|
|
4353
|
+
servedTools: selectedNames.map((name) => availableByName.get(name)),
|
|
4380
4354
|
background: () => nodeTools.background() + fencedVerbs.background()
|
|
4381
4355
|
};
|
|
4382
4356
|
}
|
|
@@ -5217,10 +5191,12 @@ var DriverRetryLoop = class {
|
|
|
5217
5191
|
}
|
|
5218
5192
|
failureRecord(failure) {
|
|
5219
5193
|
const producerFailure = turnFailureOf(failure.error);
|
|
5194
|
+
const stack = errorStack(failure.error);
|
|
5220
5195
|
return {
|
|
5221
5196
|
attempt: failure.attempt,
|
|
5222
5197
|
durationMs: failure.durationMs,
|
|
5223
5198
|
error: errMessage(failure.error),
|
|
5199
|
+
...stack === void 0 ? {} : { errorStack: stack },
|
|
5224
5200
|
...producerFailure === void 0 ? {} : { failure: producerFailure },
|
|
5225
5201
|
classification: failure.classification,
|
|
5226
5202
|
...failure.classification === "transient" ? { failureKind: transientFailureKind(failure.error) } : {},
|
|
@@ -5630,13 +5606,13 @@ async function runDriverWithRetry(run) {
|
|
|
5630
5606
|
}
|
|
5631
5607
|
}
|
|
5632
5608
|
// src/runtime/supervise/reentry.ts
|
|
5633
|
-
/**
|
|
5609
|
+
/** What a re-entry may assume when nothing proved its session, environment or workspace. */
|
|
5634
5610
|
const UNPROVEN_CONTINUITY = Object.freeze({
|
|
5635
5611
|
session: "new",
|
|
5636
5612
|
environment: "unknown",
|
|
5637
5613
|
workspace: "unknown"
|
|
5638
5614
|
});
|
|
5639
|
-
/**
|
|
5615
|
+
/** The task a re-entered driver receives: what changed, why it re-entered, and its objective. */
|
|
5640
5616
|
function composeReentryTask(input) {
|
|
5641
5617
|
const { reentry, continuity, state } = input;
|
|
5642
5618
|
if (reentry.reason === "unmet-contract" && continuity.session === "continued") {
|
|
@@ -5690,28 +5666,21 @@ function composeReentryTask(input) {
|
|
|
5690
5666
|
"Your coordination tools are served by the same coordinator as before, and the state above comes from it."
|
|
5691
5667
|
].join("\n");
|
|
5692
5668
|
}
|
|
5693
|
-
/**
|
|
5694
|
-
* Why the driver is back, in one clause. The failure's own text stays in the attempt records and
|
|
5695
|
-
* never reaches the driver: a continuation told the details of a provider
|
|
5696
|
-
* failure spent two of its first four children probing the infrastructure, while its peer, told
|
|
5697
|
-
* only what to continue, spent all forty-five on the research.
|
|
5698
|
-
*/
|
|
5699
5669
|
function whyLine(reentry) {
|
|
5700
5670
|
if (reentry.reason === "unmet-contract") return `Your previous turn ended with the completion check unmet (continuation ${reentry.continuation}).`;
|
|
5701
5671
|
if (reentry.reason === "wake") return "Your previous turn ended while your workers ran, and Runtime woke you with what happened.";
|
|
5702
5672
|
if (reentry.reason === "run-reentered") return restartLine(reentry);
|
|
5703
5673
|
return reentry.reason === "upstream-unavailable" ? "Your previous turn was interrupted before it finished; the run itself is intact." : `Your previous turn ended before it finished (retry ${reentry.retry}); the run itself is intact.`;
|
|
5704
5674
|
}
|
|
5705
|
-
/**
|
|
5706
|
-
* What a root re-entered after a barren pause is told: its last turns delivered nothing, and how
|
|
5707
|
-
* to wait on long work of its own instead of ending the turn. Measured 2026-10-21 on
|
|
5708
|
-
* magnetar-rust-20261021a: the root ended two turns to wait on its own 2^20 prove, and both
|
|
5709
|
-
* counted as barren.
|
|
5710
|
-
*/
|
|
5711
5675
|
function barrenLines(reentry) {
|
|
5712
5676
|
if (reentry.barren === void 0) return [];
|
|
5713
5677
|
const minutes = Math.round(reentry.barren.pausedMs / 6e4);
|
|
5714
|
-
|
|
5678
|
+
const unjudged = reentry.steer.includes("has not judged") && reentry.steer.includes("verdict reaches you");
|
|
5679
|
+
return [`Your last ${reentry.barren.streak} turns ended with the check unmet and delivered nothing: no accepted result, no worker that passed its check, and no rise in the check's score. Runtime waited ${minutes} minutes before this turn.`, unjudged ? [
|
|
5680
|
+
"The check has not judged this run yet, and its verdict reaches you as feedback.",
|
|
5681
|
+
"End your turn and let that verdict wake you.",
|
|
5682
|
+
"Do not sleep, poll, or record another release to poke the check."
|
|
5683
|
+
].join(" ") : "If you are waiting on long work of your own, such as a build, a proof or a job you started, do not end your turn to wait for it. Wait inside the turn with your wake or wait tool, or a command that blocks until the work finishes, then act on its result. Each turn in a row that ends with nothing delivered doubles the wait before the next, up to an hour."];
|
|
5715
5684
|
}
|
|
5716
5685
|
function restartLine(reentry) {
|
|
5717
5686
|
const replaced = new Set(reentry.replaced);
|
|
@@ -5921,10 +5890,7 @@ function managerFinalizer(deps, session) {
|
|
|
5921
5890
|
...finalizerDeliverable ? { deliverable: finalizerDeliverable } : {}
|
|
5922
5891
|
});
|
|
5923
5892
|
}
|
|
5924
|
-
/**
|
|
5925
|
-
* Drive the manager's harness until its retry loop ends, and report the loop. Returns the checked
|
|
5926
|
-
* candidate a turn that ended with the contract declared and no work open selected.
|
|
5927
|
-
*/
|
|
5893
|
+
/** Drive until the retry loop ends. Return the checked candidate when the contract is met. */
|
|
5928
5894
|
async function driveManagerTurns(inputs) {
|
|
5929
5895
|
const { config, session } = inputs;
|
|
5930
5896
|
const { deps, driveHarness } = config;
|
|
@@ -6012,14 +5978,7 @@ async function driveManagerTurns(inputs) {
|
|
|
6012
5978
|
}
|
|
6013
5979
|
return loop.candidate;
|
|
6014
5980
|
}
|
|
6015
|
-
/**
|
|
6016
|
-
* The stop-pause of an opted-in ROOT (`SupervisorAgentDeps.pauseRootStops`, which `supervise()`
|
|
6017
|
-
* sets on the root's deps alone); a nested manager keeps its stops and settles `down` for its
|
|
6018
|
-
* parent. A root steer between turns reaches the coordinator as a lead message, and one an ended
|
|
6019
|
-
* invocation still held waits in `nextTurnInbox`. Either ends a pause once and stays queued for
|
|
6020
|
-
* the next turn: a steer that turn never read, or a pool still spent, would otherwise end every
|
|
6021
|
-
* later pause at once.
|
|
6022
|
-
*/
|
|
5981
|
+
/** Root-only. A nested manager keeps its stops. One steer ends one pause and stays queued. */
|
|
6023
5982
|
function rootStopPause(config, session) {
|
|
6024
5983
|
if (config.deps.pauseRootStops !== true) return {};
|
|
6025
5984
|
const { controls } = session;
|
|
@@ -6101,11 +6060,7 @@ function readManagerProgress(loop) {
|
|
|
6101
6060
|
...composite === void 0 ? {} : { composite }
|
|
6102
6061
|
};
|
|
6103
6062
|
}
|
|
6104
|
-
/**
|
|
6105
|
-
* The check runs when a turn ends without an accepted result. A read already taken in this turn
|
|
6106
|
-
* stands (the manager just heard it); otherwise a check that judges state reads the run now. A
|
|
6107
|
-
* check that could not run is not a verdict: the loop pauses.
|
|
6108
|
-
*/
|
|
6063
|
+
/** A check already read this turn stands. A check that could not run is not a verdict. */
|
|
6109
6064
|
async function readCheckAtTurnEnd(loop, attempt) {
|
|
6110
6065
|
const deliverable = loop.config.deps.deliverable;
|
|
6111
6066
|
const { controls } = loop.session;
|
|
@@ -6150,6 +6105,8 @@ async function driveManagerTurn(loop, attempt, reentry) {
|
|
|
6150
6105
|
const { deps, runtimeToolNames } = loop.config;
|
|
6151
6106
|
const { mcp, controls, state } = loop.session;
|
|
6152
6107
|
const { scope, task } = state;
|
|
6108
|
+
const owner = owners.get(scope);
|
|
6109
|
+
if (owner) owner.replaceDeadExecution = reentry?.reason === "driver-failure" && harnessProcessDied(reentry.failure);
|
|
6153
6110
|
loop.candidate = void 0;
|
|
6154
6111
|
if (deps.controlDir !== void 0 && deps.abortRun !== void 0) applyRunCancellation(deps.controlDir, deps.abortRun, () => (/* @__PURE__ */ new Date()).toISOString());
|
|
6155
6112
|
scope.signal.throwIfAborted();
|
|
@@ -6653,15 +6610,8 @@ function supervisorAgentWithTestBrain(profile, deps) {
|
|
|
6653
6610
|
return buildSupervisorAgent(profile, runtimeDeps, brain);
|
|
6654
6611
|
}
|
|
6655
6612
|
// src/runtime/supervise/supervise-profile-admission.ts
|
|
6656
|
-
/**
|
|
6657
|
-
*
|
|
6658
|
-
* profile is materialized (bridge / sandbox / cli-worktree / cli-in-place / router / cli /
|
|
6659
|
-
* provider), which is a
|
|
6660
|
-
* different axis from WHICH CLI runs. An exhaustive switch on a closed union tag is the correct
|
|
6661
|
-
* shape and must stay: it is what makes a new executor kind a compile error here rather than a
|
|
6662
|
-
* silently weaker materialization contract. Every other `backend.backend === …` in this file and
|
|
6663
|
-
* in `runtime.ts` is the same tag; none of them are harness names.
|
|
6664
|
-
*/
|
|
6613
|
+
/** `ExecutorConfig.backend` names HOW a profile is materialized, not which CLI runs; the exhaustive
|
|
6614
|
+
* switch makes a new executor kind a compile error rather than a weaker contract. */
|
|
6665
6615
|
function backendProfileMaterialization(backend) {
|
|
6666
6616
|
switch (backend.backend) {
|
|
6667
6617
|
case "bridge":
|
|
@@ -6669,8 +6619,11 @@ function backendProfileMaterialization(backend) {
|
|
|
6669
6619
|
case "sandbox": return sandboxProfileMaterialization;
|
|
6670
6620
|
case "cli-worktree": return backend.bridge ? fullProfileMaterialization : worktreeCliProfileMaterialization;
|
|
6671
6621
|
case "cli-in-place": return worktreeCliProfileMaterialization;
|
|
6672
|
-
case "router":
|
|
6673
|
-
case "router-tools": return
|
|
6622
|
+
case "router": return promptModelProfileMaterialization;
|
|
6623
|
+
case "router-tools": return {
|
|
6624
|
+
name: "router-tools-execution",
|
|
6625
|
+
axes: [...promptModelProfileMaterialization.axes, "tools"]
|
|
6626
|
+
};
|
|
6674
6627
|
case "cli": return controlProfileMaterialization;
|
|
6675
6628
|
}
|
|
6676
6629
|
}
|
|
@@ -7103,15 +7056,25 @@ function workerFromBackend(backend, deliverable, seams) {
|
|
|
7103
7056
|
const boundSessionId = boundBackend.backend === "bridge" ? boundBackend.sessionId : void 0;
|
|
7104
7057
|
const peerMailAttachment = peerMailRuntimeAttachment(profile, capturedBackend, spawnContext);
|
|
7105
7058
|
if (spawnContext?.peerMailUrl && boundBackend.backend === "provider" && Object.hasOwn(boundBackend.defaults?.runtimeAttachments?.mcp ?? {}, "agent-runtime-peer-mail")) throw new ValidationError("workerFromBackend: provider defaults contain the reserved peer-mail attachment alias");
|
|
7106
|
-
const
|
|
7059
|
+
const sizedBackend = spawnContext?.resources !== void 0 && boundBackend.backend === "provider" ? {
|
|
7107
7060
|
...boundBackend,
|
|
7108
|
-
steering: boundBackend.steering ?? {},
|
|
7109
7061
|
defaults: {
|
|
7110
|
-
...boundBackend.defaults
|
|
7062
|
+
...boundBackend.defaults,
|
|
7063
|
+
resources: {
|
|
7064
|
+
...boundBackend.defaults?.resources,
|
|
7065
|
+
...spawnContext.resources
|
|
7066
|
+
}
|
|
7067
|
+
}
|
|
7068
|
+
} : boundBackend;
|
|
7069
|
+
const leafBackend = spawnContext?.peerMailUrl && sizedBackend.backend === "provider" ? {
|
|
7070
|
+
...sizedBackend,
|
|
7071
|
+
steering: sizedBackend.steering ?? {},
|
|
7072
|
+
defaults: {
|
|
7073
|
+
...sizedBackend.defaults ?? {},
|
|
7111
7074
|
runtimeAttachments: {
|
|
7112
|
-
...
|
|
7075
|
+
...sizedBackend.defaults?.runtimeAttachments ?? {},
|
|
7113
7076
|
mcp: {
|
|
7114
|
-
...
|
|
7077
|
+
...sizedBackend.defaults?.runtimeAttachments?.mcp ?? {},
|
|
7115
7078
|
[peerMailMcpAlias]: {
|
|
7116
7079
|
transport: "http",
|
|
7117
7080
|
url: spawnContext.peerMailUrl
|
|
@@ -7119,9 +7082,13 @@ function workerFromBackend(backend, deliverable, seams) {
|
|
|
7119
7082
|
}
|
|
7120
7083
|
}
|
|
7121
7084
|
}
|
|
7122
|
-
} :
|
|
7123
|
-
const
|
|
7124
|
-
const
|
|
7085
|
+
} : sizedBackend;
|
|
7086
|
+
const analyst = spawnContext?.analyst !== void 0;
|
|
7087
|
+
const rawFactory = createExecutor(analyst && "validator" in leafBackend ? {
|
|
7088
|
+
...leafBackend,
|
|
7089
|
+
validator: void 0
|
|
7090
|
+
} : leafBackend);
|
|
7091
|
+
const baseFactory = deliverable && !analyst ? gateFactoryOnDeliverable(rawFactory, deliverable) : rawFactory;
|
|
7125
7092
|
const executorFactory = (spec, ctx) => {
|
|
7126
7093
|
if (boundSessionId !== void 0 && ctx.node?.nodeId !== void 0) bridgeSessionByWorker.set(ctx.node.nodeId, boundSessionId);
|
|
7127
7094
|
const extraSeams = seams?.();
|
|
@@ -7315,14 +7282,16 @@ function recursiveWorkerFactoryFor(env, seat) {
|
|
|
7315
7282
|
const makeRecursiveWorker = (authoredProfile, spawnContext, recovering = false) => {
|
|
7316
7283
|
if (!spawnContext) throw new ValidationError("supervise: backend-derived workers require spawn context");
|
|
7317
7284
|
const admitted = admitSpawn(env, seat, authoredProfile, spawnContext, recovering);
|
|
7318
|
-
return admitted.usesRuntimeCoordination ? managedWorker(env, seat, admitted, spawnContext) : leafWorker(env, seat, admitted, spawnContext);
|
|
7285
|
+
return admitted.usesRuntimeCoordination ? managedWorker(env, seat, admitted, spawnContext) : leafWorker(env, seat, admitted, spawnContext, recovering);
|
|
7319
7286
|
};
|
|
7320
7287
|
registerRecovery(env, makeRecursiveWorker);
|
|
7321
7288
|
return makeRecursiveWorker;
|
|
7322
7289
|
}
|
|
7323
|
-
function leafWorker(env, seat, admitted, spawnContext) {
|
|
7290
|
+
function leafWorker(env, seat, admitted, spawnContext, recovering) {
|
|
7324
7291
|
const { options, deliverable, runNamespace } = env.setup;
|
|
7325
7292
|
const { childDeliverable } = admitted;
|
|
7293
|
+
const name = admitted.authorized.name ?? "";
|
|
7294
|
+
if (options.checkNodes?.names.includes(name) && seat.depth === 1 && (recovering || spawnContext.route?.node === name)) return options.checkNodes.leaf(admitted.authorized, admitted.authorizedContext);
|
|
7326
7295
|
if (childDeliverable !== deliverable && !options.backend) throw new ValidationError("supervise: resolveDeliverable selected a per-spawn deliverable but there is no backend to derive that leaf from; makeLeafAgent owns its own completion check");
|
|
7327
7296
|
return withModelSubstitution((childDeliverable === deliverable ? env.makeLeaf : workerFromBackend(options.backend, childDeliverable))(admitted.authorized, Object.freeze({
|
|
7328
7297
|
...admitted.authorizedContext,
|
|
@@ -8786,6 +8755,25 @@ function composeSpawnPreflights(...preflights) {
|
|
|
8786
8755
|
}
|
|
8787
8756
|
};
|
|
8788
8757
|
}
|
|
8758
|
+
/** Refuse a `spawn_worker` machine request that the backend's `maxWorkerResources` does not admit
|
|
8759
|
+
* (#1277): a request is refused, never clamped, and the refusal names the ceiling. */
|
|
8760
|
+
function resourceSpawnPreflight(backend) {
|
|
8761
|
+
return async (_profile, { resources }) => {
|
|
8762
|
+
if (resources === void 0) return void 0;
|
|
8763
|
+
const ceiling = backend?.backend === "provider" ? backend.maxWorkerResources : void 0;
|
|
8764
|
+
const over = [
|
|
8765
|
+
"cpu",
|
|
8766
|
+
"memoryMb",
|
|
8767
|
+
"diskMb",
|
|
8768
|
+
"gpu"
|
|
8769
|
+
].filter((k) => resources[k] !== void 0 && (k === "gpu" ? resources.gpu !== ceiling?.gpu : !(resources[k] <= (ceiling?.[k] ?? 0))));
|
|
8770
|
+
if (over.length === 0) return void 0;
|
|
8771
|
+
return {
|
|
8772
|
+
cause: "unprovisionable-profile",
|
|
8773
|
+
detail: `resources ${over.map((k) => `${k}=${resources[k]}`).join(", ")} exceed this run's maxWorkerResources ${JSON.stringify(ceiling ?? {})}`
|
|
8774
|
+
};
|
|
8775
|
+
};
|
|
8776
|
+
}
|
|
8789
8777
|
// src/runtime/supervise/supervise-sql-admission.ts
|
|
8790
8778
|
/** What a SQL run context admits, in two phases: identity and worker seam before any compute (a
|
|
8791
8779
|
* synchronous configuration fault), then coordinator and retained-control capabilities at start. */
|
|
@@ -9036,13 +9024,15 @@ function managerDriverPlan(options, canonicalProfile, externalRoot) {
|
|
|
9036
9024
|
if (authoredSeatStages(canonicalProfile) && !hasCustomDriveHarness && !options.selectSeat) throw new ValidationError("supervise: AgentProfile.seats requires selectSeat before execution");
|
|
9037
9025
|
const automaticDriver = managerBackend !== void 0 && automaticDriverBackendSupported(managerBackend, options.coordination);
|
|
9038
9026
|
const spawnResourceRoot = hasCustomDriveHarness ? void 0 : rootSpawnResourceRoot(managerBackend);
|
|
9039
|
-
const
|
|
9027
|
+
const agentPreflight = composeSpawnPreflights(async (profile, context) => {
|
|
9040
9028
|
const external = isExternalSupervisor(profile);
|
|
9041
9029
|
const manager = declaredRuntimeToolNames(profile).length > 0 || external && authoredSeatStages(profile) !== void 0;
|
|
9042
9030
|
const custom = manager ? external && hasCustomDriveHarness : options.makeLeafAgent !== void 0;
|
|
9043
9031
|
const backend = manager ? external ? managerBackend : void 0 : options.backend;
|
|
9044
9032
|
return modelSettingsSpawnPreflight(options.makeWorkerAgent === void 0 && !custom, backend?.backend === "provider" ? "provider" : "router")?.(profile, context);
|
|
9045
|
-
}, profileToolSpawnPreflight(options.makeWorkerAgent === void 0, options.resolveSupervisorTools !== void 0), coordinationChannelSpawnPreflight(options.makeWorkerAgent === void 0, hasCustomDriveHarness, managerBackend, options.coordination), options.backend?.backend === "bridge" ? bridgeSpawnPreflight(options.backend) : void 0, options.backend?.backend === "provider" && typeof options.backend.provider === "object" ? providerSpawnPreflight(options.backend.provider) : void 0);
|
|
9033
|
+
}, profileToolSpawnPreflight(options.makeWorkerAgent === void 0, options.resolveSupervisorTools !== void 0), coordinationChannelSpawnPreflight(options.makeWorkerAgent === void 0, hasCustomDriveHarness, managerBackend, options.coordination), options.backend?.backend === "bridge" ? bridgeSpawnPreflight(options.backend) : void 0, options.backend?.backend === "provider" && typeof options.backend.provider === "object" ? providerSpawnPreflight(options.backend.provider) : void 0, resourceSpawnPreflight(options.backend));
|
|
9034
|
+
const checkNames = options.checkNodes?.names;
|
|
9035
|
+
const spawnPreflight = agentPreflight && checkNames ? (profile, context) => checkNames.includes(profile.name ?? "") && !profile.harness && !profile.model ? Promise.resolve(void 0) : agentPreflight(profile, context) : agentPreflight;
|
|
9046
9036
|
const driverMaterialization = hasCustomDriveHarness ? options.driveHarnessMaterialization ?? fullProfileMaterialization : managerBackend && automaticDriver ? backendProfileMaterialization(managerBackend) : void 0;
|
|
9047
9037
|
if (externalRoot && !hasCustomDriveHarness && !automaticDriver) throw new ValidationError(`supervise: external supervisor profile.harness=${JSON.stringify(canonicalProfile.harness)} requires a local bridge, a provider with authenticated coordination.publicUrl and runtime MCP attachments, or an explicit driveHarness with reachable coordination transport`);
|
|
9048
9038
|
return {
|
|
@@ -9409,4 +9399,4 @@ function superviseWithContext(profile, task, opts, brain) {
|
|
|
9409
9399
|
}
|
|
9410
9400
|
export { dumbContinuationPassPrompt as A, areaUnderCurve as B, defaultEdgeTraversalCap as C, createPromptRegistry as D, analyzesFindingsReportPrompt as E, allWorkersStalled as F, plateauLength as H, anyOf as I, noProgressFor as L, kernelPromptRegistry as M, naiveContinuationPrompt as N, delegatesWorkerBriefPrompt as O, promptHandle as P, plateau as R, validateFlowGraph as S, validateGraphTopology as T, renderAnytimeTable as U, bestSoFar as V, createSupervisorSpanRecorder as W, GraphRouteError as _, superviseRootProfile as a, journaledGateDecider as b, supervisorAgentWithTestBrain as c, composeReentryTask as d, serveCoordinationMcp as f, createGraphOverlay as g, runBrainLoop as h, profileGuidanceComposer as i, formatPromptHandle as j, dumbContinuationFailPrompt as k, runToolSpans as l, driverAgent as m, superviseFleetCapabilities as n, workerFromBackend as o, coordinationControlToolNames as p, superviseWithTestBrain as r, supervisorAgent as s, supervise as t, UNPROVEN_CONTINUITY as u, createFlowRun as v, graphRootProfile as w, routeFlowOf as x, flowRootProfile as y, anytimeReport as z };
|
|
9411
9401
|
|
|
9412
|
-
//# sourceMappingURL=supervise-
|
|
9402
|
+
//# sourceMappingURL=supervise-DWiSgPLB.js.map
|