Documentation
¶
Overview ¶
Package project locates an aitk project and loads its configuration.
Index ¶
- Constants
- func DetectCheck(root string) string
- func IsV1(root string) bool
- func Slug(s string, maxLen int) string
- type AssistantCfg
- type BriefCfg
- type CheckCfg
- type Config
- func (c Config) ASVSLevel() int
- func (c Config) ArchiveAfterDays() int
- func (c Config) AuditRequired(profile string) bool
- func (c Config) AutoPersona() bool
- func (c Config) BriefBudget() int
- func (c Config) ChangelogFile() string
- func (c Config) CharacterMode() string
- func (c Config) CheckTimeout() string
- func (c Config) DefaultBranch() string
- func (c Config) InboxLimit() int
- func (c Config) InitialVersion() string
- func (c Config) LiteMaxFiles() int
- func (c Config) LiteMaxLines() int
- func (c Config) OneTaskAtATime() bool
- func (c Config) RegressionTestsRequired() bool
- func (c Config) ReviewLoop() bool
- func (c Config) ReviewRequired(profile string) bool
- func (c Config) RunSettings() RunCfg
- func (c Config) TagPrefix() string
- func (c Config) TalkMode() string
- func (c Config) UATRequired(profile string) bool
- type DeployCfg
- type KnowledgeCfg
- type PluginsCfg
- type Project
- func (p *Project) AitkDir() string
- func (p *Project) AitkRel(gitPath string) string
- func (p *Project) GitPath(rel string) string
- func (p *Project) GitRel(dir string) string
- func (p *Project) LockPath() string
- func (p *Project) Path(rel ...string) string
- func (p *Project) SharedDir() string
- func (p *Project) SharedStateDirs() []string
- func (p *Project) StateDirs() []string
- type ProjectCfg
- type QualityCfg
- type ReleaseCfg
- type RiskCfg
- type RunCfg
- type Scanner
- type SecurityCfg
- type UATCfg
Constants ¶
const ( ConfigFile = "aitk.toml" StateFile = "ai-state.json" AgentsFile = "AGENTS.md" DocsAI = "docs/ai" TasksDir = "docs/ai/tasks" HandoffDir = "docs/ai/handoff" KnowDir = "docs/ai/knowledge" LegacyDir = "docs/ai/_legacy" ADRDir = "docs/adr" ContextFile = "docs/ai/project-context.md" )
Paths relative to Root.
const LocalStateDir = ".aitk"
LocalStateDir is the in-tree fallback for aitk's private state, used when the git directory is read-only (for example inside an agent sandbox). It ignores itself.
Variables ¶
This section is empty.
Functions ¶
func DetectCheck ¶
DetectCheck guesses a check command from common build files.
Types ¶
type AssistantCfg ¶ added in v2.9.0
type AssistantCfg struct {
Character string `toml:"character,omitempty" json:"character,omitempty"`
Talk string `toml:"talk,omitempty" json:"talk,omitempty"`
AutoPersona *bool `toml:"auto_persona,omitempty" json:"auto_persona,omitempty"`
}
AssistantCfg sets how agents work and talk in this project, applied through aitk brief.
type BriefCfg ¶
type BriefCfg struct {
Budget int `toml:"budget,omitempty" json:"budget,omitempty"`
}
type Config ¶
type Config struct {
Project ProjectCfg `toml:"project,omitempty" json:"project,omitempty"`
Check CheckCfg `toml:"check,omitempty" json:"check,omitempty"`
Risk RiskCfg `toml:"risk,omitempty" json:"risk,omitempty"`
Brief BriefCfg `toml:"brief,omitempty" json:"brief,omitempty"`
Knowledge KnowledgeCfg `toml:"knowledge,omitempty" json:"knowledge,omitempty"`
Deploy DeployCfg `toml:"deploy,omitempty" json:"deploy,omitempty"`
Plugins PluginsCfg `toml:"plugins,omitempty" json:"plugins,omitempty"`
UAT UATCfg `toml:"uat,omitempty" json:"uat,omitempty"`
Release ReleaseCfg `toml:"release,omitempty" json:"release,omitempty"`
Security SecurityCfg `toml:"security,omitempty" json:"security,omitempty"`
Run *RunCfg `toml:"run,omitempty" json:"run,omitempty"`
Quality QualityCfg `toml:"quality,omitempty" json:"quality,omitempty"`
Assistant AssistantCfg `toml:"assistant,omitempty" json:"assistant,omitempty"`
}
Config mirrors schemas/config.schema.json.
func LoadConfig ¶
LoadConfig parses aitk.toml, rejecting unknown keys and values that violate schemas/config.schema.json.
func (Config) ASVSLevel ¶ added in v2.2.0
ASVSLevel is the OWASP ASVS level required for strict tasks (0 = off).
func (Config) ArchiveAfterDays ¶
func (Config) AuditRequired ¶ added in v2.2.0
AuditRequired reports whether the Definition of Done for this profile needs a passing audit.
func (Config) AutoPersona ¶ added in v2.9.0
AutoPersona reports whether the brief picks personas for the active task (default true).
func (Config) BriefBudget ¶
func (Config) ChangelogFile ¶ added in v2.2.0
func (Config) CharacterMode ¶ added in v2.9.0
CharacterMode is lite, full (default), ultra, or off; AITK_CHARACTER overrides it per person.
func (Config) CheckTimeout ¶
func (Config) DefaultBranch ¶
func (Config) InboxLimit ¶
func (Config) InitialVersion ¶ added in v2.2.0
func (Config) LiteMaxFiles ¶
Effective defaults (docs/spec/workflow.md, schemas/config.schema.json).
func (Config) LiteMaxLines ¶
func (Config) OneTaskAtATime ¶ added in v2.11.0
OneTaskAtATime reports whether an agent must finish (or block) the active task before it starts another in the same worktree (default true).
func (Config) RegressionTestsRequired ¶ added in v2.4.0
RegressionTestsRequired reports whether bug tasks must change a test file (default true).
func (Config) ReviewLoop ¶ added in v2.11.0
ReviewLoop reports whether agents review their own work until a pass finds 0 (on strict work too): on by default; [quality] review = "strict" or "off" turns it off.
func (Config) ReviewRequired ¶ added in v2.11.0
ReviewRequired reports whether a task of this profile needs review passes until one finds 0 before it is done. [quality] review: "standard" (the default: standard and strict work), or "strict" or its alias "off" (the old behaviour: only strict work, which always needs its independent review). Lite work never needs it, so a quick close without a task stays quick.
func (Config) RunSettings ¶ added in v2.4.0
RunSettings returns [run], empty when not configured.
func (Config) TalkMode ¶ added in v2.9.0
TalkMode is normal (default), lite, or caveman; AITK_TALK overrides it per person.
func (Config) UATRequired ¶ added in v2.2.0
UATRequired reports whether tasks with this profile need a person's acceptance.
type KnowledgeCfg ¶
type PluginsCfg ¶
type Project ¶
type Project struct {
Root string // git toplevel
GitDir string // per-worktree git dir
CommonDir string // shared git dir
Config Config
// contains filtered or unexported fields
}
Project is a discovered repository.
func (*Project) AitkDir ¶
AitkDir is the per-worktree private state directory (the first writable of StateDirs).
func (*Project) AitkRel ¶ added in v2.11.0
AitkRel maps a path as git reports it back to aitk's own name for it: with docs -> documentation, documentation/ai/tasks/T-1.md is docs/ai/tasks/T-1.md. Other paths are returned unchanged.
func (*Project) GitPath ¶ added in v2.11.0
GitPath is the inverse of AitkRel: aitk's name for a file (docs/ai/tasks/T-1.md) as the path git tracks it under, for git commands that take a path (git show HEAD:<path>, git log).
func (*Project) GitRel ¶ added in v2.11.0
GitRel returns the repository-relative path git uses for one of aitk's directories: when it (or a parent, like docs) is a symlink to another directory inside the repository, git tracks the files under the link's target, and pathspecs through the link are refused. A directory that resolves outside the repository, to the root itself, or cannot be resolved is returned unchanged. Results are cached per Project: callers ask for every changed file.
func (*Project) LockPath ¶
LockPath is the project lock, shared by all worktrees when the git directory is writable.
func (*Project) SharedDir ¶
SharedDir is the shared state directory (the first writable of SharedStateDirs).
func (*Project) SharedStateDirs ¶
SharedStateDirs lists locations shared by all worktrees, in order of preference.
type ProjectCfg ¶
type QualityCfg ¶ added in v2.4.0
type ReleaseCfg ¶ added in v2.2.0
type RunCfg ¶ added in v2.4.0
type RunCfg struct {
Agent string `toml:"agent,omitempty" json:"agent,omitempty"`
Cmd string `toml:"cmd,omitempty" json:"cmd,omitempty"`
Args []string `toml:"args,omitempty" json:"args,omitempty"`
MaxTasks int `toml:"max_tasks,omitempty" json:"max_tasks,omitempty"`
MaxAttempts int `toml:"max_attempts,omitempty" json:"max_attempts,omitempty"`
TimeoutMinutes int `toml:"timeout_minutes,omitempty" json:"timeout_minutes,omitempty"`
Commit bool `toml:"commit,omitempty" json:"commit,omitempty"`
}