Documentation
¶
Overview ¶
Package proof verifies a proof packet under NO-PROOF-NO-CLOSE: every declared artifact exists on disk and its bytes hash to the recorded digest. The digest is identity.Hash (sha256[:16]), binding the packet to the exact bytes it covers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Save ¶
Save writes a packet manifest to path as indented JSON, creating the directory if needed and writing atomically so a crash never leaves a half-written manifest.
func Verify ¶
Verify checks that every artifact in pkt exists under root and matches its recorded digest. It returns EINVALID when the packet declares nothing and ECONFLICT on the first missing artifact or digest mismatch. Provenance is not a gate condition: a packet verifies on its bytes regardless of the commit it records, so a proof created at one commit still verifies at another.
Types ¶
type Artifact ¶
Artifact is one declared piece of proof: a repository-relative path and the expected content digest.
type Packet ¶
type Packet struct {
Arc string `json:"arc"`
Provenance *Provenance `json:"provenance,omitempty"`
Artifacts []Artifact `json:"artifacts"`
}
Packet is a declared proof: the artifacts that must exist and match, plus optional provenance. Provenance is nil when none was recorded (e.g. no git repo).
func Create ¶
Create builds a proof packet for arc by hashing each path's bytes under root (identity.Hash, sha256[:16]). Paths are recorded repo-relative, exactly as Verify resolves them. gitSHA records provenance; an empty gitSHA records none. The caller resolves the SHA and passes it, so proof needs no version-control dependency. A proof must cover real bytes: an empty path set is EINVALID and an unreadable artifact is an error, never a silent skip.
type Provenance ¶
type Provenance struct {
GitSHA string `json:"git_sha,omitempty"`
}
Provenance records where a proof packet came from: the commit the proof was created against. It is optional and informational — the gate binds a packet to its bytes by digest; the git SHA binds it to a commit.