Skip to content

fix(cursor): support wal mode without shm files via immutable fallback - #40

Merged
theonly1me merged 1 commit into
mainfrom
fix/cursor-wal-unreadable-store
Sep 6, 2026
Merged

fix(cursor): support wal mode without shm files via immutable fallback#40
theonly1me merged 1 commit into
mainfrom
fix/cursor-wal-unreadable-store

Conversation

@theonly1me

Copy link
Copy Markdown
Owner

What changed

  • Introduce openCursorDatabase with fallback to immutable URI mode when read-only WAL initialization fails.
  • Add unit tests for Cursor SQLite database in WAL mode without active -shm or -wal files.
  • Add unit tests for reading active uncheckpointed WAL frames.

Why

Cursor operates in SQLite WAL mode and removes -shm and -wal files when idle or cleanly closed. Opening a WAL-mode database with readonly: true when -shm is absent causes SQLite statement preparation to fail with SQLITE_CANTOPEN (errno 14). Falling back to mode=ro&immutable=1 allows reading the checkpointed store without requiring shared memory initialization.

How to verify

bun test src/observe/adapters/cursorStore.test.ts
bun run check
bun run ./src/cli/index.ts learn --dry-run

Data handling

  • Any new capture source has an opt-in flag and a README entry in this PR
  • Everything that reaches the network passes redactSecrets
  • No raw capture in a log line, an error message, or a test fixture
  • A test exercises the real entry point, not just the redaction function

@theonly1me
theonly1me merged commit bc35a50 into main Sep 6, 2026
7 checks passed
@theonly1me
theonly1me deleted the fix/cursor-wal-unreadable-store branch September 6, 2026 12:13
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