fix: assert content-only identity stability in the P3 acceptance

This commit is contained in:
2026-08-12 18:04:43 +02:00
parent c4063eecb6
commit 6feb96270b
+10 -3
View File
@@ -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] };
},
},
{