Skip to content

fix(memory): enforce readonly mode across writes - #119

Merged
Grivn merged 1 commit into
masterfrom
codex/issue-102-readonly-writes
Aug 30, 2026
Merged

fix(memory): enforce readonly mode across writes#119
Grivn merged 1 commit into
masterfrom
codex/issue-102-readonly-writes

Conversation

@Grivn

@Grivn Grivn commented Aug 30, 2026

Copy link
Copy Markdown
Member

Summary

  • make --readonly reject every CLI path that can mutate memory or store selection
  • open SQLite through a correctly encoded mode=ro&immutable=1 file URI
  • enforce the boundary in the store layer as well as the CLI layer
  • document the immutable snapshot semantics in English and Chinese

The write gates cover remember, forget, link, non-dry-run import, mutating embed modes, gc --keep, and store create/set/remove. Read-only paths do not create WAL/SHM sidecars, including when the database path contains spaces.

Verification

  • reproduced the bug before the change: --readonly remember exited 0 and increased the row count
  • after the change, the same command exits non-zero and the row count is unchanged
  • focused CLI/store tests cover write rejection, readable snapshots, path encoding, and sidecar absence
  • git diff --check
  • make test

Closes #102.

Open SQLite through an immutable read-only URI, reject mutating CLI paths with an actionable error, and document snapshot semantics. Add regression coverage for rejected writes, successful reads, unchanged data, and absent WAL sidecars.

Validated with focused store and command tests, an end-to-end readonly reproduction, and make test.
@Grivn
Grivn merged commit a3eb84e into master Aug 30, 2026
2 checks passed
@Grivn
Grivn deleted the codex/issue-102-readonly-writes branch August 30, 2026 19:52
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.

CLI: --readonly does not gate writes (remember persists under --readonly)

1 participant