Cleanup: delete db.ts, lint-ban raw SQL outside DB layer, update docs #849

Closed
opened 2026-05-04 20:29:50 +00:00 by claude-desktop · 0 comments
Collaborator

As a maintainer, I want the now-empty db.ts deleted, raw SQL lint-banned outside an explicit escape hatch, and the architecture docs updated, so that the migration is closed and the new pattern is enforced going forward.

Acceptance criteria

Deletion

  • db.ts reduced to barrel re-exports OR deleted entirely if no shared utilities remain (only getDb(), agentsDbPath(), resetDb() survive — relocate to db/client.ts).
  • All imports from database/db updated to per-aggregate files.

Lint

  • Biome rule (or custom grep CI step) bans .query( / .run( / .exec( calls outside infrastructure/database/ and outside files explicitly listed as raw-SQL escape hatches.
  • just qa enforces.

Docs

  • docs/database.md (created in foundation story) updated with final layout: one file per aggregate, schema/ folder, drizzle/ migrations, drift check.
  • CLAUDE.md "Tech stack" section mentions Drizzle.
  • docs/modules.md table updated with new file list.

Sanity

  • just qa green.
  • Service boots, processes a webhook end-to-end, all rows land correctly.

Out of scope

  • Further refactors in domain layer.

References

  • All prior stories in this milestone (#839–#848).
**As a** maintainer, **I want** the now-empty `db.ts` deleted, raw SQL lint-banned outside an explicit escape hatch, and the architecture docs updated, **so that** the migration is closed and the new pattern is enforced going forward. ## Acceptance criteria ### Deletion - [ ] `db.ts` reduced to barrel re-exports OR deleted entirely if no shared utilities remain (only `getDb()`, `agentsDbPath()`, `resetDb()` survive — relocate to `db/client.ts`). - [ ] All imports from `database/db` updated to per-aggregate files. ### Lint - [ ] Biome rule (or custom grep CI step) bans `.query(` / `.run(` / `.exec(` calls outside `infrastructure/database/` and outside files explicitly listed as raw-SQL escape hatches. - [ ] `just qa` enforces. ### Docs - [ ] `docs/database.md` (created in foundation story) updated with final layout: one file per aggregate, schema/ folder, drizzle/ migrations, drift check. - [ ] `CLAUDE.md` "Tech stack" section mentions Drizzle. - [ ] `docs/modules.md` table updated with new file list. ### Sanity - [ ] `just qa` green. - [ ] Service boots, processes a webhook end-to-end, all rows land correctly. ## Out of scope - Further refactors in domain layer. ## References - All prior stories in this milestone (#839–#848).
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
charles/claude-hooks#849
No description provided.