feat(db): v1 schema with user_intent + edited flags
Task 6 of the slice plan. Adds the initial database surface:
- m001_initial: notes (with v0.2 columns user_intent,
intent_prompted_at, title_edited_by_user,
summary_edited_by_user), tags, note_tags (with source ai/user),
media, pending_jobs.
- migrations/index: forward-only PRAGMA user_version runner that
applies pending migrations inside a single transaction.
- db/index: openDb() that opens better-sqlite3, enables WAL +
foreign_keys, then runs migrations.
- migrations.test: schema columns are present at v1; runMigrations
is idempotent.
Verification: `npx vitest run tests/unit/migrations.test.ts`
2 passed.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>