methodology

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: Apache-2.0 Imports: 6 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 Method Plan 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 (
	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 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 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 Method Plan 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