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

capture

package
v0.1.26 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const CaptureManifestVersion = "mulgae-capture-manifest.v1"

Variables

View Source
var ErrCaptureIdentityUnavailable = errors.New("capture_identity_unavailable")

Functions

func VerifyCaptureManifest

func VerifyCaptureManifest(data []byte, material ports.CapturedReviewMaterial, expected domain.CaptureIdentity) error

VerifyCaptureManifest requires the complete hash-verified retained archive; neither a stored digest nor current-tree content can stand in for it.

func VerifySupport

func VerifySupport(session domain.SessionID, run domain.RunID, targetSHA256 string, baseOID, headOID *string, artifacts map[string]ports.ImmutablePublicationArtifact) (domain.CaptureIdentity, error)

VerifySupport reconstructs the complete capture exclusively from hash-bound publication artifacts. Callers retain ownership of the stable P2 observation.

func VerifySupportAt

func VerifySupportAt(prefix, targetSHA256 string, baseOID, headOID *string, artifacts map[string]ports.ImmutablePublicationArtifact) (domain.CaptureIdentity, error)

VerifySupportAt also verifies the role-specific capture namespace of a composite.

Types

type CaptureContext

type CaptureContext struct {
	Present bool   `json:"present"`
	Size    int64  `json:"size"`
	SHA256  string `json:"sha256"`
}

type CaptureFile

type CaptureFile struct {
	Side        string `json:"side"`
	Path        string `json:"path"`
	MediaType   string `json:"media_type"`
	Disposition string `json:"disposition"`
	Size        int64  `json:"size"`
	SHA256      string `json:"sha256"`
}

type CaptureManifest

type CaptureManifest struct {
	SchemaVersion  string         `json:"schema_version"`
	Target         CaptureTarget  `json:"target"`
	PolicyIdentity string         `json:"policy_identity"`
	Sides          []string       `json:"sides"`
	Files          []CaptureFile  `json:"files"`
	Context        CaptureContext `json:"context"`
}

CaptureManifest is canonical verification support, not a publication or an assertion that a stored digest has been verified. NewCaptureManifest derives it from admitted immutable material; VerifyCaptureManifest checks that material.

func DecodeCaptureManifest

func DecodeCaptureManifest(data []byte) (CaptureManifest, error)

DecodeCaptureManifest admits only canonical field, number and array encoding (insignificant JSON whitespace is allowed). This rejects duplicate/unknown or omitted fields instead of letting a permissive decoder erase them.

func NewCaptureManifest

func NewCaptureManifest(material ports.CapturedReviewMaterial) (CaptureManifest, error)

func (CaptureManifest) CanonicalBytes

func (manifest CaptureManifest) CanonicalBytes() ([]byte, error)

func (CaptureManifest) Identity

func (manifest CaptureManifest) Identity() (domain.CaptureIdentity, error)

func (CaptureManifest) Validate

func (manifest CaptureManifest) Validate() error

type CaptureTarget

type CaptureTarget struct {
	Kind              string `json:"kind"`
	GitMode           string `json:"git_mode"`
	SHA256            string `json:"sha256"`
	Size              int64  `json:"size"`
	BaseObjectID      string `json:"base_object_id"`
	HeadObjectID      string `json:"head_object_id"`
	HeadTreeObjectID  string `json:"head_tree_object_id"`
	IndexTreeObjectID string `json:"index_tree_object_id"`
}

Jump to

Keyboard shortcuts

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