@tangle-network/agent-runtime 0.339.0 → 0.340.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-CVSFxis9.js → activation-D2PVljaw.js} +4 -4
- package/dist/{activation-CVSFxis9.js.map → activation-D2PVljaw.js.map} +1 -1
- package/dist/{activation-CJIIl_Ey.d.ts → activation-DGDl4wwI.d.ts} +2 -2
- package/dist/agent.d.ts +4 -18
- package/dist/agent.js +3 -21
- package/dist/agent.js.map +1 -1
- package/dist/analyst-loop.d.ts +2 -2
- package/dist/{bundle-DVOhBTic.js → bundle-DNUq-OPW.js} +2 -2
- package/dist/{bundle-DVOhBTic.js.map → bundle-DNUq-OPW.js.map} +1 -1
- package/dist/candidate-execution/index.d.ts +2 -40
- package/dist/candidate-execution/index.js +9 -255
- package/dist/candidate-execution/index.js.map +1 -1
- package/dist/{delegate-CCWE_AkU.js → delegate-CtJIS-tp.js} +2 -2
- package/dist/{delegate-CCWE_AkU.js.map → delegate-CtJIS-tp.js.map} +1 -1
- package/dist/{driver-control-acknowledgers-C53ggdJ6.js → driver-control-acknowledgers-MTrs8HAF.js} +5 -5
- package/dist/driver-control-acknowledgers-MTrs8HAF.js.map +1 -0
- package/dist/durable.d.ts +1 -1
- package/dist/durable.js +5 -5
- package/dist/{graph-CI9JXKqO.js → graph-DfWqp_1e.js} +4 -4
- package/dist/{graph-CI9JXKqO.js.map → graph-DfWqp_1e.js.map} +1 -1
- package/dist/{improve-BOXTLWJ3.js → improve-CKRVQqzt.js} +6 -6
- package/dist/{improve-BOXTLWJ3.js.map → improve-CKRVQqzt.js.map} +1 -1
- package/dist/{improvement-adapter-HUt_-cWA.d.ts → improvement-adapter-sIthWkcN.d.ts} +2 -2
- package/dist/index.d.ts +6 -14
- package/dist/index.js +10 -10
- package/dist/intelligence.d.ts +4 -4
- package/dist/intelligence.js +6 -6
- package/dist/kernel.d.ts +3 -3
- package/dist/kernel.js +10 -10
- package/dist/{loop-runner-CWzG1bH4.d.ts → loop-runner-C4EWEcXf.d.ts} +3 -3
- package/dist/{loop-runner-pmPIHFVY.js → loop-runner-DNWbTcVm.js} +2 -2
- package/dist/{loop-runner-pmPIHFVY.js.map → loop-runner-DNWbTcVm.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 +3 -3
- package/dist/mcp/index.d.ts +1 -1
- package/dist/mcp/index.js +5 -5
- package/dist/placement.d.ts +2 -26
- package/dist/placement.js +1 -35
- package/dist/placement.js.map +1 -1
- package/dist/{prepare-bXkvPMJA.js → prepare-FzJoS68l.js} +3 -3
- package/dist/{prepare-bXkvPMJA.js.map → prepare-FzJoS68l.js.map} +1 -1
- package/dist/{profile-Dpei_Sq0.js → profile-DToH0XEs.js} +2 -2
- package/dist/{profile-Dpei_Sq0.js.map → profile-DToH0XEs.js.map} +1 -1
- package/dist/profile-materialization-bPm0gGLO.d.ts +49 -0
- package/dist/profiles.d.ts +1 -1
- package/dist/{protected-model-port-BGgpy2r9.d.ts → protected-model-port-DVVh-hEk.d.ts} +2 -6
- package/dist/{provision-supervisor-CJ6Zz6dz.js → provision-supervisor-DqvWXmAE.js} +4 -4
- package/dist/{provision-supervisor-CJ6Zz6dz.js.map → provision-supervisor-DqvWXmAE.js.map} +1 -1
- package/dist/{runtime-B2fjL9Oi.js → runtime-C55Zgo1R.js} +10 -10
- package/dist/{runtime-B2fjL9Oi.js.map → runtime-C55Zgo1R.js.map} +1 -1
- package/dist/{sandbox-profile-compat-BzVBFqrz.js → sandbox-profile-compat-DRr3JwDx.js} +2 -2
- package/dist/{sandbox-profile-compat-BzVBFqrz.js.map → sandbox-profile-compat-DRr3JwDx.js.map} +1 -1
- package/dist/{search-executor-zMumiak_.js → search-executor-ChOlRBgg.js} +3 -3
- package/dist/{search-executor-zMumiak_.js.map → search-executor-ChOlRBgg.js.map} +1 -1
- package/dist/{server-_4voDNrl.js → server-DkVBSN_S.js} +4 -4
- package/dist/{server-_4voDNrl.js.map → server-DkVBSN_S.js.map} +1 -1
- package/dist/{structural-rollout-DpLCXzaL.js → structural-rollout-C1LEk_zq.js} +3 -3
- package/dist/{structural-rollout-DpLCXzaL.js.map → structural-rollout-C1LEk_zq.js.map} +1 -1
- package/dist/{supervise-qAwXmPtD.js → supervise-CaUAxZZP.js} +86 -22
- package/dist/supervise-CaUAxZZP.js.map +1 -0
- package/dist/{supervisor-DHrUJhEZ.js → supervisor-VXuN2OHT.js} +29 -86
- package/dist/supervisor-VXuN2OHT.js.map +1 -0
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +13 -13
- package/dist/tui/index.d.ts +1 -1
- package/dist/tui/index.js +1 -1
- package/dist/{types-zWfqDjeL.d.ts → types-Cwrea-bU.d.ts} +2 -17
- package/dist/{types-CaOXqRTq.d.ts → types-DZ6L0Bv3.d.ts} +54 -58
- package/dist/workspace-store/index.d.ts +1 -82
- package/dist/workspace-store/index.js +1 -415
- package/dist/workspace-store/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/driver-control-acknowledgers-C53ggdJ6.js.map +0 -1
- package/dist/profile-materialization-B1wm2SPT.d.ts +0 -94
- package/dist/supervise-qAwXmPtD.js.map +0 -1
- package/dist/supervisor-DHrUJhEZ.js.map +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { n as assertNoSymlinkDescendant } from "./durable-file-gNI9ILAn.js";
|
|
2
|
-
import { $ as
|
|
2
|
+
import { $ as noteScopeRetainedOwnerCoordination, $n as CONTINUATIONS_DIR, $r as runtimeOwnedExecutorProviderEvidence, A as providerVisibleProfile, Ai as assertValidBudget, Ar as fullProfileMaterialization, At as toolResultText, B as recordScopeOwnerBarrenPause, Bn as classifyDriverFailure, Br as attestRuntimeOwnedScopeOwner, C as beginScopeOwnerAttempt, Ci as executorFailure, D as scopeOwnerExecutorNodeContext, Di as newUsageTotals, Dn as isPeerMailEnvelope, Dt as codeModeModelOutput, E as restoreScopeOwnerAcceptedExecution, Ei as meterUsageEvent, Er as assertProfileMaterialization, Et as codeModeArguments, Fn as isTerminalNodeStatus, G as consumeScopeRetainedOwnerResult, Gn as SeatChainExhaustedError, H as recordScopeOwnerPause, Hn as undispatchedCredentialExit, In as DriverAttemptsExhaustedError, Ir as sandboxProfileMaterialization, J as scopeRetainedOwnerResult, Jr as providerAttemptEvidence, K as prepareScopeRetainedOwnerTask, Kn as authoredSeatStages, Ln as HarnessTurnFailedError, Lr as unsupportedProfileDimensions, Mn as createActivityLog, Mr as promptControlProfileMaterialization, Mt as routerBrain, N as assertRecursiveReservationPolicy, Nr as promptModelProfileMaterialization, O as coordinationMcpAlias, Or as controlProfileMaterialization, Ot as createCodeModeTools, P as deriveNodeExecutionIdentity, Pn as isLiveNodeStatus, Pr as renderUnsupported, Pt as resolveAgentEnvironmentProvider, Q as scopeRetainedOwnerRestorePoint, Qr as runtimeOwnedExecutorMaterialization, R as meterRuntimeOwnedAccounting, Rn as abandonablePending, Rr as worktreeCliProfileMaterialization, Si as contentAddress, T as recordScopeOwnerMaterialization, U as prepareScopeRetainedOwnerSeatSwitch, Un as upstreamUnavailableSignal, V as recordScopeOwnerDriverAttempt, Vn as summarizeDriverAttempts, Vr as authoredAgentIdentity, W as abandonScopeRetainedOwnerInvocation, Wn as SeatChain, Wr as inheritRuntimeOwnedExecutorAttestation, X as scopeRetainedOwnerTurnEnded, Xn as gateOnDeliverable, Xr as runtimeOwnedDriveHarnessProviderEvidence, Xt as readHarnessTranscript, Y as beginScopeRetainedOwnerDrive, Yn as CheckUnavailableError, Yr as recordRuntimeOwnedDriveHarnessProviderEvidence, Yt as persistHarnessTranscript, Z as reconcileScopeRetainedOwnerEnvironment, Zr as runtimeOwnedExecutorExecutionBinding, _r as runAbortable, a as runTree, bn as createInbox, br as bridgeStopSignalKey, c as driverExecutorFactory, cn as createOtelExporter, cr as bridgeAdmissionRefusal, di as registerRetainedExecutorPreparation, ei as runtimeOwnedPendingExecutorMaterialization, er as admitContinuationPolicy, et as bindScopeRetainedOwnerEnvironmentId, fi as retainedExecutorSeamKey, ft as bindReusableExecutorExecutionId, gi as unavailableResumeAt, gr as linkAbort, hi as unavailablePauseMs, hr as RunCancellationReason, ht as snapshotExecutorConfig, i as runFinalizer, it as scopeRetainedOwnerJournalRoot, j as runtimeGraphMetadataKey, jr as profileMaterializationAxes$1, jt as createRouterTranscript, k as coordinationProfileToolPrefix, ki as spendFromUsageTotals, kr as defineProfileMaterializationContract, l as isDriverSpec, lr as bridgeModelRouteRefusal, m as parseWorkerToolTraceArtifact, mi as jitteredMs, mn as toOtelAttributes, mt as createExecutor, n as createSupervisor, nr as checkVerdictOf, nt as owners, o as createRootHandle, pi as cappedDoublingMs, pt as captureReusableExecutorConfig, q as scopeRetainedOwnerPriorSpend, qn as seatExecutionProfile, r as bestDelivered, rr as createContinuationKeeper, rt as scopeRetainedOwnerContext, s as driverChild, ti as runtimeOwnedScopeOwnerRuntime, tn as WORKER_TRACE_PROPAGATION, tr as bestComposite, tt as bindScopeRetainedOwnerProvider, ui as RetainedExecutionPendingError, un as generateSpanId, w as noteScopeOwnerPlannedExecution, wi as errMessage, wn as PEER_MAIL_WIRE_KEY, xi as detachedSnapshot, yn as INBOX_RECEIPT_KEY, yr as bridgeRuntimeAttachmentsKey, z as meterRuntimeOwnedProviderAttempt, zn as causedByPartialFailure } from "./supervisor-VXuN2OHT.js";
|
|
3
3
|
import { f as RuntimeRunStateError, i as ConfigError, m as ValidationError } from "./errors-DodWX-cb.js";
|
|
4
4
|
import { t as isRecord } from "./record-value-B6bwJxLa.js";
|
|
5
|
-
import {
|
|
5
|
+
import { K as chargedTokens, Ot as teardownExecutor, W as addSpend, X as errorMessage, _t as withBudgetResources, dt as withTimeout, et as isAsyncIterable$1, ft as zeroSpend, gt as resourceTelemetry, kt as teardownSurfaces, mt as addResourceSpend, nt as promptCacheTokenClasses, ot as sleep, ut as unmeteredSpend, xt as DEFAULT_SUCCESSFUL_SHUTDOWN_MS } from "./sandbox-profile-compat-DRr3JwDx.js";
|
|
6
6
|
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-CyCUwHed.js";
|
|
7
7
|
import { t as composeRuntimeHooks } from "./runtime-hooks-tXpAarhW.js";
|
|
8
8
|
import { a as readCommittedJsonLines, n as isNoEntError, r as prepareJsonlAppend } from "./jsonl-file-C9Kde_0Z.js";
|
|
9
|
-
import { _ as environmentReader, c as safeJsonText, d as coordinationVerbNames, f as createFileRunContext, i as createCoordinationToolsForManager, l as normalizeAnalyzeOnSettle, m as withRunContext, n as createSteerAcknowledger, p as createInMemoryRunContext, r as createCoordinationTools, s as budgetOverspendText, t as createCancelAcknowledger } from "./driver-control-acknowledgers-
|
|
9
|
+
import { _ as environmentReader, c as safeJsonText, d as coordinationVerbNames, f as createFileRunContext, i as createCoordinationToolsForManager, l as normalizeAnalyzeOnSettle, m as withRunContext, n as createSteerAcknowledger, p as createInMemoryRunContext, r as createCoordinationTools, s as budgetOverspendText, t as createCancelAcknowledger } from "./driver-control-acknowledgers-MTrs8HAF.js";
|
|
10
10
|
import { a as watchRunCancellation, i as readRunCancellation, o as writeRunCancellation, r as readRunCancelRequest, t as applyRunCancellation } from "./run-cancellation-C9oL62sW.js";
|
|
11
11
|
import { n as createStdioToolServer, t as PROTOCOL_VERSION } from "./tool-server-XV4aJwoQ.js";
|
|
12
12
|
import { c as loadGraph, i as graphRegistry } from "./graph-registry-BnO64cn8.js";
|
|
@@ -3123,21 +3123,26 @@ function driverAgent(opts) {
|
|
|
3123
3123
|
* the drive harness's fact, and the caller composes the re-entry task from it (see
|
|
3124
3124
|
* `./reentry.ts`). A continuation re-enters the same session only on a backend that proves it.
|
|
3125
3125
|
*
|
|
3126
|
-
* Progress
|
|
3127
|
-
* resets the barren failure counter decides
|
|
3128
|
-
* `continuation.maxBarren`
|
|
3129
|
-
*
|
|
3130
|
-
*
|
|
3131
|
-
*
|
|
3126
|
+
* Progress paces the continuations, and nothing else counts them. The same delivery reading that
|
|
3127
|
+
* resets the barren failure counter decides how soon a continued drive is re-entered: once
|
|
3128
|
+
* `continuation.maxBarren` re-entered drives in a row complete without progress, the loop PAUSES
|
|
3129
|
+
* before each further continuation, 5 minutes and doubling per barren drive up to 60, journals one
|
|
3130
|
+
* `barren-pause` row per pause for an operator alarm, and re-enters. A barren streak never ends the
|
|
3131
|
+
* run: the check, the deadline, the budget and cancellation do. Progress is a delivery or a rise
|
|
3132
|
+
* in the check's best composite, and it resets the streak and the backoff. There is no count cap
|
|
3133
|
+
* and no caller veto: the old prompt-owned loop logged 896 of 1,011 rounds with no progress, and
|
|
3134
|
+
* 650 recorded inputs chose seven different re-prompt counts. Measured 2026-10-21 on
|
|
3135
|
+
* magnetar-rust-20261021a: the barren bound settled a 48-hour run `no-winner` after 14.3 hours,
|
|
3136
|
+
* while its last two turns updated its pages and waited on its own 2^20 prove.
|
|
3132
3137
|
*
|
|
3133
3138
|
* A RE-ENTERED run is one this process resumed after an earlier process drove it, usually one
|
|
3134
3139
|
* that stopped without settling it. Its first drive is entered as `run-reentered` with the
|
|
3135
3140
|
* workers that were open, and a drive counts toward `maxBarren` only if it began after the root
|
|
3136
3141
|
* streamed a model event in this process: the drive that straddles the restart never counts, and
|
|
3137
|
-
* a root that speaks and then stays barren is
|
|
3142
|
+
* a root that speaks and then stays barren is paced as any other. Measured 2026-10-19 on
|
|
3138
3143
|
* magnetar-rust-20261019f: after a host reboot the re-entered root was first driven with the
|
|
3139
3144
|
* bare original task and no word of its three open workers, two barren continuations followed,
|
|
3140
|
-
* and the
|
|
3145
|
+
* and the barren bound of the time settled the run `no-result-selected`.
|
|
3141
3146
|
*
|
|
3142
3147
|
* A THIRD CLASS sits between the two: the upstream said "not now". A model provider's exhausted
|
|
3143
3148
|
* quota, a rate limit, or an overloaded service (HTTP 429, 503, 529, or the router's own codes for
|
|
@@ -3171,6 +3176,17 @@ const DEFAULT_MAX_ATTEMPTS = Number.POSITIVE_INFINITY;
|
|
|
3171
3176
|
const DEFAULT_INITIAL_BACKOFF_MS$1 = 2e3;
|
|
3172
3177
|
const DEFAULT_MAX_BACKOFF_MS$1 = 3e4;
|
|
3173
3178
|
const DEFAULT_TRANSIENT_OUTAGE_MS = 9e5;
|
|
3179
|
+
const BARREN_PAUSE_FIRST_MS = 5 * 6e4;
|
|
3180
|
+
const BARREN_PAUSE_MAX_MS = 60 * 6e4;
|
|
3181
|
+
/**
|
|
3182
|
+
* The pause before a continuation once `streak` re-entered drives in a row have completed without
|
|
3183
|
+
* progress: 5 minutes at `maxBarren`, doubling per further barren drive, 60 minutes at most.
|
|
3184
|
+
* Derived from the streak alone, so a progress reading resets the backoff with the streak. Not
|
|
3185
|
+
* jittered: a barren streak is one root's, not an outage that cut many drivers off together.
|
|
3186
|
+
*/
|
|
3187
|
+
function barrenPauseMs(streak, maxBarren) {
|
|
3188
|
+
return cappedDoublingMs(streak - maxBarren + 1, BARREN_PAUSE_FIRST_MS, BARREN_PAUSE_MAX_MS);
|
|
3189
|
+
}
|
|
3174
3190
|
/**
|
|
3175
3191
|
* The repeated-failure bound: attempts that each fail within {@link INSTANT_FAILURE_MS} with the
|
|
3176
3192
|
* same error, {@link REPEATED_FAILURE_LIMIT} or more in a row over at least
|
|
@@ -3233,7 +3249,7 @@ async function defaultSleep$1(ms, signal) {
|
|
|
3233
3249
|
* Run the driver until it completes WITH ITS CONTRACT MET, or until the budget, the deadline, an
|
|
3234
3250
|
* abort, a terminal error, or a ceiling stops it. Transient failures are retried. A drive that
|
|
3235
3251
|
* returns with its completion check unmet is re-entered with Runtime's continuation note until the
|
|
3236
|
-
* continuation's deadline
|
|
3252
|
+
* continuation's deadline, pausing first once `maxBarren` turns in a row made no progress. Throws
|
|
3237
3253
|
* `DriverAttemptsExhaustedError` (cause = the last real failure) when a FAILURE ends the loop; a
|
|
3238
3254
|
* completed drive returns, met contract or not, because deciding what an undelivered run is worth
|
|
3239
3255
|
* belongs to the finalizer, not to this loop.
|
|
@@ -3270,6 +3286,7 @@ async function runDriverWithRetry(run) {
|
|
|
3270
3286
|
let wakes = 0;
|
|
3271
3287
|
let reentry = run.reentered?.first;
|
|
3272
3288
|
let beforeModelEvent = false;
|
|
3289
|
+
let lastProgressAt = now();
|
|
3273
3290
|
const emit = async (record) => {
|
|
3274
3291
|
const entered = reentry === void 0 ? {} : { reentry: reentry.reason };
|
|
3275
3292
|
const stamped = {
|
|
@@ -3294,9 +3311,29 @@ async function runDriverWithRetry(run) {
|
|
|
3294
3311
|
const byBudget = budgetStop(run.budget(), now());
|
|
3295
3312
|
return byBudget === "deadline" || byBudget === "budget-exhausted" ? byBudget : void 0;
|
|
3296
3313
|
};
|
|
3297
|
-
if (barrenReentries >= policy.maxBarren) return { refusedBy: "no-progress" };
|
|
3298
3314
|
const before = bounds();
|
|
3299
3315
|
if (before !== void 0) return { refusedBy: before };
|
|
3316
|
+
let barren;
|
|
3317
|
+
if (barrenReentries >= policy.maxBarren) {
|
|
3318
|
+
const pausedAt = now();
|
|
3319
|
+
const budgetDeadline = run.budget().deadlineMs;
|
|
3320
|
+
const until = Math.min(policy.deadlineMs, budgetDeadline > 0 ? budgetDeadline : Number.POSITIVE_INFINITY);
|
|
3321
|
+
const pauseMs = Math.max(0, Math.min(barrenPauseMs(barrenReentries, policy.maxBarren), until - pausedAt));
|
|
3322
|
+
await run.onBarrenPause?.({
|
|
3323
|
+
attempt,
|
|
3324
|
+
streak: barrenReentries,
|
|
3325
|
+
pauseMs,
|
|
3326
|
+
resumeAt: new Date(pausedAt + pauseMs).toISOString(),
|
|
3327
|
+
lastProgressAt: new Date(lastProgressAt).toISOString()
|
|
3328
|
+
});
|
|
3329
|
+
await sleep(pauseMs, run.signal);
|
|
3330
|
+
barren = {
|
|
3331
|
+
streak: barrenReentries,
|
|
3332
|
+
pausedMs: pauseMs
|
|
3333
|
+
};
|
|
3334
|
+
const afterPause = bounds();
|
|
3335
|
+
if (afterPause !== void 0) return { refusedBy: afterPause };
|
|
3336
|
+
}
|
|
3300
3337
|
const steer = (await policy.compose({
|
|
3301
3338
|
attempt,
|
|
3302
3339
|
continuations,
|
|
@@ -3308,7 +3345,10 @@ async function runDriverWithRetry(run) {
|
|
|
3308
3345
|
const afterCompose = bounds();
|
|
3309
3346
|
if (afterCompose !== void 0) return { refusedBy: afterCompose };
|
|
3310
3347
|
if (steer.length === 0) throw new ValidationError("runDriverWithRetry: the continuation note is empty");
|
|
3311
|
-
return { steer }
|
|
3348
|
+
return barren === void 0 ? { steer } : {
|
|
3349
|
+
steer,
|
|
3350
|
+
barren
|
|
3351
|
+
};
|
|
3312
3352
|
};
|
|
3313
3353
|
for (let attempt = 1;; attempt += 1) {
|
|
3314
3354
|
const before = run.progress();
|
|
@@ -3326,7 +3366,10 @@ async function runDriverWithRetry(run) {
|
|
|
3326
3366
|
const classification = classifyDriverFailure(error, run.signal);
|
|
3327
3367
|
const after = run.progress();
|
|
3328
3368
|
const progressed = madeProgress(before, after);
|
|
3329
|
-
if (progressed)
|
|
3369
|
+
if (progressed) {
|
|
3370
|
+
abandonments = 0;
|
|
3371
|
+
lastProgressAt = now();
|
|
3372
|
+
}
|
|
3330
3373
|
const retainedFailure = error instanceof RetainedExecutionPendingError ? error : void 0;
|
|
3331
3374
|
const pending = abandonablePending(error);
|
|
3332
3375
|
const failureRecord = () => ({
|
|
@@ -3470,8 +3513,10 @@ async function runDriverWithRetry(run) {
|
|
|
3470
3513
|
const progressed = madeProgress(before, after);
|
|
3471
3514
|
const contract = contractOf(after);
|
|
3472
3515
|
const contractField = contract === "none" ? {} : { contract };
|
|
3473
|
-
if (progressed)
|
|
3474
|
-
|
|
3516
|
+
if (progressed) {
|
|
3517
|
+
barrenReentries = 0;
|
|
3518
|
+
lastProgressAt = now();
|
|
3519
|
+
} else if (!beforeModelEvent && reentry !== void 0 && reentry.reason !== "wake" && contract === "unmet") barrenReentries += 1;
|
|
3475
3520
|
const wait = run.wait;
|
|
3476
3521
|
if (wait !== void 0 && contract !== "met" && !(continuation?.closed() ?? false) && !run.signal.aborted && budgetStop(run.budget(), now()) === void 0 && wait.open()) {
|
|
3477
3522
|
const woken = await wait.wake(attempt + 1);
|
|
@@ -3503,12 +3548,14 @@ async function runDriverWithRetry(run) {
|
|
|
3503
3548
|
madeProgress: progressed,
|
|
3504
3549
|
...contractField,
|
|
3505
3550
|
reprompted: true,
|
|
3506
|
-
retryInMs: 0
|
|
3551
|
+
retryInMs: 0,
|
|
3552
|
+
...decision.barren === void 0 ? {} : { barrenPauseMs: decision.barren.pausedMs }
|
|
3507
3553
|
});
|
|
3508
3554
|
reentry = {
|
|
3509
3555
|
reason: "unmet-contract",
|
|
3510
3556
|
steer: decision.steer,
|
|
3511
|
-
continuation: continuations
|
|
3557
|
+
continuation: continuations,
|
|
3558
|
+
...decision.barren === void 0 ? {} : { barren: decision.barren }
|
|
3512
3559
|
};
|
|
3513
3560
|
continue;
|
|
3514
3561
|
}
|
|
@@ -3545,13 +3592,18 @@ function composeReentryTask(input) {
|
|
|
3545
3592
|
const { reentry, continuity, state } = input;
|
|
3546
3593
|
if (reentry.reason === "unmet-contract" && continuity.session === "continued") {
|
|
3547
3594
|
const changes = stateLines(state, false, input.tools);
|
|
3548
|
-
return [
|
|
3595
|
+
return [
|
|
3596
|
+
...barrenLines(reentry).flatMap((line) => [line, ""]),
|
|
3597
|
+
reentry.steer,
|
|
3598
|
+
...changes.length > 0 ? ["", ...changes] : []
|
|
3599
|
+
].join("\n");
|
|
3549
3600
|
}
|
|
3550
3601
|
if (reentry.reason === "wake" && continuity.session === "continued") return reentry.input;
|
|
3551
3602
|
return [
|
|
3552
3603
|
`You are re-entering a run that is already in progress (driver attempt ${input.attempt}). This is the same run and the same objective, not a new one.`,
|
|
3553
3604
|
whyLine(reentry),
|
|
3554
3605
|
environmentLine(continuity),
|
|
3606
|
+
...reentry.reason === "unmet-contract" ? barrenLines(reentry) : [],
|
|
3555
3607
|
"",
|
|
3556
3608
|
"## Objective",
|
|
3557
3609
|
"",
|
|
@@ -3601,6 +3653,17 @@ function whyLine(reentry) {
|
|
|
3601
3653
|
if (reentry.reason === "run-reentered") return restartLine(reentry);
|
|
3602
3654
|
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.`;
|
|
3603
3655
|
}
|
|
3656
|
+
/**
|
|
3657
|
+
* What a root re-entered after a barren pause is told: its last turns delivered nothing, and how
|
|
3658
|
+
* to wait on long work of its own instead of ending the turn. Measured 2026-10-21 on
|
|
3659
|
+
* magnetar-rust-20261021a: the root ended two turns to wait on its own 2^20 prove, and both
|
|
3660
|
+
* counted as barren.
|
|
3661
|
+
*/
|
|
3662
|
+
function barrenLines(reentry) {
|
|
3663
|
+
if (reentry.barren === void 0) return [];
|
|
3664
|
+
const minutes = Math.round(reentry.barren.pausedMs / 6e4);
|
|
3665
|
+
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.`, "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."];
|
|
3666
|
+
}
|
|
3604
3667
|
function restartLine(reentry) {
|
|
3605
3668
|
const replaced = new Set(reentry.replaced);
|
|
3606
3669
|
const gone = reentry.live.filter((id) => !replaced.has(id));
|
|
@@ -4612,7 +4675,8 @@ function buildSupervisorAgent(profile, deps, testBrain) {
|
|
|
4612
4675
|
madeProgress: record.madeProgress
|
|
4613
4676
|
});
|
|
4614
4677
|
await deps.onDriverAttempt?.(record);
|
|
4615
|
-
}
|
|
4678
|
+
},
|
|
4679
|
+
onBarrenPause: (pause) => recordScopeOwnerBarrenPause(scope, pause)
|
|
4616
4680
|
});
|
|
4617
4681
|
driverFailed = false;
|
|
4618
4682
|
} finally {
|
|
@@ -8468,4 +8532,4 @@ function superviseWithContext(profile, task, opts, brain) {
|
|
|
8468
8532
|
//#endregion
|
|
8469
8533
|
export { supervisorAgent as A, noProgressFor as B, delegatesWorkerBriefPrompt as C, kernelPromptRegistry as D, formatPromptHandle as E, runtimeFlowBrain as F, plateauLength as G, anytimeReport as H, runBrainLoop as I, readRootStreamReceipt as J, renderAnytimeTable as K, serveCoordinationMcp as L, UNPROVEN_CONTINUITY as M, composeReentryTask as N, naiveContinuationPrompt as O, driverAgent as P, allWorkersStalled as R, createPromptRegistry as S, dumbContinuationPassPrompt as T, areaUnderCurve as U, plateau as V, bestSoFar as W, createSupervisorSpanRecorder as Y, validateFlowGraph as _, superviseRootProfile as a, validateGraphTopology as b, retryPreSpawnRefusals as c, createGraphOverlay as d, GraphRouteError as f, routeFlowOf as g, journaledGateDecider as h, profileGuidanceComposer as i, supervisorAgentWithTestBrain as j, promptHandle as k, withWorkerSpawnRetry as l, flowRootProfile as m, superviseFleetCapabilities as n, isPreSpawnExecutorFailure as o, createFlowRun as p, readRootStream as q, superviseWithTestBrain as r, resolveWorkerSpawnRetry as s, supervise as t, workerFromBackend as u, defaultEdgeTraversalCap as v, dumbContinuationFailPrompt as w, analyzesFindingsReportPrompt as x, graphRootProfile as y, anyOf as z };
|
|
8470
8534
|
|
|
8471
|
-
//# sourceMappingURL=supervise-
|
|
8535
|
+
//# sourceMappingURL=supervise-CaUAxZZP.js.map
|