# internal/core/reviewevidence

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

## StatusUnchanged

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

## StatusAdded

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

## StatusModified

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

## StatusDeleted

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

## StatusGitlink

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

## ComparisonPath

```go
func ComparisonPath(raw string) bool
```

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

## ComparisonSnapshot

```go
func ComparisonSnapshot(snapshot []string) []string
```

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.

## MaterialDigest

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

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.

## NormalizePath

```go
func NormalizePath(raw string) (string, error)
```

NormalizePath returns a slash-separated repository-relative path.

## PinnedEvidenceExclusionReason

```go
func PinnedEvidenceExclusionReason(name string) string
```

PinnedEvidenceExclusionReason classifies a normalized repository path that cannot be pinned as reviewer evidence. Present files still require signed content digests even when this returns an exclusion reason.

## SHA256Hex

```go
func SHA256Hex(data []byte) string
```

SHA256Hex returns the lowercase SHA-256 digest for data.

## SnapshotDigest

```go
func SnapshotDigest(snapshot []string) string
```

SnapshotDigest returns the stable digest sealed into review session entries.

## SnapshotDirty

```go
func SnapshotDirty(snapshot []string) string
```

SnapshotDirty returns the string form stored in session JSON.

## ValidateFile

```go
func ValidateFile(file EvidenceFile) (EvidenceFile, error)
```

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

## ValidateStatus

```go
func ValidateStatus(status string) error
```

ValidateStatus rejects evidence statuses outside the fingerprint enum.

## VerifyHash

```go
func VerifyHash(file EvidenceFile) error
```

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

## EvidenceFile

```go
type EvidenceFile struct {
	Path   string
	Status string
	Bytes  []byte
	SHA256 string
}
```

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

- `Path: string`: 
- `Status: string`: 
- `Bytes: []byte`: 
- `SHA256: string`: 

## MaterialFile

```go
type MaterialFile struct {
	Path   string
	SHA256 string
}
```

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

- `Path: string`: 
- `SHA256: string`: 

## MaterialSeal

```go
type MaterialSeal struct {
	Scope  []string
	Digest string
}
```

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

- `Scope: []string`: 
- `Digest: string`: 

## Provenance

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

Provenance records how one evidence file was materialized for review.

- `Path: string` (json:"path"): 
- `Status: string` (json:"status"): 
- `SHA256: string` (json:"sha256"): 
- `ScratchPath: string` (json:"scratch_path"):
