Documentation
¶
Overview ¶
Package spec holds the cross-cutting state and domain value types that both internal/core and internal/context depend on. It is a leaf: it imports only the standard library and must never import internal/core, so the two heavier packages can share these enums without an import cycle.
Index ¶
- Variables
- func IsReadonlyRole(r string) bool
- func ReadonlyRoleNames() []string
- func RoleAllowsPhase(name string, phase Phase) bool
- func RoleAllowsTool(name, tool string) bool
- func RoleBudgetTier(name string) string
- func RoleFilePolicy(name string) string
- func RoleNames() []string
- func RolePromptClass(name string) string
- func RoleToolSet(name string) map[string]bool
- func RoleTools(name string) []string
- type Phase
- type RoleDef
- type SpecStatus
Constants ¶
This section is empty.
Variables ¶
var Roles = []RoleDef{ { Name: "scout", RW: "readonly", BudgetTier: "minimal", PhaseAffinity: []Phase{PhasePerceive, PhaseAnalyze, PhasePlan, PhaseExecute, PhaseVerify, PhaseReflect}, Tools: []string{"specd_inspect", "specd_read", "specd_query", "specd_status", "specd_context"}, FilePolicy: "no writes", PromptClass: "gate-only", }, { Name: "researcher", RW: "readonly", BudgetTier: "large", PhaseAffinity: []Phase{PhasePerceive, PhaseAnalyze, PhasePlan, PhaseExecute, PhaseVerify, PhaseReflect}, Tools: []string{"specd_inspect", "specd_read", "specd_query", "specd_status", "specd_context", "specd_diff", "specd_report", "specd_check"}, FilePolicy: "no writes", PromptClass: "gate-only", }, { Name: "auditor", RW: "readonly", BudgetTier: "medium", PhaseAffinity: []Phase{PhasePerceive, PhaseAnalyze, PhasePlan, PhaseExecute, PhaseVerify, PhaseReflect}, Tools: []string{"specd_inspect", "specd_read", "specd_query", "specd_status", "specd_context", "specd_diff", "specd_report", "specd_check", "specd_waves"}, FilePolicy: "no writes", PromptClass: "gate-only", }, { Name: "architect", RW: "readonly", BudgetTier: "medium", PhaseAffinity: []Phase{PhaseAnalyze, PhasePlan}, Tools: []string{"specd_inspect", "specd_read", "specd_query", "specd_status", "specd_context", "specd_check", "specd_approve", "specd_waves", "specd_report", "specd_diff"}, FilePolicy: "no writes", PromptClass: "gate-only", }, { Name: "craftsman", RW: "readwrite", BudgetTier: "focused", PhaseAffinity: []Phase{PhaseExecute}, Tools: []string{"specd_inspect", "specd_read", "specd_context", "specd_status", "specd_next", "specd_dispatch", "specd_verify", "specd_task", "specd_report"}, FilePolicy: "task scope only", PromptClass: "card", }, { Name: "tester", RW: "readwrite", BudgetTier: "focused", PhaseAffinity: []Phase{PhaseExecute, PhaseVerify}, Tools: []string{"specd_inspect", "specd_read", "specd_context", "specd_status", "specd_check", "specd_verify", "specd_task", "specd_report"}, FilePolicy: "task scope only", PromptClass: "card", }, { Name: "documenter", RW: "readwrite", BudgetTier: "focused", PhaseAffinity: []Phase{PhaseAnalyze, PhasePlan, PhaseExecute, PhaseVerify, PhaseReflect}, Tools: []string{"specd_inspect", "specd_read", "specd_context", "specd_status", "specd_memory", "specd_decision", "specd_report", "specd_diff", "specd_check"}, FilePolicy: "unrestricted within files:", PromptClass: "card", }, { Name: "validator", RW: "readwrite", BudgetTier: "medium", PhaseAffinity: []Phase{PhaseExecute, PhaseVerify}, Tools: []string{"specd_check", "specd_status", "specd_state_read", "specd_doctor"}, FilePolicy: "specd state only", PromptClass: "contract", }, }
Roles is single registry of declared role contracts, in stable order.
Functions ¶
func IsReadonlyRole ¶
IsReadonlyRole reports whether r is a read-only task role.
func ReadonlyRoleNames ¶
func ReadonlyRoleNames() []string
ReadonlyRoleNames returns stable readonly-role names.
func RoleAllowsPhase ¶
RoleAllowsPhase reports whether role may operate in phase.
func RoleAllowsTool ¶
RoleAllowsTool reports whether role may expose tool.
func RoleBudgetTier ¶
RoleBudgetTier returns budget tier for role.
func RoleFilePolicy ¶
RoleFilePolicy returns file policy for role.
func RolePromptClass ¶
RolePromptClass returns prompt class for role.
func RoleToolSet ¶
RoleToolSet returns the allowed MCP tool names for role as a set.
Types ¶
type Phase ¶
type Phase string
Phase is the PDCA-style execution phase a spec status maps to.
func PhaseForStatus ¶
func PhaseForStatus(status SpecStatus) Phase
PhaseForStatus maps a spec status to its execution phase.
func RolePhaseAffinity ¶
RolePhaseAffinity returns phase affinity for role.
type RoleDef ¶
type RoleDef struct {
Name string
RW string
BudgetTier string
PhaseAffinity []Phase
Tools []string
FilePolicy string
PromptClass string
}
RoleDef is one role contract: permission, budget, phase affinity, allowed tools, file policy, and prompt class.
type SpecStatus ¶
type SpecStatus string
SpecStatus is the lifecycle status of a spec, recorded in state.json.
const ( StatusRequirements SpecStatus = "requirements" StatusDesign SpecStatus = "design" StatusTasks SpecStatus = "tasks" StatusExecuting SpecStatus = "executing" StatusVerifying SpecStatus = "verifying" StatusComplete SpecStatus = "complete" StatusBlocked SpecStatus = "blocked" )
func (SpecStatus) IsValid ¶
func (s SpecStatus) IsValid() bool
IsValid reports whether s is one of the recognized lifecycle statuses. It is the single source of truth for "is this a status specd ever writes", so a resume that finds a hand-edited or corrupt on-disk status can fail loud instead of silently coercing it to a default.