diff --git a/backend/scripts/p2-acceptance.mjs b/backend/scripts/p2-acceptance.mjs index 6c6432ac..5a5e22ee 100644 --- a/backend/scripts/p2-acceptance.mjs +++ b/backend/scripts/p2-acceptance.mjs @@ -1201,29 +1201,33 @@ async function realChecks(ctx) { { id: "evidence_processing", async run() { - const full = await runThothctlJson(ctx, "preprocess-run-dwh-blocked", ["workspace", "preprocess", "run", "--workspace", "p2-dwh"], 3); + // Full-run FK checkpoint: the filesystem workspace already has mined FK candidates, + // so a full run must stop for human review before schema/Evidence writes. + const full = await runThothctlJson(ctx, "preprocess-run-fs-blocked", ["workspace", "preprocess", "run", "--workspace", "p2-filesystem"], 3); assert(full.payload.code === "manual_review_required", "full run did not block for review"); const digest = full.payload.artifactIdentities?.[0]?.digest; assert(/^sha256:[0-9a-f]{64}$/.test(digest ?? ""), "full run digest missing"); - const reviewPath = join(ctx.run.root, "fixtures", "p2-dwh.annotations.yaml"); + const reviewPath = join(ctx.run.root, "fixtures", "p2-filesystem.full-annotations.yaml"); await atomicWrite(reviewPath, "tables: {}\n"); - const reviewed = await runThothctlJson(ctx, "schema-check-dwh", [ - "workspace", "schema", "check", "--workspace", "p2-dwh", + const reviewed = await runThothctlJson(ctx, "schema-check-fs-full", [ + "workspace", "schema", "check", "--workspace", "p2-filesystem", "--annotations", reviewPath, "--reviewed-candidates", digest, ], 0); - const resumed = await runThothctlJson(ctx, "preprocess-run-dwh-resume", ["workspace", "preprocess", "run", "--workspace", "p2-dwh", "--resume", full.payload.runId], 0); + assert(reviewed.payload.status === "succeeded", "full-run review failed"); + // Resume continues through index-schema and stops at filesystem Evidence materialization. + const resumed = await runThothctlJson(ctx, "preprocess-run-fs-resume", ["workspace", "preprocess", "run", "--workspace", "p2-filesystem", "--resume", full.payload.runId], 3); + assert(resumed.payload.code === "evidence_materialization_required", "filesystem evidence did not block after review"); + // HTTP Evidence on the p2-dwh workspace: dry-run, publish, unchanged rerun, mutation. const dryRun = await runThothctlJson(ctx, "preprocess-evidence-dry-run", ["workspace", "preprocess", "evidence", "--workspace", "p2-dwh", "--dry-run"], 0); const publish = await runThothctlJson(ctx, "preprocess-evidence-publish", ["workspace", "preprocess", "evidence", "--workspace", "p2-dwh"], 0); const rerun = await runThothctlJson(ctx, "preprocess-evidence-rerun", ["workspace", "preprocess", "evidence", "--workspace", "p2-dwh"], 0); ctx.evidenceState.content = "# P2 Evidence\n\nSecond generation.\n"; const mutated = await runThothctlJson(ctx, "preprocess-evidence-mutated", ["workspace", "preprocess", "evidence", "--workspace", "p2-dwh"], 0); - const fsBlocked = await runThothctlJson(ctx, "preprocess-evidence-filesystem", ["workspace", "preprocess", "evidence", "--workspace", "p2-filesystem"], 3); - assert(fsBlocked.payload.code === "evidence_materialization_required", "filesystem evidence did not block"); state.fullRunId = full.payload.runId; return { commands: ["thothctl"], artifacts: [ ...full.artifacts, ...reviewed.artifacts, ...resumed.artifacts, ...dryRun.artifacts, - ...publish.artifacts, ...rerun.artifacts, ...mutated.artifacts, ...fsBlocked.artifacts, + ...publish.artifacts, ...rerun.artifacts, ...mutated.artifacts, ] }; }, },