feat(paroche): KOSync protocol for ebook reading-progress sync#220
Merged
forkwright merged 2 commits intomainfrom Apr 22, 2026
Merged
feat(paroche): KOSync protocol for ebook reading-progress sync#220forkwright merged 2 commits intomainfrom
forkwright merged 2 commits intomainfrom
Conversation
Implements the KOSync 4-endpoint wire protocol (POST/users/create, GET/users/auth, PUT/syncs/progress, GET/syncs/progress/:document) for KOReader cross-device reading position sync. Includes SHA1-based auth, last-write-wins conflict resolution, and comprehensive tests. KOReader-only v1; Thorium documented as future work (no server-side position sync protocol as of 2026). - Migration 010_kosync.sql: kosync_users + kosync_positions tables - apotheke::repo::kosync: storage layer + tests - paroche::routes::kosync: HTTP endpoints + request/response types - docs/integrations.md: KOReader setup and protocol reference Closes #213 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements KOSync protocol per /tmp/research-harmonia-213-sync.md §5. Ships 4 endpoints + storage + migrations. KOReader-only v1 (operator Q1 approval); Thorium Reader has no server-side position sync protocol, documented as future work.
Endpoints (under
/kosync)POST /users/create— register (username + SHA1 password hash)POST /users/auth— authenticate (returns OK or 401)POST /syncs/progress— upload{document, progress, percentage, device, device_id, timestamp}GET /syncs/progress/{document}— fetch latest position for a docWire-format hash is SHA1(password) per KOReader client convention; documented in-code as "kosync-compat: stronger hashing would break interop."
Storage
Migration
010_kosync.sqladds:kosync_users(username PRIMARY KEY, password_hash, created_at)kosync_positions(username, document, progress, percentage, device, device_id, timestamp)— last-write-wins PK on(username, document).Deferred (non-goals)
Test plan
Closes #213
🤖 Generated with Claude Code