import assert from "node:assert/strict"; import fs from "node:fs"; import path from "node:path"; import test from "node:test"; import { assertLegacyManifestArtifacts, evidence } from "./legacy-manifest-integrity.mjs"; const root = path.resolve(import.meta.dirname, "../../.."); test("M12 historical manifest drift is explicit and read-only", () => { assert.equal(evidence.historicalEvidencePreserved, true); assert.equal(evidence.immutableSourceSnapshotAvailable, true); assert.equal(evidence.completeImmutableSourceSnapshotAvailable, false); assert.equal(evidence.provenanceState, "PARTIAL_HISTORICAL_SOURCES"); assert.equal(evidence.recoveredBindings, evidence.entries.filter(entry => entry.provenanceState === "VERIFIED_HISTORICAL_BYTES").length); assert.equal(evidence.blockedBindings, evidence.entries.filter(entry => entry.provenanceState === "BLOCKED_SOURCE_LOST").length); assert.ok(evidence.entries.length > 0); for (const task of fs.readdirSync(path.join(root, "tests/golden")).filter((name) => /^M12-/u.test(name)).sort()) { const manifestPath = path.join(root, "tests/golden", task, "manifest.json"); if (fs.existsSync(manifestPath)) assertLegacyManifestArtifacts(JSON.parse(fs.readFileSync(manifestPath, "utf8"))); } });