Skip to content

refactor: extract inbox domain and thin ipc handlers - #191

Merged
h4yfans merged 2 commits into
mainfrom
memry/inbox-domain-extraction
Apr 9, 2026
Merged

refactor: extract inbox domain and thin ipc handlers#191
h4yfans merged 2 commits into
mainfrom
memry/inbox-domain-extraction

Conversation

@h4yfans

@h4yfans h4yfans commented Apr 9, 2026

Copy link
Copy Markdown
Collaborator

What

Reintroduce a narrow @memry/domain-inbox package and move inbox CRUD, batch, and query ownership out of main-process IPC handlers into inbox runtime modules, leaving IPC as a transport layer.

Why

Phase 3 of the architecture reset checklist still described inbox as extracted, but current main had reverted that package and kept persistence/orchestration in inbox-handlers.ts. This restores the intended Phase 3 boundary without claiming the later Phase 4 projection separation work is complete.

How

  • restore packages/domain-inbox with pure inbox commands, queries, types, and focused tests
  • add apps/desktop/src/main/inbox/domain.ts, crud.ts, batch.ts, and queries.ts to own desktop-side orchestration and adapters
  • reduce inbox IPC handler files to thin registration/delegation shells
  • wire workspace, Vite, TypeScript, and Vitest config so @memry/domain-inbox resolves correctly
  • regenerate the IPC invoke map and update the architecture plan docs

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)
pnpm ipc:check
pnpm --filter @memry/desktop exec vitest run --config config/vitest.config.ts src/main/ipc/inbox-handlers.test.ts
pnpm --filter @memry/desktop exec vitest run --config config/vitest.config.ts src/main/ipc/inbox-query-handlers.test.ts
pnpm --filter @memry/desktop exec vitest run --config config/vitest.config.ts ../../packages/domain-inbox/src/commands.test.ts

Screenshots

N/A

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 9, 2026 22:12
@h4yfans
h4yfans merged commit 16a2b7f into main Apr 9, 2026
4 checks passed
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