methodology

package
v1.28.2 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: Apache-2.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package methodology reads the selected Autonomy Profile from the Bootstrap and answers one operational question: may the CLI do this without asking? What a plan means is defined by the Bootstrap; this package only executes the operating policy the Bootstrap declares, using its policy vocabulary.

Index

Constants

View Source
const (
	Initial    = "selected"
	Relaxed    = "relaxed"
	Reinforced = "reinforced"
)

Directions of a plan change.

View Source
const (
	IdentityResolution = "identity_resolution"
	ReferenceUpdates   = "reference_updates"
	IndexRebuild       = "index_rebuild"
	Validation         = "validation"
	AgentContextSync   = "agent_context_sync"
	RelevantChange     = "relevant_change"
	Destructive        = "destructive"
	GovernedDecision   = "governed_decision"
)

Operation kinds the Bootstrap's operating policy names.

View Source
const TeamPolicy = "team_policy"

TeamPolicy is the Bootstrap's value for "as the team declares".

Variables

This section is empty.

Functions

func TeamDeclarations

func TeamDeclarations(report string) map[string]string

TeamDeclarations extracts, from the Bootstrap's agreements report, the policy values a team declared. A team agreement declares one when it applies to "policy.<kind>" and its text starts with a policy value, for example: TA-01 | team | policy.agent_context_sync | automatic_safe. Personal preferences (scope user) never set team policy.

Types

type Change added in v1.10.0

type Change struct {
	From        string       `json:"from,omitempty"`
	To          string       `json:"to"`
	Direction   string       `json:"direction"`
	Relaxes     []string     `json:"relaxes,omitempty"`
	Differences []Difference `json:"differences,omitempty"`
	// Opposite is the plan that moves the other way from this one, if any.
	Opposite string `json:"opposite,omitempty"`
	// Revert is the plan the project came from, if any.
	Revert string `json:"revert,omitempty"`
}

Change describes what a plan change means. Every sentence about a plan comes from the Bootstrap's profile contract; the CLI only compares and points to the way back.

func Compare added in v1.10.0

func Compare(ctx context.Context, b ports.Bootstrap, from, to string) (Change, error)

Compare reads the profile contract and describes moving from one plan to another. from is empty when no plan was selected before.

type Choice

type Choice struct {
	ID      string
	Label   string
	Summary string
}

Choice is one selectable plan, with the Bootstrap's own wording.

func Choices

func Choices(ctx context.Context, b ports.Bootstrap) ([]Choice, error)

Choices reads the selectable plans and their descriptions from the Bootstrap, in the Bootstrap's order.

type Decision

type Decision int

Decision is how the CLI must treat one kind of operation.

const (
	// Automatic: do it and report.
	Automatic Decision = iota
	// AutomaticSafe: do it without asking only when nothing human-authored
	// would be overwritten; otherwise ask.
	AutomaticSafe
	// Confirm: prepare, show, apply after the human confirms.
	Confirm
	// Propose: propose with reasoning; nothing is written until confirmed.
	Propose
)

type Difference added in v1.10.0

type Difference struct {
	Control string `json:"control"`
	From    string `json:"from"`
	To      string `json:"to"`
}

Difference is one control whose requirement differs between two plans, in the Bootstrap's own words.

type Plan

type Plan struct {
	Profile   string   `json:"profile"`
	Selected  bool     `json:"selected"`
	Language  string   `json:"language"`
	Frozen    bool     `json:"frozen"`
	Supported []string `json:"supported"`
	Detail    struct {
		Label     string `json:"label"`
		Summary   string `json:"summary"`
		Delegates string `json:"delegates"`
		Policy    struct {
			Automation map[string]string `json:"automation"`
			Human      struct {
				Confirmation map[string]string `json:"confirmation"`
			} `json:"human"`
			Collaboration map[string]string `json:"collaboration"`
		} `json:"policy"`
	} `json:"plan"`
	Interaction struct {
		WithoutAsking []string          `json:"without_asking"`
		AsksFor       map[string]string `json:"asks_for"`
	} `json:"interaction"`
	// Team holds the values the team declared for the kinds the plan leaves
	// to team policy, read from the team's working agreements.
	Team map[string]string `json:"team_policy_declared,omitempty"`
}

Plan is the selected Autonomy Profile as the Bootstrap reports it.

func Load

func Load(ctx context.Context, b ports.Bootstrap) (Plan, error)

Load asks the Bootstrap for the plan in force.

func (Plan) Decide

func (p Plan) Decide(kind string) Decision

Decide maps the Bootstrap's policy value to a Decision. A destructive operation and a governed decision are confirmed in every plan, and any value this CLI does not know is treated as Confirm: never guess.

func (Plan) Value

func (p Plan) Value(kind string) string

Value is the policy value in force for an operation kind.

Jump to

Keyboard shortcuts

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