lifecycle

package
v0.10.6 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PolicyAgentManagedWithFallback = "agent_managed_with_fallback"
	PolicyVersion                  = 1

	ActionSourceNone     = "none"
	ActionSourceAgent    = "agent"
	ActionSourceFallback = "fallback"

	BranchProvenancePlanned       = "planned"
	BranchProvenanceAgentMigrated = "agent_migrated"
)

Variables

This section is empty.

Functions

func DisclosurePromptInstruction

func DisclosurePromptInstruction(runner string, cfg config.DisclosureConfig, agentRuntime string, agentModel string) string

func PromptInstruction

func PromptInstruction(runner, branch, baseBranch string, expectPush, expectPR bool, disclosureCfg config.DisclosureConfig, agentRuntime string, agentModel string) string

Types

type Actions

type Actions struct {
	Commit string `json:"commit,omitempty"`
	Push   string `json:"push,omitempty"`
	PR     string `json:"pr,omitempty"`
}

func (*Actions) UnmarshalJSON added in v0.9.0

func (a *Actions) UnmarshalJSON(data []byte) error

type Policy

type Policy struct {
	Name            string   `json:"name"`
	Version         int      `json:"version"`
	ExpectCommit    bool     `json:"expectCommit"`
	ExpectPush      bool     `json:"expectPush"`
	ExpectPR        bool     `json:"expectPr"`
	AllowFallback   bool     `json:"allowFallback"`
	EligibleRunners []string `json:"eligibleRunners"`
}

func AgentManagedWithFallbackPolicy

func AgentManagedWithFallbackPolicy(runner string, expectPR bool) Policy

type State

type State struct {
	Policy            string   `json:"policy,omitempty"`
	PolicyVersion     int      `json:"policy_version,omitempty"`
	Branch            string   `json:"branch,omitempty"`
	BaseBranch        string   `json:"base_branch,omitempty"`
	PlannedBranch     string   `json:"planned_branch,omitempty"`
	PlannedBaseBranch string   `json:"planned_base_branch,omitempty"`
	AgentBranch       string   `json:"agent_branch,omitempty"`
	AgentBaseBranch   string   `json:"agent_base_branch,omitempty"`
	ActiveBranch      string   `json:"active_branch,omitempty"`
	ActiveBaseBranch  string   `json:"active_base_branch,omitempty"`
	BranchProvenance  string   `json:"branch_provenance,omitempty"`
	CommitSHAs        []string `json:"commit_shas,omitempty"`
	Pushed            bool     `json:"pushed,omitempty"`
	PRNumber          int64    `json:"pr_number,omitempty"`
	PRURL             string   `json:"pr_url,omitempty"`
	PRAdopted         bool     `json:"pr_adopted,omitempty"`
	Actions           Actions  `json:"actions,omitempty"`
	ReconciledAt      string   `json:"reconciled_at,omitempty"`
	ReconciledBy      string   `json:"reconciled_by,omitempty"`
	LastError         string   `json:"last_reconciliation_error,omitempty"`
	AgentIngestedAt   string   `json:"agent_ingested_at,omitempty"`
}

func FromMap

func FromMap(value any) (*State, error)

func NewState

func NewState(policy Policy, branch, baseBranch string) *State

func (*State) MergeAgent

func (s *State) MergeAgent(agent *State, ingestedAt string)

func (*State) Normalize

func (s *State) Normalize()

func (*State) RecordAgentBranch added in v0.7.5

func (s *State) RecordAgentBranch(branch, baseBranch string)

func (*State) SetActiveBranch added in v0.7.5

func (s *State) SetActiveBranch(branch, baseBranch, provenance string)

func (*State) UnmarshalJSON

func (s *State) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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