diff --git a/src/resources/extensions/sf/tests/uok-purpose-coherence.test.mjs b/src/resources/extensions/sf/tests/uok-purpose-coherence.test.mjs index 1b8eb3a79..10e415d26 100644 --- a/src/resources/extensions/sf/tests/uok-purpose-coherence.test.mjs +++ b/src/resources/extensions/sf/tests/uok-purpose-coherence.test.mjs @@ -173,18 +173,15 @@ function makeLegacyDb() { } /** - * Open an SF DB and bolt on the columns the parallel migrations will - * eventually add. Mirrors the post-P2/P3 schema so we can exercise the - * "trace column present, value NULL" and "full chain present" branches. + * Open an SF DB. Post-P2/P3 merge the trace columns are already added + * by the schema migration ladder (v70 = tasks.purpose_trace, + * v72 = slices.traces_vision_fragment), so no manual ALTER is needed. + * Test value-NULL paths by inserting rows with explicit NULL. */ function makeForwardDb() { const base = makeProject(); openDatabase(join(base, ".sf", "sf.db")); const db = _getAdapter(); - db.exec( - "ALTER TABLE slices ADD COLUMN traces_vision_fragment TEXT DEFAULT NULL", - ); - db.exec("ALTER TABLE tasks ADD COLUMN purpose_trace TEXT DEFAULT NULL"); return { base, db }; } @@ -206,7 +203,11 @@ describe("evaluatePurposeCoherence (DB-backed)", () => { db, }); expect(verdict.outcome).toBe("warn"); - expect(verdict.rationale).toMatch(/traces_vision_fragment column/); + // Post-migration the column always exists; the warn message now + // reports the NULL value rather than the absent column. The gate + // itself still keeps the column-missing SqliteError catch so + // projects that somehow predate the migration don't hard-fail. + expect(verdict.rationale).toMatch(/slice goal does not trace/); }); test("vision missing on legacy DB → fail", () => {