Skip to content

Type the ledger through drizzle - #21

Merged
Octember merged 1 commit into
mainfrom
cursor/drizzle-ledger
Aug 14, 2026
Merged

Type the ledger through drizzle#21
Octember merged 1 commit into
mainfrom
cursor/drizzle-ledger

Conversation

@Octember

Copy link
Copy Markdown
Owner

Summary

  • App reads and writes go through drizzle’s bun-sqlite sync API, with src/ledger/schema.ts as the query-time contract (JSON columns typed, enums derived from the tables).
  • The v14 boot path (version ladder + schema.sql) is unchanged, so existing ledgers and the v1→14 migration test still apply. FTS5 / triggers stay custom SQL.
  • Dropped the hand-written row and report types (RewindReport, TimerRow, AuditRecord, status/budget wrappers, etc.) that just restated what the schema or the function already returns.

Test plan

  • bun run typecheck
  • bun run lint
  • bun test (413 pass)
  • Open a fresh ledger and a v13-on-disk ledger; confirm boot still lands on v14
  • Smoke a wake that writes events, tasks, attention, and a worker report

Made with Cursor

…e schema.

Keep the v14 SQL ladder for existing databases; drop the hand-written row/report types that just restated what the queries already return.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Octember
Octember merged commit f128380 into main Aug 14, 2026
1 check passed
Octember added a commit that referenced this pull request Aug 14, 2026
The concurrent ledger rewrite absorbed a stale partial copy of this branch;
this is the reconciliation: main's idiom (drizzle orm, typed one/many, guard
helpers, pedantic oxlint), the branch's final reviewed semantics — provenance-
gated recentIdenticalPost (+already-landed sentinel), failCards, absolute
slack paths, v15 terminal-report triggers, §8.6 recent tier + decay,
per-identity workspaces, message-ref task_confirm, dead code kept dead
(no guests, no distillation/ambient chains). agent-tools pinned 0.5.1.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Octember added a commit that referenced this pull request Aug 14, 2026
The concurrent ledger rewrite absorbed a stale partial copy of this branch;
this is the reconciliation: main's idiom (drizzle orm, typed one/many, guard
helpers, pedantic oxlint), the branch's final reviewed semantics — provenance-
gated recentIdenticalPost (+already-landed sentinel), failCards, absolute
slack paths, v15 terminal-report triggers, §8.6 recent tier + decay,
per-identity workspaces, message-ref task_confirm, dead code kept dead
(no guests, no distillation/ambient chains). agent-tools pinned 0.5.1.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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