Files
Liber-public/CLAUDE.md
T

2.8 KiB

Liber Domi — core (public)

Liber (Latin: book) is the Domi home for books. This repository is the public, MPL-2.0 core (https://gitea.marek-novak.cz/mnovak/Liber-public; the roadmap calls it LiberPublic): pure Rust, no network, no UI, no clock. The app lives in the private Liber repo (https://gitea.marek-novak.cz/mnovak/Liber) and depends on this one by git tag, never by a path. The roadmap and the day pages are in the app repo (docs/01_books.md).

Layout

crates/liber-format    EPUB 2/3, FB2 (+ .fb2.zip), TXT, DRM-free MOBI/AZW3 -> one Document; the zip reader and
                       writer; the sanitizer (whitelist, no scripts, no remote URLs); positions (CFI + text quote)
crates/liber-library   book identity (ISBN, text fingerprint), the library model, the event log and its merge
                       (sync semantics), stats, Goodreads/StoryGraph CSV import, the liber-export format
crates/liber-habit     Day 2: the local day (the only day computation in Liber), days read, the forgiving streak,
                       the reminder schedule, the medal rules (a pure function of the log)
fixtures-fetch/        sha256-pinned hostile corpora -> fixtures/fetched/ (never in git; the tests generate theirs)
docs/                  FORMATS.md (formats, limits, positions, DRM), DEPENDENCIES.md (every crate, its licence)
scripts/deps.mjs       regenerates the crate table in DEPENDENCIES.md; exits 1 on a licence outside the allowed set

Direction: liber-habit -> liber-library -> liber-format. Neither crate opens files, sockets or reads the clock: bytes in, values out; time and ids are parameters (tests/purity.rs checks the sources).

Commands

cargo test --workspace          # every mandatory test
node scripts/deps.mjs           # licence table; must exit 0

On the dev PC CARGO_HOME=F:\C-Drive-Migration\future-caches\cargo (C: is off limits).

Rules

  • Commits: [<crate>] <Feature>: <description>. No AI attribution, ever: no Co-Authored-By, no session links, no "Generated with".
  • Licence rule: a crate is recorded in docs/DEPENDENCIES.md before it is used. Allowed: MIT, Apache-2.0, BSD, Zlib, MPL-2.0 (and the interpretations listed there). Anything else: stop and report.
  • Hostile input: every outside file is hostile. Explicit Limits; no allocation sized from a number read out of a file; nothing outside the input is ever resolved (no external entities, no remote URLs).
  • DRM: detected and refused with "This book is DRM-protected, so Liber cannot open it." There is no decrypt path.
  • No binaries in git: fixtures are generated by the tests or fetched by fixtures-fetch/.
  • Branch -> PR on Gitea ($GITEA_TOKEN, never echoed, never written) -> self-review in the PR body -> merge --no-ff -> push -> git rev-parse HEAD origin/main twice the same -> tag vX.Y.Z.