Files

49 lines
3.8 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Liber Domi — core (public)
Liber (Latin: book) is the Domi home for books. This repository is the **public, CPAL-1.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;
Day 5 `together`: what another person's Liber sends (strictly parsed), where a shared note
lands in one's own copy (exact / approximate / lost), the spoiler guard, recording approval
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)
crates/liber-lang Day 3: words by UAX #29 with UTF-16 offsets, the Lemmatizer trait (a licensed table first,
hand-written rules per language after), a book's lemma counts, coverage, the warm-up, levels,
Ludus concept ids, edition alignment (Gale–Church with anchors). Ships no outside data.
crates/liber-audio Day 4: the audio engine, reusable (no Liber types): WSOLA time-stretch, silence trimming,
voice boost, chapters, queue, sleep timer, position saving, the read-aloud timeline and cache
key; MP4/ID3/cue containers with DRM detection (refused, never decrypted); symphonia decoding
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`; `liber-lang` and `liber-audio` stand alone. No 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`.