feat(update): session-keyed transfers + progress events (agent, VA-97) #98
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/VA-97-update-progress-session"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Agent half of the VS-77 / VA-97 co-design. Together with vervain-server VS-77 this fixes the confirmed root cause of #VA-96: the two proto crates had diverged, so the server only ever emitted the 52-byte hash form of
AgentUpdate, which the agent decoded as an End (never a Begin). No session ever opened, every block was dropped ("no active session"), and each block's first two bytes were misread as a request id (thelen=16382in the VA-96 logs).Builds on #VA-96 (merged): its DropBurst coalescer and the NoSession/HashMismatch split are evolved here to key on
session_id.Wire change (lockstep with vervain-server VS-77)
AgentUpdate(13): explicitkindbyte instead of length. Begin =u16 cmd | u8 0 | u32 session_id | u64 total; End =u16 cmd | u8 1 | u32 session_id | 48-byte sha384.AgentUpdateBlock(14): gains au32 session_idheader; the per-block ack echoesu16 cmd | u32 session_id.AgentUpdateProgress(32, agent -> server):session_id | phase | received | total | detail.Agent behaviour
UpdateSessionis keyed onsession_id(+ storestotal). Blocks whose id does not match the active transfer are rejected without touching it; an End only finalizes when its id matches.net.rsemits progress at each boundary: session-start, throttled downloading (at most one event per 5%), verifying, applying, and restarting (flushed beforeexecv, which never returns), plus failed on hash mismatch / apply error / stray-session block. Emission is best-effort and never aborts the transfer.Tests
just check+ full lib suite pass. New: session-mismatch rejection leaves the active transfer intact; End-with-no-matching-session is not a hash failure; proto round-trips for the new Begin/End/Block/Progress frames and phase codes.Dependency
Co-designed with vervain-server VS-77, which ships the byte-identical wire layout. Land them together.