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

hubvault.server.uploads.plan_commit_manifest(api, manifest: dict) dict[source]

Build one upload plan for a normalized write manifest.

Parameters:
Returns:

JSON-compatible upload plan

Return type:

dict

Raises:

hubvault.errors.ConflictError – Raised when parent_commit is 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_plan

  • uploads (Mapping[str, bytes]) – Uploaded multipart payloads indexed by field name

Returns:

Commit metadata for the created commit

Return type:

hubvault.models.CommitInfo

Raises: