Files
piik/prototype
T
AAA a723aee361 refactor(core): share one byte-distribution tree between files and watch bytes
File (file_room.rs) and Watch (room.rs) each kept the same source, parents
and refused state and each reimplemented refusal validation, refusal
retention, forwarding_available, failed-pair retirement, waiting detection,
frontier collection and per-session plan projection. A change to byte
refusal therefore had to be repeated at about eight sites in room.rs.

routes::ByteTree now owns that state next to activity_parents and
byte_frontiers, which it wraps. FileRoom keeps one per file and still
chooses among holders; Watch embeds one and RoomRuntime supplies the
receiver set, the refusal-retention predicate and the announced source.
Each family keeps its existing predicates: files retain refusals for
admitted sessions or the service, watches for routable sessions, and the
watch-only source and self-refusal checks stay in room.rs.

watch_receivers now borrows only the activity map, so the routing loop
uses it instead of an inline copy.

No wire, storage or public API change.
a723aee361 · 2026-11-24 21:15:44 +08:00
History
..