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

planning

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package planning validates declared intent against evidence, without inventing a design.

Package planning validates declared intent against evidence, without inventing a design.

Package planning validates declared intent against evidence, without inventing a design.

Package planning validates declared intent against evidence, without inventing a design.

Package planning validates declared intent against evidence, without inventing a design.

Package planning validates declared intent against evidence, without inventing a design.

Package planning validates declared intent against evidence, without inventing a design.

Index

Constants

View Source
const (
	AssumptionOpen     = "open"
	AssumptionAccepted = "accepted"
	AssumptionResolved = "resolved"
)

Assumption statuses. Open assumptions keep verification unknown; accepted (risk knowingly taken) and resolved (investigated) require a resolution.

View Source
const MaxBytes = 4 << 20

MaxBytes bounds policy/plan input reads and parsing.

View Source
const SchemaVersion = "1"

Variables

This section is empty.

Functions

func Approved

func Approved(p Plan) bool

func Digest

func Digest(p Plan) string

func IntentGraph

func IntentGraph(p Plan, s model.Snapshot, projected bool) (model.Snapshot, error)

IntentGraph overlays declared planning entities with proposed provenance. It never converts approval or natural-language intent into source evidence.

func NextSteps

func NextSteps(findings []model.Finding) []string

NextSteps turns findings into ordered, de-duplicated actions for an agent.

func Project

func Project(p Plan, s model.Snapshot) (model.Snapshot, error)

Project creates a separate proposed graph. Existing verified provenance is retained.

func ValidateRule

func ValidateRule(r Rule) error

ValidateRule rejects unsupported verification requests rather than executing arbitrary commands.

Types

type AgentFeedback

type AgentFeedback struct {
	TaskID   string       `json:"task_id"`
	Status   model.Status `json:"status"`
	Message  string       `json:"message"`
	CheckIDs []string     `json:"check_ids"`
}

type Approval

type Approval struct {
	Reviewer   string `json:"reviewer"`
	ReviewedAt string `json:"reviewed_at"`
	Checkpoint string `json:"checkpoint"`
	PlanDigest string `json:"plan_digest"`
}

Approval records a local review declaration bound to plan contents and a checkpoint. Radar cannot authenticate the reviewer. A recorded approval never authorizes Git operations.

type Assumption

type Assumption struct {
	ID         string `json:"id,omitempty"`
	Text       string `json:"text"`
	Status     string `json:"status,omitempty"`
	Resolution string `json:"resolution,omitempty"`
}

Assumption is an unverified design premise with an explicit lifecycle.

func (Assumption) Open

func (a Assumption) Open() bool

Open reports whether the assumption still needs investigation.

func (*Assumption) UnmarshalJSON

func (a *Assumption) UnmarshalJSON(b []byte) error

UnmarshalJSON also accepts the original plain-string form.

type Check

type Check struct {
	ID          string            `json:"id"`
	Status      model.Status      `json:"status"`
	Explanation string            `json:"explanation"`
	Evidence    model.Evidence    `json:"evidence"`
	Location    *model.Provenance `json:"location,omitempty"`
}

type Constraint

type Constraint struct {
	ID     string `json:"id"`
	Intent string `json:"intent"`
	Rule   *Rule  `json:"rule,omitempty"`
}

type Context

type Context struct {
	Relationships []model.Edge   `json:"relationships"`
	Query         string         `json:"query"`
	Matches       []ContextMatch `json:"matches"`
	Unknown       []string       `json:"unknown"`
	PlanningDepth string         `json:"planning_depth"`
	Reason        string         `json:"reason"`
}

func GroundedContext

func GroundedContext(intent string, s model.Snapshot) *Context

GroundedContext ranks lexical evidence, not semantic relevance or runtime behavior.

type ContextMatch

type ContextMatch struct {
	Entity      string           `json:"entity"`
	Score       int              `json:"score"`
	Explanation string           `json:"explanation"`
	Evidence    model.Provenance `json:"evidence"`
}

type ContractDelta

type ContractDelta struct {
	Contract    string          `json:"contract"`
	Schema      string          `json:"schema,omitempty"`
	Pointer     string          `json:"pointer,omitempty"`
	Expected    json.RawMessage `json:"expected,omitempty"`
	Operation   string          `json:"operation"`
	Description string          `json:"description"`
	Consumers   []string        `json:"consumers,omitempty"`
}

type Criterion

type Criterion struct {
	ID          string `json:"id"`
	Requirement string `json:"requirement"`
	Intent      string `json:"intent"`
	Rule        *Rule  `json:"rule,omitempty"`
}

type Decision

type Decision struct {
	ID           string   `json:"id"`
	Intent       string   `json:"intent"`
	Alternatives []string `json:"alternatives,omitempty"`
	Tradeoffs    []string `json:"tradeoffs,omitempty"`
}

type Delta

type Delta struct {
	Operation string      `json:"operation"`
	Node      *model.Node `json:"node,omitempty"`
	Edge      *model.Edge `json:"edge,omitempty"`
}

