Documentation
¶
Index ¶
- Constants
- Variables
- func AddMilestone(configPath string, ms Milestone) error
- func DefaultDisableBoldForEnvironment() bool
- func DefaultDisableRoundedBordersForEnvironment() bool
- func DeleteMilestone(configPath, statePath, milestoneID string) error
- func DeleteMilestoneCycle(configPath, statePath, milestoneID string, cycleNum int) error
- func GenerateDefaultConfig(path string) error
- func GetGlobalConfigDir() string
- func InitializeMilestonesConfig(path string) error
- func IsValidLLM(val string) bool
- func SaveGlobalSettings(s Settings) error
- func SaveProjectSettings(s Settings) error
- func SaveProjectSettingsAt(path string, s Settings) error
- func SaveState(path string, state *State) error
- type Agent
- type AgentActionLog
- type AgentFrontmatter
- type AgentGroup
- type AgentInstructionsSettings
- type Config
- type Milestone
- type MilestoneCycleLog
- type MilestoneMigrationResult
- type Settings
- type State
- func (s *State) AddCycleLog(id string, log MilestoneCycleLog)
- func (s *State) GetActiveMilestoneID() string
- func (s *State) GetHistory(id string) []MilestoneCycleLog
- func (s *State) GetMilestoneAgentInstructionsUpdateScore(id string) int
- func (s *State) GetMilestoneCycles(id string) int
- func (s *State) GetMilestoneRecommendation(id string) int
- func (s *State) GetMilestoneStatus(id string) string
- func (s *State) IncrementMilestoneCycles(id string) int
- func (s *State) SetActiveMilestoneID(id string)
- func (s *State) SetMilestoneAgentInstructionsUpdateScore(id string, score int)
- func (s *State) SetMilestoneCycles(id string, cycles int)
- func (s *State) SetMilestoneRecommendation(id string, score int)
- func (s *State) SetMilestoneStatus(id, status string)
- func (s *State) UpdateLastCycleLog(id string, updateFn func(log *MilestoneCycleLog))
Constants ¶
const DefaultOllamaModel = "glm-5.2:cloud"
Variables ¶
var PredefinedDefaultGroup = AgentGroup{ Name: "Default", AgentIDs: []string{"pm", "developer", "qa", "recommender"}, }
PredefinedDefaultGroup is the built-in default agent group containing pm, developer, and qa.
Functions ¶
func AddMilestone ¶
AddMilestone saves a compact milestone index entry to milestone.yml.
func DefaultDisableBoldForEnvironment ¶
func DefaultDisableBoldForEnvironment() bool
DefaultDisableBoldForEnvironment resolves the startup bold setting while allowing VS Code terminals to opt into safer rendering only when settings do not say otherwise.
NOTE: The VS Code integrated terminal has known compatibility issues with bold formatting in certain themes/fonts, causing character overlapping, alignment issues, or cursor offset bugs. Therefore, we auto-detect TERM_PROGRAM == "vscode" to disable bold styling by default. Modifying or bypassing this default auto-detection without explicit user config will cause visual rendering/alignment bugs in the VS Code integrated terminal.
func DefaultDisableRoundedBordersForEnvironment ¶
func DefaultDisableRoundedBordersForEnvironment() bool
DefaultDisableRoundedBordersForEnvironment resolves the startup border setting while allowing VS Code terminals to opt into normal borders only when settings do not say otherwise.
NOTE: The VS Code integrated terminal frequently suffers from visual glitches when rendering Unicode rounded border characters, resulting in double-width border gaps, alignment issues, or disjointed boxes. To ensure layout integrity, we auto-detect TERM_PROGRAM == "vscode" and default to normal/square ASCII-safe borders unless explicitly overridden by configuration settings. Modifying or bypassing this fallback logic will lead to broken layout borders and visual degradation in the VS Code terminal environment.
func DeleteMilestone ¶
DeleteMilestone removes a milestone from config and state files, and cleans up specs and reports.
func DeleteMilestoneCycle ¶
DeleteMilestoneCycle removes a specific cycle directory and renumbers later cycle directories and state entries sequentially.
func GenerateDefaultConfig ¶
GenerateDefaultConfig creates an empty milestone index for a new project.
func GetGlobalConfigDir ¶
func GetGlobalConfigDir() string
GetGlobalConfigDir returns the default directory path for global configurations.
func InitializeMilestonesConfig ¶
InitializeMilestonesConfig creates the default config and companion milestones directory.
func IsValidLLM ¶
IsValidLLM checks if a given LLM runner name is supported.
func SaveGlobalSettings ¶
SaveGlobalSettings saves settings to the global settings file.
func SaveProjectSettings ¶
SaveProjectSettings saves settings to the project settings file.
func SaveProjectSettingsAt ¶
SaveProjectSettingsAt saves project settings to an explicit settings.yml path.
Types ¶
type Agent ¶
type Agent struct {
ID string `json:"id"`
Name string `yaml:"name" json:"name"`
Description string `yaml:"description" json:"description"`
Order int `yaml:"order" json:"order"`
RunnerBinary string `yaml:"runner_binary" json:"runner_binary"`
OutputContract string `yaml:"output_contract,omitempty" json:"output_contract,omitempty"`
PromptPath string `json:"prompt_path"`
PromptBody string `json:"prompt_body"`
}
Agent represents a dynamic agent loaded from prompts.
func LoadDynamicAgents ¶
LoadDynamicAgents scans global config (~/.config/cyclestone/agents/) and local config (.cyclestone/agents/).
type AgentActionLog ¶
type AgentActionLog struct {
AgentID string `json:"agent_id"`
Timestamp time.Time `json:"timestamp"`
ExitCode int `json:"exit_code"`
InputFile string `json:"input_file"`
OutputFile string `json:"output_file"`
Duration string `json:"duration,omitempty"`
}
AgentActionLog tracks an execution step.
type AgentFrontmatter ¶
type AgentFrontmatter struct {
Name string `yaml:"name"`
Description string `yaml:"description"`
Order *int `yaml:"order"`
RunnerBinary string `yaml:"runner_binary"`
OutputContract string `yaml:"output_contract"`
}
AgentFrontmatter is used for parsing agent configuration from Markdown frontmatter.
type AgentGroup ¶
type AgentGroup struct {
Name string `yaml:"name" json:"name"`
AgentIDs []string `yaml:"agent_ids" json:"agent_ids"`
}
AgentGroup represents a serialized pipeline group of agents.
func MergeAgentGroups ¶
func MergeAgentGroups(global, project []AgentGroup) []AgentGroup
MergeAgentGroups merges global and project agent groups, project groups overriding global ones with same name.
type AgentInstructionsSettings ¶ added in v0.0.3
type AgentInstructionsSettings struct {
File string `yaml:"file,omitempty" json:"file,omitempty"`
ProposeUpdates *bool `yaml:"propose_updates,omitempty" json:"propose_updates,omitempty"`
AutoApplyUpdates *bool `yaml:"auto_apply_updates,omitempty" json:"auto_apply_updates,omitempty"`
}
AgentInstructionsSettings controls the durable instruction file loaded into agent prompts and whether agents may propose updates for human review.
type Config ¶
type Config struct {
Milestones []Milestone `yaml:"milestones"`
Repositories []string `yaml:"repositories,omitempty"`
}
Config wraps a collection of Milestones.
func LoadConfig ¶
LoadConfig reads the milestone.yml file.
type Milestone ¶
type Milestone struct {
ID string `yaml:"id" json:"id"`
Title string `yaml:"title" json:"title"`
SpecPath string `yaml:"spec_path,omitempty" json:"spec_path,omitempty"`
Goal string `yaml:"goal,omitempty" json:"goal,omitempty"`
AcceptanceCriteria []string `yaml:"acceptance_criteria,omitempty" json:"acceptance_criteria,omitempty"`
Status string `yaml:"status,omitempty" json:"status,omitempty"` // legacy: runtime state now lives in state.json
Cycles int `yaml:"cycles,omitempty" json:"cycles,omitempty"` // legacy: runtime state now lives in state.json
Checks []string `yaml:"checks,omitempty" json:"checks,omitempty"`
}
Milestone defines a milestone's configuration structure.
type MilestoneCycleLog ¶
type MilestoneCycleLog struct {
CycleNumber int `json:"cycle_number"`
Timestamp time.Time `json:"timestamp"`
Branch string `json:"branch"`
CommitHash string `json:"commit_hash,omitempty"`
Status string `json:"status"` // "approved", "blocked", "failed"
UserNote string `json:"user_note"`
Actions []AgentActionLog `json:"actions"`
Duration string `json:"duration,omitempty"`
}
MilestoneCycleLog represents one run cycle of the milestone.
type MilestoneMigrationResult ¶
type MilestoneMigrationResult struct {
Milestones int
SpecsCreated int
StatusesCopied int
CyclesCopied int
Changed bool
}
MilestoneMigrationResult summarizes a legacy milestone storage migration.
func MigrateMilestoneStorage ¶
func MigrateMilestoneStorage(configPath, statePath string) (MilestoneMigrationResult, error)
MigrateMilestoneStorage moves legacy milestone definitions into compact index entries.
type Settings ¶
type Settings struct {
DefaultLLM string `yaml:"default_llm,omitempty" json:"default_llm,omitempty"` // "codex", "agy", "aider", "ollama", "ollama-codex", or "" (inherit)
DefaultMode string `yaml:"default_mode,omitempty" json:"default_mode,omitempty"` // "sandbox", "unrestricted", or "" (inherit)
AutoGitBranch *bool `yaml:"auto_git_branch,omitempty" json:"auto_git_branch,omitempty"` // pointer to bool, nil if unset/inherit
CreateMilestoneBranch *bool `yaml:"create_milestone_branch,omitempty" json:"create_milestone_branch,omitempty"` // pointer to bool, nil if unset/inherit
DisableBold *bool `yaml:"disable_bold,omitempty" json:"disable_bold,omitempty"` // pointer to bool, nil if unset/inherit
DisableRoundedBorders *bool `yaml:"disable_rounded_borders,omitempty" json:"disable_rounded_borders,omitempty"` // pointer to bool, nil if unset/inherit
DefaultGitBranchPrefix string `yaml:"default_git_branch_prefix,omitempty" json:"default_git_branch_prefix,omitempty"`
AiderModel string `yaml:"aider_model,omitempty" json:"aider_model,omitempty"`
OllamaModel string `yaml:"ollama_model,omitempty" json:"ollama_model,omitempty"`
OllamaCodexModel string `yaml:"ollama_codex_model,omitempty" json:"ollama_codex_model,omitempty"`
OllamaHost string `yaml:"ollama_host,omitempty" json:"ollama_host,omitempty"`
EnableContextCaching *bool `yaml:"enable_context_caching,omitempty" json:"enable_context_caching,omitempty"`
EnableCompactPhaseHandoffs *bool `yaml:"enable_compact_phase_handoffs,omitempty" json:"enable_compact_phase_handoffs,omitempty"`
EnableCodexSessionResume *bool `yaml:"enable_codex_session_resume,omitempty" json:"enable_codex_session_resume,omitempty"`
CacheTTLMinutes int `yaml:"cache_ttl_minutes,omitempty" json:"cache_ttl_minutes,omitempty"`
MaxHandoffChars int `yaml:"max_handoff_chars,omitempty" json:"max_handoff_chars,omitempty"`
OllamaNumCtx int `yaml:"ollama_num_ctx,omitempty" json:"ollama_num_ctx,omitempty"`
OllamaNumPredict int `yaml:"ollama_num_predict,omitempty" json:"ollama_num_predict,omitempty"`
MaxModelCallsPerPhase int `yaml:"max_model_calls_per_phase,omitempty" json:"max_model_calls_per_phase,omitempty"`
MaxTokenBudgetPerPhase int `yaml:"max_token_budget_per_phase,omitempty" json:"max_token_budget_per_phase,omitempty"`
MaxLLMInputChars int `yaml:"max_llm_input_chars,omitempty" json:"max_llm_input_chars,omitempty"`
MaxRetainedConversationMessages int `yaml:"max_retained_conversation_messages,omitempty" json:"max_retained_conversation_messages,omitempty"`
AgentGroups []AgentGroup `yaml:"agent_groups,omitempty" json:"agent_groups,omitempty"`
AgentInstructions AgentInstructionsSettings `yaml:"agent_instructions,omitempty" json:"agent_instructions,omitempty"`
}
Settings represents global and project configurations.
func LoadDefaultSettings ¶
func LoadDefaultSettings() Settings
LoadDefaultSettings returns the default settings object.
func LoadGlobalSettings ¶
LoadGlobalSettings reads the global settings.yml if it exists.
func LoadMergedSettings ¶
func LoadMergedSettings() Settings
LoadMergedSettings merges global and project configurations (project overrides global).
func LoadProjectSettings ¶
LoadProjectSettings reads the local project settings.yml if it exists.
type State ¶
type State struct {
ActiveMilestoneID string `json:"active_milestone_id"`
MilestoneStatuses map[string]string `json:"milestone_statuses"` // milestone ID -> status
MilestoneCycles map[string]int `json:"milestone_cycles"` // milestone ID -> cycle count
MilestoneRecommendations map[string]int `json:"milestone_recommendations"`
MilestoneAgentInstructionUpdateScores map[string]int `json:"milestone_agent_instruction_update_scores"`
History map[string][]MilestoneCycleLog `json:"history"` // milestone ID -> list of cycles
// contains filtered or unexported fields
}
State tracks the runtime / progress state of the milestones.
func LoadState ¶
LoadState reads the state.json tracking file and migrates legacy formats if necessary.
func (*State) AddCycleLog ¶
func (s *State) AddCycleLog(id string, log MilestoneCycleLog)
func (*State) GetActiveMilestoneID ¶
func (*State) GetHistory ¶
func (s *State) GetHistory(id string) []MilestoneCycleLog
func (*State) GetMilestoneAgentInstructionsUpdateScore ¶ added in v0.0.3
func (*State) GetMilestoneCycles ¶
func (*State) GetMilestoneRecommendation ¶
func (*State) GetMilestoneStatus ¶
func (*State) IncrementMilestoneCycles ¶
func (*State) SetActiveMilestoneID ¶
func (*State) SetMilestoneAgentInstructionsUpdateScore ¶ added in v0.0.3
func (*State) SetMilestoneCycles ¶
func (*State) SetMilestoneRecommendation ¶
func (*State) SetMilestoneStatus ¶
func (*State) UpdateLastCycleLog ¶
func (s *State) UpdateLastCycleLog(id string, updateFn func(log *MilestoneCycleLog))