Internal

internal/core/reviewevidence

Package reviewevidence defines the canonical file evidence contract used by the receipt-grade review path.

import "github.com/nilstate/scafld/v2/internal/core/reviewevidence"

Package reviewevidence defines the canonical file evidence contract used by the receipt-grade review path.

Constants

Source: internal/core/reviewevidence/evidence.go:17

const (
	StatusUnchanged = "unchanged"
	StatusAdded     = "added"
	StatusModified  = "modified"
	StatusDeleted   = "deleted"
	StatusGitlink   = "gitlink"
)

Functions

func ComparisonPath(raw string) bool

Source: internal/core/reviewevidence/evidence.go:135

ComparisonPath reports whether path is part of the reviewed workspace state.

func ComparisonSnapshot(snapshot []string) []string

Source: internal/core/reviewevidence/evidence.go:124

ComparisonSnapshot returns the Git-visible changes that review and complete use for stale-review checks. scafld runtime state is excluded because session and spec projection writes must not invalidate the review that produced them.

func MaterialDigest(scope []string, files []MaterialFile) string

Source: internal/core/reviewevidence/evidence.go:167

MaterialDigest returns a content digest for the reviewed material. It ignores Git dirty status so dirty-to-committed transitions preserve authority when scoped file bytes are unchanged.

func NormalizePath(raw string) (string, error)

Source: internal/core/reviewevidence/evidence.go:55

NormalizePath returns a slash-separated repository-relative path.

func SHA256Hex(data []byte) string

Source: internal/core/reviewevidence/evidence.go:116

SHA256Hex returns the lowercase SHA-256 digest for data.

func SnapshotDigest(snapshot []string) string

Source: internal/core/reviewevidence/evidence.go:149

SnapshotDigest returns the stable digest sealed into review session entries.

func SnapshotDirty(snapshot []string) string

Source: internal/core/reviewevidence/evidence.go:157

SnapshotDirty returns the string form stored in session JSON.

func ValidateFile(file EvidenceFile) (EvidenceFile, error)

Source: internal/core/reviewevidence/evidence.go:84

ValidateFile normalizes path/status and verifies the declared byte hash.

func ValidateStatus(status string) error

Source: internal/core/reviewevidence/evidence.go:74

ValidateStatus rejects evidence statuses outside the fingerprint enum.

func VerifyHash(file EvidenceFile) error

Source: internal/core/reviewevidence/evidence.go:103

VerifyHash checks that Bytes match the declared SHA-256 hex digest.

Types

type EvidenceFile

Source: internal/core/reviewevidence/evidence.go:26

EvidenceFile is one canonical repository file snapshot supplied to a receipt-grade reviewer sandbox.

type EvidenceFile struct {
	Path   string
	Status string
	Bytes  []byte
	SHA256 string
}
Fields
  • Path string
  • Status string
  • Bytes []byte
  • SHA256 string

type MaterialFile

Source: internal/core/reviewevidence/evidence.go:49

MaterialFile records one present file's content hash under a material scope.

type MaterialFile struct {
	Path   string
	SHA256 string
}
Fields
  • Path string
  • SHA256 string

type MaterialSeal

Source: internal/core/reviewevidence/evidence.go:43

MaterialSeal records the reviewed task material independent of Git status. Scope is the normalized path set used to recompute Digest.

type MaterialSeal struct {
	Scope  []string
	Digest string
}
Fields
  • Scope []string
  • Digest string

type Provenance

Source: internal/core/reviewevidence/evidence.go:34

Provenance records how one evidence file was materialized for review.

type Provenance struct {
	Path        string `json:"path"`
	Status      string `json:"status"`
	SHA256      string `json:"sha256"`
	ScratchPath string `json:"scratch_path"`
}
Fields
  • Path string `json:"path"`
  • Status string `json:"status"`
  • SHA256 string `json:"sha256"`
  • ScratchPath string `json:"scratch_path"`