Documentation
¶
Overview ¶
Package recovery owns immutable failed-run inputs and accepted partial results. A recovery manifest grants replay authority, never final review publication.
Index ¶
- Constants
- Variables
- func BlobPath(run ports.PublicationRun, blob Blob) (ports.SafeRelativePath, error)
- func Digest(value []byte) string
- func ManifestPath(run ports.PublicationRun) (ports.SafeRelativePath, error)
- type Attempt
- type Blob
- type Document
- type Evidence
- type Finding
- type Prepared
- type Prompt
- type RetentionMetadata
- type RetryAttempt
- type Role
- type SchemaValidator
- type Snapshot
- type Source
- type Status
- type Target
- type Visual
Constants ¶
const SchemaURI = "https://mulgae.local/schemas/mulgae-run-recovery.v1.schema.json"
const SchemaVersion = "mulgae-run-recovery.v1"
Variables ¶
Functions ¶
func BlobPath ¶
func BlobPath(run ports.PublicationRun, blob Blob) (ports.SafeRelativePath, error)
func ManifestPath ¶
func ManifestPath(run ports.PublicationRun) (ports.SafeRelativePath, error)
Types ¶
type Attempt ¶
type Attempt struct {
AttemptID string `json:"attempt_id"`
Role domain.Role `json:"role"`
ProviderInstance string `json:"provider_instance"`
State domain.AttemptState `json:"state"`
FailureClass domain.FailureClass `json:"failure_class"`
ReasonCode string `json:"reason_code"`
InitialPrompt Prompt `json:"initial_prompt"`
}
type Document ¶
type Document struct {
SchemaVersion string `json:"schema_version"`
SessionID string `json:"session_id"`
RunID string `json:"run_id"`
RunType domain.RunType `json:"run_type"`
RunState domain.RunState `json:"run_state"`
Threshold domain.Severity `json:"threshold"`
Source *Source `json:"source"`
Target Target `json:"target"`
SnapshotManifestSHA256 string `json:"snapshot_manifest_sha256"`
WorkspaceTerminalReceipt string `json:"workspace_terminal_receipt"`
Roles []Role `json:"roles"`
Attempts []Attempt `json:"attempts"`
Findings []Finding `json:"findings"`
}
Document is the bounded manifest. Provider content remains in hash-bound blobs.
func DecodeManifest ¶
type Finding ¶
type Finding struct {
ID string `json:"id"`
Fingerprint string `json:"fingerprint"`
Role domain.Role `json:"role"`
ProviderInstance string `json:"provider_instance"`
Severity domain.Severity `json:"severity"`
Title string `json:"title"`
Description string `json:"description"`
Recommendation string `json:"recommendation"`
Confidence domain.Confidence `json:"confidence"`
Lifecycle domain.FindingLifecycle `json:"lifecycle"`
Evidence []Evidence `json:"evidence"`
}
type Prepared ¶
type Prepared struct {
// contains filtered or unexported fields
}
func NewPrepared ¶
type Prompt ¶
type Prompt struct {
Stdin Blob `json:"stdin"`
SourceInvocationID string `json:"source_invocation_id"`
ExecutionInvocationID string `json:"execution_invocation_id"`
TemplateID string `json:"template_id"`
TemplateVersion string `json:"template_version"`
TemplateSHA256 string `json:"template_sha256"`
AdapterProfile string `json:"adapter_profile"`
AdapterParameters map[string]string `json:"adapter_parameters"`
Scope string `json:"scope"`
}
type RetentionMetadata ¶
type RetentionMetadata struct {
// contains filtered or unexported fields
}
RetentionMetadata identifies a manifest and its optional parent for cleanup. It does not verify blob content and cannot authorize replay or publication.
func ReadRetentionMetadata ¶
func ReadRetentionMetadata(ctx context.Context, store ports.RunSupportArtifactStore, validator SchemaValidator, run ports.PublicationRun, maxManifestBytes int64) (RetentionMetadata, error)
ReadRetentionMetadata verifies bounded manifest metadata and confirms that it remains unchanged. It never reads the source-sized input or report blobs.
func (RetentionMetadata) Manifest ¶
func (metadata RetentionMetadata) Manifest() ports.ImmutablePublicationArtifact
func (RetentionMetadata) Parent ¶
func (metadata RetentionMetadata) Parent() (domain.SourceReference, bool)
type RetryAttempt ¶
type Role ¶
type Role struct {
Role domain.Role `json:"role"`
Required bool `json:"required"`
Outcome string `json:"outcome"`
AttemptID string `json:"attempt_id"`
ProviderInstance string `json:"provider_instance"`
ReportsOnly bool `json:"reports_only"`
Report *Blob `json:"report"`
FindingIDs []string `json:"finding_ids"`
}
type SchemaValidator ¶
type Snapshot ¶
type Snapshot struct {
// contains filtered or unexported fields
}
func Read ¶
func Read(ctx context.Context, store ports.RunSupportArtifactStore, validator SchemaValidator, run ports.PublicationRun, maxManifestBytes int64) (Snapshot, error)
Read verifies the manifest, all original input and report blobs, captured evidence, and an unchanged manifest before returning replay authority.
type Source ¶
type Status ¶
type Status struct {
Available bool `json:"available"`
SourceKind *string `json:"source_kind"`
RunID *string `json:"run_id"`
ManifestSHA256 *string `json:"manifest_sha256"`
AcceptedRoles []domain.Role `json:"accepted_roles"`
RetryAttempts []RetryAttempt `json:"retry_attempts"`
}
Status exposes replay admission without granting final-review authority.
func UnavailableStatus ¶
type Target ¶
type Target struct {
Kind domain.TargetKind `json:"kind"`
SHA256 string `json:"sha256"`
RepositoryID string `json:"repository_id"`
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"`
GitMode domain.GitTargetMode `json:"git_mode"`
Bytes Blob `json:"bytes"`
CapturedArchive Blob `json:"captured_archive"`
}