feat(cli): add Kindle SDR highlight extraction - #16
Conversation
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #16 +/- ##
===========================================
+ Coverage 22.22% 50.05% +27.82%
===========================================
Files 8 14 +6
Lines 594 1998 +1404
===========================================
+ Hits 132 1000 +868
- Misses 454 782 +328
- Partials 8 216 +208
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
Summary
ck-cli sdr --path PATH [--json]with automatic Kindle tree,.sdr, and single-book discovery.azw3rand.yjrannotations, APNX pages, KFX navigation pages, notes, and underlinesCONT/ENTYcontent with readable orClippingItemJSON output.yjr.bad_filewhen Kindle leaves the active.yjrcache empty[]Why
Kindle sidecars store annotation positions rather than highlighted words. Recovering the text requires joining those positions with either the sibling KF8 markup stream or KFX text pools and compressed section position maps.
The supplied KFX snapshot exposed a false-success case: both its active
.yjrand.yjr.bad_filecontain a valid but emptyannotation.cache.object. The command decoded the book and returned zero highlights as though extraction had succeeded, hiding that no local positions were available.Impact
The command is read-only and offline, with no Python or KindleUnpack runtime dependency. KFX binary Ion decoding uses the Apache-2.0 Amazon Ion Go library. The existing JSON schema remains unchanged. DRM-protected books, Mobi7, and
.yjfreading statistics remain unsupported.When the active KFX annotation cache is empty, the extractor now checks a decodable
.yjr.bad_file. If neither file contains annotations, it explains that the book must be opened/synced before copying or thatdocuments/My Clippings.txtshould be used. It no longer prints a misleading successful empty JSON array.Validation
go test ./...go test -race ./...go vet ./...go build -o /tmp/clippingkk-ck-cli ./cmd/ck-cli.yjr.bad_file.yjrtest: exact Chinese selection, attached note, and navigation pagegolangci-lintwas not available in the workspace.