type Plan

type Plan struct {
	SchemaVersion  string             `json:"schema_version"`
	FeatureID      string             `json:"feature_id"`
	Intent         string             `json:"intent"`
	BaseRevision   string             `json:"base_revision"`
	Requirements   []Requirement      `json:"requirements"`
	Decisions      []Decision         `json:"decisions"`
	Constraints    []Constraint       `json:"constraints"`
	ContractDeltas []ContractDelta    `json:"contract_deltas"`
	Tasks          []Task             `json:"tasks"`
	Acceptance     []Criterion        `json:"acceptance"`
	GraphDeltas    []Delta            `json:"graph_deltas"`
	Assumptions    []Assumption       `json:"assumptions"`
	Evidence       []model.Provenance `json:"evidence"`
	Incomplete     []string           `json:"incomplete"`
	Approval       *Approval          `json:"approval,omitempty"`
	Context        *Context           `json:"context,omitempty"`
}

func Generate

func Generate(intent string, s model.Snapshot) Plan

func Load

func Load(path string) (Plan, error)

func Parse

func Parse(data []byte) (Plan, error)

Parse decodes exact captured plan bytes without reopening an input file.

type Report

type Report struct {
	Revision      string          `json:"revision,omitempty"`
	BaseRevision  string          `json:"base_revision,omitempty"`
	PlanDigest    string          `json:"plan_digest,omitempty"`
	Tasks         []TaskStatus    `json:"tasks,omitempty"`
	Feedback      []AgentFeedback `json:"feedback,omitempty"`
	Status        model.Status    `json:"status"`
	Authoritative bool            `json:"authoritative"`
	Findings      []model.Finding `json:"findings"`
	Checks        []Check         `json:"checks"`
	NextSteps     []string        `json:"next_steps,omitempty"`
}

func Validate

func Validate(p Plan, s model.Snapshot) Report

Validate checks a plan against the indexed snapshot. Findings are reported in a fixed order: identity, requirements and criteria, constraints, coverage, tasks and their coordination, contract deltas, decisions, assumptions and review state.

type Requirement

type Requirement struct {
	ID                string `json:"id"`
	Intent            string `json:"intent"`
	SecuritySensitive bool   `json:"security_sensitive,omitempty"`
}

type Rule

type Rule struct {
	CWD        string   `json:"cwd,omitempty"`
	Kind       string   `json:"kind"`
	Command    []string `json:"command,omitempty"`
	EvidenceID string   `json:"evidence_id,omitempty"`
	Path       string   `json:"path,omitempty"`
	Entity     string   `json:"entity,omitempty"`
	Pointer    string   `json:"pointer,omitempty"`
	Property   string   `json:"property,omitempty"`
	// test_run execution environment. Every field is part of the reviewed plan.
	Setup [][]string `json:"setup,omitempty"` // commands run before Command in the snapshot
	Env   []string   `json:"env,omitempty"`   // caller environment variable names passed through
	Link  []string   `json:"link,omitempty"`  // untracked dependency paths linked from the checkout
	JUnit string     `json:"junit,omitempty"` // snapshot-relative JUnit XML report or TEST-*.xml directory
}

type Schedule

type Schedule struct {
	PlanDigest     string       `json:"plan_digest"`
	Instructions   []TaskPacket `json:"instructions"`
	Order          []string     `json:"order"`
	ParallelGroups [][]string   `json:"parallel_groups"`
}

func Tasks

func Tasks(p Plan) (Schedule, error)

type Task

type Task struct {
	ID            string   `json:"id"`
	Intent        string   `json:"intent"`
	Requirements  []string `json:"requirements"`
	Components    []string `json:"components,omitempty"`
	Contracts     []string `json:"contracts,omitempty"`
	DependsOn     []string `json:"depends_on"`
	Acceptance    []string `json:"acceptance"`
	Consequential bool     `json:"consequential,omitempty"`
}

type TaskPacket

type TaskPacket struct {
	ContractDeltas []ContractDelta    `json:"contract_deltas"`
	GraphDeltas    []Delta            `json:"graph_deltas"`
	PlanDigest     string             `json:"plan_digest"`
	FeatureID      string             `json:"feature_id"`
	Decisions      []Decision         `json:"decisions"`
	Approval       *Approval          `json:"approval,omitempty"`
	Task           Task               `json:"task"`
	Requirements   []Requirement      `json:"requirements"`
	Acceptance     []Criterion        `json:"acceptance"`
	Constraints    []Constraint       `json:"constraints"`
	BaseRevision   string             `json:"base_revision"`
	Evidence       []model.Provenance `json:"evidence"`
}

type TaskStatus

type TaskStatus struct {
	Checks      []string     `json:"checks,omitempty"`
	BlockedBy   []string     `json:"blocked_by,omitempty"`
	ID          string       `json:"id"`
	Status      model.Status `json:"status"`
	Explanation string       `json:"explanation"`
}

Jump to

Keyboard shortcuts

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