| 1 | import { readFileSync } from "node:fs"; |
| 2 | |
| 3 | function ok(value: unknown, message: string) { |
| 4 | if (!value) throw new Error(message); |
| 5 | } |
| 6 | |
| 7 | const source = readFileSync(new URL("../components/MemoryPanel.tsx", import.meta.url), "utf8"); |
| 8 | |
| 9 | ok(source.includes("function memoryFactKey"), "Context Center must use a stable fact identity helper"); |
| 10 | ok(source.includes("app.MemoryRevisionsForTab"), "Context Center must load revision history for the selected workspace"); |
| 11 | ok(source.includes("app.RestoreMemoryRevisionForTab"), "Context Center must restore a selected revision"); |
| 12 | ok(source.includes("view.lastRecall"), "Context Center must explain the last automatic recall"); |
| 13 | ok(source.includes("view.conflicts"), "Context Center must explain project-over-global memory resolution"); |
| 14 | ok(source.includes("view.instructionDiagnostics"), "Context Center must surface instruction diagnostics"); |
| 15 | ok(source.includes("d.precedence"), "Context Center must show resolved instruction precedence"); |
| 16 | |
| 17 | console.log("context-center-contract: ok"); |
| 18 |