From e2f631901f16e788fadabd179121b8a17d017407 Mon Sep 17 00:00:00 2001 From: Mikael Hugo Date: Thu, 14 May 2026 05:19:09 +0200 Subject: [PATCH] =?UTF-8?q?test(sf-db-migration):=20bump=20expected=20sche?= =?UTF-8?q?ma=20version=2062=20=E2=86=92=2063?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Schema head moved to v63 in commit 21d905461 (parallel agent's "rem-agent-inspired memory discipline + always-in-context invariants board" track) but the migration tests still asserted v62 — flagged in the last 2 iterations as "pre-existing migration failures, not mine." Update both schema-version assertions to 63 + add a context_board table-exists check after the v63 migration so future schema bumps explicitly require updating both the version assertion AND the matching table-presence check (catches naked-version-bump skews). 11/11 migration tests pass. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../extensions/sf/tests/sf-db-migration.test.mjs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/resources/extensions/sf/tests/sf-db-migration.test.mjs b/src/resources/extensions/sf/tests/sf-db-migration.test.mjs index 27064c59b..0f19f3126 100644 --- a/src/resources/extensions/sf/tests/sf-db-migration.test.mjs +++ b/src/resources/extensions/sf/tests/sf-db-migration.test.mjs @@ -273,7 +273,7 @@ test("openDatabase_migrates_v27_tasks_without_created_at_through_spec_backfill", const version = db .prepare("SELECT MAX(version) AS version FROM schema_version") .get(); - assert.equal(version.version, 62); + assert.equal(version.version, 63); // v61: intent_chapters table exists const chaptersTable = db .prepare( @@ -294,6 +294,16 @@ test("openDatabase_migrates_v27_tasks_without_created_at_through_spec_backfill", trackedMdTable, "tracked_md_files table should exist after v62 migration", ); + // v63: context_board table exists (always-in-context invariants board) + const contextBoardTable = db + .prepare( + "SELECT name FROM sqlite_master WHERE type='table' AND name='context_board'", + ) + .get(); + assert.ok( + contextBoardTable, + "context_board table should exist after v63 migration", + ); const taskSpec = db .prepare( "SELECT milestone_id, slice_id, task_id, verify FROM task_specs WHERE task_id = 'T01'", @@ -335,11 +345,11 @@ test("openDatabase_v52_db_heals_routing_history_and_auto_start_path_works", () = initRoutingHistory(dbPath); }, "initRoutingHistory should not throw on a v52 DB"); - // Schema should have migrated to v62 + // Schema should have migrated to v63 (current head) const version = db .prepare("SELECT MAX(version) AS version FROM schema_version") .get(); - assert.equal(version.version, 62); + assert.equal(version.version, 63); }); test("openDatabase_when_fresh_db_supports_schedule_entries", () => {