Skip to content

feat(cli): add Kindle SDR highlight extraction - #16

Draft
AnnatarHe wants to merge 1 commit into
masterfrom
agent/kindle-sdr-highlights
Draft

feat(cli): add Kindle SDR highlight extraction#16
AnnatarHe wants to merge 1 commit into
masterfrom
agent/kindle-sdr-highlights

Conversation

@AnnatarHe

Copy link
Copy Markdown
Member

Summary

  • add ck-cli sdr --path PATH [--json] with automatic Kindle tree, .sdr, and single-book discovery
  • decode KRDS annotations and APNX pages, then reconstruct unencrypted AZW3/KF8 text natively in Go
  • support uncompressed, PalmDOC, and HUFF/CDIC content with readable or ClippingItem JSON output
  • document supported formats and add deterministic unit and end-to-end fixtures

Why

Kindle .azw3r sidecars store annotation positions rather than the highlighted words. Recovering the text requires joining those positions with the sibling book's reconstructed KF8 markup stream.

Impact

The command is read-only, offline, and has no Python or KindleUnpack runtime dependency. It extracts highlights, note spans, and underlines while preserving the existing JSON schema. DRM, Mobi7, and KFX/.yjr remain explicitly unsupported.

Validation

  • go test ./...
  • go vet ./...
  • go build ./cmd/ck-cli
  • CLI help and invalid-path smoke tests

@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@claude

claude Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Claude encountered an error —— View job


I'll analyze this and get back to you.

@codecov

codecov Bot commented Aug 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 52.69017% with 510 lines in your changes missing coverage. Please review.
✅ Project coverage is 43.68%. Comparing base (8518e5c) to head (3a0659c).

Files with missing lines Patch % Lines
internal/sdr/azw3.go 48.80% 202 Missing and 77 partials ⚠️
internal/sdr/krds.go 64.06% 60 Missing and 32 partials ⚠️
internal/sdr/extract.go 52.17% 53 Missing and 24 partials ⚠️
internal/commands/sdr.go 13.63% 31 Missing and 7 partials ⚠️
internal/sdr/text.go 67.60% 13 Missing and 10 partials ⚠️
cmd/ck-cli/main.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master      #16       +/-   ##
===========================================
+ Coverage   22.22%   43.68%   +21.45%     
===========================================
  Files           8       13        +5     
  Lines         594     1527      +933     
===========================================
+ Hits          132      667      +535     
- Misses        454      702      +248     
- Partials        8      158      +150     
Flag Coverage Δ
unittests 43.68% <52.69%> (+21.45%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant