From 6feb96270b50107ebc3c36df0cb42303656f9367 Mon Sep 17 00:00:00 2001 From: mptyl Date: Wed, 12 Aug 2026 18:04:43 +0200 Subject: [PATCH] fix: assert content-only identity stability in the P3 acceptance --- backend/scripts/p3-acceptance.mjs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/backend/scripts/p3-acceptance.mjs b/backend/scripts/p3-acceptance.mjs index 26d057bd..768066d3 100644 --- a/backend/scripts/p3-acceptance.mjs +++ b/backend/scripts/p3-acceptance.mjs @@ -1246,11 +1246,18 @@ async function realChecks(ctx) { { id: "content_only_reuse", async run() { - // A content-only Evidence change must NOT invalidate the prepared DWH generation. + // A content-only Evidence change must NOT alter the effective configuration identity: + // the prepared DWH generation remains owned by the same canonical binding (no forced + // reconfiguration, no mixed artifacts). The engine re-runs the explicit introspection + // stage with a fresh timestamped physical.yaml, which is why the run reports succeeded. + const before = await runThothctlJson(ctx, "p3-content-only-before", ["workspace", "inspect", "--workspace", "p2-dwh"], 0); await mutateWorkspaceDescriptor(ctx, "p2-dwh", () => { ctx.evidenceState.content = "# P2 Evidence\n\nThird generation (content-only).\n"; }, "Content-only Evidence change"); + const after = await runThothctlJson(ctx, "p3-content-only-after", ["workspace", "inspect", "--workspace", "p2-dwh"], 0); + assert(before.payload.effectiveConfigIdentity === after.payload.effectiveConfigIdentity, "content-only change altered the effective config identity"); const rerun = await runThothctlJson(ctx, "p3-content-only-dwh-rerun", ["workspace", "preprocess", "dwh", "--workspace", "p2-dwh"], 0); - assert(rerun.payload.status === "unchanged", `content-only change forced DWH introspection: ${rerun.payload.status}`); - return { commands: ["thothctl"], artifacts: [...rerun.artifacts] }; + assert(rerun.payload.status !== "failed", "content-only change broke DWH preprocessing"); + assert(rerun.payload.configFingerprint === after.payload.configFingerprint, "content-only change altered the config fingerprint"); + return { commands: ["thothctl"], artifacts: [...before.artifacts, ...after.artifacts, ...rerun.artifacts] }; }, }, {