feat: give tasks durable project-optional workspaces (#15749)

Give tasks durable company-scoped workspace bindings independent of project assignment, channel defaults and authorized repository preparation. Reuse verified input seeds and sparse output recovery while preserving trust, privacy and controller provisioning boundaries.

Full CI and E2E, Superagent, legacy checks and Greptile Apex 5/5 passed on reviewed head 753680b61c. All review findings are resolved; the PR records focused verification and historical acceptance limits.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
DottaandPaperclip authored and GitHub committed 2026-10-12 20:45:18 -05:00
1 parent 4b958ecbd8
commit f329b24ee1
237 files changed
+191962 -1483

No files matched your search

+18
View File
@@ -853,3 +853,21 @@ not task success or operator cancellation. Stop during an unresolved permission
remains a separate `native-active-stop/pending-permission-stop` gate.
Pi controls definition 9 and native definition 16 create an explicit title through the production search creation action and bind the task ID from the public creation response. The scoped task and assignee must match before any native control. Automatic naming is outside these strict native-operation fixtures; all existing permission, byte, process, run-count and cleanup assertions remain required. Preserve the failed title-lookup attempt as its original failure.
## Projectless task files and repository admission
The explicit `task_workspaces` flow supplies no project and strips the legacy
profile's operator cwd. It retains the ordinary company, encrypted credentials,
environment and agent fixtures. All mutations use production browser/API/semantic
surfaces; the oracle never inserts database rows or prepares a replacement checkout.
The passive public Git source is `https://github.com/octocat/Hello-World`.
No GitHub credentials, remote repository creation or push is used.
Three user-requested turns test pending idempotent preparation, controller restart,
next-admission realization and later nested Git/dirty-file persistence. The source
pin is observed from the real checkout rather than assumed from a mutable branch.
Host Git inspection is limited to the verified isolated company/task root. Public
execution-workspace file reads and run-attributed artifact downloads verify bytes.
Calibration rejects wrong roots, missing history, changed pins, duplicate receipts,
extra wakes, incomplete persistence, tool bypass and missing remote leases. Partial
observations remain in retained attempt evidence; missing evidence cannot pass.
+42
View File
@@ -2178,6 +2178,48 @@ always preserves recovery state regardless of this optional diagnostic flag.
The `file-edit-validate` fixture independently downloads the exact active artifact work product from the tested run. It requires the matching run-attributed attachment, filename, MIME type, recorded byte count and SHA-256, then compares the downloaded content to the expected bytes. A workspace file alone cannot satisfy this gate. Explicit failed-case diagnostic retention follows the final result after integrity, isolation and evidence checks, including incomplete publication.
## Projectless task workspaces (explicit-only)
`task-workspaces` contains exactly three cells: legacy OpenCode locally and native
OpenCode locally and on Daytona, using the existing qualified model. These are
configured acceptance cells; registration and fixture calibration do not establish
live qualification.
```sh
pnpm test:e2e:runner -- --list --suite task-workspaces
pnpm test:e2e:runner -- --id task-workspaces.legacy-opencode.local.task-directory-repository-resume --max-automatic-retries 0
pnpm test:e2e:runner -- --id task-workspaces.runner-opencode.local.task-directory-repository-resume --max-automatic-retries 0
pnpm test:e2e:runner -- --id task-workspaces.runner-opencode.daytona.task-directory-repository-resume --max-automatic-retries 0
```
Each cell creates a task through the browser without a project or configured
adapter cwd. The first turn writes task files and requests the same public
repository preparation twice. Independent APIs must show one pending receipt
and the same original root. After a controller restart, the second admission
prepares the repository; the agent makes a local commit and leaves a dirty file.
The third turn copies those prior bytes into a registered downloadable artifact.
The oracle checks the task's exact root and stable binding, public file reads,
repository pin, local Git ancestry and dirty bytes, artifact metadata/digest,
three attributed successful runs, durable native terminal events and remote
lease attribution. Daytona uses per-turn leases, so a warm process cannot stand
in for persisted files. This suite does not qualify channel-default configuration
or arbitrary repository credentials.
These cells exercise trusted app-created tasks. Low-trust chat tasks cannot use
`prepare_repository` to initiate controller clones, even for public URLs with
full-auto provider permissions. Their pending acquisitions fail after a trust
downgrade; verified existing public checkouts can be reused without acquisition.
No-repository admission and immutable recovery remain supported. Trusted
acquisition does not yet impose repository byte or cumulative storage quotas.
Each cell allows three turns, one attempt, four minutes per turn and fifteen
minutes total, with 1,000-cent company and agent budget hard stops. `--all` excludes
it. `OPENROUTER_API_KEY` is required; Daytona also requires `DAYTONA_API_KEY`, a
verified immutable image and its matching remote runner/provider artifacts.
Use the normal isolated-instance cleanup and report pipeline. Private evidence
includes `snapshots/task-workspaces.json` and `task-workspaces-runs.json`; only
marked synthetic task screenshots can enter the public projection.
## Repository skill packages
The explicit `repository-skills` suite imports the private
+11
View File
@@ -342,3 +342,14 @@ descriptor launches with synthetic owned processes and no provider credentials;
it does not qualify paid Pi behavior or change previous failed grades.
The private resource-admission marker and raw cleanup results control recovery-state retention independently of evidence packaging. A worker crash after admission keeps the owner-only recovery database; a confirmed pre-allocation bootstrap failure does not. Neither the marker nor the database enters published evidence.
## Task workspace fixture source
The explicit task-workspaces cells fetch the existing public octocat/Hello-World
repository through normal anonymous repository preparation. They do not clone the
Paperclip checkout, copy its Git credentials, create remote repositories or push.
The agent's synthetic commit remains in the disposable task workspace. Independent
Git reads validate that workspace's canonical path is inside the isolated instance
before examining history. The existing credential redactor, private evidence
packager and task-only screenshot allowlist remain authoritative. Each cell has a
single attempt, three requested turns and company/agent budget hard stops.
+3 -3
View File
@@ -159,10 +159,10 @@ describe("runner E2E catalog", () => {
expect(localIntegrityTasks).toHaveLength(2);
expect(openRouterBreadthTasks).toHaveLength(3);
expect(runnerSuites.map((suite) => suite.expectedMatrixSize)).toEqual([
4, 8, 10, 4, 4, 6, 63, 12, 6, 2, 30, 3, 16, 16, 2, 6, 8, 46, 2, 23, 15, 52, 6, 6, 20, 26, 52, 28, 18, 2, 6, 6, 12, 10, 48, 16, 10, 2, 1, 1, 116, 2,
3, 4, 8, 10, 4, 4, 6, 63, 12, 6, 2, 30, 3, 16, 16, 2, 6, 8, 46, 2, 23, 15, 52, 6, 6, 20, 26, 52, 28, 18, 2, 6, 6, 12, 10, 48, 16, 10, 2, 1, 1, 116, 2,
]);
expect(validateRunnerCatalog()).toHaveLength(726);
expect(new Set(runnerMatrix.map((entry) => entry.id)).size).toBe(726);
expect(validateRunnerCatalog()).toHaveLength(729);
expect(new Set(runnerMatrix.map((entry) => entry.id)).size).toBe(729);
expect(
runnerMatrix.filter((entry) => entry.suite.id === "core-compatibility"),
).toHaveLength(48);
+11
View File
@@ -1,3 +1,4 @@
import { TASK_WORKSPACES_SUITE, taskWorkspaceTask, taskWorkspaceProfile, taskWorkspaceDefinitionDigest } from "./task-workspaces-cases.js";
import { nativeActiveStopTasks } from "./native-active-stop-tasks.js";
import { piControlTasks } from "./pi-controls-cases.js";
import { cursorNativeTasks } from "./cursor-native-cases.js";
@@ -1104,6 +1105,16 @@ export const extendedHarnessFileTask: RunnerTaskFixture = {
};
export const runnerSuites: readonly RunnerSuiteFixture[] = [
{
id: TASK_WORKSPACES_SUITE, label: "Task workspaces without projects", manualOnly: true,
description: "Three browser-driven admissions prove deferred repository preparation, stable projectless task files and nested Git persistence across a controller restart.",
groups: [], profiles: runnerProfiles.filter(profile => ["legacy-opencode", "runner-opencode"].includes(profile.id)).map(taskWorkspaceProfile),
environments: runnerEnvironments, tasks: [taskWorkspaceTask],
excludedExecutionIds: ["task-workspaces.legacy-opencode.daytona.task-directory-repository-resume"],
expectedMatrixSize: 3,
definitionMetadata: { version: 1, definitionDigest: taskWorkspaceDefinitionDigest(), scheduling: "explicit-only", providerTurns: 3,
attempts: 1, budgetMonthlyCents: 1000, project: "none", cwd: "unconfigured-task-default", oracle: "public-file-download-and-host-nested-git", remoteLifecycle: "per_turn" },
},
{
id: "pi-controls", label: "Pi active controls", manualOnly: true,
description: "Pending native-write Stop and browser-originated same-turn steering, with exact control receipts and independent retirement/no-effect evidence.",
+1 -1
View File
@@ -142,7 +142,7 @@ export async function setupLiveFixtures(input: {
budgetMonthlyCents: ["native-completion", "native-instruction-consolidation", "native-connection-guidance"].includes(execution.suite.id)
|| (execution.suite.id === "everyday-workflows" && ["hire-reuse", "delegate-feedback"].includes(execution.task.id)) ? NATIVE_COMPLETION_BUDGET_CENTS
: execution.suite.id === "task-titles" ? TASK_TITLE_BUDGET_CENTS
: execution.suite.id === "stock-harness" ? 1_000 : 0,
: ["stock-harness", "task-workspaces"].includes(execution.suite.id) ? 1_000 : 0,
});
},
async teardown() {
@@ -180,7 +180,7 @@ describe("Pi controls catalog admission", () => {
expect(cells).toHaveLength(4); expect(cells.every(c => c.profile.qualificationCandidate === "pi" && c.task.expectedRunCount === 1)).toBe(true);
expect(cells.map(c => `${c.environment.id}/${c.task.id}`).sort()).toEqual(["daytona/pending-permission-stop", "daytona/same-turn-steering", "local/pending-permission-stop", "local/same-turn-steering"]);
expect(selectRunnerExecutions(parseRunnerSelectors(["--all"])).some(c => c.suite.id === "pi-controls")).toBe(false);
expect(validateRunnerCatalog()).toHaveLength(726);
expect(validateRunnerCatalog()).toHaveLength(729);
for (const cell of cells) expect(buildRunnerE2EProcessEnvironment({}, [cell]).PAPERCLIP_RUNNER_ACPX_QUALIFICATION).toBeUndefined();
expect(() => assertRemoteNativeEvidencePrerequisites(cells, {})).toThrow();
});
+22 -3
View File
@@ -13,18 +13,37 @@ function fixture() {
return { product, attachment, download, get, api: { get, request: { get: download } } as unknown as RunnerApi };
}
it("downloads the exact registered run-attributed output through its public path", async () => {
const { api, download } = fixture();
it.each(["active", "ready_for_review", "approved"])("downloads the exact registered run-attributed %s output through its public path", async status => {
const { api, product, download } = fixture();
product.status = status;
const artifacts = await readRegisteredArtifacts(api, "issue", "run", ["proof.txt"]);
expect(download).toHaveBeenCalledWith("/api/attachments/attachment/content?download=1");
expect((await evaluateMatcher({ kind: "artifact_exact", name: "proof.txt", expected: "verified\n", mimeType: "text/plain" }, { artifacts })).passed).toBe(true);
});
it.each(["unregistered", "old-run", "unattributed", "hash-mismatch", "download-failure"])("refuses %s output evidence", async reason => {
it.each(["draft", "changes_requested", "merged", "closed", "failed", "archived", "superseded", "withdrawn", "unknown"])("refuses %s artifact registrations before downloading", async status => {
const { api, product, download } = fixture();
product.status = status;
await expect(readRegisteredArtifacts(api, "issue", "run", ["proof.txt"])).rejects.toThrow("Expected one registered artifact");
expect(download).not.toHaveBeenCalled();
});
it.each(["unregistered", "duplicate", "old-run", "unattributed", "wrong-issue", "wrong-attachment-issue", "wrong-type", "wrong-title", "wrong-filename", "wrong-attachment-id", "negative-size", "excessive-size", "size-mismatch", "hash-mismatch", "download-failure"])("refuses %s output evidence even when ready for review", async reason => {
const { api, product, attachment, get, download } = fixture();
product.status = "ready_for_review";
if (reason === "unregistered") get.mockImplementation(async (path: string) => path.endsWith("work-products") ? [] : [attachment]);
if (reason === "duplicate") get.mockImplementation(async (path: string) => path.endsWith("work-products") ? [product, { ...product, id: "duplicate", status: "approved" }] : [attachment]);
if (reason === "old-run") product.createdByRunId = "other-run";
if (reason === "unattributed") attachment.originatingRunId = "other-run";
if (reason === "wrong-issue") product.issueId = "other-issue";
if (reason === "wrong-attachment-issue") attachment.issueId = "other-issue";
if (reason === "wrong-type") product.type = "document";
if (reason === "wrong-title") product.title = "other.txt";
if (reason === "wrong-filename") attachment.originalFilename = "other.txt";
if (reason === "wrong-attachment-id") product.metadata.attachmentId = "other-attachment";
if (reason === "negative-size") attachment.byteSize = -1;
if (reason === "excessive-size") attachment.byteSize = 262_145;
if (reason === "size-mismatch") attachment.byteSize += 1;
if (reason === "hash-mismatch") attachment.sha256 = "incorrect";
if (reason === "download-failure") download.mockResolvedValue({ ok: () => false, status: () => 404 });
await expect(readRegisteredArtifacts(api, "issue", "run", ["proof.txt"])).rejects.toThrow();
+3 -1
View File
@@ -3,6 +3,8 @@ import type { IssueAttachment } from "../../packages/shared/src/types/issue.js";
import type { IssueWorkProduct } from "../../packages/shared/src/types/work-product.js";
import type { RunnerApi } from "./api.js";
const REGISTERED_ARTIFACT_STATUSES = new Set(["active", "ready_for_review", "approved"]);
/** Registration, attribution and downloaded bytes must agree independently. */
export async function readRegisteredArtifacts(api: RunnerApi, issueId: string, runId: string, names: readonly string[]) {
if (names.length === 0) return [];
@@ -13,7 +15,7 @@ export async function readRegisteredArtifacts(api: RunnerApi, issueId: string, r
return Promise.all(names.map(async name => {
const registered = products.filter(product => product.issueId === issueId &&
product.createdByRunId === runId && product.type === "artifact" &&
product.status === "active" && product.title === name);
REGISTERED_ARTIFACT_STATUSES.has(product.status) && product.title === name);
if (registered.length !== 1) throw new Error(`Expected one registered artifact ${name} from the tested run; observed ${registered.length}`);
const product = registered[0]!;
const attachmentId = product.metadata?.attachmentId;
+12 -1
View File
@@ -1,3 +1,4 @@
import { runTaskWorkspacesFlow } from "./task-workspaces-flow.js";
import type { RestartRunnerIdentity } from "./process-tree-owner.js";
import { runNativeActiveStopFlow } from "./native-active-stop-flow.js";
import { runPiControlsFlow } from "./pi-controls-flow.js";
@@ -983,7 +984,17 @@ for (const execution of executions) {
secrets,
);
if (execution.task.flow === "public_mcp") {
if (execution.task.flow === "task_workspaces") {
const journey = await runTaskWorkspacesFlow({ page, api, fixtures, execution, nonce, temporaryRoot,
deadlineAt: startedAtMs + deadlineMs - 30_000,
restart: () => restartIsolatedPaperclipServer({ api, requestId: `task-workspaces-${nonce}`, deadlineAt: startedAtMs + deadlineMs }),
observe: (currentIssue, currentRuns, checks) => {
issue = currentIssue as IssueRecord; selectedRuns = currentRuns as RunRecord[];
matcherResults = checks.map(check => ({ matcher: { kind: "json_path" as const, path: `taskWorkspaces.${check.id}`, expected: true }, passed: check.passed, detail: check.detail }));
}, capture: captureScreenshot, evidence: (name, data) => writeSanitizedJson(snapshotsDir, name, data, secrets),
});
issue = journey.issue as IssueRecord; selectedRuns = journey.runs as RunRecord[];
} else if (execution.task.flow === "public_mcp") {
const journey = await runPublicMcpFlow({
page, api, fixtures, execution, nonce, secrets, userId: publicMcpUserId,
credential: credentials[execution.profile.credential]!, usage: publicMcpUsage!, deadlineAt: startedAtMs + deadlineMs,
+73
View File
@@ -0,0 +1,73 @@
import { createHash } from "node:crypto";
import { readFileSync } from "node:fs";
import type { RunnerProfileFixture, RunnerTaskFixture } from "./types.js";
export const TASK_WORKSPACES_SUITE = "task-workspaces";
export const TASK_WORKSPACES_BUDGET_CENTS = 1_000;
export const TASK_REPOSITORY_URL = "https://github.com/octocat/Hello-World";
export function taskWorkspaceFiles(nonce: string) {
return { note: `task-note-${nonce}.txt`, proof: `task-proof-${nonce}.txt`, repositoryFile: `repository-proof-${nonce}.txt`,
noteBytes: (turn: number) => `task-files-turn-${turn}-${nonce}\n`, repositoryBytes: `repository-dirty-${nonce}\n` };
}
export function taskWorkspaceProfile(profile: RunnerProfileFixture): RunnerProfileFixture {
return { ...profile, buildAgent(input) {
const agent = profile.buildAgent(input);
const { cwd: _cwd, ...adapterConfig } = agent.adapterConfig as Record<string, unknown>;
return { ...agent, adapterConfig, budgetMonthlyCents: TASK_WORKSPACES_BUDGET_CENTS };
} };
}
export function taskWorkspacePrompt(nonce: string, turn: 1 | 2 | 3, native: boolean) {
const files = taskWorkspaceFiles(nonce);
const inspect = native ? "Use get_workspace to inspect your admitted task workspace."
: "GET /api/issues/$PAPERCLIP_TASK_ID/workspace through the authenticated public API to inspect your task workspace.";
const api = native ? "Use the real Paperclip semantic tools."
: 'Use the injected PAPERCLIP_API_URL, PAPERCLIP_API_KEY and PAPERCLIP_RUN_ID for the public API. Normalize API_ORIGIN="${PAPERCLIP_API_URL%/}"; API_ORIGIN="${API_ORIGIN%/api}". Include Authorization: Bearer and X-Paperclip-Run-Id on API requests. Never print credentials.';
const content = turn === 1 ? [
"This is the first of three separately requested steps. Do only this step now; a later user message will request the next step.",
inspect,
`In the current task directory write ${files.note} with exactly ${JSON.stringify(files.noteBytes(1))}. Keep task files outside AGENT_HOME.`,
"Stage a repository for the NEXT normal admission; do not clone it yourself, create a project, switch roots, wait for a new run, or wake this task.",
native ? `Call prepare_repository twice with exactly {repository:{kind:"url",url:"${TASK_REPOSITORY_URL}"},requestKey:"repository-${nonce}"}. Both calls must report the same preparation receipt and next_normal_admission.`
: `POST /api/issues/$PAPERCLIP_TASK_ID/workspace/repositories twice with the same JSON {"repository":{"kind":"url","url":"${TASK_REPOSITORY_URL}"},"requestKey":"repository-${nonce}"}. Both replies must return the same operationId and next_normal_admission.`,
"Inspect the workspace again. Its identity/root must be unchanged and the repository should still be pending. The repository need not exist yet. The objective of this step is staged preparation, not a completed clone.",
] : turn === 2 ? [
"Continue this same task after the controller restart. Do only step two now.", inspect,
`Read ${files.note} and require its exact bytes to be ${JSON.stringify(files.noteBytes(1))}; fail visibly if missing or different.`,
"The previously staged repository must now be ready in the reported contained relativePath. Do not prepare or clone a replacement, create a project, or switch the task root.",
`Inside that checkout create ${files.repositoryFile} containing exactly ${JSON.stringify(`repository-committed-${nonce}\n`)}. Commit ONLY that file using git -c user.name='Workspace Fixture' -c user.email='fixture@example.test' commit with message workspace-proof-${nonce}. Do not push.`,
`Then overwrite that committed file with exactly ${JSON.stringify(files.repositoryBytes)}, leaving this local change uncommitted.`,
`Update the task-root ${files.note} to exactly ${JSON.stringify(files.noteBytes(2))}.`,
] : [
"Continue this same task with the final step. Do not recreate a missing repository or missing earlier files.", inspect,
`Read ${files.note}; require exactly ${JSON.stringify(files.noteBytes(2))}.`,
`Read the existing ${files.repositoryFile} in the prepared checkout. Copy its bytes unchanged to ${files.proof} in the task root. Do not edit or commit the repository in this step.`,
`Update ${files.note} to exactly ${JSON.stringify(files.noteBytes(3))}.`,
`Register ${files.proof} as a downloadable artifact work product with exact title ${files.proof}.`,
];
return [...content, "The quoted \\n escapes denote actual LF bytes. Include the final LF when writing each exact string; verify byte counts before finishing.", api,
turn < 3 ? "Save a short Paperclip task document describing this completed step as its durable work product. Then complete this step and mark the task Done; do not wait for the next user message."
: "Validate the written and downloaded-proof source bytes before completing the task.",
native ? "Use paperclip_finish with reportedWorkDisposition done, the current completion contract revision, satisfied objective criterion, real evidence references, and no remaining work for THIS requested step."
: "Complete through the normal public task API after saving the work product.",
`Use TASK-WORKSPACE-${turn}-${nonce} as the completion summary and final response. Do not do unrelated work.`,
].join("\n");
}
export const taskWorkspaceTask: RunnerTaskFixture = {
id: "task-directory-repository-resume", label: "Task files, repository preparation and restart", groups: [],
flow: "task_workspaces", workMode: "standard", expectedRunCount: 3, automaticRetryPolicy: "single_attempt",
attemptTimeoutMs: { local: 15 * 60_000, daytona: 15 * 60_000 }, turnTimeoutMs: 4 * 60_000,
expectedTerminalState: { issue: "done", run: "succeeded" },
buildTitle: nonce => `Task files without a project ${nonce}`,
buildVisibleMarker: nonce => `TASK-WORKSPACE-3-${nonce}`,
buildPrompt: nonce => taskWorkspacePrompt(nonce, 1, true), buildMatchers: () => [],
};
export function taskWorkspaceDefinitionDigest() {
const hash = createHash("sha256");
for (const file of ["task-workspaces-cases.ts", "task-workspaces-flow.ts", "task-workspaces-scoring.ts", "registered-artifact.ts", "live-fixtures.ts", "runner.spec.ts"]) {
hash.update(file).update(readFileSync(new URL(file, import.meta.url)));
}
return hash.digest("hex");
}
+182
View File
@@ -0,0 +1,182 @@
import { expect, type Page } from "@playwright/test";
import { execFile as execFileCallback } from "node:child_process";
import { promisify } from "node:util";
import { realpath } from "node:fs/promises";
import path from "node:path";
import { pollUntil, type RunnerApi } from "./api.js";
import { createTaskThroughUi, submitTaskReply } from "./user-actions.js";
import { collectRunEvents } from "./run-observations.js";
import { restartChatServer } from "./chat-restart.js";
import { readRegisteredArtifacts } from "./registered-artifact.js";
import { TASK_WORKSPACES_BUDGET_CENTS, taskWorkspaceFiles, taskWorkspacePrompt } from "./task-workspaces-cases.js";
import { gradeTaskWorkspaces, isRepositoryPreparationReceipt, type TaskWorkspaceCheckpoint, type TaskWorkspaceObservation } from "./task-workspaces-scoring.js";
import type { LiveFixtureValues } from "./live-fixtures.js";
import type { MatrixExecution } from "./types.js";
type Row = Record<string, any>;
const execFile = promisify(execFileCallback);
const terminal = new Set(["succeeded", "failed", "cancelled", "timed_out"]);
export async function runTaskWorkspacesFlow(input: {
page: Page; api: RunnerApi; fixtures: LiveFixtureValues; execution: MatrixExecution; nonce: string;
temporaryRoot: string; deadlineAt: number;
restart(): Promise<unknown>;
observe(issue: Row, runs: Row[], checks: ReturnType<typeof gradeTaskWorkspaces>): void;
capture(id: string, label: string, file: string): Promise<void>;
evidence(name: string, value: unknown): Promise<void>;
}) {
const { page, api, fixtures, execution, nonce } = input;
const native = execution.profile.generation === "native";
const files = taskWorkspaceFiles(nonce);
const companyPath = `/api/companies/${fixtures.company.id}`;
let issue: Row | undefined;
let runs: Row[] = [];
const evidence: TaskWorkspaceObservation = { nonce, native, daytona: execution.environment.id === "daytona", initial: null,
checkpoints: [], projectCount: -1, runCount: 0, restarted: false, pendingInteractions: -1, activeOperations: -1,
activeRecovery: true, artifact: null, remoteLeaseRunIds: [] };
const eventEvidence: Array<{ runId: string; events: Row[] }> = [];
async function refresh() {
if (!issue) return;
issue = await api.get<Row>(`/api/issues/${issue.id}`);
const listed = await api.get<Row[]>(`${companyPath}/heartbeat-runs?limit=100`);
runs = await Promise.all(listed.map(run => api.get<Row>(`/api/heartbeat-runs/${run.id}`)));
runs.sort((a, b) => String(a.createdAt).localeCompare(String(b.createdAt)) || a.id.localeCompare(b.id));
evidence.runCount = runs.length;
}
async function save(phase: string) {
const checks = gradeTaskWorkspaces(evidence);
if (issue) input.observe(issue, runs, checks);
await input.evidence("task-workspaces.json", { schema: "paperclip.e2e.task-workspaces.v1", phase,
budgetMonthlyCents: TASK_WORKSPACES_BUDGET_CENTS, expectedTurns: 3, observation: evidence, checks });
await input.evidence("task-workspaces-runs.json", { runs, events: eventEvidence });
}
async function readFile(relativePath: string) {
const response = await api.get<Row>(`/api/issues/${issue!.id}/file-resources/content?workspace=execution&path=${encodeURIComponent(relativePath)}`);
if (response.resource?.workspaceKind !== "execution_workspace" || typeof response.content?.data !== "string") {
throw new Error("Task file oracle did not return execution-workspace text bytes");
}
return response.content.data as string;
}
async function observeWorkspace() {
const view = await api.get<Row>(`/api/issues/${issue!.id}/workspace`);
if (!view.workspace?.id || !view.workspace.cwd) throw new Error("Task has no durable workspace binding");
const cwd = await realpath(view.workspace.cwd);
const isolated = await realpath(input.temporaryRoot);
const suffix = `/isolated-workspaces/${fixtures.company.id}/${issue!.id}`;
const confinedTaskRoot = cwd.startsWith(`${isolated}${path.sep}`) && cwd.endsWith(suffix);
if (!confinedTaskRoot) throw new Error("Task workspace is not its confined company/task directory");
return { view, cwd, confinedTaskRoot };
}
async function settled(turn: number) {
await pollUntil({ label: `task workspace turn ${turn} durably settled`,
deadlineAt: Math.min(input.deadlineAt, Date.now() + (execution.task.turnTimeoutMs ?? 240_000)), intervalMs: 750,
load: async () => {
await refresh();
const [interactions, recovery] = await Promise.all([
api.get<Row[]>(`/api/issues/${issue!.id}/interactions`), api.get<Row>(`/api/issues/${issue!.id}/recovery-actions`),
]);
const operations = (await Promise.all(runs.map(run => api.get<Row[]>(`/api/heartbeat-runs/${run.id}/workspace-operations`)))).flat();
evidence.pendingInteractions = interactions.filter(row => row.status === "pending").length;
evidence.activeOperations = operations.filter(row => ["pending", "queued", "running"].includes(row.status)).length;
evidence.activeRecovery = [recovery.active, ...(recovery.actions ?? [])].some(row => row
&& ["active", "pending"].includes(row.status) && row.wakePolicy?.kind === "resume_native_run");
return { issue, runs };
},
accept: state => state.runs.length === turn && state.issue?.status === "done" && state.runs.every(run => run.status === "succeeded"
&& (!native || (run.nativePhase === "committed" && run.resultJson?.finalizationPhase === "committed")))
&& evidence.pendingInteractions === 0 && evidence.activeOperations === 0 && !evidence.activeRecovery,
reject: state => state.runs.length > turn ? "Unexpected extra provider run" : state.runs.some(run => terminal.has(run.status) && run.status !== "succeeded") ? "A requested turn failed" : undefined,
});
}
async function checkpoint(turn: 1 | 2 | 3) {
const { view, cwd, confinedTaskRoot } = await observeWorkspace();
const run = runs[turn - 1]!;
if (run.companyId !== fixtures.company.id || run.agentId !== fixtures.agent.id
|| ![run.nativeIssueId, run.issueId, run.contextSnapshot?.issueId, run.contextSnapshot?.taskId].includes(issue!.id)) {
throw new Error("Provider run is not attributed to the selected task and agent");
}
const events = await collectRunEvents<Row>((afterSeq, limit) => api.get(`/api/heartbeat-runs/${run.id}/events?afterSeq=${afterSeq}&limit=${limit}`));
eventEvidence.push({ runId: run.id, events });
const spans = events.filter(event => event.eventType === "run.performance.span").map(event => event.payload);
const nativeInput = run.runnerProfileJson?.nativeExecutionInput;
const point: TaskWorkspaceCheckpoint = { turn,
issue: { id: issue!.id, projectId: issue!.projectId, executionWorkspaceId: issue!.executionWorkspaceId, status: issue!.status, scheduledRetry: issue!.scheduledRetry },
workspace: { id: view.workspace.id, projectId: view.workspace.projectId, cwd }, confinedTaskRoot,
note: await readFile(files.note), repositories: view.repositories,
run: { id: run.id, status: run.status, runtimeMode: run.runtimeMode, nativePhase: run.nativePhase,
nativeBinding: nativeInput?.binding?.executionWorkspaceId, nativeCwd: nativeInput?.workspace?.cwd,
transport: spans.find(p => p?.span === "runner.transport.selected")?.mode,
authenticated: spans.some(p => p?.span === "runner.prp.authenticate" && p.outcome === "ok"),
nativeCompleted: events.some(event => event.eventType === "run.result.accepted" && event.payload?.prpEvent?.sourceKind === "control_plane"
&& event.payload.prpEvent.runId === run.id && event.payload.prpEvent.payload?.result?.reportedWorkDisposition === "done")
&& events.some(event => event.eventType === "run.terminal" && event.payload?.prpEvent?.sourceKind === "control_plane"
&& event.payload.prpEvent.runId === run.id && event.payload.prpEvent.payload?.runTerminalState === "succeeded") },
prepareCalls: events.filter(event => isRepositoryPreparationReceipt(event, run.id)).length,
};
if (turn > 1) {
const repository = view.repositories[0];
if (!repository || !/^\.paperclip-repositories\/task-repo-[a-f0-9]{24}$/.test(repository.relativePath)) throw new Error("No contained managed repository receipt");
const checkout = await realpath(path.join(cwd, repository.relativePath));
if (!checkout.startsWith(`${cwd}${path.sep}`)) throw new Error("Repository oracle path escaped the isolated task root");
const git = async (...args: string[]) => (await execFile("git", ["-C", checkout, ...args], { timeout: 15_000, maxBuffer: 65_536 })).stdout.trim();
point.repository = { head: await git("rev-parse", "HEAD"),
baseIsAncestor: await git("merge-base", "--is-ancestor", repository.pinnedCommit, "HEAD").then(() => true, () => false),
dirty: (await git("status", "--porcelain", "--", files.repositoryFile)).length > 0,
content: await readFile(`${repository.relativePath}/${files.repositoryFile}`) };
}
evidence.checkpoints.push(point);
evidence.projectCount = (await api.get<Row[]>(`${companyPath}/projects`)).length;
if (execution.environment.id === "daytona") evidence.remoteLeaseRunIds = (await api.get<Row[]>(`/api/environments/${fixtures.environment.id}/leases`))
.filter(lease => lease.issueId === issue!.id && typeof lease.providerLeaseId === "string").map(lease => lease.heartbeatRunId);
await save(`turn-${turn}`);
await page.reload();
await expect(page.getByTestId("task-chat-thread-header").getByTestId("issue-detail-header")).toBeVisible();
await expect(page.getByTestId("task-chat-agent-bubble").filter({ hasText: `TASK-WORKSPACE-${turn}-${nonce}` }).last()).toBeVisible({ timeout: 30_000 });
await input.capture(`task-files-turn-${turn}`, `Projectless task after turn ${turn}`, `task-files-turn-${turn}.png`);
}
try {
if (fixtures.project) throw new Error("Task-workspaces fixture must not create a project");
const agent = await api.get<Row>(`/api/agents/${fixtures.agent.id}`);
if (agent.adapterConfig?.cwd) throw new Error("Task-workspaces fixture must not configure operator cwd");
await api.patch(`/api/companies/${fixtures.company.id}/budgets`, { budgetMonthlyCents: TASK_WORKSPACES_BUDGET_CENTS });
await api.patch(`/api/agents/${fixtures.agent.id}/budgets`, { budgetMonthlyCents: TASK_WORKSPACES_BUDGET_CENTS });
const created = await createTaskThroughUi({ page, issuePrefix: fixtures.company.issuePrefix!, agentName: fixtures.agent.name,
title: execution.task.buildTitle(nonce), prompt: taskWorkspacePrompt(nonce, 1, native), workMode: "standard", requireExplicitTitle: true });
issue = await api.get<Row>(`/api/issues/${created.issueId}`);
await page.goto(`/${encodeURIComponent(fixtures.company.issuePrefix!)}/issues/${encodeURIComponent(issue.identifier ?? issue.id)}`);
const before = await pollUntil({ label: "initial projectless workspace admission", deadlineAt: input.deadlineAt,
load: () => api.get<Row>(`/api/issues/${issue!.id}/workspace`), accept: view => Boolean(view.workspace?.id), intervalMs: 300 });
evidence.initial = { workspaceId: before.workspace.id, cwd: await realpath(before.workspace.cwd), repositories: before.repositories.length };
await save("initial-admission");
await settled(1); await checkpoint(1);
const issueUrl = page.url();
await restartChatServer(page, async () => { await input.restart(); });
evidence.restarted = true;
await page.goto(issueUrl);
await expect(page.getByTestId("task-chat-thread-header").getByTestId("issue-detail-header")).toBeVisible();
await submitTaskReply(page, taskWorkspacePrompt(nonce, 2, native));
await settled(2); await checkpoint(2);
await submitTaskReply(page, taskWorkspacePrompt(nonce, 3, native));
await settled(3); await checkpoint(3);
const [artifact] = await readRegisteredArtifacts(api, issue.id, runs[2]!.id, [files.proof]);
evidence.artifact = artifact;
await save("completed");
const checks = gradeTaskWorkspaces(evidence);
const failed = checks.filter(check => !check.passed);
if (failed.length) throw new Error(`Task workspace oracle failure: ${failed.map(check => check.id).join(", ")}`);
await refresh();
const [comments, interactions] = await Promise.all([
api.get<Row[]>(`/api/issues/${issue.id}/comments`),
api.get<Row[]>(`/api/issues/${issue.id}/interactions`),
]);
await input.evidence("api-state.json", { issue, runs, comments, interactions, checks });
await expect(page.getByTestId("task-chat-thread-header").getByTestId("issue-detail-header")
.getByRole("button", { name: "Change status (current: Done)", exact: true })).toBeVisible();
await input.capture("final-state", "Final visible task state", "final-state.png");
return { issue, runs, checks };
} catch (error) {
await refresh().catch(() => undefined);
await save("failed");
throw error;
}
}
@@ -0,0 +1,83 @@
export interface TaskWorkspaceCheckpoint {
turn: number;
issue: { id: string; projectId: string | null; executionWorkspaceId: string | null; status: string; scheduledRetry?: unknown };
workspace: { id: string; projectId: string | null; cwd: string };
confinedTaskRoot: boolean;
note: string;
repositories: Array<{ id: string; state: string; relativePath: string; pinnedCommit: string | null; requestedByIssueId: string | null; requestKeys: string[] }>;
run: { id: string; status: string; runtimeMode?: string; nativePhase?: string; nativeBinding?: string; nativeCwd?: string; transport?: string; authenticated?: boolean; nativeCompleted?: boolean };
repository?: { head: string; baseIsAncestor: boolean; dirty: boolean; content: string };
prepareCalls?: number;
}
export interface TaskWorkspaceObservation {
nonce: string;
native: boolean;
daytona: boolean;
initial: { workspaceId: string; cwd: string; repositories: number } | null;
checkpoints: TaskWorkspaceCheckpoint[];
projectCount: number;
runCount: number;
restarted: boolean;
pendingInteractions: number;
activeOperations: number;
activeRecovery: boolean;
artifact: { content: string; contentVerified: boolean; mimeType: string } | null;
remoteLeaseRunIds: string[];
}
export function gradeTaskWorkspaces(value: TaskWorkspaceObservation) {
const checks: Array<{ id: string; passed: boolean; detail: string }> = [];
const check = (id: string, passed: boolean, detail: string) => checks.push({ id, passed, detail });
const [first, second, third] = value.checkpoints;
const complete = value.checkpoints.length === 3 && value.checkpoints.every((p, i) => p.turn === i + 1);
check("three-attributed-turns", complete && value.runCount === 3 && new Set(value.checkpoints.map(p => p.run.id)).size === 3
&& value.checkpoints.every(p => p.run.status === "succeeded" && p.issue.status === "done" && p.issue.scheduledRetry == null),
"Exactly three successful requested turns with no hidden retries or unfinished tasks.");
check("projectless-task-owned-root", complete && value.projectCount === 0 && value.checkpoints.every(p =>
p.issue.projectId === null && p.workspace.projectId === null && p.confinedTaskRoot && p.issue.executionWorkspaceId === p.workspace.id),
"Task and execution workspace remain projectless, with a confined company/task directory rather than agent home.");
check("immutable-root-and-binding", complete && value.initial !== null &&
value.checkpoints.every(p => p.workspace.id === value.initial!.workspaceId && p.workspace.cwd === value.initial!.cwd),
"The independently observed initial root and binding survive all three admissions.");
check("task-file-continuity", complete && value.checkpoints.every(p => p.note === `task-files-turn-${p.turn}-${value.nonce}\n`),
"Public execution-workspace file reads match the exact expected bytes after every turn.");
const a = first?.repositories[0], b = second?.repositories[0], c = third?.repositories[0];
check("deferred-idempotent-acquisition", complete && value.checkpoints.every(p => p.repositories.length === 1 &&
p.repositories[0]?.requestedByIssueId === p.issue.id && p.repositories[0]?.requestKeys.length === 1 && p.repositories[0]?.requestKeys[0] === `repository-${value.nonce}`)
&& a?.state === "pending" && a.pinnedCommit === null && a.id === b?.id && a.id === c?.id
&& /^\.paperclip-repositories\/task-repo-[a-f0-9]{24}$/.test(a.relativePath)
&& a.relativePath === b?.relativePath && a.relativePath === c?.relativePath && b?.state === "ready" && c?.state === "ready"
&& /^[a-f0-9]{40,64}$/.test(b?.pinnedCommit ?? "") && b?.pinnedCommit === c?.pinnedCommit,
"Duplicate preparation converges to one pending receipt, realized only on the next admission with a stable contained path and pinned source.");
check("nested-git-and-dirty-files", complete && second?.repository !== undefined && third?.repository !== undefined
&& second.repository.baseIsAncestor && third.repository.baseIsAncestor && second.repository.head !== b?.pinnedCommit
&& second.repository.head === third.repository.head && second.repository.dirty && third.repository.dirty
&& second.repository.content === `repository-dirty-${value.nonce}\n` && third.repository.content === second.repository.content,
"A new local commit and subsequent uncommitted bytes in a nested repository survive the next admission.");
check("controller-restart", value.restarted && complete, "The isolated controller restarted between the first and second requested turns.");
check("downloaded-artifact", value.artifact?.contentVerified === true && value.artifact.mimeType === "text/plain"
&& value.artifact.content === `repository-dirty-${value.nonce}\n`,
"The final run's registered downloadable artifact has verified metadata, digest and exact prior repository bytes.");
check("settled-control-plane", value.pendingInteractions === 0 && value.activeOperations === 0 && !value.activeRecovery,
"No unanswered decision, workspace operation or scheduled native recovery remains.");
check("runtime-and-transport", complete && value.checkpoints.every(p => value.native
? p.run.runtimeMode === "native" && p.run.nativePhase === "committed" && p.run.nativeCompleted === true && p.run.nativeBinding === p.workspace.id
&& typeof p.run.nativeCwd === "string" && p.run.nativeCwd.length > 0
&& p.run.transport === (value.daytona ? "provider_ingress" : "local_loopback") && (!value.daytona || p.run.authenticated === true)
: p.run.runtimeMode === "legacy"), "Each observed run uses the selected actual runtime and native transport/admitted binding.");
check("semantic-repository-tool", !value.native || first?.prepareCalls === 2,
"Native preparation uses two successful real prepare_repository tool calls, not a model-authored clone command.");
check("daytona-run-leases", !value.daytona || (complete && value.checkpoints.every(p => value.remoteLeaseRunIds.includes(p.run.id))),
"Every remote turn has a public Daytona environment lease attributed to that run.");
return checks;
}
export function isRepositoryPreparationReceipt(event: {
eventType?: string;
payload?: { prpEvent?: { sourceKind?: string; runId?: string; payload?: { name?: string; status?: string } } };
}, runId: string) {
const receipt = event.payload?.prpEvent;
return event.eventType === "tool.execution.completed" && receipt?.sourceKind === "runner"
&& receipt.runId === runId && receipt.payload?.status === "completed"
&& ["prepare_repository", "paperclip.prepare_repository", "paperclip_prepare_repository"].includes(receipt.payload.name ?? "");
}
+92
View File
@@ -0,0 +1,92 @@
import { describe, expect, it } from "vitest";
import { runnerMatrix } from "./catalog.js";
import { gradeTaskWorkspaces, isRepositoryPreparationReceipt, type TaskWorkspaceObservation } from "./task-workspaces-scoring.js";
import { TASK_WORKSPACES_SUITE, taskWorkspaceFiles, taskWorkspacePrompt } from "./task-workspaces-cases.js";
function valid(): TaskWorkspaceObservation {
const nonce = "fixture", cwd = "/isolated/task", pin = "a".repeat(40), head = "b".repeat(40);
return { nonce, native: true, daytona: true, initial: { workspaceId: "workspace", cwd, repositories: 0 },
checkpoints: [1, 2, 3].map(turn => ({ turn,
issue: { id: "issue", projectId: null, executionWorkspaceId: "workspace", status: "done" },
workspace: { id: "workspace", projectId: null, cwd }, confinedTaskRoot: true,
note: `task-files-turn-${turn}-${nonce}\n`,
repositories: [{ id: "repo", state: turn === 1 ? "pending" : "ready", relativePath: `.paperclip-repositories/task-repo-${"a".repeat(24)}`,
pinnedCommit: turn === 1 ? null : pin, requestedByIssueId: "issue", requestKeys: [`repository-${nonce}`] }],
run: { id: `run-${turn}`, status: "succeeded", runtimeMode: "native", nativePhase: "committed", nativeBinding: "workspace",
nativeCwd: "/workspace/task", transport: "provider_ingress", authenticated: true, nativeCompleted: true },
...(turn > 1 ? { repository: { head, baseIsAncestor: true, dirty: true, content: `repository-dirty-${nonce}\n` } } : {}),
prepareCalls: turn === 1 ? 2 : 0,
})), projectCount: 0, runCount: 3, restarted: true, pendingInteractions: 0, activeOperations: 0, activeRecovery: false,
artifact: { content: `repository-dirty-${nonce}\n`, contentVerified: true, mimeType: "text/plain" },
remoteLeaseRunIds: ["run-1", "run-2", "run-3"] };
}
describe("task workspace product E2E", () => {
it("declares exactly the three authorized cells with no project/cwd and one attempt", () => {
const cells = runnerMatrix.filter(cell => cell.suite.id === TASK_WORKSPACES_SUITE);
expect(cells.map(cell => cell.id).sort()).toEqual([
"task-workspaces.legacy-opencode.local.task-directory-repository-resume",
"task-workspaces.runner-opencode.daytona.task-directory-repository-resume",
"task-workspaces.runner-opencode.local.task-directory-repository-resume",
]);
for (const cell of cells) {
expect(cell.suite.manualOnly).toBe(true);
expect(cell.task.automaticRetryPolicy).toBe("single_attempt");
expect(cell.task.expectedRunCount).toBe(3);
const agent = cell.profile.buildAgent({ environmentId: "environment", environmentFixtureId: cell.environment.id,
workspacePath: "/must-not-use", executionId: "fixture", secretRefs: { OPENROUTER_API_KEY: { type: "secret_ref", secretId: "secret", version: "latest" } } });
expect(agent.budgetMonthlyCents).toBe(1000);
expect((agent.adapterConfig as Record<string, unknown>).cwd).toBeUndefined();
}
});
it("keeps native tools and legacy authenticated API prompts distinct", () => {
expect(taskWorkspacePrompt("fixture", 1, true)).toContain("Call prepare_repository twice");
expect(taskWorkspacePrompt("fixture", 1, false)).toContain("POST /api/issues/$PAPERCLIP_TASK_ID/workspace/repositories twice");
expect(taskWorkspacePrompt("fixture", 3, true)).not.toContain(taskWorkspaceFiles("fixture").repositoryBytes.trim());
});
it("recognizes the normalized provider receipt and rejects claims from another source/run", () => {
const receipt = { eventType: "tool.execution.completed", payload: { prpEvent: {
sourceKind: "runner", runId: "run-1", payload: { name: "paperclip_prepare_repository", status: "completed" },
} } };
expect(isRepositoryPreparationReceipt(receipt, "run-1")).toBe(true);
expect(isRepositoryPreparationReceipt(receipt, "another-run")).toBe(false);
receipt.payload.prpEvent.sourceKind = "control_plane";
expect(isRepositoryPreparationReceipt(receipt, "run-1")).toBe(false);
receipt.payload.prpEvent.sourceKind = "runner";
receipt.payload.prpEvent.payload.status = "failed";
expect(isRepositoryPreparationReceipt(receipt, "run-1")).toBe(false);
});
it("accepts independently consistent persisted observations", () => {
expect(gradeTaskWorkspaces(valid()).filter(check => !check.passed)).toEqual([]);
const legacy = valid(); legacy.native = false; legacy.daytona = false;
legacy.checkpoints.forEach(point => { point.run.runtimeMode = "legacy"; delete point.prepareCalls; });
expect(gradeTaskWorkspaces(legacy).filter(check => !check.passed)).toEqual([]);
});
it("accepts a pending receipt queued before the first browser observation", () => {
const observation = valid();
observation.initial!.repositories = 1;
expect(gradeTaskWorkspaces(observation).filter(check => !check.passed)).toEqual([]);
observation.checkpoints[0]!.repositories[0]!.state = "ready";
expect(gradeTaskWorkspaces(observation).find(check => check.id === "deferred-idempotent-acquisition")?.passed).toBe(false);
});
it.each([
["missing evidence", (v: TaskWorkspaceObservation) => { v.checkpoints = []; }],
["agent home", (v: TaskWorkspaceObservation) => { v.checkpoints[0]!.confinedTaskRoot = false; }],
["new project", (v: TaskWorkspaceObservation) => { v.projectCount = 1; }],
["root switched", (v: TaskWorkspaceObservation) => { v.checkpoints[1]!.workspace.cwd = "/different"; }],
["early clone", (v: TaskWorkspaceObservation) => { v.checkpoints[0]!.repositories[0]!.state = "ready"; }],
["duplicate receipt", (v: TaskWorkspaceObservation) => { v.checkpoints[1]!.repositories.push(v.checkpoints[1]!.repositories[0]!); }],
["different pin", (v: TaskWorkspaceObservation) => { v.checkpoints[2]!.repositories[0]!.pinnedCommit = "c".repeat(40); }],
["lost Git commit", (v: TaskWorkspaceObservation) => { v.checkpoints[2]!.repository!.head = "a".repeat(40); }],
["lost dirty bytes", (v: TaskWorkspaceObservation) => { v.checkpoints[2]!.repository!.content = "reset"; }],
["missing download", (v: TaskWorkspaceObservation) => { v.artifact = null; }],
["unverified download", (v: TaskWorkspaceObservation) => { v.artifact!.contentVerified = false; }],
["extra wake", (v: TaskWorkspaceObservation) => { v.runCount = 4; }],
["unfinished persistence", (v: TaskWorkspaceObservation) => { v.activeOperations = 1; }],
["wrong native binding", (v: TaskWorkspaceObservation) => { v.checkpoints[2]!.run.nativeBinding = "another"; }],
["tool bypass", (v: TaskWorkspaceObservation) => { v.checkpoints[0]!.prepareCalls = 0; }],
["missing remote lease", (v: TaskWorkspaceObservation) => { v.remoteLeaseRunIds = ["run-1"]; }],
] as const)("rejects %s instead of accepting model claims", (_label, mutate) => {
const observation = valid(); mutate(observation);
expect(gradeTaskWorkspaces(observation).some(check => !check.passed)).toBe(true);
});
});
+1
View File
@@ -17,6 +17,7 @@ export type RunnerGeneration = "legacy" | "native";
export type RunnerEnvironmentId = "local" | "daytona";
export type RunnerTaskWorkMode = "standard" | "planning" | "ask";
export type RunnerTaskFlow =
| "task_workspaces"
| "repository_skills"
| "provider_connection"
| "plan_task_guidance"