/** * [ref] §8 F2(a) — worker SELF-UPLOAD diff-out (the factory-env counterpart of diffout.ts's pullDiff). * * With a factory env the runner owns the container lifecycle (create at task start, destroy at finish — and * durable suspend only produces a complete ownedEnv on this path), so the leader can no longer pull the diff * from a still-alive env after the task. Instead (the gate#2-proven MinIO presigned pattern): * 1. the env factory STAGES each fresh container (seed repo + write an upload script holding a presigned * PUT URL) — adapter-side, so the URL/bulk never enters the model's CONTEXT by construction (it does sit * on the sandbox filesystem, readable if the agent goes looking — the objective forbids inspecting it; * the URL is single-object, PUT-only, short-TTL, so that residual face is small); * 2. the worker's objective ends with a MANDATORY final step: run the upload script (`git format-patch` → * `curl -T ` — a real file, so Content-Length is set; MinIO 411-rejects chunked presigned PUTs); * 3. after fan-out the leader fetches the object over a presigned GET on the CONTROL PLANE (fetchUploadedDiff). * A worker that skips the upload surfaces as `{ok:false}` → merge quarantines it (honest failure, no hang). * pullDiff stays as the compat path for static (leader-owned) envs — M2 降兼容. */ import { type PullDiffResult } from "./diffout.js"; /** The staged upload script. `repoDir`/`workDir` are deployment config; `baseSha` is interpolated into a * shell line, so it is re-validated HERE (fail-closed) — callers should already have applied diffout's * safeRev rules, but this function is the last line before the shell. The patch is written OUTSIDE the repo * dir so it never shows up as untracked noise in the worker's `git status`. */ export declare function buildUploadScript(p: { repoDir: string; baseSha: string; putUrl: string; workDir: string; }): string; /** The objective suffix that makes the upload the worker's last task step (no URL through the model). */ export declare function uploadStepSuffix(workDir: string): string; /** * Fetch the worker-uploaded patch over a presigned GET (control plane; creds stay adapter-held). Returns the * same result shape as pullDiff so merge consumes either path. 🔴 The presigned URL is a short-lived bearer * credential — it must never appear in returned errors (gate#3 council#5 redaction rule). */ export declare function fetchUploadedDiff(getUrl: string, opts?: { maxBytes?: number; fetchImpl?: typeof fetch; }): Promise; /** * Wrap an ExecutionEnv so a one-shot `stage(env)` (seed repo + write the upload script) runs before the FIRST * workspace-touching call — the adapters are lazy-connect, so there is no explicit connect() hook to ride; this * guarantees seed-before-agent on whichever call comes first. A failed staging rejects that call (task fails * honestly) and RESETS, so a retried call re-attempts staging instead of replaying a cached rejection. */ export declare function withStaging(env: T, stage: (env: T) => Promise, finalize?: (env: T) => Promise): T; //# sourceMappingURL=diffup.d.ts.map