feat: ingest Brevier archive and phone note exports #48

Closed
opened 2026-11-08 19:52:09 +00:00 by david · 0 comments
Owner

Brevier (github.com/gurov/brevier) is a reader-browser that reduces pages to Markdown and keeps a local copy of everything read. It is the closest thing to "ambient awareness" of my reading, and none of it reaches knox.

What Brevier produces

  • Archive copies: <host>/<date>-<slug>.md.lz4 (or .md when "plain copies" is on), front matter title / source / read, then the article Markdown.
  • Notes: quotes with #:~:text= deep links back to the passage, plus the note text.
  • Phone: the app can export all notes as .md/.zip through the share sheet, and save a single article (text + ## Your notes) through SAF. There is no bulk archive export (roadmap #15 leaves it undecided), and the phone archive is app-private.

Design (agreed)

Two inputs, two source ids, one ingester internal/ingest/brevier.go:

Input Source Entry
~/.local/share/brevier/archive/<host>/<date>-<slug>.md[.lz4] brevier one per source URL; body, front matter, read date in provenance
`~/.local/share/knox/inbox/brevier/*.md *.zip` brevier-notes
  • Fingerprint sha256("brevier:"+source) so a re-read on another day versions the same entry rather than creating a duplicate.
  • ContentHash over the body: unchanged copies add no observations.
  • Support both .md and .md.lz4 (github.com/pierrec/lz4/v4); Brevier writes both forms side by side by design.
  • Zip handling: parse every .md entry, ignore images/.
  • Env overrides BREVIER_ARCHIVE / BREVIER_INBOX; hourly ticker; per-file error isolation.
  • Local sources only; the server node replicates.

Verification

  • Temp-dir fixtures for plain, compressed, and phone-zip inputs.
  • Re-ingest adds nothing; changing a body updates the entry.
  • knox_get on an entry shows the article body and the read date.
Brevier (github.com/gurov/brevier) is a reader-browser that reduces pages to Markdown and keeps a local copy of everything read. It is the closest thing to "ambient awareness" of my reading, and none of it reaches knox. ## What Brevier produces - Archive copies: `<host>/<date>-<slug>.md.lz4` (or `.md` when "plain copies" is on), front matter `title / source / read`, then the article Markdown. - Notes: quotes with `#:~:text=` deep links back to the passage, plus the note text. - Phone: the app can export **all notes** as `.md`/`.zip` through the share sheet, and save a single article (text + `## Your notes`) through SAF. There is no bulk archive export (roadmap #15 leaves it undecided), and the phone archive is app-private. ## Design (agreed) Two inputs, two source ids, one ingester `internal/ingest/brevier.go`: | Input | Source | Entry | |---|---|---| | `~/.local/share/brevier/archive/<host>/<date>-<slug>.md[.lz4]` | `brevier` | one per `source` URL; body, front matter, read date in provenance | | `~/.local/share/knox/inbox/brevier/*.md|*.zip` | `brevier-notes` | one per page from phone exports; notes digest with deep links | - Fingerprint `sha256("brevier:"+source)` so a re-read on another day versions the same entry rather than creating a duplicate. - `ContentHash` over the body: unchanged copies add no observations. - Support both `.md` and `.md.lz4` (`github.com/pierrec/lz4/v4`); Brevier writes both forms side by side by design. - Zip handling: parse every `.md` entry, ignore `images/`. - Env overrides `BREVIER_ARCHIVE` / `BREVIER_INBOX`; hourly ticker; per-file error isolation. - Local sources only; the server node replicates. ## Verification - Temp-dir fixtures for plain, compressed, and phone-zip inputs. - Re-ingest adds nothing; changing a body updates the entry. - `knox_get` on an entry shows the article body and the read date.
david closed this issue 2026-11-09 00:31:34 +00:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: david/knox#48