hubvault.server.uploads
Write-manifest planning helpers for hubvault.server.
This module implements the HTTP-side upload planning and apply logic used by the Phase 7 write routes. The protocol is intentionally conservative: upload plans are bound to one immutable branch head so a stale preflight cannot be applied after an intervening write.
The module contains:
plan_commit_manifest()- Build one upload plan for a write manifestapply_commit_manifest()- Materialize public commit operations from a planned manifest and uploaded payload parts
plan_commit_manifest
- hubvault.server.uploads.plan_commit_manifest(api, manifest: dict) dict[source]
Build one upload plan for a normalized write manifest.
- Parameters:
api (hubvault.api.HubVaultApi) – Public repository API instance
manifest (dict) – Normalized write manifest
- Returns:
JSON-compatible upload plan
- Return type:
dict
- Raises:
hubvault.errors.ConflictError – Raised when
parent_commitis stale relative to the current branch head.
apply_commit_manifest
- hubvault.server.uploads.apply_commit_manifest(api, manifest: dict, uploads: Mapping[str, bytes])[source]
Apply one previously planned write manifest.
- Parameters:
api (hubvault.api.HubVaultApi) – Public repository API instance
manifest (dict) – Normalized write manifest including
upload_planuploads (Mapping[str, bytes]) – Uploaded multipart payloads indexed by field name
- Returns:
Commit metadata for the created commit
- Return type:
- Raises:
HubVaultValidationError – Raised when the apply payload is invalid.
hubvault.errors.ConflictError – Raised when the planned branch head is stale and the caller must re-plan.