orizu 0.5.26 → 0.5.28
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/README.md +19 -0
- package/dist/artifacts-git-runtime.d.ts +34 -0
- package/dist/artifacts-git-runtime.d.ts.map +1 -0
- package/dist/artifacts-git-runtime.js +312 -0
- package/dist/cloudflare-artifacts-git-remote.d.ts +5 -0
- package/dist/cloudflare-artifacts-git-remote.d.ts.map +1 -0
- package/dist/cloudflare-artifacts-git-remote.js +21 -0
- package/dist/dataset-transfer-download.d.ts +2 -0
- package/dist/dataset-transfer-download.d.ts.map +1 -0
- package/dist/dataset-transfer-download.js +66 -0
- package/dist/dataset-transfer-policy.d.ts +2 -0
- package/dist/dataset-transfer-policy.d.ts.map +1 -0
- package/dist/dataset-transfer-policy.js +8 -0
- package/dist/dataset-transfer-upload.d.ts +42 -0
- package/dist/dataset-transfer-upload.d.ts.map +1 -0
- package/dist/dataset-transfer-upload.js +110 -0
- package/dist/git-credential.d.ts.map +1 -1
- package/dist/git-credential.js +1 -1
- package/dist/git-recovery-environment.d.ts +1 -0
- package/dist/git-recovery-environment.d.ts.map +1 -1
- package/dist/git-recovery-environment.js +1 -1
- package/dist/help.d.ts.map +1 -1
- package/dist/help.js +44 -11
- package/dist/hosted-boot.d.ts +75 -2
- package/dist/hosted-boot.d.ts.map +1 -1
- package/dist/hosted-boot.js +585 -102
- package/dist/hosted-bootstrap.d.ts +2 -0
- package/dist/hosted-bootstrap.d.ts.map +1 -1
- package/dist/hosted-bootstrap.js +12 -3
- package/dist/hosted-harness-opencode.d.ts +8 -9
- package/dist/hosted-harness-opencode.d.ts.map +1 -1
- package/dist/hosted-harness-opencode.js +126 -24
- package/dist/hosted-harness.d.ts +3 -0
- package/dist/hosted-harness.d.ts.map +1 -1
- package/dist/hosted-harness.js +4 -1
- package/dist/hosted-harvest.d.ts +30 -9
- package/dist/hosted-harvest.d.ts.map +1 -1
- package/dist/hosted-harvest.js +222 -28
- package/dist/hosted-loop-lifecycle.d.ts +15 -3
- package/dist/hosted-loop-lifecycle.d.ts.map +1 -1
- package/dist/hosted-loop-lifecycle.js +6 -4
- package/dist/hosted-loop.d.ts +47 -7
- package/dist/hosted-loop.d.ts.map +1 -1
- package/dist/hosted-loop.js +310 -64
- package/dist/hosted-question-limits.d.ts +7 -0
- package/dist/hosted-question-limits.d.ts.map +1 -0
- package/dist/hosted-question-limits.js +6 -0
- package/dist/hosted-question.d.ts +27 -0
- package/dist/hosted-question.d.ts.map +1 -0
- package/dist/hosted-question.js +118 -0
- package/dist/hosted-run-event-sink.d.ts +10 -5
- package/dist/hosted-run-event-sink.d.ts.map +1 -1
- package/dist/hosted-run-event-sink.js +12 -8
- package/dist/hosted-runtime-assets.d.ts +16 -7
- package/dist/hosted-runtime-assets.d.ts.map +1 -1
- package/dist/hosted-runtime-assets.js +40 -12
- package/dist/hosted-session-cli.d.ts.map +1 -1
- package/dist/hosted-session-cli.js +10 -19
- package/dist/http.d.ts +1 -1
- package/dist/http.d.ts.map +1 -1
- package/dist/http.js +10 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +113 -92
- package/dist/instruction-set-gepa-launch.d.ts +1 -1
- package/dist/instruction-set-gepa-launch.d.ts.map +1 -1
- package/dist/instruction-set-gepa-launch.js +5 -3
- package/dist/instruction-set-loader.d.ts.map +1 -1
- package/dist/instruction-set-loader.js +63 -2
- package/dist/instruction-set-lock/index.d.ts +51 -0
- package/dist/instruction-set-lock/index.d.ts.map +1 -0
- package/dist/instruction-set-lock/index.js +459 -0
- package/dist/instruction-set-lock/schema.v1.d.ts +136 -0
- package/dist/instruction-set-lock/schema.v1.d.ts.map +1 -0
- package/dist/instruction-set-lock/schema.v1.js +155 -0
- package/dist/instruction-set-provenance.d.ts +26 -0
- package/dist/instruction-set-provenance.d.ts.map +1 -0
- package/dist/instruction-set-provenance.js +68 -0
- package/dist/instruction-set-sync/helpers.d.ts +22 -0
- package/dist/instruction-set-sync/helpers.d.ts.map +1 -0
- package/dist/instruction-set-sync/helpers.js +677 -0
- package/dist/instruction-set-sync/index.d.ts +60 -0
- package/dist/instruction-set-sync/index.d.ts.map +1 -0
- package/dist/instruction-set-sync/index.js +689 -0
- package/dist/instruction-set-update/index.d.ts +42 -0
- package/dist/instruction-set-update/index.d.ts.map +1 -0
- package/dist/instruction-set-update/index.js +445 -0
- package/dist/instruction-set-verify/index.d.ts +27 -0
- package/dist/instruction-set-verify/index.d.ts.map +1 -0
- package/dist/instruction-set-verify/index.js +865 -0
- package/dist/instruction-sets-cli.d.ts +1 -4
- package/dist/instruction-sets-cli.d.ts.map +1 -1
- package/dist/instruction-sets-cli.js +220 -109
- package/dist/model-config-fields.d.ts +35 -0
- package/dist/model-config-fields.d.ts.map +1 -0
- package/dist/model-config-fields.js +28 -0
- package/dist/optimizations-list-cli.d.ts.map +1 -1
- package/dist/optimizations-list-cli.js +7 -4
- package/dist/score-format.d.ts +2 -0
- package/dist/score-format.d.ts.map +1 -0
- package/dist/score-format.js +18 -0
- package/dist/workbench-repo-contract.d.ts +65 -0
- package/dist/workbench-repo-contract.d.ts.map +1 -0
- package/dist/workbench-repo-contract.js +250 -0
- package/dist/workspace-bootstrap-job.d.ts +45 -0
- package/dist/workspace-bootstrap-job.d.ts.map +1 -0
- package/dist/workspace-bootstrap-job.js +431 -0
- package/dist/workspace-bootstrap-seed.d.ts +74 -0
- package/dist/workspace-bootstrap-seed.d.ts.map +1 -0
- package/dist/workspace-bootstrap-seed.js +209 -0
- package/package.json +4 -3
- package/src/artifacts-git-runtime.ts +360 -0
- package/src/cloudflare-artifacts-git-remote.ts +24 -0
- package/src/dataset-transfer-download.ts +61 -0
- package/src/dataset-transfer-policy.ts +8 -0
- package/src/dataset-transfer-upload.ts +145 -0
- package/src/git-credential.ts +1 -2
- package/src/git-recovery-environment.ts +1 -1
- package/src/help.ts +44 -11
- package/src/hosted-boot.ts +644 -109
- package/src/hosted-bootstrap.ts +14 -3
- package/src/hosted-harness-opencode.ts +130 -28
- package/src/hosted-harness.ts +4 -1
- package/src/hosted-harvest.ts +258 -33
- package/src/hosted-loop-lifecycle.ts +19 -5
- package/src/hosted-loop.ts +340 -68
- package/src/hosted-question-limits.ts +6 -0
- package/src/hosted-question.ts +145 -0
- package/src/hosted-run-event-sink.ts +24 -12
- package/src/hosted-runtime-assets.ts +51 -11
- package/src/hosted-session-cli.ts +10 -24
- package/src/http.ts +10 -4
- package/src/index.ts +108 -134
- package/src/instruction-set-gepa-launch.ts +4 -4
- package/src/instruction-set-loader.ts +53 -2
- package/src/instruction-set-lock/index.ts +561 -0
- package/src/instruction-set-lock/schema.v1.json +141 -0
- package/src/instruction-set-lock/schema.v1.ts +155 -0
- package/src/instruction-set-provenance.ts +89 -0
- package/src/instruction-set-sync/helpers.ts +707 -0
- package/src/instruction-set-sync/index.ts +791 -0
- package/src/instruction-set-update/index.ts +488 -0
- package/src/instruction-set-verify/index.ts +1067 -0
- package/src/instruction-sets-cli.ts +226 -114
- package/src/model-config-fields.ts +31 -0
- package/src/optimizations-list-cli.ts +7 -4
- package/src/score-format.ts +16 -0
- package/src/workbench-repo-contract.ts +314 -0
- package/src/workspace-bootstrap-job.ts +611 -0
- package/src/workspace-bootstrap-seed.ts +350 -0
- package/vendor/orizu-gepa/src/orizu_gepa_connector/instruction_set_loader.py +46 -2
- package/vendor/skills/orizu/SKILL.md +4 -2
- package/vendor/skills/orizu/flows/promote.md +4 -0
- package/vendor/skills/orizu/references/assess-and-plan.md +1 -1
- package/vendor/skills/orizu/references/authority-map.md +1 -1
- package/vendor/skills/orizu/references/cli-reference.md +151 -35
- package/vendor/skills/orizu/references/instructions-after-prompts.md +3 -3
- package/vendor/skills/orizu/references/migrate-existing-gepa-setup.md +5 -6
- package/vendor/skills/orizu/references/migrate-hand-rolled-instruction-layout.md +252 -0
- package/vendor/skills/orizu/references/optimization-reports.md +5 -4
- package/vendor/skills/orizu/references/optimization-with-gepa.md +1 -1
- package/vendor/skills/orizu/references/orizu-in-your-codebase.md +195 -0
- package/vendor/skills/orizu/references/primer.md +4 -2
- package/vendor/skills/orizu/references/prompt-control-plane.md +33 -29
- package/vendor/skills/orizu/references/vocabulary.md +1 -1
|
@@ -132,6 +132,8 @@ export interface HostedBootstrapResult {
|
|
|
132
132
|
steps: HostedBootstrapStep[];
|
|
133
133
|
events: readonly AppendedRunEvent[];
|
|
134
134
|
paths: HostedRuntimePaths;
|
|
135
|
+
/** Bootstrap-selected helper, carried out-of-repo to checkpoint transport. */
|
|
136
|
+
credentialHelper: string;
|
|
135
137
|
/** Set on the failure path: the residue sweep result after teardown. */
|
|
136
138
|
sweep: {
|
|
137
139
|
clean: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hosted-bootstrap.d.ts","sourceRoot":"","sources":["../src/hosted-bootstrap.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAE3D,OAAO,EAAwB,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAiBhF,MAAM,MAAM,WAAW,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAA;AAIhF,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;IACjB,+DAA+D;IAC/D,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACjC;AAED;;;;;;GAMG;AACH,MAAM,WAAW,qBAAqB;IACpC,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAA;IACvF,QAAQ,CAAC,QAAQ,EAAE,SAAS,gBAAgB,EA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,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,cAAc,EAAE,CAAA;CAAE,CAAC,CAezD;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,kBAAkB,CAAA;IACzB,YAAY,EAAE,MAAM,CAAA;IACpB,WAAW,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CAChC;AAED;;;;GAIG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,cAAc,EACvB,IAAI,EAAE,kBAAkB,GACvB,OAAO,CAAC,cAAc,EAAE,CAAC,CA0B3B"}
|
package/dist/hosted-bootstrap.js
CHANGED
|
@@ -297,7 +297,10 @@ export async function bootstrapHostedSandbox(opts) {
|
|
|
297
297
|
if (opts.deferSetupHook) {
|
|
298
298
|
record('setup_hook_deferred', true, 'deferred to loop (runs after egress canary)');
|
|
299
299
|
await sink.append('setup_hook_deferred', { reason: 'egress canary must pass before customer setup.sh runs' });
|
|
300
|
-
return {
|
|
300
|
+
return {
|
|
301
|
+
ok: true, steps, events: sink.recorded, paths,
|
|
302
|
+
credentialHelper: helperValue, sweep: null, failure: null,
|
|
303
|
+
};
|
|
301
304
|
}
|
|
302
305
|
const hookRel = `${workspaceDir}/${SETUP_HOOK_RELATIVE_PATH}`;
|
|
303
306
|
if (await session.fileExists(hookRel)) {
|
|
@@ -314,7 +317,10 @@ export async function bootstrapHostedSandbox(opts) {
|
|
|
314
317
|
record('setup_hook_skipped', true, 'no .orizu/setup.sh');
|
|
315
318
|
await sink.append('setup_hook_skipped', { reason: 'no .orizu/setup.sh' });
|
|
316
319
|
}
|
|
317
|
-
return {
|
|
320
|
+
return {
|
|
321
|
+
ok: true, steps, events: sink.recorded, paths,
|
|
322
|
+
credentialHelper: helperValue, sweep: null, failure: null,
|
|
323
|
+
};
|
|
318
324
|
}
|
|
319
325
|
catch (error) {
|
|
320
326
|
const message = error instanceof Error ? error.message : String(error);
|
|
@@ -322,7 +328,10 @@ export async function bootstrapHostedSandbox(opts) {
|
|
|
322
328
|
// Record the failure (redacted), then tear down + prove no residue remains.
|
|
323
329
|
await safeAppend(sink, 'bootstrap_failed', { step: currentStep, error: message });
|
|
324
330
|
const sweep = await teardownHostedSandbox({ session, paths, bearer: opts.bearer, workspaceDir });
|
|
325
|
-
return {
|
|
331
|
+
return {
|
|
332
|
+
ok: false, steps, events: sink.recorded, paths, credentialHelper: helperValue,
|
|
333
|
+
sweep, failure: { step: currentStep, error: message },
|
|
334
|
+
};
|
|
326
335
|
}
|
|
327
336
|
}
|
|
328
337
|
/** Never let a failure-path event append mask the original error. */
|
|
@@ -156,20 +156,19 @@ export interface OpenCodeConfigOptions {
|
|
|
156
156
|
permission?: Record<string, unknown>;
|
|
157
157
|
}
|
|
158
158
|
/**
|
|
159
|
-
* Tools
|
|
160
|
-
*
|
|
161
|
-
*
|
|
162
|
-
*
|
|
163
|
-
*
|
|
164
|
-
*
|
|
165
|
-
* to it as a tool error) so it proceeds autonomously per the standing preamble
|
|
166
|
-
* (HOSTED_TASK_PREAMBLE), instead of blocking the run forever. This is the
|
|
167
|
-
* documented fallback path in ALI-1037 (answer-externally is not cleanly possible).
|
|
159
|
+
* Tools denied for CLI-origin headless runs (ALI-1037). OpenCode 1.14.41 removes
|
|
160
|
+
* a tool from the model toolset when its permission rule is `deny` on `*`; it does
|
|
161
|
+
* not expose the tool and report a denial result. Hosted-web therefore overrides
|
|
162
|
+
* `question` to `allow`, intercepts its measured running part, and quiesces the
|
|
163
|
+
* turn while waiting for the human. CLI-origin runs retain this deny list because
|
|
164
|
+
* no human reply flow exists there.
|
|
168
165
|
*/
|
|
169
166
|
export declare const HEADLESS_DENIED_TOOLS: readonly ["question"];
|
|
170
167
|
/** The default headless permission map: allow everything, deny the interactive
|
|
171
168
|
* question tool (see HEADLESS_DENIED_TOOLS). */
|
|
172
169
|
export declare function defaultHeadlessPermission(): Record<string, unknown>;
|
|
170
|
+
/** Select the OpenCode permission map for the session's human-input surface. */
|
|
171
|
+
export declare function permissionForOrigin(origin?: 'hosted-web' | 'cli'): Record<string, unknown>;
|
|
173
172
|
/**
|
|
174
173
|
* Build the `OPENCODE_CONFIG_CONTENT` payload OpenCode reads at boot (mirrors
|
|
175
174
|
* OpenInspect's `start_opencode`). Kept pure so the launch command and the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hosted-harness-opencode.d.ts","sourceRoot":"","sources":["../src/hosted-harness-opencode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AAIH,OAAO,KAAK,EACV,YAAY,EAIb,MAAM,qBAAqB,CAAA;AAS5B,eAAO,MAAM,uBAAuB,YAAY,CAAA;AAUhD,eAAO,MAAM,8BAA8B,UAAY,CAAA;AAQvD,MAAM,MAAM,YAAY,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAA;AAEjF,MAAM,WAAW,sBAAsB;IACrC,4EAA4E;IAC5E,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,CAAC,EAAE,YAAY,CAAA;IACxB,uEAAuE;IACvE,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,uEAAuE;IACvE,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,8EAA8E;IAC9E,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,GAAG,CAAC,EAAE,MAAM,MAAM,CAAA;CACnB;AAED;wEACwE;AACxE,eAAO,MAAM,yBAAyB,iCAAiC,CAAA;AAuDvE;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAGzF;AAED,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,i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AE,MAAM,CAAA;IAChB;;6CAEyC;IACzC,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,4DAA4D;IAC5D,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,oEAAoE;IACpE,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB,uEAAuE;IACvE,SAAS,CAAC,EAAE,OAAO,KAAK,CAAA;CACzB;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,IAAI,CAAA;IAChB;8DAC0D;IAC1D,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAkBD;;;;;;;;;GASG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,eAAe,CAAC,CA+DxF"}
|
|
@@ -281,6 +281,12 @@ export function createOpenCodeHarness(options) {
|
|
|
281
281
|
// Set true by the public stop(); makes the next idle terminal resolve as a
|
|
282
282
|
// cancellation rather than a success (P2-2).
|
|
283
283
|
let stopRequested = false;
|
|
284
|
+
let stopRequest = null;
|
|
285
|
+
let promptSubmissionPending = false;
|
|
286
|
+
let promptSubmissionSettled = null;
|
|
287
|
+
let resolvePromptSubmission = null;
|
|
288
|
+
let postAcceptanceAbortGeneration = -1;
|
|
289
|
+
let promptGeneration = 0;
|
|
284
290
|
// Last title actually forwarded, deduped across the whole harness lifetime so
|
|
285
291
|
// a repeated identical title is emitted once (P3-6).
|
|
286
292
|
let lastForwardedTitle = null;
|
|
@@ -331,16 +337,52 @@ export function createOpenCodeHarness(options) {
|
|
|
331
337
|
return false;
|
|
332
338
|
}
|
|
333
339
|
}
|
|
334
|
-
async function requestStop() {
|
|
340
|
+
async function requestStop(options = {}) {
|
|
335
341
|
if (!opencodeSessionId)
|
|
336
342
|
return;
|
|
343
|
+
if (promptSubmissionPending &&
|
|
344
|
+
promptSubmissionSettled &&
|
|
345
|
+
postAcceptanceAbortGeneration !== promptGeneration) {
|
|
346
|
+
const racedGeneration = promptGeneration;
|
|
347
|
+
const settlement = promptSubmissionSettled;
|
|
348
|
+
postAcceptanceAbortGeneration = racedGeneration;
|
|
349
|
+
// The stream consumer may close this generator as soon as its signal
|
|
350
|
+
// aborts. Keep the post-acceptance abort independent of generator
|
|
351
|
+
// continuation so an accepted prompt cannot escape cancellation.
|
|
352
|
+
void settlement.then(() => requestStop({ force: true }));
|
|
353
|
+
}
|
|
354
|
+
// Prompt signal + the hosted-loop stop() belt normally share one successful
|
|
355
|
+
// request. A failed request is never memoized, and prompt acknowledgement
|
|
356
|
+
// can force a post-acceptance abort when an earlier abort raced ahead of it.
|
|
357
|
+
if (stopRequest && !options.force) {
|
|
358
|
+
const inFlight = stopRequest;
|
|
359
|
+
try {
|
|
360
|
+
await inFlight;
|
|
361
|
+
return;
|
|
362
|
+
}
|
|
363
|
+
catch {
|
|
364
|
+
if (stopRequest === inFlight)
|
|
365
|
+
stopRequest = null;
|
|
366
|
+
// The owner of the failed request handles its own best-effort result.
|
|
367
|
+
// This overlapping caller owns the one follow-up acknowledgement try;
|
|
368
|
+
// it must never inherit the rejected memo as a fatal prompt error.
|
|
369
|
+
return requestStop(options);
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
const request = (async () => {
|
|
373
|
+
const response = await timedFetch(`${base}/session/${encodeURIComponent(opencodeSessionId)}/abort`, { method: 'POST' });
|
|
374
|
+
if (!response.ok)
|
|
375
|
+
throw new Error(`OpenCode abort failed (${response.status})`);
|
|
376
|
+
})();
|
|
377
|
+
stopRequest = request;
|
|
337
378
|
try {
|
|
338
|
-
await
|
|
339
|
-
method: 'POST',
|
|
340
|
-
});
|
|
379
|
+
await request;
|
|
341
380
|
}
|
|
342
381
|
catch {
|
|
343
|
-
|
|
382
|
+
if (stopRequest === request)
|
|
383
|
+
stopRequest = null;
|
|
384
|
+
// best-effort: stream teardown still settles this attempt, while a later
|
|
385
|
+
// stop can retry because the failed request no longer owns the memo.
|
|
344
386
|
}
|
|
345
387
|
}
|
|
346
388
|
async function* fetchFinalState(sessionId, userMessageIds, allowedAssistantMsgIds, messageText, compactionOccurred) {
|
|
@@ -404,8 +446,13 @@ export function createOpenCodeHarness(options) {
|
|
|
404
446
|
if (!opencodeSessionId)
|
|
405
447
|
opencodeSessionId = await createSession();
|
|
406
448
|
const sessionId = opencodeSessionId;
|
|
407
|
-
|
|
408
|
-
|
|
449
|
+
promptGeneration += 1;
|
|
450
|
+
// Per-prompt state: a fresh stop generation unless a human interrupt was
|
|
451
|
+
// already delivered before this generator began iterating.
|
|
452
|
+
if (!signal.aborted) {
|
|
453
|
+
stopRequested = false;
|
|
454
|
+
stopRequest = null;
|
|
455
|
+
}
|
|
409
456
|
let compactionOccurred = false;
|
|
410
457
|
const promptStart = now();
|
|
411
458
|
if (!readyEmitted) {
|
|
@@ -416,6 +463,19 @@ export function createOpenCodeHarness(options) {
|
|
|
416
463
|
payload: { agentSessionId: sessionId },
|
|
417
464
|
};
|
|
418
465
|
}
|
|
466
|
+
// A durable interrupt can predate generator iteration. Do not submit a
|
|
467
|
+
// prompt merely to abort it; report the prompt-scoped cancellation after
|
|
468
|
+
// the stop belt has had a chance to settle.
|
|
469
|
+
if (signal.aborted) {
|
|
470
|
+
await requestStop();
|
|
471
|
+
yield {
|
|
472
|
+
kind: 'execution_complete',
|
|
473
|
+
messageId: prompt.messageId,
|
|
474
|
+
critical: true,
|
|
475
|
+
payload: { success: false, aborted: true },
|
|
476
|
+
};
|
|
477
|
+
return;
|
|
478
|
+
}
|
|
419
479
|
const opencodeMessageId = ascendingId('msg');
|
|
420
480
|
const requestBody = buildPromptRequestBody(prompt.content, startModel, opencodeMessageId, startReasoningEffort);
|
|
421
481
|
// Per-part cumulative text, ordered per assistant message so a coalesced
|
|
@@ -485,6 +545,19 @@ export function createOpenCodeHarness(options) {
|
|
|
485
545
|
}
|
|
486
546
|
return events;
|
|
487
547
|
};
|
|
548
|
+
// The vulnerable submission window begins before /event is opened and
|
|
549
|
+
// ends only when prompt_async settles. A stop anywhere in this window
|
|
550
|
+
// schedules an independent post-acceptance abort.
|
|
551
|
+
promptSubmissionPending = true;
|
|
552
|
+
promptSubmissionSettled = new Promise(resolve => {
|
|
553
|
+
resolvePromptSubmission = resolve;
|
|
554
|
+
});
|
|
555
|
+
const settlePromptSubmission = () => {
|
|
556
|
+
promptSubmissionPending = false;
|
|
557
|
+
resolvePromptSubmission?.();
|
|
558
|
+
resolvePromptSubmission = null;
|
|
559
|
+
promptSubmissionSettled = null;
|
|
560
|
+
};
|
|
488
561
|
let sseResponse;
|
|
489
562
|
try {
|
|
490
563
|
sseResponse = await fetchImpl(`${base}/event`, {
|
|
@@ -493,10 +566,23 @@ export function createOpenCodeHarness(options) {
|
|
|
493
566
|
});
|
|
494
567
|
}
|
|
495
568
|
catch (error) {
|
|
496
|
-
|
|
569
|
+
settlePromptSubmission();
|
|
570
|
+
if (signal.aborted) {
|
|
571
|
+
await requestStop();
|
|
572
|
+
yield {
|
|
573
|
+
kind: 'execution_complete',
|
|
574
|
+
messageId: prompt.messageId,
|
|
575
|
+
critical: true,
|
|
576
|
+
payload: { success: false, aborted: true },
|
|
577
|
+
};
|
|
578
|
+
}
|
|
579
|
+
else {
|
|
580
|
+
yield errorEvent(prompt.messageId, error);
|
|
581
|
+
}
|
|
497
582
|
return;
|
|
498
583
|
}
|
|
499
584
|
if (!sseResponse.ok || !sseResponse.body) {
|
|
585
|
+
settlePromptSubmission();
|
|
500
586
|
// Cancel the body on the failure path too — a non-2xx response can still
|
|
501
587
|
// carry an (unconsumed) body that would otherwise leak (P3-7).
|
|
502
588
|
await cancelBody(sseResponse.body);
|
|
@@ -508,11 +594,17 @@ export function createOpenCodeHarness(options) {
|
|
|
508
594
|
let errorText = null;
|
|
509
595
|
let terminalYielded = false;
|
|
510
596
|
try {
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
597
|
+
let promptRes;
|
|
598
|
+
try {
|
|
599
|
+
promptRes = await timedFetch(`${base}/session/${encodeURIComponent(sessionId)}/prompt_async`, {
|
|
600
|
+
method: 'POST',
|
|
601
|
+
headers: { 'Content-Type': 'application/json' },
|
|
602
|
+
body: JSON.stringify(requestBody),
|
|
603
|
+
});
|
|
604
|
+
}
|
|
605
|
+
finally {
|
|
606
|
+
settlePromptSubmission();
|
|
607
|
+
}
|
|
516
608
|
if (promptRes.status !== 200 && promptRes.status !== 204) {
|
|
517
609
|
throw new Error(`Async prompt failed (${promptRes.status})`);
|
|
518
610
|
}
|
|
@@ -679,15 +771,22 @@ export function createOpenCodeHarness(options) {
|
|
|
679
771
|
}
|
|
680
772
|
},
|
|
681
773
|
async stop() {
|
|
682
|
-
// Mark intent so the resulting idle terminal is reported as cancelled,
|
|
683
|
-
// succeeded (P2-2), then best-effort ask OpenCode to abort.
|
|
774
|
+
// Mark intent so the resulting idle terminal is reported as cancelled,
|
|
775
|
+
// not succeeded (P2-2), then best-effort ask OpenCode to abort.
|
|
684
776
|
stopRequested = true;
|
|
685
777
|
await requestStop();
|
|
686
778
|
},
|
|
687
779
|
async shutdown() {
|
|
780
|
+
if (process.env.NODE_ENV === 'test' &&
|
|
781
|
+
process.env.ORIZU_HOSTED_TEST_HARNESS_SHUTDOWN_THROWS === '1') {
|
|
782
|
+
throw new Error('fixture harness shutdown failed');
|
|
783
|
+
}
|
|
688
784
|
opencodeSessionId = null;
|
|
689
785
|
readyEmitted = false;
|
|
690
786
|
stopRequested = false;
|
|
787
|
+
stopRequest = null;
|
|
788
|
+
promptGeneration = 0;
|
|
789
|
+
postAcceptanceAbortGeneration = -1;
|
|
691
790
|
},
|
|
692
791
|
};
|
|
693
792
|
}
|
|
@@ -832,15 +931,12 @@ export async function awaitOpenCodeModelResolvable(opts) {
|
|
|
832
931
|
};
|
|
833
932
|
}
|
|
834
933
|
/**
|
|
835
|
-
* Tools
|
|
836
|
-
*
|
|
837
|
-
*
|
|
838
|
-
*
|
|
839
|
-
*
|
|
840
|
-
*
|
|
841
|
-
* to it as a tool error) so it proceeds autonomously per the standing preamble
|
|
842
|
-
* (HOSTED_TASK_PREAMBLE), instead of blocking the run forever. This is the
|
|
843
|
-
* documented fallback path in ALI-1037 (answer-externally is not cleanly possible).
|
|
934
|
+
* Tools denied for CLI-origin headless runs (ALI-1037). OpenCode 1.14.41 removes
|
|
935
|
+
* a tool from the model toolset when its permission rule is `deny` on `*`; it does
|
|
936
|
+
* not expose the tool and report a denial result. Hosted-web therefore overrides
|
|
937
|
+
* `question` to `allow`, intercepts its measured running part, and quiesces the
|
|
938
|
+
* turn while waiting for the human. CLI-origin runs retain this deny list because
|
|
939
|
+
* no human reply flow exists there.
|
|
844
940
|
*/
|
|
845
941
|
export const HEADLESS_DENIED_TOOLS = ['question'];
|
|
846
942
|
/** The default headless permission map: allow everything, deny the interactive
|
|
@@ -851,6 +947,12 @@ export function defaultHeadlessPermission() {
|
|
|
851
947
|
permission[tool] = 'deny';
|
|
852
948
|
return permission;
|
|
853
949
|
}
|
|
950
|
+
/** Select the OpenCode permission map for the session's human-input surface. */
|
|
951
|
+
export function permissionForOrigin(origin) {
|
|
952
|
+
if (origin === 'hosted-web')
|
|
953
|
+
return { ...defaultHeadlessPermission(), question: 'allow' };
|
|
954
|
+
return defaultHeadlessPermission();
|
|
955
|
+
}
|
|
854
956
|
/**
|
|
855
957
|
* Build the `OPENCODE_CONFIG_CONTENT` payload OpenCode reads at boot (mirrors
|
|
856
958
|
* OpenInspect's `start_opencode`). Kept pure so the launch command and the
|
package/dist/hosted-harness.d.ts
CHANGED
|
@@ -75,8 +75,11 @@ export declare const HARNESS_EVENT_KINDS: {
|
|
|
75
75
|
readonly egress_allowed: "egress_allowed";
|
|
76
76
|
readonly work_persisted: "work_persisted";
|
|
77
77
|
readonly work_none: "work_none";
|
|
78
|
+
readonly work_not_inspected: "work_not_inspected";
|
|
78
79
|
readonly work_persist_failed: "work_persist_failed";
|
|
79
80
|
readonly question_auto_answered: "question_auto_answered";
|
|
81
|
+
readonly question_pending: "question_pending";
|
|
82
|
+
readonly question_invalid: "question_invalid";
|
|
80
83
|
readonly error: "error";
|
|
81
84
|
readonly execution_complete: "execution_complete";
|
|
82
85
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hosted-harness.d.ts","sourceRoot":"","sources":["../src/hosted-harness.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH;8DAC8D;AAC9D,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAA;IACZ,qEAAqE;IACrE,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACxB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAC7B;AAED,MAAM,WAAW,mBAAmB;IAClC,yEAAyE;IACzE,YAAY,EAAE,MAAM,CAAA;IACpB,kEAAkE;IAClE,KAAK,EAAE,MAAM,CAAA;IACb,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,UAAU,CAAC,EAAE,SAAS,eAAe,EAAE,CAAA;IACvC,wEAAwE;IACxE,oBAAoB,CAAC,EAAE,MAAM,CAAA;CAC9B;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAA;IACb,0DAA0D;IAC1D,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;IACf,kEAAkE;IAClE,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAA;CACxC;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,mBAAmB
|
|
1
|
+
{"version":3,"file":"hosted-harness.d.ts","sourceRoot":"","sources":["../src/hosted-harness.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAo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AO,CAAC,CAAA;IAChC,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED,MAAM,WAAW,YAAY;IAC3B,4DAA4D;IAC5D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,8EAA8E;IAC9E,KAAK,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC;QAAE,cAAc,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IACrE;;;;;OAKG;IACH,SAAS,CAAC,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,WAAW,GAAG,aAAa,CAAC,YAAY,CAAC,CAAA;IAClF,2EAA2E;IAC3E,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IACrB,gEAAgE;IAChE,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CAC1B"}
|
package/dist/hosted-harness.js
CHANGED
|
@@ -48,13 +48,16 @@ export const HARNESS_EVENT_KINDS = {
|
|
|
48
48
|
egress_allowed: 'egress_allowed',
|
|
49
49
|
// Durability + headless (ALI-1036 / ALI-1037). NOT produced by a harness — the
|
|
50
50
|
// in-sandbox loop emits these through the SAME single-writer run-event sink:
|
|
51
|
-
// the end-of-run auto-harvest result (
|
|
51
|
+
// the end-of-run auto-harvest result (persisted/none/not-inspected/failed)
|
|
52
52
|
// and the headless question auto-handling record (question_auto_answered). They
|
|
53
53
|
// are ordinary structural events (never terminal), appended like any other.
|
|
54
54
|
work_persisted: 'work_persisted',
|
|
55
55
|
work_none: 'work_none',
|
|
56
|
+
work_not_inspected: 'work_not_inspected',
|
|
56
57
|
work_persist_failed: 'work_persist_failed',
|
|
57
58
|
question_auto_answered: 'question_auto_answered',
|
|
59
|
+
question_pending: 'question_pending',
|
|
60
|
+
question_invalid: 'question_invalid',
|
|
58
61
|
error: 'error',
|
|
59
62
|
execution_complete: 'execution_complete',
|
|
60
63
|
};
|
package/dist/hosted-harvest.d.ts
CHANGED
|
@@ -11,16 +11,18 @@
|
|
|
11
11
|
* 2. If dirty: `git add -A` then `git commit` attributed to the agent identity
|
|
12
12
|
* (AGENT_GIT_IDENTITY) with message `checkpoint: run <runId> auto-harvest`.
|
|
13
13
|
* 3. If there is anything unpushed (a fresh checkpoint OR pre-existing local
|
|
14
|
-
* commits the agent made but did not push),
|
|
15
|
-
*
|
|
14
|
+
* commits the agent made but did not push), push the exact HEAD SHA to the
|
|
15
|
+
* session branch at bootstrap's independently validated repository locator.
|
|
16
16
|
* 4. Return a typed outcome the loop records as a run event: `work_persisted`
|
|
17
|
-
* (sha + files), `work_none` (clean, nothing to push),
|
|
18
|
-
* (error). Harvest NEVER throws —
|
|
19
|
-
*
|
|
17
|
+
* (sha + files), `work_none` (clean, nothing to push), `work_not_inspected`
|
|
18
|
+
* (safety-gated), or `work_persist_failed` (error). Harvest NEVER throws —
|
|
19
|
+
* a harvest failure must not change the run's terminal status; it is recorded
|
|
20
|
+
* and the run proceeds to terminal.
|
|
20
21
|
*
|
|
21
22
|
* The loop runs IN the sandbox, so git is driven with `child_process` (matching
|
|
22
23
|
* `defaultRunSetupHook` / `installOpenCodePinned` in `hosted-loop.ts`). `exec` is
|
|
23
|
-
* injectable so the whole thing is unit-testable with no real git
|
|
24
|
+
* injectable so the whole thing is unit-testable with no real git; the HTTPS
|
|
25
|
+
* smart-Git boundary tests independently prove the production transport.
|
|
24
26
|
*/
|
|
25
27
|
export interface HarvestExecResult {
|
|
26
28
|
exitCode: number;
|
|
@@ -33,19 +35,28 @@ export interface HarvestOptions {
|
|
|
33
35
|
/** Directory of the cloned session-branch workspace (the loop's cwd for git). */
|
|
34
36
|
workspaceDir: string;
|
|
35
37
|
runId: string;
|
|
38
|
+
/** Validated session branch that receives the exact checkpoint commit. */
|
|
39
|
+
sessionBranch: string;
|
|
40
|
+
/** Credential-free, bootstrap-validated repository locator. */
|
|
41
|
+
repositoryRemote: string;
|
|
42
|
+
/** Bootstrap-owned credential helper; never read back from mutable repo config. */
|
|
43
|
+
credentialHelper?: string;
|
|
36
44
|
/** Commit attribution (AGENT_GIT_IDENTITY from hosted-runtime-assets). */
|
|
37
45
|
author: {
|
|
38
46
|
name: string;
|
|
39
47
|
email: string;
|
|
40
48
|
};
|
|
49
|
+
/** Trusted test seams; production resolves from the measured image/host lists. */
|
|
50
|
+
caBundleCandidates?: readonly string[];
|
|
51
|
+
caPathCandidates?: readonly string[];
|
|
41
52
|
/** Injectable git runner (default: real `git` via child_process). */
|
|
42
53
|
exec?: HarvestExec;
|
|
43
54
|
/**
|
|
44
55
|
* Safety gate (review finding #1): the default exec runs REAL `git add/commit/
|
|
45
56
|
* push` in `workspaceDir`. Real harvest must be affirmatively enabled — the loop
|
|
46
57
|
* only enables it inside a genuine hosted sandbox (prebaked marker present). When
|
|
47
|
-
* false AND no `exec` is injected, harvest is a no-op (`
|
|
48
|
-
* workspaceDir (a test, a dev run) can never commit/push a host repo. An injected
|
|
58
|
+
* false AND no `exec` is injected, harvest is a no-op (`work_not_inspected`) so
|
|
59
|
+
* an errant workspaceDir (a test, a dev run) can never commit/push a host repo. An injected
|
|
49
60
|
* `exec` always wins (tests that DO drive harvest).
|
|
50
61
|
*/
|
|
51
62
|
enabled?: boolean;
|
|
@@ -53,13 +64,23 @@ export interface HarvestOptions {
|
|
|
53
64
|
export type HarvestOutcome = {
|
|
54
65
|
kind: 'work_persisted';
|
|
55
66
|
sha: string;
|
|
56
|
-
files: string[];
|
|
67
|
+
files: string[] | null;
|
|
57
68
|
} | {
|
|
58
69
|
kind: 'work_none';
|
|
70
|
+
} | {
|
|
71
|
+
kind: 'work_not_inspected';
|
|
59
72
|
} | {
|
|
60
73
|
kind: 'work_persist_failed';
|
|
61
74
|
error: string;
|
|
62
75
|
};
|
|
76
|
+
export declare const HOSTED_HARVEST_CA_BUNDLE_CANDIDATES: readonly ["/etc/pki/tls/certs/ca-bundle.crt", "/etc/ssl/certs/ca-certificates.crt", "/etc/ssl/cert.pem"];
|
|
77
|
+
export declare const HOSTED_HARVEST_CA_PATH_CANDIDATES: readonly ["/etc/pki/ca-trust/extracted/pem/directory-hash", "/etc/ssl/certs"];
|
|
78
|
+
export declare const HOSTED_HARVEST_TRANSPORT_POLICY: {
|
|
79
|
+
readonly environmentDenylist: readonly ["HTTP_PROXY", "http_proxy", "HTTPS_PROXY", "https_proxy", "ALL_PROXY", "all_proxy", "GIT_SSL_NO_VERIFY", "GIT_PROXY_COMMAND", "GIT_SSL_CAINFO", "GIT_SSL_CAPATH", "CURL_CA_BUNDLE", "SSL_CERT_FILE", "SSL_CERT_DIR", "GIT_SSL_CERT", "GIT_SSL_KEY", "GIT_ASKPASS", "GIT_ASKPASS_REQUIRE", "SSH_ASKPASS", "SSH_ASKPASS_REQUIRE", "GIT_TERMINAL_PROMPT"];
|
|
80
|
+
readonly exactUrlHttpConfig: readonly [readonly ["proxy", ""], readonly ["sslVerify", "true"], readonly ["curloptResolve", ""], readonly ["followRedirects", "false"]];
|
|
81
|
+
readonly rejectedLocalHttpKeys: readonly ["sslcert", "sslkey", "sslcertpasswordprotected", "sslbackend", "pinnedpubkey", "sslversion", "sslcipherlist"];
|
|
82
|
+
};
|
|
83
|
+
export declare function resolveHostedHarvestCaBundle(candidates?: readonly string[]): string | null;
|
|
63
84
|
/**
|
|
64
85
|
* Persist any uncommitted or unpushed work in the workspace. Deterministic and
|
|
65
86
|
* total: every path returns a `HarvestOutcome`, never throws.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hosted-harvest.d.ts","sourceRoot":"","sources":["../src/hosted-harvest.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"hosted-harvest.d.ts","sourceRoot":"","sources":["../src/hosted-harvest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAaH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;CACf;AAED,iFAAiF;AACj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