Host deployment
Image synchronization has a host-owned deployment boundary. @knolo/core encodes and verifies the V5 exchange. The host owns everything that touches a network.
| Concern | Owner |
|---|---|
| Request and response encoding, signatures, image roots | @knolo/core |
| Peer discovery | Host adapter, opaque peerId values |
| Sockets, URLs, proxies | Host adapter |
| Credentials and TLS | Host adapter. Never passed into the coordinator |
| Retry bounds | Coordinator, within host maxAttempts |
| Checkpoints | Host load and save callbacks |
| Logs and metrics | Host monitoring sink |
| Adopting the image into durable storage | A separate explicit store operation |
executeKnowledgeSyncHostDeploymentV5 discovers peers, transfers bytes, verifies the response and the image, handles expiry and replay, and emits monitoring events. It does not mutate the local image by itself.
InMemoryKnowledgeSyncHostAdapterV5 is for deterministic tests. It does not model sockets, credentials, or durable checkpoints.
| Failure | What happens |
|---|---|
| Discovery failure or an ambiguous peer | Terminal. No transfer |
| Expiry | Terminal. deployment.expired. Replay state unchanged |
| Replay | Terminal. deployment.replayed. The existing entry stays authoritative |
| Transfer error with a valid checkpoint | Retry until maxAttempts |
| Repeated transfer failure | Terminal. deployment.failed |
| Verified exchange | deployment.succeeded. No further retry |
Monitoring events can include request ids, peer ids, attempt counts, offsets, and byte counts. They must not include credentials, endpoint secrets, image contents, or private keys.
Applying a fast-forward after that exchange is Sync and merge.