diff --git a/doc/plans/2026-10-02-stock-harness-paperclip-checklist.md b/doc/plans/2026-10-02-stock-harness-paperclip-checklist.md index 9ac801bb526..d2dd84ca0f7 100644 --- a/doc/plans/2026-10-02-stock-harness-paperclip-checklist.md +++ b/doc/plans/2026-10-02-stock-harness-paperclip-checklist.md @@ -150,6 +150,12 @@ not inherit instructions to call unavailable native finish/block tools. and all 900 E2E support tests. Runner core/surface compilation and E2E typecheck passed. Both exact SH-4 gates passed (14 selected assertions; unrelated cases explicitly skipped). Repository-wide and paid qualification remain pending. + Qualification now includes a native-only concrete blocker case on Codex, + ACPX Claude, and OpenCode. It checks persisted blocker disposition, owner, + action, scope, and the visible explanation. Positive and seven plausible + negative oracle calibrations passed. The current suite has 27 cells and 51 + expected turns; the earlier manual/shared comparison remains 24 cells per + variant. No native paid qualification has run at this point. - [ ] **2.3.2 Move document/file delivery procedures into native tool docs.** Include the live server override and preserve prepared versus delivered receipts. - [ ] **2.3.3 Move hiring/dependency recipes into native discovery/tool docs.** diff --git a/tests/runner-e2e/README.md b/tests/runner-e2e/README.md index 3af598de8f2..737ca5758f6 100644 --- a/tests/runner-e2e/README.md +++ b/tests/runner-e2e/README.md @@ -444,7 +444,8 @@ pnpm test:e2e:runner -- --id context-integrity.runner-codex.local.ordered-commen `stock-harness` reuses ordered continuation, assigned-skill invocation, and chat restart journeys with production-default hires instead of the custom QA manual. -Its 24 explicit local cells cover eight legacy/native profiles and are excluded +Its 27 explicit local cells cover eight legacy/native profiles, including a +native-only concrete blocker report, and are excluded from `--all`. Run `pnpm test:e2e:runner:stock-harness` for the credential-free instruction-layering, hire, and shared-prompt prerequisites. The [suite contract](STOCK-HARNESS.md) maps each change to its graders, budgets, diff --git a/tests/runner-e2e/STOCK-HARNESS.md b/tests/runner-e2e/STOCK-HARNESS.md index aeb27e6148b..1dd95ac243d 100644 --- a/tests/runner-e2e/STOCK-HARNESS.md +++ b/tests/runner-e2e/STOCK-HARNESS.md @@ -14,7 +14,7 @@ agent-creation route materialize the shipped default. | SH-1: native Codex preserves vendor base instructions | Serialized start/resume requests from the TypeScript driver, recovery paths, runnerd transport, Runner Lab/live sessions, and Rust provider use additive developer instructions. | Real new native Codex hires execute the three journeys below. Task success alone cannot prove vendor base preservation. | | SH-2: identity-only default hire manual | Existing public agent-creation and onboarding-asset tests cover default, custom, and CEO exceptions. | The public bundle is exactly one `AGENTS.md` containing the eight-word shipped identity, checked before provider execution and again during cleanup. | | SH-3: reduced shared legacy task/chat defaults and resume delta | Shared prompt tests and ACPX, Codex, OpenCode, Pi, Hermes, and Cursor Cloud adapter regressions retain runtime context and exclude removed generic procedures. | Actual legacy `adapter.invoke` prompts retain fresh identity/connection guidance, omit the removed procedures, and have complete receipts for every observed run. | -| SH-4: shared native finish/block tool guidance | Actual authenticated MCP catalogs, Codex start/resume frames, serialized daemon catalogs for all five native provider kinds, and rotation of a retained v13 thread to the new tool contract. | The three native profiles run the existing skill, continuation, and chat journeys. Configured coverage is not a live qualification result. | +| SH-4: shared native finish/block tool guidance | Actual authenticated MCP catalogs, Codex start/resume frames, serialized daemon catalogs for all five native provider kinds, and rotation of a retained v13 thread to the new tool contract. | The three native profiles run the existing completion journeys and a concrete blocker case. The blocker oracle checks persisted disposition, owner, action, scope, and the visible final explanation. Configured coverage is not a live qualification result. | SH-4 changes native Runner tools only. Legacy adapters do not receive `paperclip_finish` or `paperclip_block` from this change. Their skill/API @@ -43,8 +43,9 @@ Oracle/admission calibration is itself included in the prerequisite gate. ## Live matrix -There are 24 explicit local cells: these eight existing profiles each run three -existing journeys with independently calibrated graders. +There are 27 explicit local cells: these eight existing profiles each run three +existing journeys. The three native profiles also run one concrete blocker case. +All journeys have independently calibrated graders. - Legacy: `legacy-codex`, `legacy-claude`, `legacy-opencode`, `legacy-acp-codex`, `legacy-acp-claude`. @@ -55,8 +56,10 @@ existing journeys with independently calibrated graders. | `assigned-skill-explicit-invocation` | 1 | Public skill creation/pinning, an explicit skill request, and saved output containing the marker available only in the skill body. | 12 minutes | | `ordered-comment-continuation` | 2 | Initial report followed by three ordered public comments, including repeated wording and a changed scope; final saved report preserves the ledger and requested scope. | 12 minutes | | `continuity-restart` | 3 | Task-backed chat retains the requested context across a server restart and subsequent replies. | 15 minutes | +| `native-blocked-report` (native profiles only) | 1 | A persisted whole-task blocker identifies Release Owner and the exact requested unblock action; its visible explanation includes the marker. | 5 minutes | -A full matrix expects 48 provider turns. Models, credentials, effort, +A full current matrix expects 51 provider turns. The earlier manual/shared-prompt +comparison used the original 24 cells and expected 48 turns. Models, credentials, effort, permissions, assigned skills, environment, and managed secret references are inherited from the existing profile; only its QA manual is omitted. Both company and agent receive a 1,000-cent monthly hard stop before provider execution, @@ -107,6 +110,12 @@ saved result without appearing in the task request or follow-up comments. Skill tool/read event detection is retained as supporting evidence; it is not a required cross-provider tool-trace assertion. +The native blocker request supplies the blocking facts and desired user outcome; +it does not prescribe a tool name or completion payload. Its grader rejects a +visible claim without a persisted native report, the wrong owner/action/scope, +a completed-work report, a legacy runtime, and a failed run. It uses the ordinary +public task-creation and completion flow, screenshots, cleanup, and billing rules. + ## Qualification status Setup was validated locally on 2026-10-02 with the deterministic prerequisites, diff --git a/tests/runner-e2e/catalog.test.ts b/tests/runner-e2e/catalog.test.ts index 702986e8e6e..1e1b86dffb5 100644 --- a/tests/runner-e2e/catalog.test.ts +++ b/tests/runner-e2e/catalog.test.ts @@ -136,10 +136,10 @@ describe("runner E2E catalog", () => { expect(localIntegrityTasks).toHaveLength(2); expect(openRouterBreadthTasks).toHaveLength(3); expect(runnerSuites.map((suite) => suite.expectedMatrixSize)).toEqual([ - 6, 30, 3, 16, 16, 2, 6, 8, 46, 23, 50, 20, 24, 52, 28, 18, 6, 6, 12, 10, 48, 16, 10, 2, 1, 1, + 6, 30, 3, 16, 16, 2, 6, 8, 46, 23, 50, 20, 27, 52, 28, 18, 6, 6, 12, 10, 48, 16, 10, 2, 1, 1, ]); - expect(validateRunnerCatalog()).toHaveLength(460); - expect(new Set(runnerMatrix.map((entry) => entry.id)).size).toBe(460); + expect(validateRunnerCatalog()).toHaveLength(463); + expect(new Set(runnerMatrix.map((entry) => entry.id)).size).toBe(463); expect( runnerMatrix.filter((entry) => entry.suite.id === "core-compatibility"), ).toHaveLength(48); diff --git a/tests/runner-e2e/catalog.ts b/tests/runner-e2e/catalog.ts index 54ee749e76f..0bc25209d8d 100644 --- a/tests/runner-e2e/catalog.ts +++ b/tests/runner-e2e/catalog.ts @@ -6,6 +6,7 @@ import { blockerTasks, blockerProfile } from "./blocker-cases.js"; import { accountingTasks } from "./accounting-cases.js"; import { continuationTasks } from "./continuation-cases.js"; import { contextIntegrityTasks } from "./context-integrity-cases.js"; +import { nativeBlockedReportTask } from "./native-completion-case.js"; import { productionDefaultHireProfile, stockHarnessSourceDigest } from "./stock-harness.js"; import { lifecycleLiveTasks, lifecycleLiveDefinitionDigest } from "./lifecycle-live-cases.js"; import { everydayTasks, productionStoryProfile } from "./everyday-cases.js"; @@ -1217,19 +1218,21 @@ export const runnerSuites: readonly RunnerSuiteFixture[] = [ id: "stock-harness", label: "Stock harness with Paperclip", manualOnly: true, - description: "Production-default hires, reduced shared prompts, assigned skills, continuation, and persistent chat.", + description: "Production-default hires, reduced shared prompts, assigned skills, continuation, persistent chat, and native blocker reporting.", groups: ["stock-harness", "native", "legacy"], profiles: [...contextIntegrityProfiles.filter(profile => !pendingContextIntegrityProfiles.includes(profile)), runnerProfiles.find(profile => profile.id === "legacy-opencode")!].map(productionDefaultHireProfile), environments: [localEnvironment], - tasks: [...contextIntegrityTasks, chatTasks.find(task => task.id === "continuity-restart")!], - expectedMatrixSize: 24, + tasks: [...contextIntegrityTasks, chatTasks.find(task => task.id === "continuity-restart")!, nativeBlockedReportTask], + excludedExecutionIds: ["legacy-codex", "legacy-claude", "legacy-opencode", "legacy-acp-codex", "legacy-acp-claude"] + .map(profile => `stock-harness.${profile}.local.native-blocked-report`), + expectedMatrixSize: 27, definitionMetadata: { - version: 1, instructions: "production-default-hire", scheduling: "explicit-only", + version: 2, instructions: "production-default-hire", scheduling: "explicit-only", sourceDigest: stockHarnessSourceDigest(), grading: "public-default-bundle-and-delivered-prompts-plus-independent-lifecycle-oracles", vendorBaseEvidence: "required deterministic Codex driver/runnerd/Rust gate; task success is not vendor-base proof", - paidCalls: "one skill turn, two ordered-comment turns, three chat turns per profile", + paidCalls: "one skill turn, two ordered-comment turns, three chat turns per profile; one native-only blocker turn", }, }, { diff --git a/tests/runner-e2e/native-completion-case.test.ts b/tests/runner-e2e/native-completion-case.test.ts new file mode 100644 index 00000000000..963296d37b0 --- /dev/null +++ b/tests/runner-e2e/native-completion-case.test.ts @@ -0,0 +1,33 @@ +import { describe, expect, it } from "vitest"; +import { evaluateMatchers, type MatcherObservation } from "./matchers.js"; +import { nativeBlockedReportTask } from "./native-completion-case.js"; +import type { MatrixExecution } from "./types.js"; + +function observation(): MatcherObservation { + return { message: "BLOCKED_probe. Release Owner must Grant deployment access.", + issueStatus: "blocked", runStatus: "succeeded", runtimeMode: "native", + json: { run: { resultJson: { nativeResult: { reportedWorkDisposition: "blocked", + blocker: { owner: { name: "Release Owner" }, unblockAction: "Grant deployment access", scope: "task_wide" } } } } } }; +} + +describe("native completion blocker oracle", () => { + const matchers = nativeBlockedReportTask.buildMatchers("probe", {} as MatrixExecution); + it("accepts the persisted blocker, owner and exact requested unblock action", async () => { + expect((await evaluateMatchers(matchers, observation())).every(row => row.passed)).toBe(true); + expect(nativeBlockedReportTask.buildPrompt("probe")).not.toMatch(/paperclip_(?:finish|block)|reportedWorkDisposition|json/i); + }); + it.each(["visible-claim-only", "wrong-owner", "wrong-action", "wrong-scope", "done-report", "legacy-runtime", "run-failed"])( + "rejects %s without trusting the visible completion claim", async variant => { + const current = observation(); + const result = (current.json as { run: { resultJson: { nativeResult?: { reportedWorkDisposition: string; + blocker: { owner: { name: string }; unblockAction: string; scope: string } } } } }).run.resultJson; + if (variant === "visible-claim-only") { current.issueStatus = "in_progress"; delete result.nativeResult; } + if (variant === "wrong-owner") result.nativeResult!.blocker.owner.name = "Someone else"; + if (variant === "wrong-action") result.nativeResult!.blocker.unblockAction = "Pretend deployment succeeded"; + if (variant === "wrong-scope") result.nativeResult!.blocker.scope = "current_track"; + if (variant === "done-report") result.nativeResult!.reportedWorkDisposition = "done"; + if (variant === "legacy-runtime") current.runtimeMode = "legacy"; + if (variant === "run-failed") current.runStatus = "failed"; + expect((await evaluateMatchers(matchers, current)).some(row => !row.passed)).toBe(true); + }); +}); diff --git a/tests/runner-e2e/native-completion-case.ts b/tests/runner-e2e/native-completion-case.ts new file mode 100644 index 00000000000..ed633be07a6 --- /dev/null +++ b/tests/runner-e2e/native-completion-case.ts @@ -0,0 +1,31 @@ +import type { RunnerTaskFixture } from "./types.js"; + +/** A native-only blocker with facts, not tool names or a completion payload recipe. */ +export const nativeBlockedReportTask: RunnerTaskFixture = { + id: "native-blocked-report", + label: "Native concrete blocker report", + groups: ["native-completion"], + workMode: "standard", + flow: "single_turn", + expectedRunCount: 1, + attemptTimeoutMs: { local: 5 * 60_000, daytona: 5 * 60_000 }, + expectedTerminalState: { issue: "blocked", run: "succeeded" }, + buildTitle: nonce => `Native blocker report ${nonce}`, + buildVisibleMarker: nonce => `BLOCKED_${nonce.replace(/[^a-z0-9]/gi, "")}`, + buildPrompt: nonce => [ + "Deployment cannot proceed because required release access has not been granted.", + "Release Owner is the external owner of that grant. Do not attempt deployment, create subtasks, or claim the access exists.", + "Record the whole task as blocked, identify the owner as Release Owner, and state the unblock action exactly: Grant deployment access.", + `Include BLOCKED_${nonce.replace(/[^a-z0-9]/gi, "")} in your final explanation.`, + ].join("\n"), + buildMatchers: nonce => [ + { kind: "issue_status", expected: "blocked" }, + { kind: "run_status", expected: "succeeded" }, + { kind: "runtime_mode", expected: "native" }, + { kind: "message_contains", expected: `BLOCKED_${nonce.replace(/[^a-z0-9]/gi, "")}` }, + { kind: "json_path", path: "run.resultJson.nativeResult.reportedWorkDisposition", expected: "blocked" }, + { kind: "json_path", path: "run.resultJson.nativeResult.blocker.owner.name", expected: "Release Owner" }, + { kind: "json_path", path: "run.resultJson.nativeResult.blocker.unblockAction", expected: "Grant deployment access" }, + { kind: "json_path", path: "run.resultJson.nativeResult.blocker.scope", expected: "task_wide" }, + ], +}; diff --git a/tests/runner-e2e/stock-harness-checks.mjs b/tests/runner-e2e/stock-harness-checks.mjs index d9cf2f5c10d..79997e20fc0 100644 --- a/tests/runner-e2e/stock-harness-checks.mjs +++ b/tests/runner-e2e/stock-harness-checks.mjs @@ -56,11 +56,13 @@ export const stockHarnessGates = [ config: "tests/runner-e2e/vitest.config.ts", files: ["tests/runner-e2e/stock-harness.test.ts", "tests/runner-e2e/stock-harness-checks.test.mjs", "tests/runner-e2e/stock-harness-admission.test.ts", "tests/runner-e2e/stock-harness-digest.test.ts", - "tests/runner-e2e/select-rerun-artifacts.test.ts"], + "tests/runner-e2e/select-rerun-artifacts.test.ts", "tests/runner-e2e/native-completion-case.test.ts"], required: ["rejects old SHA before providers", "allows toolchain paths and excludes every present or future credential", "changes when the evaluated server/src/onboarding-assets/default/AGENTS.md changes", "changes when the evaluated packages/adapter-utils/src/server-utils.ts changes", "changes when the evaluated packages/shared/src/connection-intent-guidance.ts changes", + "changes when the evaluated tests/runner-e2e/native-completion-case.ts changes", + "accepts the persisted blocker, owner and exact requested unblock action", "retains credential-free prerequisites inside the exact campaign root"] }, ]; @@ -84,6 +86,7 @@ export function sourceFingerprint() { ...stockHarnessGates.flatMap(gate => gate.files.map(file => join(gate.cwd, file))), "tests/runner-e2e/stock-harness.ts", "tests/runner-e2e/stock-harness-checks.mjs", "tests/runner-e2e/catalog.ts", "tests/runner-e2e/stock-harness-admission.ts", "tests/runner-e2e/launch.ts", "tests/runner-e2e/runner.spec.ts", + "tests/runner-e2e/native-completion-case.ts", "packages/adapter-utils/src/server-utils.ts", "packages/shared/src/connection-intent-guidance.ts", "server/src/onboarding-assets/default/AGENTS.md", "server/src/routes/agents.ts", "scripts/ensure-plugin-build-deps.mjs", "packages/paperclip-runner/src/drivers/codex/codex-app-server-driver-impl.ts", diff --git a/tests/runner-e2e/stock-harness-digest.test.ts b/tests/runner-e2e/stock-harness-digest.test.ts index e705913096b..fc5cfa63243 100644 --- a/tests/runner-e2e/stock-harness-digest.test.ts +++ b/tests/runner-e2e/stock-harness-digest.test.ts @@ -12,6 +12,7 @@ describe("stock harness instruction revision", () => { "packages/paperclip-runner/src/drivers/runner-tool-bridge.ts", "packages/paperclip-runner/src/drivers/opencode/mcp-bridge.ts", "server/src/services/native-runtime/native-session-resume.ts", + "tests/runner-e2e/native-completion-case.ts", ])( "changes when the evaluated %s changes", source => { vi.mocked(readFileSync).mockImplementation(() => Buffer.from("unchanged")); diff --git a/tests/runner-e2e/stock-harness.test.ts b/tests/runner-e2e/stock-harness.test.ts index 37776355e84..1aebb0777b6 100644 --- a/tests/runner-e2e/stock-harness.test.ts +++ b/tests/runner-e2e/stock-harness.test.ts @@ -16,18 +16,19 @@ function recording(generation: "legacy" | "native" = "legacy"): StockHarnessEvid } describe("stock harness Product E2E", () => { - it("registers 24 explicit local cells with independent skill, continuation and chat oracles", () => { + it("registers 27 explicit local cells with independent skill, continuation, chat and native blocker oracles", () => { const cells = runnerMatrix.filter(row => row.suite.id === "stock-harness"); - expect(cells).toHaveLength(24); + expect(cells).toHaveLength(27); expect(new Set(cells.map(row => row.profile.id))).toEqual(new Set([ "legacy-codex", "legacy-claude", "legacy-opencode", "legacy-acp-codex", "legacy-acp-claude", "runner-codex", "runner-acpx-claude", "runner-opencode", ])); expect(new Set(cells.map(row => row.task.id))).toEqual(new Set([ - "ordered-comment-continuation", "assigned-skill-explicit-invocation", "continuity-restart", + "ordered-comment-continuation", "assigned-skill-explicit-invocation", "continuity-restart", "native-blocked-report", ])); expect(cells.every(row => row.suite.manualOnly && row.environment.id === "local")).toBe(true); - expect(cells.reduce((turns, row) => turns + row.task.expectedRunCount, 0)).toBe(48); + expect(cells.reduce((turns, row) => turns + row.task.expectedRunCount, 0)).toBe(51); + expect(cells.filter(row => row.task.id === "native-blocked-report").every(row => row.profile.generation === "native")).toBe(true); expect(cells[0]!.suite.definitionMetadata?.sourceDigest).toMatch(/^[a-f0-9]{64}$/); }); diff --git a/tests/runner-e2e/stock-harness.ts b/tests/runner-e2e/stock-harness.ts index 84b4bc01bd5..668d2133521 100644 --- a/tests/runner-e2e/stock-harness.ts +++ b/tests/runner-e2e/stock-harness.ts @@ -108,7 +108,7 @@ export async function captureStockHarness(input: { export function stockHarnessSourceDigest() { const hash = createHash("sha256"); for (const source of [ - "stock-harness.ts", "context-integrity-cases.ts", "context-integrity-scoring.ts", + "stock-harness.ts", "native-completion-case.ts", "context-integrity-cases.ts", "context-integrity-scoring.ts", "context-integrity-flow.ts", "chat-cases.ts", "chat-flow.ts", "live-fixtures.ts", "runner.spec.ts", "stock-harness-checks.mjs", "stock-harness-admission.ts", "../../server/src/onboarding-assets/default/AGENTS.md",