You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 840d0b3
Browse filesBrowse the repository at this point in the historyBrowse files
authored
feat(adapters): SQLite session store with the journal Store port (#61)
* feat(adapters): SQLite session store with the journal Store port
One database per source under an injected sessions folder (ADR 0009,
file-engine §2.2, §2.3): schema v1 with a schema_migration table, WAL
and synchronous=FULL read back on every open, integrity_check and
foreign_key_check before any write, fail closed on a damaged, foreign,
newer or tampered file. Sessions, groups, members, the decision log
(fold, locks and append in one transaction), plans and their status
changes, and PlanStore, the core's journal Store for one plan, under
the <key>.lock source lock. Adds rusqlite 0.40 with the bundled SQLite
(Margaux's OK, 29 Nov 2026). Choices recorded as proposals in SPEC §10.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012N2yvaknQJCM8yjc93h9jN
* build: refresh lockfiles (generated in CI)
* fix(adapters): rusqlite 0.41 for SQLite 3.54, and the file key's borrow
RUSTSEC-2026-0459 affects the SQLite that libsqlite3-sys 0.38 bundles;
rusqlite 0.41 bundles 3.54.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012N2yvaknQJCM8yjc93h9jN
* build: refresh lockfiles (generated in CI)
* ci: rerun after the lockfile refresh
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012N2yvaknQJCM8yjc93h9jN
* fix(adapters): name the plan row type for clippy
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012N2yvaknQJCM8yjc93h9jN
* test(adapters): a cancelled plan reads back without stopping
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012N2yvaknQJCM8yjc93h9jN
* fix(adapters): store review findings: run-only appends, confirm checks, crash cuts
- PlanStore appends only while the plan is applying or stopping (INV-03).
- confirm requires the active session, the newest draft and the whole
decision log, and supersedes the other drafts; Start fresh supersedes
the archived session's drafts (INV-04).
- An existing file is checked through a read-only connection first;
defensive mode, trusted_schema=OFF and mmap_size=0 before the first
read; the whole schema, SQL text included, compared on open; stored
paths validated as Windows names; an empty file with a leftover -wal
refused; plans fixed by triggers; plans loaded in one read transaction.
- Tests: crash cuts at every disk call with crash images and the
write-ahead check (INV-13, INV-14), a journal write failing mid-run,
append-only and fixed rows (INV-16), the lock (INV-23), the live -wal
refusal, the bundled SQLite version.
- Docs: file-engine §2.2, §9.7, §13; SPEC §10; threat model T5, T12,
T14; nfr §8; testing §4.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012N2yvaknQJCM8yjc93h9jN
* test(adapters): state what the write-ahead check covers
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012N2yvaknQJCM8yjc93h9jN
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Copy file name to clipboardExpand all lines: CLAUDE.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@
3
3
Culla is a Windows desktop app (Tauri 2 + Rust + React/TS) that culls Nikon JPEG+NEF photos with a swipe UI, then applies keep/reject as safe, journaled file operations. Start at `docs/SPEC.md`: it records the author's decisions and maps each topic to its owning doc (PRD, nfr, architecture, ADRs, file-engine design, threat model, testing, roadmap). `docs/research/` is historical input: where it disagrees with the spec or an ADR, the spec and ADRs win.
4
4
5
5
## Status
6
-
M0 (repo and tooling) is done; M1 (core engine headless) is in progress: NEF preview reader, scan and grouping, EXIF, volume identity, the preview decode and the preview pipeline (threads, prefetch, in-memory cache) are in, with the headless `culla scan` and `culla preview` and the `culla-bench` harness for the M1 campaign. M2 (file engine) has started: the pure decision log, `plan()`, preflight, the journal executor and the apply log's rendering are in, with the dry-run `culla plan`. M3 has started on the UI, demo backend only: start screen (folder and recent folders only, ADR 0029), swipe screen, TS decision reducer (`src/decisions`). M4 has started on the same demo backend: review screen with move or copy and the destination, and confirm dialog (`src/review`, the demo's plan and preflight in `backend/demo-plan.ts`, scenarios by `?scenario=` in `backend/demo-scenarios.ts`), apply screen and report (`src/apply`, the simulated run in `backend/demo-apply.ts`, its log in `backend/demo-log.ts`), zoom to 100 % and the EXIF overlay on the swipe screen (`swipe/zoom.ts`, `ZoomLayer.tsx`, `ExifOverlay.tsx`), resume and start over (sessions kept between visits in `backend/demo-sessions.ts`). Author decisions recorded 27 to 29 Nov; what is still open is in SPEC §10 and file-engine §13.
6
+
M0 (repo and tooling) is done; M1 (core engine headless) is in progress: NEF preview reader, scan and grouping, EXIF, volume identity, the preview decode and the preview pipeline (threads, prefetch, in-memory cache) are in, with the headless `culla scan` and `culla preview` and the `culla-bench` harness for the M1 campaign. M2 (file engine) has started: the pure decision log, `plan()`, preflight, the journal executor and the apply log's rendering are in, with the dry-run `culla plan`, and the SQLite session store (`culla_adapters::store`; reconcile on open and the Windows file steps are next). M3 has started on the UI, demo backend only: start screen (folder and recent folders only, ADR 0029), swipe screen, TS decision reducer (`src/decisions`). M4 has started on the same demo backend: review screen with move or copy and the destination, and confirm dialog (`src/review`, the demo's plan and preflight in `backend/demo-plan.ts`, scenarios by `?scenario=` in `backend/demo-scenarios.ts`), apply screen and report (`src/apply`, the simulated run in `backend/demo-apply.ts`, its log in `backend/demo-log.ts`), zoom to 100 % and the EXIF overlay on the swipe screen (`swipe/zoom.ts`, `ZoomLayer.tsx`, `ExifOverlay.tsx`), resume and start over (sessions kept between visits in `backend/demo-sessions.ts`). Author decisions recorded 27 to 29 Nov; what is still open is in SPEC §10 and file-engine §13.
7
7
8
8
## Commands
9
9
Work now:
@@ -19,7 +19,7 @@ Work now:
19
19
20
20
## Layout
21
21
-`crates/core` (package `culla-core`) — domain, ports, pure logic (TIFF/IFD walker behind a `ReadAt` port; `grouping` and scan exclusions over plain `ScanEntry` data; `exif` parsing and capture order over plain `RawExif` data; `names`; `volume`: serial + folded relative path keys, run binding; `preview`: sizes, scale, pixel cap, orientation, working bytes; `prefetch`: window, scheduler, LRU, memory budgets; `decisions`: event log, `fold`, undo/redo, reconcile clears, text form; `plan`: decided groups to operations over a snapshot of the target roots; `preflight`: P1–P17 over a plan and a snapshot of facts; `journal`: op states, recovery table, one executor for apply and resume over `Disk`/`Store` ports; `applylog`: renders the plain-text apply log from the journal; `text`: the shared escape set for untrusted names, used by the CLI and the apply log). Property tests: seeded plain loops instead of proptest (proposed, SPEC §10), `CULLA_PROP_CASES`. No I/O, no Tauri, `#![forbid(unsafe_code)]`.
22
-
-`crates/adapters` (package `culla-adapters`) — Windows file ops, the read-only folder walk (`scan`, `read_dir` only, re-checks each folder before listing it, swap window until M2, never a partial folder; moves into `winfs` in M2), file reads for NEF previews, EXIF, `preview` decode (turbojpeg builds libjpeg-turbo: needs CMake, and NASM on `PATH` for SIMD, else it silently builds slow plain C), `pipeline` (reader thread, decode workers, in-memory cache; std threads only), `facts` (read-only lookups for the dry-run plan and preflight: path facts, target snapshot, the decision log file), SQLite; `winfs` (Win32 `unsafe` only in `winfs/win32.rs`, read-only volume and time-zone lookups so far, a stub off Windows). No Tauri.
22
+
- `crates/adapters` (package `culla-adapters`) — Windows file ops, the read-only folder walk (`scan`, `read_dir` only, re-checks each folder before listing it, swap window until M2, never a partial folder; moves into `winfs` in M2), file reads for NEF previews, EXIF, `preview` decode (turbojpeg builds libjpeg-turbo: needs CMake, and NASM on `PATH` for SIMD, else it silently builds slow plain C), `pipeline` (reader thread, decode workers, in-memory cache; std threads only), `facts` (read-only lookups for the dry-run plan and preflight: path facts, target snapshot, the decision log file), `store` (the SQLite session store, rusqlite with bundled SQLite: one database per source under an injected sessions folder, WAL and `synchronous=FULL` asserted on open, schema v1 with migrations, a read-only check before any write, fails closed on a damaged, foreign, newer or altered file, journal writes only while a plan runs, the `<key>.lock` source lock, the core's `Store` port as `PlanStore`); `winfs` (Win32 `unsafe` only in `winfs/win32.rs`, read-only volume and time-zone lookups so far, a stub off Windows). No Tauri.
23
23
-`crates/cli` (package `culla-cli`, binary `culla`) — headless scan (in; exit codes, JSON fields and off-Windows behaviour provisional, SPEC §10), preview (in; decodes, times and reports), plan (in; dry run, exit codes 0 to 5 provisional), apply, resume. Wiring only; writes nothing but stdout and stderr.
24
24
-`crates/bench` (package `culla-bench`) — benchmark harness (ADR 0020): scan, preview, swipe through the pipeline, io-baseline, report; read-only, writes nothing but stdout, std only, `--json` unstable. Campaign: docs/benchmarks.md §7.
25
25
-`src-tauri` (package `culla-app`) — wiring only: commands, `culla://` image scheme, capabilities. New command: `build.rs``AppManifest::commands` + `allow-<command>` in `capabilities/main.json`.
0 commit comments