Reading together (v0.6.0) #9

Merged
mnovak merged 1 commits from feature/together into main 2026-11-22 11:22:43 +01:00
Owner

Day 5 (v0.6.0): reading together, the pure part (the app's docs/05_together.md).

liber_library::together:

  • Wire::parse(kind, body): what another person's Liber sends in their Tabellarius group — liber.hello, liber.note, liber.note.withdraw, liber.buddy, liber.progress, liber.thread. Strict: unknown kinds and fields refused, every value capped (body 64 KiB, note 10,000 chars, quote 2,000, message 4,000, name 80, ids 1–64 of [A-Za-z0-9_-], progress finite in 0–1).
  • place(doc, my_book, note): the note's anchor resolved in one's own copy with liber_format::resolve. Only the same book (ISBN-13 or fingerprint) can be Exact; another edition is at best Approximate; not found (or a tie within a chapter) is Lost → the side list.
  • Reach::of(book) + folded(spot, placed, same, reach): the spoiler guard from the furthest position the library already keeps; a finished book folds nothing.
  • Recording sources (Slot { slot, key, sha256 }, Local { sha256 }), slot/key/mime checks.

New ops (and their fold, export and restore): PersonAdd, PersonRemove, Hide, Share, Unshare, BuddyRead, RecordAsk, RecordAskClose, RecordingAdd, RecordingApprove, RecordingRemove. Library::{hidden, playable, pending, removed_recordings}. A removed recording is final: a late add or approval does not bring it back; an approval that arrives before its add is kept.

Tests (tests/together.rs, 8): mandatory 2 (exact in the same edition, approximate at the right words in another, the side list for rewritten text and for a tie), 3 (folding by chapter, by progress across editions, after the library is rebuilt from events in another order, nothing folded once read), 4 (the core's half: unapproved never playable, removal final across devices, hostile values dropped), people/shares/hides with an export round trip, strict wire parsing. Workspace 124 green (116 before); clippy 0; deps 0 not allowed.

Self-review

  • place downgrades Exact to Approximate for another edition even when positions and text agree: the positions are the sender's, and the reader should know.
  • Across chapters resolve takes the chapter nearest the anchor's own when the same text is in two chapters (its Day 1 rule); only a tie inside one chapter is Lost. That is a nearby place, never a random one.
  • An approval binds to a sha256 of the sealed take, so a later take from the same link is a new recording that waits again (the app makes its id).
Day 5 (v0.6.0): reading together, the pure part (the app's `docs/05_together.md`). `liber_library::together`: - `Wire::parse(kind, body)`: what another person's Liber sends in their Tabellarius group — `liber.hello`, `liber.note`, `liber.note.withdraw`, `liber.buddy`, `liber.progress`, `liber.thread`. Strict: unknown kinds and fields refused, every value capped (body 64 KiB, note 10,000 chars, quote 2,000, message 4,000, name 80, ids 1–64 of `[A-Za-z0-9_-]`, progress finite in 0–1). - `place(doc, my_book, note)`: the note's anchor resolved in one's own copy with `liber_format::resolve`. Only the same book (ISBN-13 or fingerprint) can be `Exact`; another edition is at best `Approximate`; not found (or a tie within a chapter) is `Lost` → the side list. - `Reach::of(book)` + `folded(spot, placed, same, reach)`: the spoiler guard from the furthest position the library already keeps; a finished book folds nothing. - Recording sources (`Slot { slot, key, sha256 }`, `Local { sha256 }`), slot/key/mime checks. New ops (and their fold, export and restore): `PersonAdd`, `PersonRemove`, `Hide`, `Share`, `Unshare`, `BuddyRead`, `RecordAsk`, `RecordAskClose`, `RecordingAdd`, `RecordingApprove`, `RecordingRemove`. `Library::{hidden, playable, pending, removed_recordings}`. A removed recording is final: a late add or approval does not bring it back; an approval that arrives before its add is kept. **Tests** (`tests/together.rs`, 8): mandatory 2 (exact in the same edition, approximate at the right words in another, the side list for rewritten text and for a tie), 3 (folding by chapter, by progress across editions, after the library is rebuilt from events in another order, nothing folded once read), 4 (the core's half: unapproved never playable, removal final across devices, hostile values dropped), people/shares/hides with an export round trip, strict wire parsing. Workspace 124 green (116 before); clippy 0; deps 0 not allowed. **Self-review** - `place` downgrades `Exact` to `Approximate` for another edition even when positions and text agree: the positions are the sender's, and the reader should know. - Across chapters `resolve` takes the chapter nearest the anchor's own when the same text is in two chapters (its Day 1 rule); only a tie inside one chapter is `Lost`. That is a nearby place, never a random one. - An approval binds to a `sha256` of the sealed take, so a later take from the same link is a new recording that waits again (the app makes its id).
mnovak added 1 commit 2026-11-22 11:22:34 +01:00
mnovak merged commit fd695de1a0 into main 2026-11-22 11:22:43 +01:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mnovak/Liber-public#9