project

package
v2.11.1 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2026 License: Apache-2.0 Imports: 10 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 project locates an aitk project and loads its configuration.

Index

Constants

View Source
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.

View Source
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

func DetectCheck(root string) string

DetectCheck guesses a check command from common build files.

func IsV1

func IsV1(root string) bool

IsV1 reports whether root holds a v1 ai-toolkit project.

func Slug

func Slug(s string, maxLen int) string

Slug lowercases and hyphenates text, capped at maxLen.

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 CheckCfg

type CheckCfg struct {
	Cmd     string `toml:"cmd,omitempty" json:"cmd,omitempty"`
	Timeout string `toml:"timeout,omitempty" json:"timeout,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

func LoadConfig(path string) (Config, error)

LoadConfig parses aitk.toml, rejecting unknown keys and values that violate schemas/config.schema.json.

func (Config) ASVSLevel added in v2.2.0

func (c Config) ASVSLevel() int

ASVSLevel is the OWASP ASVS level required for strict tasks (0 = off).

func (Config) ArchiveAfterDays

func (c Config) ArchiveAfterDays() int

func (Config) AuditRequired added in v2.2.0

func (c Config) AuditRequired(profile string) bool

AuditRequired reports whether the Definition of Done for this profile needs a passing audit.

func (Config) AutoPersona added in v2.9.0

func (c Config) AutoPersona() bool

AutoPersona reports whether the brief picks personas for the active task (default true).

func (Config) BriefBudget

func (c Config) BriefBudget() int

func (Config) ChangelogFile added in v2.2.0

func (c Config) ChangelogFile() string

func (Config) CharacterMode added in v2.9.0

func (c Config) CharacterMode() string

CharacterMode is lite, full (default), ultra, or off; AITK_CHARACTER overrides it per person.

func (Config) CheckTimeout

func (c Config) CheckTimeout() string

func (Config) DefaultBranch

func (c Config) DefaultBranch() string

func (Config) InboxLimit

func (c Config) InboxLimit() int

func (Config) InitialVersion added in v2.2.0

func (c Config) InitialVersion() string

func (Config) LiteMaxFiles

func (c Config) LiteMaxFiles() int

Effective defaults (docs/spec/workflow.md, schemas/config.schema.json).

func (Config) LiteMaxLines

func (c Config) LiteMaxLines() int

func (Config) OneTaskAtATime added in v2.11.0

func (c Config) OneTaskAtATime() bool

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

func (c Config) RegressionTestsRequired() bool

RegressionTestsRequired reports whether bug tasks must change a test file (default true).

func (Config) ReviewLoop added in v2.11.0

func (c Config) ReviewLoop() bool

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

func (c Config) ReviewRequired(profile string) bool

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

func (c Config) RunSettings() RunCfg

RunSettings returns [run], empty when not configured.

func (Config) TagPrefix added in v2.2.0

func (c Config) TagPrefix() string

func (Config) TalkMode added in v2.9.0

func (c Config) TalkMode() string

TalkMode is normal (default), lite, or caveman; AITK_TALK overrides it per person.

func (Config) UATRequired added in v2.2.0

func (c Config) UATRequired(profile string) bool

UATRequired reports whether tasks with this profile need a person's acceptance.

type DeployCfg

type DeployCfg struct {
	Targets   map[string]string `toml:"targets,omitempty" json:"targets,omitempty"`
	PostCheck string            `toml:"post_check,omitempty" json:"post_check,omitempty"`
}

type KnowledgeCfg

type KnowledgeCfg struct {
	InboxLimit       int `toml:"inbox_limit,omitempty" json:"inbox_limit,omitempty"`
	ArchiveAfterDays int `toml:"archive_after_days,omitempty" json:"archive_after_days,omitempty"`
}

type PluginsCfg

type PluginsCfg struct {
	Enabled  []string                  `toml:"enabled,omitempty" json:"enabled,omitempty"`
	Timeout  string                    `toml:"timeout,omitempty" json:"timeout,omitempty"`
	Settings map[string]map[string]any `toml:"settings,omitempty" json:"settings,omitempty"`
}

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 Open

func Open(dir string) (*Project, error)

Open locates the project and loads aitk.toml. A v1 project yields E_NEEDS_MIGRATION.

func Repo

func Repo(dir string) (*Project, error)

Repo locates the git repository containing dir without requiring aitk.toml.

func (*Project) AitkDir

func (p *Project) AitkDir() string

AitkDir is the per-worktree private state directory (the first writable of StateDirs).

func (*Project) AitkRel added in v2.11.0

func (p *Project) AitkRel(gitPath string) string

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

func (p *Project) GitPath(rel string) string

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

func (p *Project) GitRel(dir string) string

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

func (p *Project) LockPath() string

LockPath is the project lock, shared by all worktrees when the git directory is writable.

func (*Project) Path

func (p *Project) Path(rel ...string) string

Path joins rel onto the project root.

func (*Project) SharedDir

func (p *Project) SharedDir() string

SharedDir is the shared state directory (the first writable of SharedStateDirs).

func (*Project) SharedStateDirs

func (p *Project) SharedStateDirs() []string

SharedStateDirs lists locations shared by all worktrees, in order of preference.

func (*Project) StateDirs

func (p *Project) StateDirs() []string

StateDirs lists per-worktree state locations in order of preference.

type ProjectCfg

type ProjectCfg struct {
	Name          string `toml:"name,omitempty" json:"name,omitempty"`
	DefaultBranch string `toml:"default_branch,omitempty" json:"default_branch,omitempty"`
}

type QualityCfg added in v2.4.0

type QualityCfg struct {
	RegressionTests *bool  `toml:"regression_tests,omitempty" json:"regression_tests,omitempty"`
	Review          string `toml:"review,omitempty" json:"review,omitempty"`
	OneTask         *bool  `toml:"one_task,omitempty" json:"one_task,omitempty"`
}

type ReleaseCfg added in v2.2.0

type ReleaseCfg struct {
	TagPrefix      string `toml:"tag_prefix,omitempty" json:"tag_prefix,omitempty"`
	Changelog      string `toml:"changelog,omitempty" json:"changelog,omitempty"`
	InitialVersion string `toml:"initial_version,omitempty" json:"initial_version,omitempty"`
}

type RiskCfg

type RiskCfg struct {
	SensitivePaths []string `toml:"sensitive_paths,omitempty" json:"sensitive_paths,omitempty"`
	LiteMaxFiles   *int     `toml:"lite_max_files,omitempty" json:"lite_max_files,omitempty"`
	LiteMaxLines   *int     `toml:"lite_max_lines,omitempty" json:"lite_max_lines,omitempty"`
}

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"`
}

type Scanner added in v2.2.0

type Scanner struct {
	Name string `toml:"name" json:"name"`
	Cmd  string `toml:"cmd" json:"cmd"`
}

type SecurityCfg added in v2.2.0

type SecurityCfg struct {
	ASVSLevel *int      `toml:"asvs_level,omitempty" json:"asvs_level,omitempty"`
	Audit     string    `toml:"audit,omitempty" json:"audit,omitempty"`
	Scanners  []Scanner `toml:"scanners,omitempty" json:"scanners,omitempty"`
}

type UATCfg added in v2.2.0

type UATCfg struct {
	Required string `toml:"required,omitempty" json:"required,omitempty"`
}

Jump to

Keyboard shortcuts

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