@claudexor/orchestrator 1.0.1 → 2.1.3
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/attemptTelemetry.d.ts +47 -2
- package/dist/attemptTelemetry.d.ts.map +1 -1
- package/dist/attemptTelemetry.js +100 -2
- package/dist/attemptTelemetry.js.map +1 -1
- package/dist/attemptUsage.d.ts +19 -0
- package/dist/attemptUsage.d.ts.map +1 -0
- package/dist/attemptUsage.js +29 -0
- package/dist/attemptUsage.js.map +1 -0
- package/dist/candidateEvidence.d.ts +22 -0
- package/dist/candidateEvidence.d.ts.map +1 -0
- package/dist/candidateEvidence.js +42 -0
- package/dist/candidateEvidence.js.map +1 -0
- package/dist/candidateOutputs.d.ts +43 -0
- package/dist/candidateOutputs.d.ts.map +1 -0
- package/dist/candidateOutputs.js +146 -0
- package/dist/candidateOutputs.js.map +1 -0
- package/dist/contract-gates.d.ts +21 -0
- package/dist/contract-gates.d.ts.map +1 -0
- package/dist/contract-gates.js +93 -0
- package/dist/contract-gates.js.map +1 -0
- package/dist/credential-profiles.d.ts +162 -0
- package/dist/credential-profiles.d.ts.map +1 -0
- package/dist/credential-profiles.js +357 -0
- package/dist/credential-profiles.js.map +1 -0
- package/dist/diffReview.d.ts +12 -1
- package/dist/diffReview.d.ts.map +1 -1
- package/dist/diffReview.js +117 -18
- package/dist/diffReview.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/modelGovernance.d.ts +6 -1
- package/dist/modelGovernance.d.ts.map +1 -1
- package/dist/modelGovernance.js +8 -2
- package/dist/modelGovernance.js.map +1 -1
- package/dist/orchestrateExecutor.d.ts +43 -0
- package/dist/orchestrateExecutor.d.ts.map +1 -0
- package/dist/orchestrateExecutor.js +207 -0
- package/dist/orchestrateExecutor.js.map +1 -0
- package/dist/orchestratePlanner.d.ts.map +1 -1
- package/dist/orchestratePlanner.js.map +1 -1
- package/dist/orchestrator.d.ts +97 -85
- package/dist/orchestrator.d.ts.map +1 -1
- package/dist/orchestrator.js +1056 -1090
- package/dist/orchestrator.js.map +1 -1
- package/dist/outcomeReducer.d.ts +25 -0
- package/dist/outcomeReducer.d.ts.map +1 -0
- package/dist/outcomeReducer.js +121 -0
- package/dist/outcomeReducer.js.map +1 -0
- package/dist/policyFindings.d.ts +18 -0
- package/dist/policyFindings.d.ts.map +1 -0
- package/dist/policyFindings.js +166 -0
- package/dist/policyFindings.js.map +1 -0
- package/dist/requestRequirements.d.ts +38 -0
- package/dist/requestRequirements.d.ts.map +1 -0
- package/dist/requestRequirements.js +127 -0
- package/dist/requestRequirements.js.map +1 -0
- package/dist/reviewerPanel.d.ts +15 -1
- package/dist/reviewerPanel.d.ts.map +1 -1
- package/dist/reviewerPanel.js +85 -2
- package/dist/reviewerPanel.js.map +1 -1
- package/dist/routeContext.d.ts +37 -0
- package/dist/routeContext.d.ts.map +1 -0
- package/dist/routeContext.js +38 -0
- package/dist/routeContext.js.map +1 -0
- package/dist/runSupport.d.ts +37 -21
- package/dist/runSupport.d.ts.map +1 -1
- package/dist/runSupport.js +102 -78
- package/dist/runSupport.js.map +1 -1
- package/dist/runTelemetryWriter.d.ts +20 -0
- package/dist/runTelemetryWriter.d.ts.map +1 -0
- package/dist/runTelemetryWriter.js +68 -0
- package/dist/runTelemetryWriter.js.map +1 -0
- package/dist/runTerminals.d.ts +7 -1
- package/dist/runTerminals.d.ts.map +1 -1
- package/dist/runTerminals.js +42 -4
- package/dist/runTerminals.js.map +1 -1
- package/dist/structuredOutput.d.ts +33 -0
- package/dist/structuredOutput.d.ts.map +1 -0
- package/dist/structuredOutput.js +106 -0
- package/dist/structuredOutput.js.map +1 -0
- package/package.json +19 -18
- package/dist/finalVerifier.d.ts +0 -25
- package/dist/finalVerifier.d.ts.map +0 -1
- package/dist/finalVerifier.js +0 -110
- package/dist/finalVerifier.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestratePlanner.js","sourceRoot":"","sources":["../src/orchestratePlanner.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"orchestratePlanner.js","sourceRoot":"","sources":["../src/orchestratePlanner.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,eAAe,IAAI,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,SAAS,gBAAgB,CAAC,GAAY;IACpC,OAAO,aAAa,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;AACzE,CAAC;AAED,MAAM,UAAU,6BAA6B,CAC3C,IAAY,EACZ,IAAc,EACd,WAAoB,EACpB,QAA8B;IAE9B,OAAO;QACL,uEAAuE;QACvE,EAAE;QACF,SAAS;QACT,IAAI;QACJ,EAAE;QACF,6CAA6C;QAC7C,IAAI,CAAC,MAAM,GAAG,CAAC;YACb,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;YACxC,CAAC,CAAC,uDAAuD;QAC3D,WAAW;YACT,CAAC,CAAC,yEAAyE;YAC3E,CAAC,CAAC,6EAA6E;QACjF,EAAE;QACF,mDAAmD;QACnD,GAAG,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1C,EAAE;QACF,oBAAoB;QACpB,wGAAwG;QACxG,8LAA8L;QAC9L,sGAAsG;QACtG,8DAA8D;QAC9D,6DAA6D;QAC7D,6DAA6D;QAC7D,2EAA2E;QAC3E,gFAAgF;KACjF,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC;AAED;;;;GAIG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KAAK,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;IACzE,IAAI,CAAC,SAAS;QAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,kDAAkD,EAAE,CAAC;IACjG,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,qBAAqB,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QAClF,IAAI,CAAC,MAAM,CAAC,OAAO;YACjB,OAAO;gBACL,IAAI,EAAE,IAAI;gBACV,KAAK,EAAE,wCAAwC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,OAAO,IAAI,SAAS,EAAE;aAC9F,CAAC;QACJ,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;IAC1C,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,iCAAiC,gBAAgB,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;IACzF,CAAC;AACH,CAAC"}
|
package/dist/orchestrator.d.ts
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
|
-
import type { AccessProfile, Attachment, ControlReviewerPanelEntry, EffortHint, ExternalContextPolicy, HarnessEvent, InteractionAnswerSet, InteractionRequest, ModeKind,
|
|
1
|
+
import type { AccessProfile, Attachment, ControlReviewerPanelEntry, EffortHint, ExternalContextPolicy, HarnessEvent, InteractionAnswerSet, InteractionRequest, ModeKind, PaidBudget, QuotaSnapshot, RoutingGoal, ProtectedPathApproval, RunEvent, RunStatus, TestCommandInvocation, ProviderFamily } from "@claudexor/schema";
|
|
2
2
|
import { type OrchestrateAutonomy } from "@claudexor/schema";
|
|
3
3
|
import type { AdapterRegistry } from "@claudexor/core";
|
|
4
4
|
import { type DiffReviewInput, type DiffReviewResult } from "./diffReview.js";
|
|
5
5
|
import { type ReviewerSpec } from "@claudexor/review";
|
|
6
6
|
import { type SynthesisMode } from "@claudexor/synthesis";
|
|
7
|
+
import { BudgetLedger } from "@claudexor/budget";
|
|
7
8
|
export interface OrchestratorDeps {
|
|
8
9
|
registry: AdapterRegistry;
|
|
9
10
|
reviewers?: ReviewerSpec[];
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
paidBudget?: PaidBudget;
|
|
12
|
+
routingGoal?: RoutingGoal;
|
|
13
|
+
/** Durable global quota projection, injected by the daemon boundary. */
|
|
14
|
+
quotaSnapshots?: () => readonly QuotaSnapshot[];
|
|
15
|
+
/** Persist typed live quota/cooldown events into that same projection. */
|
|
16
|
+
quotaEventSink?: (harnessId: string, event: HarnessEvent) => void;
|
|
12
17
|
/** Ordered explicit reviewer panel. Unlike legacy per-family overrides this
|
|
13
18
|
* preserves duplicate harness entries, so one provider can review through
|
|
14
19
|
* multiple requested models in a single panel pass. */
|
|
@@ -32,19 +37,22 @@ export interface RunInput {
|
|
|
32
37
|
*/
|
|
33
38
|
executionRoot?: string;
|
|
34
39
|
prompt: string;
|
|
40
|
+
/** Caller-supplied system-level instructions layered onto every task-producing
|
|
41
|
+
* lane (primary, candidate, planner, explorer, orchestrate-planner) — never
|
|
42
|
+
* reviewers, synthesis, or the auth smoke. */
|
|
43
|
+
instructions?: string;
|
|
35
44
|
/** Files/images attached to this turn, resolved to scoped on-disk paths. */
|
|
36
45
|
attachments?: Attachment[];
|
|
37
46
|
/**
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
* resolves it to a per-harness `HarnessRunSpec.browser`.
|
|
47
|
+
* Request the agent-driven browser. Preflight resolves it per selected lane;
|
|
48
|
+
* a zero-effective pool refuses and a mixed pool carries explicit receipts.
|
|
41
49
|
*/
|
|
42
50
|
browser?: boolean;
|
|
43
51
|
mode?: ModeKind;
|
|
44
52
|
contextMode?: "off" | "auto";
|
|
45
53
|
harnesses?: string[];
|
|
46
54
|
primaryHarness?: string;
|
|
47
|
-
|
|
55
|
+
routingGoal?: RoutingGoal;
|
|
48
56
|
n?: number;
|
|
49
57
|
baseRef?: string;
|
|
50
58
|
attempts?: number | null;
|
|
@@ -55,12 +63,12 @@ export interface RunInput {
|
|
|
55
63
|
/** agent flag: create-from-scratch intent (the old `create` mode). */
|
|
56
64
|
create?: boolean;
|
|
57
65
|
synthesis?: SynthesisMode;
|
|
58
|
-
/** Explicit deterministic
|
|
59
|
-
tests?:
|
|
66
|
+
/** Explicit typed-argv deterministic gates from caller-provided run configuration. */
|
|
67
|
+
tests?: TestCommandInvocation[];
|
|
60
68
|
/** Typed per-run approval for changing auto-protected gate/test paths. */
|
|
61
69
|
protectedPathApprovals?: ProtectedPathApproval[];
|
|
62
|
-
|
|
63
|
-
|
|
70
|
+
paidBudget?: PaidBudget;
|
|
71
|
+
budgetLedger?: BudgetLedger;
|
|
64
72
|
/** Orchestrate executor: cap on plan tool calls. */
|
|
65
73
|
maxToolCalls?: number | null;
|
|
66
74
|
/** Access profile; e.g. `full` for autonomous terminal tasks (agent and in-place convergence). */
|
|
@@ -90,14 +98,22 @@ export interface RunInput {
|
|
|
90
98
|
threadId?: string;
|
|
91
99
|
/** Preferred auth route for harness attempts (subscription/api_key/auto). */
|
|
92
100
|
authPreference?: "subscription" | "api_key" | "auto";
|
|
101
|
+
/** Explicit credential profile for this turn (INV-135): resolved once per
|
|
102
|
+
* routed harness; unknown/disabled/mismatched ids refuse, never default. */
|
|
103
|
+
credentialProfileId?: string | null;
|
|
93
104
|
/**
|
|
94
105
|
* Native CLI session ids to resume, keyed by harness id (the thread's vendor
|
|
95
106
|
* session cache). A routed harness with an entry continues its own native
|
|
96
107
|
* conversation (`codex exec resume` / `claude --resume`) instead of starting fresh.
|
|
97
108
|
*/
|
|
98
|
-
resumeSessions?: Record<string,
|
|
109
|
+
resumeSessions?: Record<string, {
|
|
110
|
+
sessionId: string;
|
|
111
|
+
profileId: string | null;
|
|
112
|
+
}>;
|
|
99
113
|
/** Called when a harness emits its native session id (recorded for future resume). */
|
|
100
|
-
|
|
114
|
+
/** profileId = the EFFECTIVE profile the session was created under
|
|
115
|
+
* (adapter-stamped; rotation makes it differ from the requested id). */
|
|
116
|
+
onSessionObserved?: (harnessId: string, nativeSessionId: string, observedModel?: string | null, profileId?: string | null) => void;
|
|
101
117
|
/** In-process sink for every RunEvent (mirrors events.jsonl) for live observers. */
|
|
102
118
|
onEvent?: (event: RunEvent) => void;
|
|
103
119
|
/** In-process sink for the full per-harness event stream (richer than RunEvent). */
|
|
@@ -126,6 +142,31 @@ export interface RunInput {
|
|
|
126
142
|
* is the deliverable. Only honored by convergence modes.
|
|
127
143
|
*/
|
|
128
144
|
inPlace?: boolean;
|
|
145
|
+
/**
|
|
146
|
+
* Per-run globs no candidate may touch at all (create/modify/delete) —
|
|
147
|
+
* stricter than protected paths, which gate only tampering with existing
|
|
148
|
+
* files. Envelope/isolated runs only: the engine's post-diff policy gate is
|
|
149
|
+
* the authoritative enforcement (violation → blocking finding → blocked,
|
|
150
|
+
* patch undelivered). An in-place run with denyPaths is refused at preflight:
|
|
151
|
+
* a live tree offers no pre-delivery containment, and silent non-enforcement
|
|
152
|
+
* is never acceptable. accept_risk MAY still deliver (INV-111).
|
|
153
|
+
*/
|
|
154
|
+
denyPaths?: string[];
|
|
155
|
+
/**
|
|
156
|
+
* JSON Schema the run's final ANSWER must conform to (normalized at the
|
|
157
|
+
* engine boundary). MANDATORY when present: every answer-producing lane is
|
|
158
|
+
* constrained natively, an incapable lane is a typed preflight refusal, and
|
|
159
|
+
* ONE engine validator writes final/output.json + a conformance receipt. A
|
|
160
|
+
* non-conformant answer ends success-with-warnings, never a hard fail.
|
|
161
|
+
* Applies to agent race/ask answers; other strategies refuse loudly.
|
|
162
|
+
*/
|
|
163
|
+
outputSchema?: Record<string, unknown> | null;
|
|
164
|
+
/**
|
|
165
|
+
* Per-run turn cap. Run-level beats per-harness settings (specific beats
|
|
166
|
+
* general); a lane whose manifest lacks max_turns support discloses the
|
|
167
|
+
* ignored knob instead of silently dropping it.
|
|
168
|
+
*/
|
|
169
|
+
maxTurns?: number | null;
|
|
129
170
|
/**
|
|
130
171
|
* How much the orchestrate planner may act without confirmation
|
|
131
172
|
* (suggest/auto_safe/auto_full). Honored ONLY by mode=orchestrate; the
|
|
@@ -178,10 +219,19 @@ export interface OrchestratorResult {
|
|
|
178
219
|
/** Settled ledger spend for this run (USD); null when no ledger tracked it.
|
|
179
220
|
* Consumer: the orchestrate executor's aggregate budget across sub-runs. */
|
|
180
221
|
spendUsd?: number | null;
|
|
222
|
+
/** Why a `cancelled` run was cancelled, when it was NOT a plain user cancel —
|
|
223
|
+
* today only `wall_clock_exceeded` (the maxSeconds deadline). Absent for a
|
|
224
|
+
* user-initiated cancel. */
|
|
225
|
+
cancelReason?: string;
|
|
181
226
|
}
|
|
182
227
|
export declare class Orchestrator {
|
|
183
228
|
private readonly deps;
|
|
184
229
|
private readonly gateway;
|
|
230
|
+
private readonly requestRequirements;
|
|
231
|
+
/** Per-attempt cap on forwarded live delta chunks (W-C4 flood guard, sol
|
|
232
|
+
* #10): past this the deltas are dropped and the cutoff is disclosed once;
|
|
233
|
+
* the complete message always still lands. */
|
|
234
|
+
static readonly MAX_DELTAS_PER_ATTEMPT = 4000;
|
|
185
235
|
constructor(deps: OrchestratorDeps);
|
|
186
236
|
/** Scoped DIFF review — thin delegate; mechanics live in diffReview.ts. */
|
|
187
237
|
reviewDiff(input: DiffReviewInput): Promise<DiffReviewResult>;
|
|
@@ -200,16 +250,6 @@ export declare class Orchestrator {
|
|
|
200
250
|
private artifactStore;
|
|
201
251
|
/** The producing intent a candidate plays (create flag switches it; not hardcoded to implement). */
|
|
202
252
|
private candidateIntent;
|
|
203
|
-
/**
|
|
204
|
-
* Resolve the per-harness browser-tool wiring for a run spec. Returns null
|
|
205
|
-
* (no browser) unless: the run opted in (`input.browser`), the harness has the
|
|
206
|
-
* `browser_tool` capability, AND web policy is not `off` (the browser is live
|
|
207
|
-
* egress and must ride `external_context_policy`). Screenshots/PDFs are written
|
|
208
|
-
* into the run's artifact tree so they surface in the Canvas gallery. Headed by
|
|
209
|
-
* default so the user can watch; `cdp_endpoint` is filled by the headed-Chromium
|
|
210
|
-
* launcher (7B) for the shared, mirrored window.
|
|
211
|
-
*/
|
|
212
|
-
private browserSpecFor;
|
|
213
253
|
/**
|
|
214
254
|
* Session fields for a route's run spec: auth route preference + native
|
|
215
255
|
* resume id. Preference precedence: explicit per-run > per-harness
|
|
@@ -221,8 +261,15 @@ export declare class Orchestrator {
|
|
|
221
261
|
private estimateUsdFloor;
|
|
222
262
|
private execRootOf;
|
|
223
263
|
private sessionSpecFields;
|
|
224
|
-
|
|
225
|
-
|
|
264
|
+
private resolveCredentialProfile;
|
|
265
|
+
/** The typed effective auth route for a SELECTED credential profile
|
|
266
|
+
* (round-18 #2): adapters execute strictly by credential_kind, so routing,
|
|
267
|
+
* billing classification, model truth, and quota lookup must share this
|
|
268
|
+
* one fact — never the default store's sources or a previous default-route
|
|
269
|
+
* metric. null = no profile selected or it does not resolve here. */
|
|
270
|
+
private profileAuthRoute;
|
|
271
|
+
private profilePolicy;
|
|
272
|
+
private preflightProfile;
|
|
226
273
|
/**
|
|
227
274
|
* Lift an adapter's auth-route override marker into the typed
|
|
228
275
|
* `route.fallback.auth_switched` run event (validated payload). An explicit
|
|
@@ -233,13 +280,13 @@ export declare class Orchestrator {
|
|
|
233
280
|
/**
|
|
234
281
|
* Resolve candidate adapters: explicit `--harness`, else available real harnesses, then
|
|
235
282
|
* **capability-gate** to those that can actually produce work for `intent` (e.g. a
|
|
236
|
-
*
|
|
283
|
+
* a planner-only adapter with `implement: false` is dropped from an implement race), and
|
|
237
284
|
* expand to n. Fails loudly if nothing can perform the intent.
|
|
238
285
|
*/
|
|
239
286
|
private resolveRunInput;
|
|
240
287
|
private resolveCandidateAdapters;
|
|
241
288
|
/**
|
|
242
|
-
* Order the eligible pool by
|
|
289
|
+
* Order the eligible pool by the selected routing goal (budget router): an
|
|
243
290
|
* explicit user pool keeps the user's order; an explicit primary harness is
|
|
244
291
|
* always pinned first. Cross-family diversity is encouraged for later slots.
|
|
245
292
|
*/
|
|
@@ -252,12 +299,6 @@ export declare class Orchestrator {
|
|
|
252
299
|
* candidates explore the live tree inside their own envelopes.
|
|
253
300
|
*/
|
|
254
301
|
private lazyContextSection;
|
|
255
|
-
/**
|
|
256
|
-
* Ledger a routed harness reserves from: harnesses with a configured
|
|
257
|
-
* `max_usd` get a child sub-ledger (spend rolls up to the run cap), so one
|
|
258
|
-
* harness exhausting its own budget cannot drain the whole run.
|
|
259
|
-
*/
|
|
260
|
-
private harnessLedger;
|
|
261
302
|
/**
|
|
262
303
|
* The web mode a routed harness actually executes for a requested policy.
|
|
263
304
|
* Tools-permissioned web (e.g. claude) has no cached index: `cached` upgrades
|
|
@@ -270,23 +311,29 @@ export declare class Orchestrator {
|
|
|
270
311
|
private config;
|
|
271
312
|
private projectConfig;
|
|
272
313
|
private buildContract;
|
|
273
|
-
private gateSpecs;
|
|
274
|
-
private testsEvidence;
|
|
275
|
-
private writeTestsEvidence;
|
|
276
314
|
/**
|
|
277
315
|
* Per-harness settings applied to one route's run spec (model/effort/web
|
|
278
316
|
* defaults, max_turns, tool lists). Knobs the manifest does not support are
|
|
279
317
|
* RETURNED as ignored reasons (disclosed by the caller), never silently sent.
|
|
280
318
|
*/
|
|
319
|
+
/**
|
|
320
|
+
* The HarnessRunSpec fields every TASK-PRODUCING lane shares (primary,
|
|
321
|
+
* candidate, planner, explorer, orchestrate-planner). Extracting the identical
|
|
322
|
+
* block into ONE owner means a new task-producing field lands here once —
|
|
323
|
+
* never forgotten in one of the HarnessRunSpec.parse sites (the multi-path
|
|
324
|
+
* trap). Per-run `instructions` ride every task-producing lane but are withheld
|
|
325
|
+
* from `synthesize` (a merge of existing candidates, not a fresh task
|
|
326
|
+
* execution — owner Quiz-5a); reviewers and the auth smoke build their own
|
|
327
|
+
* specs and never call this.
|
|
328
|
+
*/
|
|
329
|
+
private harnessSpecKnobs;
|
|
281
330
|
private routeSpecKnobs;
|
|
282
|
-
/** Run one candidate inside an already-created envelope. Never creates/disposes the envelope. */
|
|
283
331
|
private runCandidateInEnvelope;
|
|
284
|
-
private toEvidence;
|
|
285
332
|
private interactionChannelFor;
|
|
286
333
|
/**
|
|
287
334
|
* Guarantee a git boundary for write-mode runs. Non-git project folders are
|
|
288
|
-
* initialized in place (
|
|
289
|
-
*
|
|
335
|
+
* initialized in place (`git init`, deterministic baseline commit) without
|
|
336
|
+
* creating or editing `.gitignore`, and the action is announced via a
|
|
290
337
|
* `project.git.initialized` event. Returns the failure message when the
|
|
291
338
|
* boundary cannot be established (the terminal failure events are already
|
|
292
339
|
* emitted); null on success.
|
|
@@ -296,21 +343,14 @@ export declare class Orchestrator {
|
|
|
296
343
|
/** Single-owner telemetry artifact (final/telemetry.yaml); surfaces project it, never recompute. */
|
|
297
344
|
private writeRunTelemetry;
|
|
298
345
|
/** Review a set of runs and return their evidence (with finalReviewClean + review_verified caveat). */
|
|
299
|
-
/**
|
|
300
|
-
* Deterministic policy findings from the typed diff (no LLM, no regex over
|
|
301
|
-
* prose): protected-path changes and critical-risk diffs escalate NEEDS_HUMAN;
|
|
302
|
-
* a high-risk diff without a cross-family panel escalates as well. Each
|
|
303
|
-
* finding cites the matched files as evidence (BIBLE: evidence beats summaries).
|
|
304
|
-
*/
|
|
305
|
-
private policyFindings;
|
|
306
346
|
/**
|
|
307
347
|
* SINGLE funnel for every reviewer-panel invocation: run it inside a per-review
|
|
308
|
-
* scoped harness HOME (Bible §6) so reviewer
|
|
309
|
-
*
|
|
310
|
-
*
|
|
311
|
-
*
|
|
312
|
-
*
|
|
313
|
-
* settles (resolve OR reject).
|
|
348
|
+
* scoped harness HOME (Bible §6) so reviewer scratch state and injected auth
|
|
349
|
+
* routes do not enter the project or ordinary operator HOME. Native
|
|
350
|
+
* Codex/Claude routes deliberately keep their vendor-owned host-user stores;
|
|
351
|
+
* no credential file is copied into the scoped home. Every call site MUST go
|
|
352
|
+
* through here so the non-native scoping cannot drift. Disposed once the
|
|
353
|
+
* panel settles (resolve OR reject).
|
|
314
354
|
*/
|
|
315
355
|
private reviewScoped;
|
|
316
356
|
private reviewRuns;
|
|
@@ -335,46 +375,18 @@ export declare class Orchestrator {
|
|
|
335
375
|
private runExplore;
|
|
336
376
|
/** audit: single read-only audit/map report. */
|
|
337
377
|
private runAudit;
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
* and runs READ-ONLY. With default `suggest` autonomy its work product is a
|
|
342
|
-
* typed orchestration plan over the 6-tool belt (start_run / race / status /
|
|
343
|
-
* answer_question / apply / review); execution happens as subsequent thread
|
|
344
|
-
* turns. Degradation contract: any 1 harness works (single-route plan); 2+
|
|
345
|
-
* harnesses unlock cross-family race/review in the plan space.
|
|
346
|
-
*/
|
|
347
|
-
/** ONE owner of the per-run USD cap precedence: explicit input -> embedder deps -> operator config. */
|
|
348
|
-
private resolveMaxUsdCap;
|
|
378
|
+
private resolvePaidBudget;
|
|
379
|
+
private rootLedger;
|
|
380
|
+
private routeBillingKnowledge;
|
|
349
381
|
private runOrchestrate;
|
|
350
382
|
private runReadOnlyReport;
|
|
351
|
-
/**
|
|
352
|
-
* Execute a typed orchestration plan under auto_safe / auto_full. Runs the
|
|
353
|
-
* tool_calls IN ORDER, classifying each via toolRisk (FAIL-CLOSED). Persists
|
|
354
|
-
* final/orchestration_progress.yaml and emits progress events. Returns the
|
|
355
|
-
* executor's terminal status (success / blocked / failed) and a short note.
|
|
356
|
-
*
|
|
357
|
-
* SAFETY INVARIANTS (see CLAUDEXOR doctrine):
|
|
358
|
-
* 1. A SAFE step NEVER mutates the live tree: start_run/race run as isolated
|
|
359
|
-
* ENVELOPE sub-runs (inPlace=false, asserted), review/status/answer are reads.
|
|
360
|
-
* 2. Risk is fail-closed (toolRisk): any unknown/undeclared tool is risky.
|
|
361
|
-
* 3. auto_safe STOPS at the first risky step (apply) without executing it; the
|
|
362
|
-
* run ends `blocked` awaiting a human decision.
|
|
363
|
-
* 4. answer_question / status / review are read-only w.r.t. the tree.
|
|
364
|
-
*/
|
|
365
|
-
private executeOrchestratePlan;
|
|
366
383
|
/**
|
|
367
384
|
* Run one SAFE plan step. start_run/race spawn ISOLATED ENVELOPE sub-runs
|
|
368
385
|
* (inPlace=false, ASSERTED); review/status/answer_question are pure reads /
|
|
369
386
|
* answer delivery that never mutate the live tree.
|
|
370
387
|
*/
|
|
371
388
|
private executeSafeStep;
|
|
372
|
-
/**
|
|
373
|
-
* Execute a RISKY `apply` step (auto_full only) through the SINGLE existing
|
|
374
|
-
* apply gate (`validateApplyGate`) + `deliver` — the same path
|
|
375
|
-
* accept_clean_patch uses. Reads the referenced run's patch + work_product +
|
|
376
|
-
* decision artifacts; refuses unless the gate passes.
|
|
377
|
-
*/
|
|
389
|
+
/** Execute an auto_full apply through the shared fresh-verification gate. */
|
|
378
390
|
private executeApplyStep;
|
|
379
391
|
}
|
|
380
392
|
//# sourceMappingURL=orchestrator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrator.d.ts","sourceRoot":"","sources":["../src/orchestrator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"orchestrator.d.ts","sourceRoot":"","sources":["../src/orchestrator.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EACV,aAAa,EACb,UAAU,EACV,yBAAyB,EACzB,UAAU,EAEV,qBAAqB,EACrB,YAAY,EAEZ,oBAAoB,EACpB,kBAAkB,EAClB,QAAQ,EACR,UAAU,EACV,aAAa,EACb,WAAW,EACX,qBAAqB,EAIrB,QAAQ,EACR,SAAS,EAET,qBAAqB,EACrB,cAAc,EAOf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAIL,KAAK,mBAAmB,EAiBzB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,KAAK,EAAE,eAAe,EAAsC,MAAM,iBAAiB,CAAC;AAqD3F,OAAO,EAAiB,KAAK,eAAe,EAAE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