chore(db): relocate handle-lifecycle exports to db/client.ts, lint-ban raw sqlite #863

Merged
reviewer merged 1 commit from dev/849 into main 2026-05-04 22:39:54 +00:00
Collaborator

Relocates getDb() / agentsDbPath() / resetDb() + orm() from db.ts into db/client.ts (canonical home). db.ts re-exports them for backward compat while #843–#845 finish extracting aggregates.

Adds just sql-layer-check — bans non-type bun:sqlite imports outside infrastructure/database/ (escape hatch: architect.ts manages its own sessions DB). Wired into just qa and a new CI job.

Test plan

  • just sql-layer-check passes
  • bun x turbo run typecheck clean
  • bun x @biomejs/biome@^2 check . — 0 errors, 8 pre-existing warnings

Closes #849

Relocates `getDb()` / `agentsDbPath()` / `resetDb()` + `orm()` from `db.ts` into `db/client.ts` (canonical home). `db.ts` re-exports them for backward compat while #843–#845 finish extracting aggregates. Adds `just sql-layer-check` — bans non-type `bun:sqlite` imports outside `infrastructure/database/` (escape hatch: `architect.ts` manages its own sessions DB). Wired into `just qa` and a new CI job. ## Test plan - `just sql-layer-check` passes - `bun x turbo run typecheck` clean - `bun x @biomejs/biome@^2 check .` — 0 errors, 8 pre-existing warnings Closes #849
dev self-assigned this 2026-05-04 22:35:39 +00:00
chore(db): relocate getDb/agentsDbPath/resetDb to db/client.ts, lint-ban raw sqlite, update docs
All checks were successful
qa / sql-layer-check (pull_request) Successful in 14s
qa / dockerfile (pull_request) Successful in 20s
qa / db-schema (pull_request) Successful in 30s
qa / qa-1 (pull_request) Successful in 1m41s
qa / qa (pull_request) Successful in 0s
2d9d2db10d
- Move agentsDbPath / getDb / resetDb / ensureSchema / orm() into
  db/client.ts; db.ts re-exports them for backward compat while
  aggregate extraction (#843–#845) is in progress.
- Add `just sql-layer-check` (ban non-type bun:sqlite imports outside
  infrastructure/database/; escape hatch: architect.ts) + wire into
  `just qa` and a new CI job in qa.yml.
- CLAUDE.md Tech stack: mention Drizzle + sql-layer-check.
- docs/database.md Layout: reflect current directory structure.
- docs/modules.md: add db/client.ts row, update db.ts description.

Closes #849

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
dev requested review from reviewer 2026-05-04 22:37:25 +00:00
reviewer approved these changes 2026-05-04 22:39:48 +00:00
reviewer left a comment

Relocation correct, no circular deps, backward compat re-exports intact. sql-layer-check grep is sound; Biome enforces double-quotes so single-quote escape attempts are caught at format time. CI green.

Relocation correct, no circular deps, backward compat re-exports intact. `sql-layer-check` grep is sound; Biome enforces double-quotes so single-quote escape attempts are caught at format time. CI green.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/claude-hooks!863
No description provided.