Documentation
¶
Overview ¶
Package role loads a role's contract (role.yaml) and the project's settings for it, as described in docs/spec/role-contract.md.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Retired = map[string]string{
"release-manager": "the release-manager role is retired: workline cuts no releases, it works with the release tool a project has " +
"(docs/adr/0017-the-release-manager.md, ADR-0017). Release with one — release-please, release-plz, releaser-pleaser, " +
"semantic-release or changesets; GoReleaser to publish — and route `release: [documentalist]` before it",
}
Retired says what replaces a role workline no longer ships, by its name.
Functions ¶
func CheckConfig ¶
CheckConfig refuses a config holding a key the engine does not know.
func IsConfigError ¶
IsConfigError reports whether err, or an error it wraps, is a ConfigError.
Types ¶
type ConfigError ¶
type ConfigError struct {
// contains filtered or unexported fields
}
ConfigError is a .workline/config.yaml the engine cannot trust: unreadable, or holding a key it does not know. A key that is ignored is a setting someone believes in and nothing applies, so it blocks (principle 12).
func (*ConfigError) Error ¶
func (e *ConfigError) Error() string
type Model ¶
type Model struct {
Capability string `yaml:"capability"`
Tier string `yaml:"tier"`
Effort string `yaml:"effort"`
PromoteAfter int `yaml:"promote-after"`
Timeout string `yaml:"timeout"` // how long one answer may take, e.g. "10m"; default 3m
// Tasks gives a kind of task, named by pre in in/task-kind, other needs
// than the role's: condensing a doc needs more than judging one.
Tasks map[string]Model `yaml:"tasks"`
}
Model is what kind of thinking a role needs (docs/spec/model-grid.md).
func (Model) AnswerTimeout ¶
AnswerTimeout is how long the agent may take for one answer.
type ProjectConfig ¶
type ProjectConfig struct {
AI string `yaml:"ai"` // default agent for this project: none, claude...
Forge string `yaml:"forge"` // github, gitlab, or none
Roles map[string]struct {
Settings map[string]any `yaml:"settings"`
Enforce map[string]string `yaml:"enforce"`
} `yaml:"roles"`
}
ProjectConfig is the part of .workline/config.yaml the engine reads today.
func LoadProjectConfig ¶
func LoadProjectConfig(repo string) (*ProjectConfig, error)
LoadProjectConfig reads <repo>/.workline/config.yaml. A missing file is an empty config; an unreadable or invalid one is an error.
type Role ¶
type Role struct {
Contract int `yaml:"contract"`
Name string `yaml:"name"`
Mission string `yaml:"mission"`
Events []string `yaml:"events"`
Requires []string `yaml:"requires"`
Uses []string `yaml:"uses"`
Intentions []string `yaml:"intentions"`
Model Model `yaml:"model"`
Duties struct {
Reads []string `yaml:"reads"`
Writes []string `yaml:"writes"`
} `yaml:"duties"`
Context struct {
Knowledge []string `yaml:"knowledge"`
Budget int `yaml:"budget"`
} `yaml:"context"`
WithoutAI string `yaml:"without-ai"`
Settings map[string]any `yaml:"settings"`
Dir string `yaml:"-"`
}
Role is a parsed role.yaml, plus the folder it was loaded from.
func (*Role) Enforcement ¶
func (r *Role) Enforcement(c *ProjectConfig) map[string]string
Enforcement returns how hard each rule bites for this role in this project.
func (*Role) MergedSettings ¶
func (r *Role) MergedSettings(c *ProjectConfig) map[string]any
MergedSettings returns the role's defaults overridden by the project's settings.