looply-cli 0.5.9 → 0.5.11
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/.src-hash +1 -1
- package/dist/account-failover.d.ts +30 -0
- package/dist/account-failover.d.ts.map +1 -0
- package/dist/account-failover.js +32 -0
- package/dist/account-failover.js.map +1 -0
- package/dist/autonomy-controller.d.ts +23 -1
- package/dist/autonomy-controller.d.ts.map +1 -1
- package/dist/autonomy-controller.js +50 -9
- package/dist/autonomy-controller.js.map +1 -1
- package/dist/autonomy-store.d.ts +33 -1
- package/dist/autonomy-store.d.ts.map +1 -1
- package/dist/autonomy-store.js +58 -8
- package/dist/autonomy-store.js.map +1 -1
- package/dist/autonomy-tick.d.ts +23 -1
- package/dist/autonomy-tick.d.ts.map +1 -1
- package/dist/autonomy-tick.js +80 -14
- package/dist/autonomy-tick.js.map +1 -1
- package/dist/bin.d.ts.map +1 -1
- package/dist/bin.js +25 -5
- package/dist/bin.js.map +1 -1
- package/dist/branch-delivery-wiring.d.ts.map +1 -1
- package/dist/branch-delivery-wiring.js +6 -1
- package/dist/branch-delivery-wiring.js.map +1 -1
- package/dist/branch-delivery.d.ts +135 -6
- package/dist/branch-delivery.d.ts.map +1 -1
- package/dist/branch-delivery.js +540 -80
- package/dist/branch-delivery.js.map +1 -1
- package/dist/branch-replay.d.ts +45 -0
- package/dist/branch-replay.d.ts.map +1 -0
- package/dist/branch-replay.js +123 -0
- package/dist/branch-replay.js.map +1 -0
- package/dist/commit-ownership.d.ts +102 -0
- package/dist/commit-ownership.d.ts.map +1 -0
- package/dist/commit-ownership.js +97 -0
- package/dist/commit-ownership.js.map +1 -0
- package/dist/coordinator-state.d.ts.map +1 -1
- package/dist/coordinator-state.js +21 -1
- package/dist/coordinator-state.js.map +1 -1
- package/dist/daemon-cmd.d.ts.map +1 -1
- package/dist/daemon-cmd.js +53 -4
- package/dist/daemon-cmd.js.map +1 -1
- package/dist/daemon.d.ts +10 -1
- package/dist/daemon.d.ts.map +1 -1
- package/dist/daemon.js +31 -5
- package/dist/daemon.js.map +1 -1
- package/dist/deliver-cmd.d.ts +18 -0
- package/dist/deliver-cmd.d.ts.map +1 -1
- package/dist/deliver-cmd.js +71 -5
- package/dist/deliver-cmd.js.map +1 -1
- package/dist/delivery-settings-cache.d.ts +15 -1
- package/dist/delivery-settings-cache.d.ts.map +1 -1
- package/dist/delivery-settings-cache.js +31 -3
- package/dist/delivery-settings-cache.js.map +1 -1
- package/dist/environment-hold.d.ts +69 -0
- package/dist/environment-hold.d.ts.map +1 -0
- package/dist/environment-hold.js +120 -0
- package/dist/environment-hold.js.map +1 -0
- package/dist/gate.d.ts.map +1 -1
- package/dist/gate.js +15 -1
- package/dist/gate.js.map +1 -1
- package/dist/github-api.d.ts +19 -0
- package/dist/github-api.d.ts.map +1 -1
- package/dist/github-api.js +26 -0
- package/dist/github-api.js.map +1 -1
- package/dist/goal-adaptive.d.ts +1 -0
- package/dist/goal-adaptive.d.ts.map +1 -1
- package/dist/goal-adaptive.js +26 -13
- package/dist/goal-adaptive.js.map +1 -1
- package/dist/goal-compile.d.ts +37 -0
- package/dist/goal-compile.d.ts.map +1 -1
- package/dist/goal-compile.js +25 -1
- package/dist/goal-compile.js.map +1 -1
- package/dist/goal-replay.d.ts +83 -0
- package/dist/goal-replay.d.ts.map +1 -0
- package/dist/goal-replay.js +121 -0
- package/dist/goal-replay.js.map +1 -0
- package/dist/goal-reproof.d.ts +5 -0
- package/dist/goal-reproof.d.ts.map +1 -1
- package/dist/goal-reproof.js +11 -4
- package/dist/goal-reproof.js.map +1 -1
- package/dist/grant-pause.d.ts +48 -0
- package/dist/grant-pause.d.ts.map +1 -0
- package/dist/grant-pause.js +103 -0
- package/dist/grant-pause.js.map +1 -0
- package/dist/grant-reconcile.d.ts +8 -2
- package/dist/grant-reconcile.d.ts.map +1 -1
- package/dist/grant-reconcile.js +9 -2
- package/dist/grant-reconcile.js.map +1 -1
- package/dist/grant-waiting-wiring.d.ts +49 -0
- package/dist/grant-waiting-wiring.d.ts.map +1 -0
- package/dist/grant-waiting-wiring.js +77 -0
- package/dist/grant-waiting-wiring.js.map +1 -0
- package/dist/model-transport.d.ts +13 -0
- package/dist/model-transport.d.ts.map +1 -1
- package/dist/model-transport.js +70 -9
- package/dist/model-transport.js.map +1 -1
- package/dist/planner-timeouts.d.ts +14 -0
- package/dist/planner-timeouts.d.ts.map +1 -0
- package/dist/planner-timeouts.js +51 -0
- package/dist/planner-timeouts.js.map +1 -0
- package/dist/provider-accounts-cmd.d.ts +58 -0
- package/dist/provider-accounts-cmd.d.ts.map +1 -0
- package/dist/provider-accounts-cmd.js +247 -0
- package/dist/provider-accounts-cmd.js.map +1 -0
- package/dist/provider-accounts.d.ts +157 -0
- package/dist/provider-accounts.d.ts.map +1 -0
- package/dist/provider-accounts.js +423 -0
- package/dist/provider-accounts.js.map +1 -0
- package/dist/provider-cmd.d.ts +3 -0
- package/dist/provider-cmd.d.ts.map +1 -1
- package/dist/provider-cmd.js +25 -0
- package/dist/provider-cmd.js.map +1 -1
- package/dist/provider-limit.d.ts +6 -0
- package/dist/provider-limit.d.ts.map +1 -1
- package/dist/provider-limit.js +12 -0
- package/dist/provider-limit.js.map +1 -1
- package/dist/provider-state.d.ts +3 -0
- package/dist/provider-state.d.ts.map +1 -1
- package/dist/provider-state.js +4 -1
- package/dist/provider-state.js.map +1 -1
- package/dist/run-cmd.d.ts +12 -1
- package/dist/run-cmd.d.ts.map +1 -1
- package/dist/run-cmd.js +187 -15
- package/dist/run-cmd.js.map +1 -1
- package/dist/run-refusal-marks.d.ts +7 -1
- package/dist/run-refusal-marks.d.ts.map +1 -1
- package/dist/run-refusal-marks.js +4 -0
- package/dist/run-refusal-marks.js.map +1 -1
- package/dist/server-client.d.ts +33 -2
- package/dist/server-client.d.ts.map +1 -1
- package/dist/server-client.js +33 -1
- package/dist/server-client.js.map +1 -1
- package/dist/spend-ledger.d.ts +7 -0
- package/dist/spend-ledger.d.ts.map +1 -1
- package/dist/spend-ledger.js +1 -0
- package/dist/spend-ledger.js.map +1 -1
- package/dist/start-attempts.d.ts +4 -2
- package/dist/start-attempts.d.ts.map +1 -1
- package/dist/start-attempts.js +6 -1
- package/dist/start-attempts.js.map +1 -1
- package/package.json +2 -2
package/dist/provider-limit.js
CHANGED
|
@@ -137,6 +137,18 @@ function waitingOutProviderLimits(invoke, deps) {
|
|
|
137
137
|
await say('stopped waiting for the usage limit — the run was told to stop');
|
|
138
138
|
return r;
|
|
139
139
|
}
|
|
140
|
+
let early = false;
|
|
141
|
+
try {
|
|
142
|
+
// Only before a repeat refusal: a reset that did not happen still waits the full fifteen minutes.
|
|
143
|
+
early = refusals === 1 && deps.readyEarly?.() === true;
|
|
144
|
+
}
|
|
145
|
+
catch {
|
|
146
|
+
/* an unreadable account state waits the full time */
|
|
147
|
+
}
|
|
148
|
+
if (early) {
|
|
149
|
+
await say('an AI account this work may use is available again — asking now');
|
|
150
|
+
break;
|
|
151
|
+
}
|
|
140
152
|
await deps.sleep(Math.min(exports.LIMIT_WAIT_SLICE_MS, until - deps.now()));
|
|
141
153
|
}
|
|
142
154
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider-limit.js","sourceRoot":"","sources":["../src/provider-limit.ts"],"names":[],"mappings":";;;AA4CA,0CAKC;AAGD,oCAEC;AAaD,0BA6BC;
|
|
1
|
+
{"version":3,"file":"provider-limit.js","sourceRoot":"","sources":["../src/provider-limit.ts"],"names":[],"mappings":";;;AA4CA,0CAKC;AAGD,oCAEC;AAaD,0BA6BC;AAsED,4DAyCC;AA/MD,qDAAsD;AAkCtD,8GAA8G;AACjG,QAAA,0BAA0B,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAC7D,+GAA+G;AAClG,QAAA,qBAAqB,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AACpD,kHAAkH;AACrG,QAAA,cAAc,GAAG,CAAC,GAAG,EAAE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CAAC;gBAClG,OAAO,CAAC,CAAC;YACX,CAAC;YACD,MAAM,GAAG,CAAC,GAAG,KAAK,CAAC,OAAO,oBAAoB,GAAG,CAAC,KAAK,CAAC,6EAA6E,CAAC,CAAC;YACvI,OAAO,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,EAAE,CAAC;gBAC1B,IAAI,MAAM,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;oBAC7B,MAAM,GAAG,CAAC,gEAAgE,CAAC,CAAC;oBAC5E,OAAO,CAAC,CAAC;gBACX,CAAC;gBACD,IAAI,KAAK,GAAG,KAAK,CAAC;gBAClB,IAAI,CAAC;oBACH,kGAAkG;oBAClG,KAAK,GAAG,QAAQ,KAAK,CAAC,IAAI,IAAI,CAAC,UAAU,EAAE,EAAE,KAAK,IAAI,CAAC;gBACzD,CAAC;gBAAC,MAAM,CAAC;oBACP,qDAAqD;gBACvD,CAAC;gBACD,IAAI,KAAK,EAAE,CAAC;oBACV,MAAM,GAAG,CAAC,iEAAiE,CAAC,CAAC;oBAC7E,MAAM;gBACR,CAAC;gBACD,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,2BAAmB,EAAE,KAAK,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;YACtE,CAAC;QACH,CAAC;IACH,CAAC,CAAC;AACJ,CAAC;AAED,SAAS,GAAG,CAAC,EAAU;IACrB,OAAO,IAAI,IAAI,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;AACpC,CAAC"}
|
package/dist/provider-state.d.ts
CHANGED
|
@@ -59,6 +59,8 @@ export declare function providerProfileDir(deps?: ProviderStateDeps): string;
|
|
|
59
59
|
export interface ProviderStateDeps {
|
|
60
60
|
/** The daemon's own home. Overridable so tests never touch the real one. */
|
|
61
61
|
home?: string;
|
|
62
|
+
/** A named account's profile (`provider-accounts.ts`); absent = the legacy single profile. */
|
|
63
|
+
profile?: string;
|
|
62
64
|
/** Overridable so a test can drive a fake `auth status`. */
|
|
63
65
|
run?: (exe: string, argv: readonly string[], env: Record<string, string>, timeoutMs: number) => string;
|
|
64
66
|
timeoutMs?: number;
|
|
@@ -76,6 +78,7 @@ export type ProviderAuthState = {
|
|
|
76
78
|
ok: true;
|
|
77
79
|
profile: string;
|
|
78
80
|
method: string;
|
|
81
|
+
plan?: string | null;
|
|
79
82
|
} | {
|
|
80
83
|
ok: false;
|
|
81
84
|
reason: 'unauthenticated';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider-state.d.ts","sourceRoot":"","sources":["../src/provider-state.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH;;;;;GAKG;AACH;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,CAE9E;AAED,wBAAgB,kBAAkB,CAAC,IAAI,GAAE,iBAAsB,GAAG,MAAM,CAEvE;AAED,MAAM,WAAW,iBAAiB;IAChC,4EAA4E;IAC5E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,4DAA4D;IAC5D,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;IACvG,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,iBAAiB,GACzB;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"provider-state.d.ts","sourceRoot":"","sources":["../src/provider-state.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACxE;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,WAAW,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAmBzE;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,MAAM,EAClB,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC3B,IAAI,GAAE,iBAAsB,GAC3B,iBAAiB,CAwFnB"}
|
package/dist/provider-state.js
CHANGED
|
@@ -94,7 +94,7 @@ function defaultRun(exe, argv, env, timeoutMs) {
|
|
|
94
94
|
* consumed is a boolean and a method name.
|
|
95
95
|
*/
|
|
96
96
|
function checkProviderAuth(executable, env, deps = {}) {
|
|
97
|
-
const profile = providerProfileDir(deps);
|
|
97
|
+
const profile = deps.profile ?? providerProfileDir(deps);
|
|
98
98
|
// Created rather than required: an empty profile is a profile the operator
|
|
99
99
|
// can log into, and refusing before it exists helps nobody.
|
|
100
100
|
try {
|
|
@@ -178,6 +178,9 @@ function checkProviderAuth(executable, env, deps = {}) {
|
|
|
178
178
|
ok: true,
|
|
179
179
|
profile,
|
|
180
180
|
method: typeof parsed.authMethod === 'string' ? parsed.authMethod : 'unknown',
|
|
181
|
+
// The plan's NAME only (pro, max, team, enterprise), to tell a personal
|
|
182
|
+
// subscription from a shareable one. Never the email or organisation.
|
|
183
|
+
plan: typeof parsed.subscriptionType === 'string' ? parsed.subscriptionType.slice(0, 20).toLowerCase() : null,
|
|
181
184
|
};
|
|
182
185
|
}
|
|
183
186
|
//# sourceMappingURL=provider-state.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider-state.js","sourceRoot":"","sources":["../src/provider-state.ts"],"names":[],"mappings":";;AA8DA,sDAEC;AAED,gDAEC;
|
|
1
|
+
{"version":3,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,IAAI,MAAgF,CAAC;IACrF,IAAI,CAAC;QACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAA6E,CAAC;IACvG,CAAC;IAAC,MAAM,CAAC;QACP,OAAO;YACL,EAAE,EAAE,KAAK;YACT,MAAM,EAAE,mBAAmB;YAC3B,OAAO;YACP,sEAAsE;YACtE,oDAAoD;YACpD,OAAO,EAAE,wCAAwC,GAAG,CAAC,MAAM,SAAS;SACrE,CAAC;IACJ,CAAC;IACD,IAAI,MAAM,CAAC,QAAQ,KAAK,IAAI,EAAE,CAAC;QAC7B,OAAO;YACL,EAAE,EAAE,KAAK;YACT,MAAM,EAAE,iBAAiB;YACzB,OAAO;YACP,OAAO,EACL,uDAAuD;gBACvD,qBAAqB,OAAO,KAAK,UAAU,cAAc;SAC5D,CAAC;IACJ,CAAC;IACD,OAAO;QACL,EAAE,EAAE,IAAI;QACR,OAAO;QACP,MAAM,EAAE,OAAO,MAAM,CAAC,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS;QAC7E,wEAAwE;QACxE,sEAAsE;QACtE,IAAI,EAAE,OAAO,MAAM,CAAC,gBAAgB,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,IAAI;KAC9G,CAAC;AACJ,CAAC"}
|
package/dist/run-cmd.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { type RepairContext, type RunSummary } from './round-runner';
|
|
|
6
6
|
import type { AnsweredQuestionView, PartialQuestionBody } from '@looply/core';
|
|
7
7
|
import { type ApprovalResolutionContext } from './approval-resolution';
|
|
8
8
|
import { type RepositorySpan } from '@looply/core';
|
|
9
|
+
import type { EnvironmentCode } from '@looply/core';
|
|
9
10
|
import { type GovernedActionResultContext } from './governed-run';
|
|
10
11
|
/**
|
|
11
12
|
* The composition root for `looply run`.
|
|
@@ -154,6 +155,11 @@ export declare class RunRefused extends Error {
|
|
|
154
155
|
* the mark so the daemon can settle the pursuit with facts, not a sentence.
|
|
155
156
|
*/
|
|
156
157
|
readonly delivery?: RunDelivery | undefined;
|
|
158
|
+
/**
|
|
159
|
+
* Which machine fault, on an `environment` refusal only — carried to the mark so the
|
|
160
|
+
* controller's hold names it (`environment-hold.ts`).
|
|
161
|
+
*/
|
|
162
|
+
readonly environment?: EnvironmentCode | undefined;
|
|
157
163
|
/**
|
|
158
164
|
* The same refusal, for a machine.
|
|
159
165
|
*
|
|
@@ -178,7 +184,12 @@ export declare class RunRefused extends Error {
|
|
|
178
184
|
* delivering run, the commit, and each required step's outcome. Carried to
|
|
179
185
|
* the mark so the daemon can settle the pursuit with facts, not a sentence.
|
|
180
186
|
*/
|
|
181
|
-
delivery?: RunDelivery | undefined
|
|
187
|
+
delivery?: RunDelivery | undefined,
|
|
188
|
+
/**
|
|
189
|
+
* Which machine fault, on an `environment` refusal only — carried to the mark so the
|
|
190
|
+
* controller's hold names it (`environment-hold.ts`).
|
|
191
|
+
*/
|
|
192
|
+
environment?: EnvironmentCode | undefined);
|
|
182
193
|
}
|
|
183
194
|
/** What `looply run` exits with when it refuses for good. */
|
|
184
195
|
export declare const EXIT_REFUSED = 3;
|
package/dist/run-cmd.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-cmd.d.ts","sourceRoot":"","sources":["../src/run-cmd.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAOvD,OAAO,EAGL,KAAK,cAAc,EAKnB,KAAK,IAAI,EAaT,KAAK,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAc,KAAK,YAAY,EAAE,MAAM,UAAU,CAAC;AACzD,OAAO,EAA6B,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":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A;KAAE,CAAC,CAAC;IAChF,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAAC;CACnF;AAiID;;;GAGG;AACH,wBAAsB,OAAO,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAskInE"}
|
package/dist/run-cmd.js
CHANGED
|
@@ -31,6 +31,8 @@ const untrusted_gate_1 = require("./untrusted-gate");
|
|
|
31
31
|
const model_transport_1 = require("./model-transport");
|
|
32
32
|
const agent_envelope_1 = require("./agent-envelope");
|
|
33
33
|
const provider_limit_1 = require("./provider-limit");
|
|
34
|
+
const account_failover_1 = require("./account-failover");
|
|
35
|
+
const provider_accounts_1 = require("./provider-accounts");
|
|
34
36
|
const rejected_evidence_1 = require("./rejected-evidence");
|
|
35
37
|
const owned_children_1 = require("./owned-children");
|
|
36
38
|
const verify_cmd_1 = require("./verify-cmd");
|
|
@@ -61,9 +63,13 @@ const programme_mode_1 = require("./programme-mode");
|
|
|
61
63
|
const partial_asker_1 = require("./partial-asker");
|
|
62
64
|
const goal_ownership_1 = require("./goal-ownership");
|
|
63
65
|
const goal_compile_1 = require("./goal-compile");
|
|
66
|
+
const planner_timeouts_1 = require("./planner-timeouts");
|
|
64
67
|
const plan_recovery_1 = require("./plan-recovery");
|
|
65
68
|
const goal_execution_evidence_1 = require("./goal-execution-evidence");
|
|
66
69
|
const goal_reproof_1 = require("./goal-reproof");
|
|
70
|
+
const goal_replay_1 = require("./goal-replay");
|
|
71
|
+
const branch_replay_1 = require("./branch-replay");
|
|
72
|
+
const run_base_2 = require("./run-base");
|
|
67
73
|
const round_records_1 = require("./round-records");
|
|
68
74
|
const goal_gap_1 = require("./goal-gap");
|
|
69
75
|
const goal_adaptive_1 = require("./goal-adaptive");
|
|
@@ -126,6 +132,7 @@ class RunRefused extends Error {
|
|
|
126
132
|
code;
|
|
127
133
|
branch;
|
|
128
134
|
delivery;
|
|
135
|
+
environment;
|
|
129
136
|
/**
|
|
130
137
|
* The same refusal, for a machine.
|
|
131
138
|
*
|
|
@@ -150,11 +157,17 @@ class RunRefused extends Error {
|
|
|
150
157
|
* delivering run, the commit, and each required step's outcome. Carried to
|
|
151
158
|
* the mark so the daemon can settle the pursuit with facts, not a sentence.
|
|
152
159
|
*/
|
|
153
|
-
delivery
|
|
160
|
+
delivery,
|
|
161
|
+
/**
|
|
162
|
+
* Which machine fault, on an `environment` refusal only — carried to the mark so the
|
|
163
|
+
* controller's hold names it (`environment-hold.ts`).
|
|
164
|
+
*/
|
|
165
|
+
environment) {
|
|
154
166
|
super(message);
|
|
155
167
|
this.code = code;
|
|
156
168
|
this.branch = branch;
|
|
157
169
|
this.delivery = delivery;
|
|
170
|
+
this.environment = environment;
|
|
158
171
|
}
|
|
159
172
|
}
|
|
160
173
|
exports.RunRefused = RunRefused;
|
|
@@ -1022,6 +1035,9 @@ async function runLoop(opts) {
|
|
|
1022
1035
|
* ⚠️ AN ARROW, for the same flow-analysis reason as `recordDelivery` below.
|
|
1023
1036
|
*/
|
|
1024
1037
|
const deliveringBranch = async () => {
|
|
1038
|
+
// The branch this goal's work was REBUILT onto, when it was: that is the tree that was proved.
|
|
1039
|
+
if (rebuiltAs !== null)
|
|
1040
|
+
return rebuiltAs.branch;
|
|
1025
1041
|
if (deliveringRunId === null)
|
|
1026
1042
|
return branch;
|
|
1027
1043
|
const cut = (0, run_delivery_1.deliveringBranchOf)((0, lane_claims_1.readLaneClaims)(cwd), deliveringRunId);
|
|
@@ -2579,7 +2595,41 @@ async function runLoop(opts) {
|
|
|
2579
2595
|
}
|
|
2580
2596
|
},
|
|
2581
2597
|
};
|
|
2582
|
-
|
|
2598
|
+
/**
|
|
2599
|
+
* SEVERAL AI ACCOUNTS ON THIS MACHINE (`provider-accounts.ts`): each call
|
|
2600
|
+
* uses the first account its owners allowed for this project, role and
|
|
2601
|
+
* requester; a usage limit rests that account and the same prompt goes AT
|
|
2602
|
+
* ONCE to the next allowed one (`failingOverAccounts`). Only when none is
|
|
2603
|
+
* left does the run wait, as before — and that wait ends early when an
|
|
2604
|
+
* allowed account wakes first.
|
|
2605
|
+
*/
|
|
2606
|
+
const boundGoal = opts.goalId === undefined ? undefined : goals.get(opts.goalId);
|
|
2607
|
+
const accountScope = {
|
|
2608
|
+
projectId: projectId === 'local' ? null : projectId,
|
|
2609
|
+
requesterRef: (0, provider_accounts_1.requesterRefOf)(boundGoal),
|
|
2610
|
+
};
|
|
2611
|
+
const withFinalMessage = (invoke, role = 'implementer') => builtIn
|
|
2612
|
+
? (0, agent_envelope_1.unwrapping)((0, provider_limit_1.waitingOutProviderLimits)(invoke, {
|
|
2613
|
+
...limitWait,
|
|
2614
|
+
readyEarly: () => {
|
|
2615
|
+
const c = (0, provider_accounts_1.chooseAccountForCall)({ role, ...accountScope, now: Date.now() });
|
|
2616
|
+
return c.kind === 'account' && !c.resting;
|
|
2617
|
+
},
|
|
2618
|
+
}))
|
|
2619
|
+
: invoke;
|
|
2620
|
+
const pooled = (role) => {
|
|
2621
|
+
let last = null;
|
|
2622
|
+
const inner = (0, model_transport_1.makeMediatedAgentRunner)(cwd, role, resolved.spec, { runId, ...wireFormat, ...lend, accountScope, onAccount: (n) => (last = n) }, children);
|
|
2623
|
+
return withFinalMessage(builtIn
|
|
2624
|
+
? (0, account_failover_1.failingOverAccounts)(inner, {
|
|
2625
|
+
now: () => Date.now(),
|
|
2626
|
+
lastAccount: () => last,
|
|
2627
|
+
another: (except) => (0, provider_accounts_1.anotherAccountUsable)({ role, ...accountScope, now: Date.now(), except }),
|
|
2628
|
+
log,
|
|
2629
|
+
...(limitWait.announce === undefined ? {} : { announce: limitWait.announce }),
|
|
2630
|
+
})
|
|
2631
|
+
: inner, role);
|
|
2632
|
+
};
|
|
2583
2633
|
/**
|
|
2584
2634
|
* 🔴 THE OTHER REPOSITORIES THIS GOAL'S CHANGE SPANS, LENT READ-ONLY.
|
|
2585
2635
|
*
|
|
@@ -2618,7 +2668,7 @@ async function runLoop(opts) {
|
|
|
2618
2668
|
log(`sibling : ${r.label} (${r.projectId}) — ${r.path === null ? 'not available on this machine' : `read-only at ${r.path}`}`);
|
|
2619
2669
|
}
|
|
2620
2670
|
const lend = lentSiblings.mounts.length === 0 ? {} : { siblings: lentSiblings.mounts };
|
|
2621
|
-
const agent =
|
|
2671
|
+
const agent = pooled('implementer');
|
|
2622
2672
|
/**
|
|
2623
2673
|
* 🔴 THE VERIFIER GETS THE VERIFIER'S TOOLS — AND A RUN USED TO LEND IT
|
|
2624
2674
|
* THE IMPLEMENTER'S.
|
|
@@ -2638,7 +2688,7 @@ async function runLoop(opts) {
|
|
|
2638
2688
|
* ⚠️ `runId` TRAVELS WITH IT TOO, so verify-pass invocations are still
|
|
2639
2689
|
* attributed to this run and settled with everything else it spent.
|
|
2640
2690
|
*/
|
|
2641
|
-
const verifyAgent =
|
|
2691
|
+
const verifyAgent = pooled('verifier');
|
|
2642
2692
|
/**
|
|
2643
2693
|
* 🔴 PLANNING GETS THE PLANNER'S TOOLS. Compiling a goal and evaluating a
|
|
2644
2694
|
* goal gap both READ the codebase and produce a plan; neither edits anything.
|
|
@@ -2653,7 +2703,7 @@ async function runLoop(opts) {
|
|
|
2653
2703
|
* `runId` travels with it, so planning invocations stay attributed to this
|
|
2654
2704
|
* run and are settled with everything else it spent.
|
|
2655
2705
|
*/
|
|
2656
|
-
const planAgent =
|
|
2706
|
+
const planAgent = pooled('brain');
|
|
2657
2707
|
/**
|
|
2658
2708
|
* 🔴 THE PROVER GETS THE PROVER'S TOOLS — THE SAME NARROWING AS THE TWO
|
|
2659
2709
|
* ABOVE, AND THE ONE THAT WAS MISSED.
|
|
@@ -2664,7 +2714,7 @@ async function runLoop(opts) {
|
|
|
2664
2714
|
* 2026-09-24: the bridge was launched as `implementer` for the proving turn,
|
|
2665
2715
|
* and its spend was booked as implementer spend. See `TOOL_POLICIES.prover`.
|
|
2666
2716
|
*/
|
|
2667
|
-
const proveAgent =
|
|
2717
|
+
const proveAgent = pooled('prover');
|
|
2668
2718
|
/**
|
|
2669
2719
|
* A goal with nothing to work on compiles itself some work.
|
|
2670
2720
|
*
|
|
@@ -2766,7 +2816,31 @@ async function runLoop(opts) {
|
|
|
2766
2816
|
* would put sixty minutes of verifier inside a sixty-minute window. They draw
|
|
2767
2817
|
* from one budget instead.
|
|
2768
2818
|
*/
|
|
2769
|
-
|
|
2819
|
+
/**
|
|
2820
|
+
* THE PLANNING TIER (`goal-compile.ts`, COMPILE_TIERS): after a timed-out planning of this goal
|
|
2821
|
+
* version, a longer limit and a smaller plan, so the worst case stays inside the window. The
|
|
2822
|
+
* verify budget shrinks with the plan — that is what pays for the longer compile.
|
|
2823
|
+
*/
|
|
2824
|
+
// PROJECT-scoped: a goal's next Start may be placed in another checkout, and must still know.
|
|
2825
|
+
const plannedTimeouts = binding.kind === 'bound' ? (0, planner_timeouts_1.plannerTimeoutsFor)(projectStateDirPath, `${binding.goal.id}@${binding.goal.version}`) : 0;
|
|
2826
|
+
const compileTier = (0, goal_compile_1.compileTierFor)(plannedTimeouts);
|
|
2827
|
+
const adaptiveTier = (0, goal_compile_1.compileTierFor)(plannedTimeouts, goal_compile_1.ADAPTIVE_COMPILE_TIERS);
|
|
2828
|
+
let compileTimedOut = false;
|
|
2829
|
+
/**
|
|
2830
|
+
* A PLANNER THAT RAN OUT OF TIME IS THE MACHINE'S LIMIT, NOT THE GOAL'S FAULT: the run leaves
|
|
2831
|
+
* with `environment` / `planner_timeout`, so the controller voids this Start (it costs no try),
|
|
2832
|
+
* and the timeout is counted so the next Start plans with the next tier. Null when no planning
|
|
2833
|
+
* timed out in this run — the exit is then whatever it was.
|
|
2834
|
+
*/
|
|
2835
|
+
const plannerTimedOut = (message) => {
|
|
2836
|
+
if (!compileTimedOut || binding.kind !== 'bound')
|
|
2837
|
+
return null;
|
|
2838
|
+
const n = (0, planner_timeouts_1.notePlannerTimeout)(projectStateDirPath, `${binding.goal.id}@${binding.goal.version}`);
|
|
2839
|
+
const next = (0, goal_compile_1.compileTierFor)(n);
|
|
2840
|
+
return new RunRefused(`${message} — planning took longer than its limit; the next Start plans with ${Math.round(next.timeoutMs / 60000)} minutes ` +
|
|
2841
|
+
`for at most ${next.maxSteps} steps, and this Start does not count`, 'environment', undefined, undefined, 'planner_timeout');
|
|
2842
|
+
};
|
|
2843
|
+
let verifyBudget = Math.min(verify_cmd_2.VERIFY_MAX_PER_RUN, compileTier.maxSteps);
|
|
2770
2844
|
/**
|
|
2771
2845
|
* EVERYTHING A START DOES BEFORE THE RUN, under one guard.
|
|
2772
2846
|
*
|
|
@@ -2846,6 +2920,10 @@ async function runLoop(opts) {
|
|
|
2846
2920
|
let deliveringRunId = null;
|
|
2847
2921
|
// L4b: the commit key 2 confirmed HEAD on, beside the run that delivered it.
|
|
2848
2922
|
let deliveringSha = null;
|
|
2923
|
+
/** This goal's work, rebuilt onto the base for the goal check (`goal-replay.ts`), when it was. */
|
|
2924
|
+
let rebuiltAs = null;
|
|
2925
|
+
/** Why it could not be rebuilt, when that was tried and failed: what the next revision plans around. */
|
|
2926
|
+
let replayTrouble = null;
|
|
2849
2927
|
/** F27: the tree this Start's evaluator judged, when a programme moved HEAD to the tree the lane holds. */
|
|
2850
2928
|
let judged = { kind: 'as-is', because: 'no goal-met check ran' };
|
|
2851
2929
|
/** The first compile's authority answer, kept so its reason is the acted-on one. */
|
|
@@ -2891,11 +2969,16 @@ async function runLoop(opts) {
|
|
|
2891
2969
|
checks: config.gates.map((g) => g.name),
|
|
2892
2970
|
}),
|
|
2893
2971
|
}, {
|
|
2894
|
-
compile: (i) =>
|
|
2972
|
+
compile: async (i) => {
|
|
2973
|
+
const out = await (0, goal_compile_1.compileGoal)(i, { invoke: planAgent, timeoutMs: compileTier.timeoutMs, maxSteps: compileTier.maxSteps });
|
|
2974
|
+
if (!out.ok && out.failure === 'timed-out')
|
|
2975
|
+
compileTimedOut = true;
|
|
2976
|
+
return out;
|
|
2977
|
+
},
|
|
2895
2978
|
// M3-2: checked at the committed tree before any step becomes an item; the compile recorded either way.
|
|
2896
2979
|
check: (steps) => (0, compile_check_1.checkCompiledPlan)(steps, compileReaders, compiledAt),
|
|
2897
2980
|
log: (line) => log(`compile : ${line}`),
|
|
2898
|
-
},
|
|
2981
|
+
}, compileTier.maxSteps);
|
|
2899
2982
|
// A step whose citation did not hold is re-planned, an empty plan is asked again as an instruction,
|
|
2900
2983
|
// and only then does a ticket get one direct step (`plan-recovery.ts`) — never a hand-back.
|
|
2901
2984
|
const compiled = recovered.compiled;
|
|
@@ -3157,6 +3240,53 @@ async function runLoop(opts) {
|
|
|
3157
3240
|
}
|
|
3158
3241
|
log(`goal : judging ${(0, goal_met_target_1.describeTarget)(judged)}`);
|
|
3159
3242
|
}
|
|
3243
|
+
/**
|
|
3244
|
+
* THE CODE MOVED AWAY FROM THIS GOAL'S WORK: REBUILD IT ONTO THE BASE, THEN JUDGE THAT TREE
|
|
3245
|
+
* (`goal-replay.ts`, owner ruling 2026-10-16). In a checkout Looply made, when HEAD holds none
|
|
3246
|
+
* of this plan's commits, they are replayed onto the base as a fresh run branch BEFORE the
|
|
3247
|
+
* evaluator looks — so the verdict and the gates are about the same tree, and the branch holds
|
|
3248
|
+
* only this goal's work. A replay that does not apply puts HEAD back; KEY 2 then plans what is
|
|
3249
|
+
* missing instead of refusing (`replan`).
|
|
3250
|
+
*/
|
|
3251
|
+
if (judged.kind === 'as-is' && (0, reaper_1.hasProvisionedMarker)(cwd)) {
|
|
3252
|
+
const rounds = await (0, round_records_1.readRoundRecords)(stateDir, ledger_store_1.nodeLedgerFs);
|
|
3253
|
+
if (rounds.ok) {
|
|
3254
|
+
const committed = (0, goal_execution_evidence_1.committedShasOf)({ scope: askedScope, items: owned, rounds: rounds.rounds });
|
|
3255
|
+
const aligned = await (0, goal_replay_1.alignWithOwnWork)({
|
|
3256
|
+
headSha: () => git.headSha(),
|
|
3257
|
+
changedPaths: () => git.changedPaths(),
|
|
3258
|
+
isAncestor: (a, of) => git.isAncestor(a, of),
|
|
3259
|
+
baseRef: async () => (await (0, run_base_2.resolveBaseBranch)(git, config.run.baseBranch).catch(() => null))?.ref ?? null,
|
|
3260
|
+
commitOf: (ref) => git.commitOf(ref),
|
|
3261
|
+
// The same patch replay the delivery rebuild uses: never a 3-way merge (`branch-replay.ts`).
|
|
3262
|
+
replay: (base, shas) => (0, branch_replay_1.replayOnto)((0, git_driver_1.nodeGitExec)(cwd), (dir) => (0, git_driver_1.nodeGitExec)(dir), base, shas),
|
|
3263
|
+
commitsBetween: async (base, sha) => (await (0, git_driver_1.nodeGitExec)(cwd)(['rev-list', '--reverse', `${base}..${sha}`])).stdout.split(/\r?\n/).filter((l) => l.trim() !== ''),
|
|
3264
|
+
createBranch: (name, from) => git.createBranch(name, from),
|
|
3265
|
+
}, { committed, branch: `${branch}-rebuilt`, aliases: (0, goal_replay_1.replayedAs)(projectStateDirPath, goalId) });
|
|
3266
|
+
if (aligned.kind === 'rebuilt') {
|
|
3267
|
+
(0, goal_replay_1.recordReplay)(projectStateDirPath, goalId, aligned.picked);
|
|
3268
|
+
(0, run_base_1.writeCheckoutGoal)(stateDir, { goalId, branch: aligned.branch, at: new Date().toISOString() });
|
|
3269
|
+
(0, lane_claims_1.recordLaneClaim)(cwd, {
|
|
3270
|
+
schema: lane_claims_1.LANE_CLAIMS_SCHEMA,
|
|
3271
|
+
kind: 'claims',
|
|
3272
|
+
at: new Date().toISOString(),
|
|
3273
|
+
branch: aligned.branch,
|
|
3274
|
+
runId,
|
|
3275
|
+
goalId,
|
|
3276
|
+
goalVersion: bound.version,
|
|
3277
|
+
planRevision: revision,
|
|
3278
|
+
servings: [],
|
|
3279
|
+
workspace: cwd,
|
|
3280
|
+
});
|
|
3281
|
+
rebuiltAs = { branch: aligned.branch, head: aligned.head };
|
|
3282
|
+
log(`goal : this goal's ${committed.length} commit(s) were not in the tree here — rebuilt onto ${aligned.base} as ${aligned.branch}; judging that`);
|
|
3283
|
+
}
|
|
3284
|
+
else if (aligned.kind === 'failed') {
|
|
3285
|
+
replayTrouble = aligned.because;
|
|
3286
|
+
log(`goal : ${aligned.because}`);
|
|
3287
|
+
}
|
|
3288
|
+
}
|
|
3289
|
+
}
|
|
3160
3290
|
adaptive = await (0, goal_adaptive_1.decideAdaptive)({
|
|
3161
3291
|
goalId: scope.goalId,
|
|
3162
3292
|
goalVersion: bound.version,
|
|
@@ -3197,10 +3327,19 @@ async function runLoop(opts) {
|
|
|
3197
3327
|
compile: async (i, maxSteps) => {
|
|
3198
3328
|
const at = await git.headTreeSha().catch(() => null);
|
|
3199
3329
|
const recovered = await (0, plan_recovery_1.compileWithRecovery)(i, {
|
|
3200
|
-
compile: (j) =>
|
|
3330
|
+
compile: async (j) => {
|
|
3331
|
+
const out = await (0, goal_compile_1.compileGoal)(j, {
|
|
3332
|
+
invoke: planAgent,
|
|
3333
|
+
maxSteps: Math.min(maxSteps, adaptiveTier.maxSteps),
|
|
3334
|
+
timeoutMs: adaptiveTier.timeoutMs,
|
|
3335
|
+
});
|
|
3336
|
+
if (!out.ok && out.failure === 'timed-out')
|
|
3337
|
+
compileTimedOut = true;
|
|
3338
|
+
return out;
|
|
3339
|
+
},
|
|
3201
3340
|
check: (steps) => (0, compile_check_1.checkCompiledPlan)(steps, compileReaders, at),
|
|
3202
3341
|
log: (line) => log(`goal : ${line}`),
|
|
3203
|
-
}, maxSteps);
|
|
3342
|
+
}, Math.min(maxSteps, adaptiveTier.maxSteps));
|
|
3204
3343
|
return recovered.compiled;
|
|
3205
3344
|
},
|
|
3206
3345
|
changedPaths: () => git.changedPaths(),
|
|
@@ -3236,16 +3375,47 @@ async function runLoop(opts) {
|
|
|
3236
3375
|
*/
|
|
3237
3376
|
if (!confirmed.ok && confirmed.moved === true && judged.kind !== 'carried') {
|
|
3238
3377
|
log('goal : the code moved on since this plan was delivered — running the gates again at the current tree');
|
|
3378
|
+
let reproofVerdict = null;
|
|
3239
3379
|
const again = await (0, goal_reproof_1.reproveAtHead)(head, (0, goal_execution_evidence_1.committedShasOf)(key2Input), {
|
|
3240
3380
|
changedPaths: () => git.changedPaths(),
|
|
3241
3381
|
isAncestor: (a, of) => git.isAncestor(a, of),
|
|
3242
3382
|
changedPathsBetween: (from, to) => git.changedPathsBetween(from, to),
|
|
3243
|
-
runGates: async (paths) =>
|
|
3383
|
+
runGates: async (paths) => {
|
|
3384
|
+
const gate = await (0, gate_1.runGate)({ steps: config.gates, changedPaths: paths, runner: (0, untrusted_gate_1.makeUntrustedGateRunner)(cwd) });
|
|
3385
|
+
reproofVerdict = gate.verdict;
|
|
3386
|
+
return gate.steps;
|
|
3387
|
+
},
|
|
3388
|
+
aliases: (0, goal_replay_1.replayedAs)(projectStateDirPath, goalId),
|
|
3244
3389
|
});
|
|
3245
3390
|
confirmed = again.ok
|
|
3246
3391
|
? (0, goal_execution_evidence_1.confirmGoalExecutionEvidence)({ ...key2Input, rechecked: { contains: again.contains, steps: again.steps } })
|
|
3247
3392
|
: { ok: false, because: `${goal_execution_evidence_1.CODE_MOVED_ON}, and it could not be checked again: ${again.because}` };
|
|
3248
3393
|
log(`goal : ${confirmed.ok ? 'the gates pass at the current tree, and this plan’s work is in it' : confirmed.because}`);
|
|
3394
|
+
if (!confirmed.ok) {
|
|
3395
|
+
/**
|
|
3396
|
+
* NEVER A HAND-BACK FOR THIS (owner ruling 2026-10-16). Three answers, none of them a
|
|
3397
|
+
* person's question:
|
|
3398
|
+
* - the gate could not RUN here (sandbox, tool): the machine's fault — retryable, and
|
|
3399
|
+
* the run's words name it, so the Start is voided (`environment`);
|
|
3400
|
+
* - the tree has uncommitted changes: not this run's to judge — retryable;
|
|
3401
|
+
* - the gates are red here, or the work is not in this tree (and could not be
|
|
3402
|
+
* rebuilt onto the base): a gap the work can close — the next revision plans it.
|
|
3403
|
+
*/
|
|
3404
|
+
if (reproofVerdict === 'blocked') {
|
|
3405
|
+
return {
|
|
3406
|
+
ok: false,
|
|
3407
|
+
reason: `gate blocked: step could not run — the environment is unavailable, not the change (${confirmed.because})`,
|
|
3408
|
+
unknown: true,
|
|
3409
|
+
};
|
|
3410
|
+
}
|
|
3411
|
+
if (!again.ok && /uncommitted change/.test(again.because))
|
|
3412
|
+
return { ok: false, reason: again.because, unknown: true };
|
|
3413
|
+
return {
|
|
3414
|
+
ok: false,
|
|
3415
|
+
reason: replayTrouble === null ? confirmed.because : `${confirmed.because} (${replayTrouble})`,
|
|
3416
|
+
replan: true,
|
|
3417
|
+
};
|
|
3418
|
+
}
|
|
3249
3419
|
}
|
|
3250
3420
|
/**
|
|
3251
3421
|
* 🔴 WHAT KEY 2 SAW, KEPT FOR THE FOURTH KEY.
|
|
@@ -3259,7 +3429,8 @@ async function runLoop(opts) {
|
|
|
3259
3429
|
*/
|
|
3260
3430
|
if (confirmed.ok) {
|
|
3261
3431
|
deliveringRunId = confirmed.round.runId;
|
|
3262
|
-
|
|
3432
|
+
// A REBUILT tree delivers its own tip: the original round's commit is not in it.
|
|
3433
|
+
deliveringSha = rebuiltAs !== null ? rebuiltAs.head : (confirmed.round.sha ?? null);
|
|
3263
3434
|
key2Saw = {
|
|
3264
3435
|
delivered: new Set(confirmed.delivered),
|
|
3265
3436
|
checks: new Map((confirmed.reproved ?? confirmed.round.gate?.steps ?? []).map((st) => [
|
|
@@ -3539,7 +3710,7 @@ async function runLoop(opts) {
|
|
|
3539
3710
|
await releaseHold();
|
|
3540
3711
|
// The branch the controller will ask the lane about: the one that delivered (F20).
|
|
3541
3712
|
const refusedOn = deliveredOn;
|
|
3542
|
-
throw said.terminal ? new RunRefused(said.message, said.code, refusedOn, delivery) : new Error(said.message);
|
|
3713
|
+
throw said.terminal ? new RunRefused(said.message, said.code, refusedOn, delivery) : (plannerTimedOut(said.message) ?? new Error(said.message));
|
|
3543
3714
|
}
|
|
3544
3715
|
}
|
|
3545
3716
|
const left = scope === null ? null : (0, core_1.workLeft)(runQueue.list());
|
|
@@ -3567,7 +3738,8 @@ async function runLoop(opts) {
|
|
|
3567
3738
|
throw new RunRefused(`nothing here can move without you — ${(0, queue_summary_1.describeNoReady)(runQueue.list())}`, 'human_required');
|
|
3568
3739
|
}
|
|
3569
3740
|
await releaseHold();
|
|
3570
|
-
|
|
3741
|
+
const nothing = `nothing to do — ${(0, queue_summary_1.describeNoReady)(runQueue.list())}`;
|
|
3742
|
+
throw plannerTimedOut(compileNote === null ? nothing : `${nothing} (${compileNote})`) ?? new Error(nothing);
|
|
3571
3743
|
}
|
|
3572
3744
|
/**
|
|
3573
3745
|
* THE APPROVAL BOUNDARY, AND THE ONLY PLACE IT COULD LIVE.
|