Skip to content

[00] add architecture boundary guardrails - #175

Merged
h4yfans merged 1 commit into
mainfrom
codex/architecture-guardrails
Apr 8, 2026
Merged

[00] add architecture boundary guardrails#175
h4yfans merged 1 commit into
mainfrom
codex/architecture-guardrails

Conversation

@h4yfans

@h4yfans h4yfans commented Apr 8, 2026

Copy link
Copy Markdown
Collaborator

What

Add the first Phase 00 architecture guardrails for the desktop app by introducing a dedicated architecture boundary check, wiring it into local and CI verification, and splitting note tag-definition ownership out of the note cache query module.

Why

The architecture reset needs compiler-visible and CI-visible constraints before the broader database and IPC refactors start. This PR makes new boundary regressions fail early while preserving compatibility for the existing query surface.

How

  • add check:contracts and check:architecture root scripts and run them from desktop pretypecheck plus CI
  • add scripts/check-architecture-boundaries.js to enforce renderer/main boundaries, protect note query ownership, and allowlist current direct IPC query imports
  • initialize desktop data and index databases from the split schema entrypoints and expose explicit DataDb, IndexDb, and RawIndexDb types
  • move tag-definition helpers into a dedicated data-owned query module while keeping the notes barrel stable
  • keep the legacy DrizzleDb alias as a transitional compatibility layer so untouched call sites continue to compile

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)

Ran:

  • pnpm check:contracts
  • pnpm check:architecture
  • pnpm ipc:generate
  • pnpm ipc:check
  • pnpm typecheck
  • pnpm --filter @memry/desktop exec vitest run --config config/vitest.config.ts src/main/database/client.test.ts src/main/database/queries/notes/notes.test.ts

Checklist

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

@h4yfans h4yfans changed the title [codex] add architecture boundary guardrails [00] add architecture boundary guardrails Apr 8, 2026
@h4yfans
h4yfans marked this pull request as ready for review April 8, 2026 20:52
@h4yfans
h4yfans merged commit d732540 into main Apr 8, 2026
2 of 4 checks passed
@h4yfans
h4yfans deleted the codex/architecture-guardrails branch April 8, 2026 20:53
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