Authorization and confidentiality
A grant binds host, purpose, path, size, hash and limits. The helper trusts the agent to verify the signed lease and spawn it under the authorized identity. Client validation does not replace host confinement or server policy. Root transfer requires separate authorization.
The v1 packet uses ChaCha20-Poly1305, with the header authenticated as associated data. Sequence numbers are direction-specific and cannot be reused with a key. Repairs get fresh sequences. A listening peer pins a source only after authenticating its packet. Relays see routing and traffic metadata but do not possess the file key.
Never log credentials, grant keys, route tokens or file contents. Bootstrap grant files require owner-only permissions. Transport encryption does not encrypt a destination file or a local spool at rest.
Completion is more than bytes sent
The receiver must have all ranges, verify the file hash, and perform the required filesystem commit before reporting DONE. The sender checks the DONE size/hash against the grant. active, progress counters and FIN are not successful completion. For helper integration, distinguish a terminal committed result from an in-flight event.
A receiver can commit even if the closing acknowledgment is lost. A sender-side timeout therefore does not prove that the destination was unchanged. Reconcile the result and destination before retrying with overwrite. Do not manufacture a successful result when evidence is missing.
Failure behavior
| Event | Expected behavior |
|---|---|
| Hash mismatch or incomplete ranges | No successful commit |
| Expired lease, cancel or control-pipe EOF before commit | Abort and clean up the temporary file |
| Cancellation after commit | Does not undo the published file |
| ABORT or exhausted lifetime | Grant ends; later data cannot revive it |
| Restart after failure | New grant, offset zero; v1 has no resume |
| Machine/process crash | Do not assume deferred cleanup ran; use the narrowly scoped helper sweep procedure where appropriate |
The helper sweep targets only the named grant's temporary file. It is not a general deletion API. Filesystem power-loss guarantees require testing on the deployment's actual storage; loopback tests cannot establish them.
Human intent and agent execution
Keep transfer authority separate from permission to execute or ingest the result. Untrusted data stays data. An automation client should preserve the grant ID, final status and verified file identity, and pass those to a separately authorized processing step. No v1 transfer event proves that downstream business processing happened.
The client does not write the SystemAPI audit chain. The server and agent must retain their own authorization and result evidence. A local stderr audit line is not that chain.
Protocol references
Read sahxfer v1 for nonce/replay rules, close semantics and ABORT codes; the agent file protocol for sahsync sessions; and the streaming roadmap for the separate received, persisted and processed states proposed for streams.