Skip to content

[codex] Refactor note and journal canonical metadata - #182

Merged
h4yfans merged 3 commits into
mainfrom
memry/notes-journal-vault
Apr 8, 2026
Merged

[codex] Refactor note and journal canonical metadata#182
h4yfans merged 3 commits into
mainfrom
memry/notes-journal-vault

Conversation

@h4yfans

@h4yfans h4yfans commented Apr 8, 2026

Copy link
Copy Markdown
Collaborator

What

Move note and journal canonical metadata into data.db, add storage/domain packages around it, and rewire vault, IPC, watcher, and sync flows to treat index.db as a rebuildable projection instead of the source of truth.

Why

This architecture-reset slice needs note and journal metadata to survive index rebuilds and stop depending on note_cache in index.db for canonical state. Property definitions also need to live with the canonical note metadata rather than only in the rebuildable index.

How

  • add note_metadata and canonical property_definitions tables to data.db
  • add @memry/storage-data, @memry/storage-vault, and @memry/domain-notes packages
  • route note/journal indexing, vault mutations, IPC handlers, watcher delete/rename flows, and sync handlers through canonical metadata in data.db
  • keep index.db as the search/projection cache and mirror only the rebuildable note cache state there
  • update migrations, generated IPC invoke map, lockfile, and tests for the new note/journal boundary

Type

  • feat — new feature
  • fix — bug fix
  • refactor — restructure without behavior change
  • style — visual/UI only
  • perf — performance improvement
  • test — adding or updating tests
  • chore — tooling, deps, config
  • docs — documentation only
  • ci — CI/CD changes

Test plan

  • Unit tests added/updated
  • Integration tests added/updated
  • Manual testing (describe below)

Validation run:

  • pnpm --filter @memry/db-schema typecheck
  • pnpm --filter @memry/domain-notes typecheck
  • pnpm --filter @memry/storage-data typecheck
  • pnpm --filter @memry/storage-vault typecheck
  • pnpm --filter @memry/desktop typecheck
  • pnpm --filter @memry/desktop exec vitest run --config config/vitest.config.ts --project main src/main/ipc/journal-handlers.test.ts src/main/vault/indexer.test.ts src/main/vault/watcher.test.ts src/main/vault/note-sync.test.ts src/main/database/migrate.test.ts src/main/sync/item-handlers/note-handler-binary.test.ts
  • pnpm --filter @memry/desktop exec vitest run --config config/vitest.config.ts --project shared ../../packages/domain-notes/src/commands.test.ts ../../packages/db-schema/src/data-schema.test.ts

Checklist

  • Self-reviewed the diff
  • No hardcoded secrets or credentials
  • Files stay under ~500 LOC
  • Follows immutable data patterns

@h4yfans
h4yfans marked this pull request as ready for review April 8, 2026 23:26
@h4yfans
h4yfans merged commit 0aeba68 into main Apr 8, 2026
4 checks passed
@h4yfans
h4yfans deleted the memry/notes-journal-vault branch April 8, 2026 23:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant