adoptionmaterialization

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package adoptionmaterialization owns the explicit promotion of admitted adoption records into a repository-bound, recoverable write transaction.

Index

Constants

View Source
const (
	SchemaVersion = 1
	RequestKind   = "proofkit.adoption-materialization-request"
	PlanKind      = "proofkit.adoption-materialization-plan"
	ReceiptKind   = "proofkit.adoption-materialization-receipt"

	ProjectManifestPath = "proofkit/project.v1.json"

	MaximumRequirementSources = repositorytransaction.MaximumOperations - 3
	MaximumOutputBytes        = 256 << 10
	MaximumTextBytes          = 16 << 10
	MaximumTextLines          = 96
)
View Source
const (
	ArtifactRequirementSource  = "requirement_source"
	ArtifactRequirementBinding = "requirement_proof_binding"
	ArtifactTestInventory      = "test_evidence_inventory"
	ArtifactProjectManifest    = "project_routing_manifest"
)
View Source
const (
	OperationPlan    = "plan"
	OperationApply   = "apply"
	OperationRecover = "recover"
)
View Source
const (
	ReceiptStateBlocked           = "blocked"
	ReceiptStateCleanupRequired   = "cleanup_required"
	ReceiptStateDurabilityUnknown = "durability_unknown"
	ReceiptStateFailed            = "failed"
	ReceiptStatePassed            = "passed"
	ReceiptStateRecoveryRequired  = "recovery_required"
)
View Source
const ManifestKind = "proofkit.project-routing-manifest"

Variables

This section is empty.

Functions

func RenderPlanText

func RenderPlanText(plan Plan) (string, error)

func RenderReceiptText

func RenderReceiptText(receipt Receipt) (string, error)

Types

type Manifest

type Manifest struct {
	ManifestID               string
	MaterializationRequestID string
	ProjectID                string
	Routes                   []Route
	SourcePlanID             string
}

func AdmitManifest

func AdmitManifest(raw any) (Manifest, error)

func (Manifest) JSONValue

func (manifest Manifest) JSONValue() map[string]any

type MaterializedProjectAdmission added in v0.9.0

type MaterializedProjectAdmission struct {
	ClosureAdmitted  bool
	ClosureEvaluated bool
	Project          *Project
	Records          []RoutedProjectRecordAdmission
}

MaterializedProjectAdmission separates child admission from cross-record closure. Closure is evaluated only for a complete, digest-matched, admitted route set.

func AdmitMaterializedProject added in v0.9.0

func AdmitMaterializedProject(manifest Manifest, records []RoutedProjectRecord) (MaterializedProjectAdmission, error)

AdmitMaterializedProject routes child bytes through their semantic owners and evaluates the adoption-materialization closure without reading a repository or establishing freshness or execution.

type Plan

type Plan struct {
	Manifest     Manifest
	NonClaims    []string
	ProjectID    string
	RequestID    string
	SourceIntent string
	SourcePlanID string
	Transaction  repositorytransaction.Plan
}

func AdmitPlanOutput

func AdmitPlanOutput(raw any) (Plan, error)

func BuildPlan

func BuildPlan(ctx context.Context, raw any, repositoryRoot string) (Plan, error)

func (Plan) JSONValue

func (plan Plan) JSONValue() map[string]any

type Project added in v0.14.0

type Project struct {
	// contains filtered or unexported fields
}

Project retains only a complete, child-admitted, cross-record-closed project. It does not establish repository freshness or native witness execution.

func AdmitProject added in v0.14.0

func AdmitProject(raw any) (*Project, error)

AdmitProject replays a logical project projection through the materialization owner. Route digests bind canonical child bytes, not a new filesystem read.

func (*Project) JSONValue added in v0.14.0

func (project *Project) JSONValue() (map[string]any, error)

JSONValue delegates child serialization to each semantic owner and returns fresh nested values, so consumers cannot mutate the retained cohort.

type Receipt

type Receipt struct {
	ExpectedDesiredStateID string
	ExpectedTransactionID  string
	FailureClass           string
	NonClaims              []string
	Operation              string
	ReceiptID              string
	State                  string
	TransactionResult      *repositorytransaction.Result
}

func AdmitReceiptOutput

func AdmitReceiptOutput(raw any) (Receipt, error)

func Apply

func Apply(ctx context.Context, raw any, repositoryRoot, expectedTransactionID, expectedDesiredStateID string) (Receipt, int, error)

func Recover

func Recover(ctx context.Context, repositoryRoot, transactionID, action string) (Receipt, int, error)

func (Receipt) JSONValue

func (receipt Receipt) JSONValue() map[string]any

type Request

type Request struct {
	Binding       requirementbinding.Input
	BindingPath   string
	Inventory     testevidenceinventory.Inventory
	InventoryPath string
	NonClaims     []string
	ProjectID     string
	RequestID     string
	SourceIntent  string
	SourcePlanID  string
	Sources       []requirementsourceadmission.Source
}

type Route

type Route struct {
	ArtifactID   string // SHA-256 identity of the canonical child bytes.
	ArtifactKind string
	Path         string
}

type RoutedProjectRecord added in v0.9.0

type RoutedProjectRecord struct {
	Content []byte
	Path    string
}

RoutedProjectRecord is one manifest-routed record observed by a read-only caller. Content remains untrusted until AdmitMaterializedProject returns.

type RoutedProjectRecordAdmission added in v0.9.0

type RoutedProjectRecordAdmission struct {
	Admitted      bool
	DigestMatches bool
	Path          string
}

RoutedProjectRecordAdmission is the canonical child-owner result for one supplied manifest route.

Jump to

Keyboard shortcuts

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