Skip to main content

Module local_custody

Module local_custody 

Source
Expand description

Cold, caller-budgeted local custody bundle publication and reading.

The host must enforce locality, directory ownership, exclusive chain coordination, current authorization and aggregate quotas. Atomic publication is one non-replacing bundle link, not a transactional chain-head update. A successful link does not prove directory durability or prevent rollback. Mounts, mapped drives, reparse points and filesystem behavior require platform qualification. Reads reject final-component links/reparse points on Unix and Windows; this does not guard root ancestors or establish that a volume is local. Unix nonblocking open avoids FIFO hangs but cannot prevent device-node effects.

Modules§

chain
Chain-aware publication using host-supplied authenticated head state.
local_head
Signed local chain heads under a held, cooperative OS file lock.
local_head_adapter
Connect a held local-head lease to chain-aware bundle publication.
local_recovery
Inspect a checkpoint using the signed head of a held local lease.
quota
Conservative caller-owned aggregate admission for one protected root.
recovery
Bounded, non-mutating admission of one published bundle during recovery.

Structs§

PublishedBundle
Atomic bundle publication was attempted and the target link was created. Directory synchronization and chain-head publication are not established.
ReadBundle

Enums§

CustodyError

Traits§

CustodyAuthority
Host checks are trust boundaries, not OS-enforced locality or locks. The caller must hold an exclusive chain lease across the complete operation.

Functions§

publish_bundle
Publish a single receipt-addressed bundle without replacing an existing destination. Other links or writers may still modify the underlying file. Host must hold an exclusive lease and enforce local-root/aggregate-budget policy throughout. A same-filesystem hard-link create is used; no replacement is attempted. Temporary cleanup is best effort and crash cleanup is external.
read_bundle
Read and verify one complete bundle into caller-owned buffers. Output is cleared on failure or unwind. Host read permission precedes I/O and is rechecked after receipt verification. The budget limits encoded entry size; an additional byte may be read to reject trailing data. This does not establish chain completeness.