Help us shape the future of Go! Take the 2026 Go Developer Survey

compositesupport

package
v0.1.25 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 12, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package compositesupport owns portable, self-contained composite provenance.

Index

Constants

View Source
const DocumentPath = "support/composite.json"
View Source
const Version = "mulgae-composite-support.v1"

Variables

This section is empty.

Functions

func Build

func Build(session domain.SessionID, run domain.RunID, materials []Material) ([]ports.ImmutablePublicationArtifact, error)

func ExcerptPath

func ExcerptPath(id string, index int) string

func FindingPath

func FindingPath(id string) string

func RetainCapture

func RetainCapture(material *Material, raw []byte) error

RetainCapture reconstructs historical material only when all required sides are present; partial legacy archives stay explicitly unavailable.

func SHA256

func SHA256(raw []byte) string

func SourcePrefix

func SourcePrefix(role domain.Role) string

func VerifyFinal

func VerifyFinal(doc Document, session domain.SessionID, run domain.RunID, raw []byte, artifacts map[string]ports.ImmutablePublicationArtifact) error

VerifyFinal binds copied provenance and original content to the existing composite final format without rewriting that compatibility-sensitive format.

Types

type Document

type Document struct {
	SchemaVersion string    `json:"schema_version"`
	Sources       []Source  `json:"sources"`
	Findings      []Finding `json:"findings"`
}

func Decode

func Decode(raw []byte) (Document, error)

func Verify

func Verify(session domain.SessionID, run domain.RunID, target string, artifacts map[string]ports.ImmutablePublicationArtifact) (Document, error)

Verify checks every copied byte and reconstructs each advertised capture. The caller additionally compares this document with its final finding/source map.

func (Document) CommonCapture

func (doc Document) CommonCapture() string

type Evidence

type Evidence struct {
	Index         int           `json:"index"`
	Availability  string        `json:"availability"`
	TargetSHA256  string        `json:"target_sha256"`
	Side          evidence.Side `json:"side"`
	Path          string        `json:"path"`
	LineStart     int           `json:"line_start"`
	LineEnd       int           `json:"line_end"`
	ExcerptSHA256 string        `json:"excerpt_sha256"`
	ContentSHA256 string        `json:"content_sha256"`
}

type Finding

type Finding struct {
	ID              string      `json:"id"`
	Role            domain.Role `json:"role"`
	SourceFindingID string      `json:"source_finding_id"`
	OriginalSHA256  string      `json:"original_sha256"`
	Evidence        []Evidence  `json:"evidence"`
}

type FindingMaterial

type FindingMaterial struct {
	Finding  Finding
	Original []byte
	Excerpts [][]byte
}

type Material

type Material struct {
	Source          Source
	CaptureManifest []byte
	CapturedArchive []byte
	Findings        []FindingMaterial
}

Material is collected while the source is independently verified. IDs in its findings are remapped before it crosses the publication boundary.

func Clone

func Clone(material Material) Material

type Source

type Source struct {
	Role                   domain.Role `json:"role"`
	SessionID              string      `json:"session_id"`
	RunID                  string      `json:"run_id"`
	ReviewID               string      `json:"review_id"`
	AttemptID              string      `json:"attempt_id"`
	RecoveryManifestSHA256 string      `json:"recovery_manifest_sha256"`
	FinalSHA256            string      `json:"final_sha256"`
	ManifestSHA256         string      `json:"manifest_sha256"`
	SupportSHA256          string      `json:"support_sha256"`
	LineageSHA256          string      `json:"lineage_sha256"`
	Epoch                  uint64      `json:"epoch"`
	TargetSHA256           string      `json:"target_sha256"`
	ProviderIdentities     []string    `json:"provider_identities"`
	CaptureIdentity        string      `json:"capture_identity"`
	CaptureAvailability    string      `json:"capture_availability"`
}

Source is portable provenance, deliberately excluding local project binding. Failed recovery sources have a manifest digest, not a P2 receipt.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL