fce34c7bd2
Update the peer README and architecture notes to match the landed runtime: version.ini is the download sentinel, local/ is the install predicate, install state is recovered through .lanspread.json intents, and watcher rescans are operation-gated rather than time-debounced. Add IMPL_DECISIONS.md with the implementation-time choices that were not already prescribed by PLAN.md, including the just test recipe, the UI event compatibility bridge, reuse of the existing library index for per-ID rescans, and the split between active operation state and download cancellation tokens. Test Plan: - just fmt - just clippy - just test - just build Refs: PLAN.md
1.3 KiB
1.3 KiB
Implementation Decisions
- Added a
just testrecipe so unit tests can be run through the repository's requiredjust ...command surface instead of invokingcargo testdirectly. - Kept the existing frontend
game-unpack-finishedevent name for successful transactional installs. The peer now emits install lifecycle events, but the compatibility event still lets the UI reuse its existing "install complete" path. - Implemented watcher rescans by reusing the existing
.lanspread/library_index.jsoncache and updating a single game entry in that index. This satisfies the per-ID optimized rescan requirement without adding a second cache format. - Kept a separate
active_downloadscancellation-token map next to the singleactive_operationstable. The operation table is the authoritative state for gates; the token map is only cancellation plumbing for in-flight downloads. - Treated a downloaded-but-not-installed game as immediately installable from
Tauri by sending
PeerCommand::InstallGamedirectly. A not-downloaded game still usesGetGame, and the peer auto-installs after the sentinel commit. - Derived the UI's
LocalOnlybadge frominstalled && !downloadedbecause the UI-facingGametype does not carry the protocol-levelAvailabilityenum.