reconcile

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package reconcile turns canonical change deltas into one deterministic, value-only plan for accepted behavioral truth.

Building a plan reads files and computes bytes and hashes in memory. It mutates nothing, calls no network or LLM, and reads no clock. The sync and archive transaction owners consume this same plan; check, status, review, and reports project it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApprovalFact

type ApprovalFact struct {
	Current bool   `json:"current"`
	Reason  string `json:"reason,omitempty"`
}

ApprovalFact, TaskFact, and EvidenceFact are the predecessor projections review consumes. They are injected as values so review stays pure and so approval, activity, readiness, evidence, and accepted truth remain distinct concepts rather than one fused "ready" flag.

type Blocker

type Blocker struct {
	Code   string `json:"code"`
	Owner  string `json:"owner"`
	Reason string `json:"reason"`
	Next   string `json:"next"`
}

Blocker is one labelled reason this change may not sync or archive yet. It is never authorization and never a completion claim.

type Capability

type Capability struct {
	Capability   string      `json:"capability"`
	DeltaPath    string      `json:"delta_path"`
	DeltaHash    string      `json:"delta_hash"`
	AcceptedPath string      `json:"accepted_path"`
	AcceptedHash string      `json:"accepted_hash,omitempty"`
	Created      bool        `json:"created"`
	Operations   []Operation `json:"operations"`
	Output       []byte      `json:"-"`
	OutputHash   string      `json:"output_hash,omitempty"`
	NoOp         bool        `json:"no_op"`
}

Capability is the reconciliation of one capability: its exact sources and hashes, the ordered operations, and the rebuilt accepted document.

type EvidenceFact

type EvidenceFact struct {
	Current int      `json:"current"`
	Stale   []string `json:"stale,omitempty"`
}

type Operation

type Operation struct {
	Kind        plan.DeltaOperation `json:"kind"`
	Requirement string              `json:"requirement"`
	From        string              `json:"from,omitempty"`
}

Operation is one applied delta operation in deterministic order.

type Plan

type Plan struct {
	Root         string            `json:"root"`
	Change       string            `json:"change"`
	Capabilities []Capability      `json:"capabilities"`
	Diagnostics  []plan.Diagnostic `json:"diagnostics,omitempty"`
	Applicable   bool              `json:"applicable"`
	NoOp         bool              `json:"no_op"`
}

Plan is the whole immutable projection. Outputs exist only when Applicable is true: one conflict withholds every output, never some of them.

func Build

func Build(owner *corepath.Owner, change string) Plan

Build reconciles every capability delta of one change against accepted truth.

type Review

type Review struct {
	Change        string             `json:"change"`
	Root          string             `json:"root"`
	Outcome       string             `json:"outcome,omitempty"`
	NonGoals      string             `json:"non_goals,omitempty"`
	Operations    []Operation        `json:"operations"`
	Capabilities  []ReviewCapability `json:"capabilities"`
	Tasks         TaskFact           `json:"tasks"`
	Evidence      EvidenceFact       `json:"evidence"`
	Approval      ApprovalFact       `json:"approval"`
	ArchiveTarget string             `json:"archive_target,omitempty"`
	Diagnostics   []plan.Diagnostic  `json:"diagnostics,omitempty"`
	Blockers      []Blocker          `json:"blockers,omitempty"`
	Applicable    bool               `json:"applicable"`
	NoOp          bool               `json:"no_op"`
	Ready         bool               `json:"ready"`
}

Review is the read-only projection shown before human authorization.

func ProjectReview

func ProjectReview(reconciliation Plan, input ReviewInput) Review

ProjectReview renders one reconciliation plan and its predecessor facts. It reads nothing, writes nothing, and authorizes nothing: Ready means no blocker was found, never that sync may proceed without a human.

type ReviewCapability

type ReviewCapability struct {
	Capability   string `json:"capability"`
	AcceptedPath string `json:"accepted_path"`
	DeltaPath    string `json:"delta_path"`
	BeforeHash   string `json:"before_hash,omitempty"`
	AfterHash    string `json:"after_hash,omitempty"`
	Created      bool   `json:"created"`
	NoOp         bool   `json:"no_op"`
}

ReviewCapability is the before/after projection of one capability.

type ReviewInput

type ReviewInput struct {
	Change              plan.Change
	Approval            ApprovalFact
	Tasks               TaskFact
	Evidence            EvidenceFact
	ArchiveTarget       string
	ProjectionAvailable bool
}

ReviewInput carries everything review may not read for itself.

type TaskFact

type TaskFact struct {
	Total      int      `json:"total"`
	Completed  int      `json:"completed"`
	Incomplete []string `json:"incomplete,omitempty"`
}

Jump to

Keyboard shortcuts

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