Skip to content

F12-Q2 step 4: companion-owned copies, groups and finish - #176

Merged
Fledgewing merged 12 commits into
feature/0.12from
f12/plugin-no-server-catalog-step4
Nov 27, 2026
Merged

Fledgewing merged 12 commits into
feature/0.12from
f12/plugin-no-server-catalog-step4

Conversation

@Fledgewing

@Fledgewing Fledgewing commented Nov 26, 2026 •

Copy link
Copy Markdown
Owner

Moves copy replacement, native grouped lists, settings recommendations and end-of-book catalog work out of plugin Lua. Deletes the four legacy Lua modules; their callers use ko/library.lua commands and bounded neutral snapshots. All catalog protocol/transport stays in the companion adapter, and native reader/settings actions remain behind Library.

  • Reuses android/companion/app/src/main/java/net/fledgewing/orbitcompanion/server/bookorbit/CacheWorker.kt:318 (saved-detail lookup), :338 (sidecar/statistics repair), CopiesLogic.kt:35 (candidate rules), BookOrbitLibrary.kt:36 (local ledger), BookOrbitProjection.kt:249 (membership/grouping), and LibraryReadModel.kt:26 (bounded publication). Reuses android/koreader/orbit.koplugin/ko/endsheet.lua, ko/home_host.lua and ko/library.lua for rendering/navigation/transport.
  • Adds minimal neutral catalog.action and settings.recommendations commands to Library and the companion interface, plus reader.finish/copies.state projections. Existing groups/window projections gain native-list selection scope. No parallel catalog or replacement position writer.
  • Account-scoped copy/finish/deferred-download queues checkpoint the legacy sources, which remain intact. Prepared delivery variants and artifact hashes are verified before atomic replacement. Interrupted identity repair resumes; token-validated native writeback cannot acknowledge a newer finish. Active commands remain busy after dequeue, retaining the automatic Wi-Fi hold through transfer/repair. Integrates the merged F12-Q owned writer: finish delivery follows its position drain, catalog identity survives login adoption, and completed matches feed the existing local ledger. Native catalog downloads dispatch to the companion, including verified local cache hits and replayable native cache linking.
  • Finish has three charged rows; recommendations have eight; copies state has one. Snapshots stay within 16 KiB, with timing spans, zero plugin network/forks and at most one batched materialization request per paint. Recommendation review is lifecycle cached. The guard rejects copy/finish transport even within a Lua adapter and checks retired files stay absent.

Validation: 799 companion unit tests (4 existing skips), verifySharedVersion, assembleDebug, lintDebug; 241 Lua logic tests and 277 flows; 11 boundary tests; feature/workflow/release-input/product-name checks; installer/sideload test doubles; 16 attestation tests; pinned upstream check (58 routes, none requires app attestation); pinned native plugin compatibility. Removed legacy transport/engine flow assertions move to companion workflow/projection tests and neutral dispatch tests, including the recorded delivery-variant fixture.

Android only. No devices, adb, releases, tags or firmware source changes. PR targets feature/0.12. Source/reuse evidence, performance rule and sync integration are recorded in docs/design/booksync-home/F12-Q2-NOTES.md, docs/design/backend-independence.md, AGENTS.md and the interface contract. Automatic PR checks must pass before squash merge.

Fledgewing and others added 12 commits November 26, 2026 14:40
Delete the four legacy Lua catalog modules and route callers through neutral commands and bounded snapshots. Preserve durable queue phases, delivery hashes, offline reads and native writer ordering.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BLYjLJzEkmBRpMx6vsJ4xw
Read the position mode's saved native value, retain compatibility checks, and finish through the existing writer plus outbox drain before downloading. Owned Home also closes the end sheet and readies its finish.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BLYjLJzEkmBRpMx6vsJ4xw
Keep native writer setup off Home's render path and require the companion before leaving into the owned Home flow. Add a deterministic scheduling regression.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BLYjLJzEkmBRpMx6vsJ4xw
Include executing catalog work in the companion busy gate after dequeue, and release it in finally. Cover both normal completion and failure so background copy transfers retain their Wi-Fi hold.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BLYjLJzEkmBRpMx6vsJ4xw
Bulk Use leaves previously kept choices intact. Acknowledgements count only successful native writes, and review clears the unseen line without repeating notices. Project native action labels in the companion and cover the complete eight-row snapshot budget.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BLYjLJzEkmBRpMx6vsJ4xw
Assert copy count publication and inherited finish row-budget rejection through SQLite. Reuse CacheWorker's injected timing logger for workflow-driven publication.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BLYjLJzEkmBRpMx6vsJ4xw
Retain both neutral command sets, collection membership and the four-module catalog deletion. Preserve Storage registration and rerun the combined companion and plugin suites.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BLYjLJzEkmBRpMx6vsJ4xw
Retain the base's startup and upgrade behavior alongside companion-owned catalog workflows. Validate the combined plugin, read-model, companion build and lint checks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BLYjLJzEkmBRpMx6vsJ4xw
…writer

Retain catalog provenance during sync login adoption and project matched local files
through the existing ledger. Keep end-of-book preparation local and route native
catalog downloads through the sole companion worker.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BLYjLJzEkmBRpMx6vsJ4xw
…writer

Retain catalog provenance during sync login adoption and project matched local files
through the existing ledger. Keep end-of-book preparation local and route native
catalog downloads through the sole companion worker.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BLYjLJzEkmBRpMx6vsJ4xw
Avoid redundant finish-leave commands for unmarked readers and keep the existing
30-intent flow budget when switching repeatedly between Home and the companion.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BLYjLJzEkmBRpMx6vsJ4xw
Keep both loader additions while retaining the four retired catalog modules' removal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BLYjLJzEkmBRpMx6vsJ4xw
@Fledgewing
Fledgewing merged commit e93cbcc into feature/0.12 Nov 27, 2026
21 checks passed
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