Documentation
¶
Index ¶
- func ArchiveSpec(ctx context.Context, basePath, slug string) error
- func CheckTriadArtifacts(projectRoot, slug string) (bool, []string)
- func FindProjectRoot() (string, error)
- func GetContextFiles(projectRoot, slug string) ([]string, error)
- func SpecExists(projectRoot string, slug string) (bool, string)
- type Artifact
- type ArtifactStatus
- type ConfigProvider
- type ImplementationReport
- type ImplementationTask
- type Phase
- type Registry
- type Service
- func (s *Service) GetArtifact(ctx context.Context, name string) (*Artifact, error)
- func (s *Service) GetImplementationStatus(ctx context.Context, projectRoot, slug string) (*ImplementationReport, error)
- func (s *Service) GetStatus(ctx context.Context, projectRoot string, slug string) (SpecStatus, error)
- func (s *Service) UpdateTaskStatus(ctx context.Context, projectRoot, slug, taskID, status string) error
- type SpecInfo
- type SpecStatus
- type StateCategory
- type StateItem
- type StateTree
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ArchiveSpec ¶
ArchiveSpec moves a specification from the specs directory to the archive directory.
func CheckTriadArtifacts ¶
CheckTriadArtifacts verifies if requirements.md, design.md, and tasks.md exist.
func FindProjectRoot ¶
FindProjectRoot looks for the .specforce directory in the current or parent directories.
func GetContextFiles ¶
GetContextFiles returns absolute paths for all files in the spec directory and global docs.
Types ¶
type Artifact ¶
type Artifact struct {
Name string `json:"name" yaml:"-"`
Description string `json:"description" yaml:"description"`
Instruction string `json:"instruction" yaml:"instruction"`
Template string `json:"template" yaml:"template"`
Dependency string `json:"dependency" yaml:"dependency"`
}
Artifact represents a specification document type.
type ArtifactStatus ¶
type ArtifactStatus struct {
Name string `json:"name"`
Description string `json:"description"`
Path string `json:"path"`
Exists bool `json:"exists"`
Blocked bool `json:"blocked"`
Dependency string `json:"dependency"`
}
ArtifactStatus represents the presence and description of a single spec document.
type ConfigProvider ¶
type ConfigProvider interface {
GetConfig(ctx context.Context) (*core.ProjectConfig, error)
}
ConfigProvider defines the contract for project configuration access.
type ImplementationReport ¶
type ImplementationReport struct {
Name string `json:"name"`
Status string `json:"status"` // ready | blocked
MissingArtifacts []string `json:"missing_artifacts,omitempty"`
ContextFiles []string `json:"context_files"`
Instructions []string `json:"instructions,omitempty"`
Phases []Phase `json:"phases"`
ExecutionStrategy string `json:"execution_strategy"`
PreemptiveMitigations string `json:"preemptive_mitigations"`
}
func ParseTasks ¶
func ParseTasks(ctx context.Context, projectRoot, slug string) (*ImplementationReport, error)
ParseTasks extracts implementation details from tasks.md.
func (*ImplementationReport) Tasks ¶
func (r *ImplementationReport) Tasks() []ImplementationTask
Tasks returns a flat list of tasks across all phases for backward compatibility.
type ImplementationTask ¶
type Phase ¶
type Phase struct {
ID string `json:"id"`
Title string `json:"title"`
Tasks []ImplementationTask `json:"tasks"`
}
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry manages the collection of spec artifacts.
func NewRegistry ¶
NewRegistry initializes a new registry by loading YAML files from the provided filesystem.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service orchestrates specification management logic.
func NewService ¶
func NewService(registry *Registry, configProvider ConfigProvider) *Service
NewService creates a new instance of the spec service.
func (*Service) GetArtifact ¶
GetArtifact retrieves a specific artifact by name, injecting custom project instructions if present.
func (*Service) GetImplementationStatus ¶
func (s *Service) GetImplementationStatus(ctx context.Context, projectRoot, slug string) (*ImplementationReport, error)
GetImplementationStatus retrieves the status and details for implementing a specific feature.
type SpecInfo ¶
type SpecInfo struct {
Slug string `json:"slug"`
}
SpecInfo contains basic information about a specification.
type SpecStatus ¶
type SpecStatus struct {
Slug string `json:"slug"`
Artifacts []ArtifactStatus `json:"artifacts"`
Progress int `json:"progress"`
Total int `json:"total"`
Found int `json:"found"`
}
SpecStatus represents the overall completion state of a specific feature spec.
type StateCategory ¶
type StateCategory string
StateCategory defines the top-level grouping for project state items.
const ( CategoryConstitution StateCategory = "Constitution" CategoryActiveSpecs StateCategory = "Active Specs" CategoryImplementations StateCategory = "Active Implementations" CategoryArchived StateCategory = "Archived" )
type StateItem ¶
type StateItem struct {
Slug string `json:"slug"`
Name string `json:"name"`
Path string `json:"path"`
Category StateCategory `json:"category"`
Status string `json:"status"` // PENDING | IN-PROGRESS | FINISHED
Progress int `json:"progress"`
Description string `json:"description"`
ArtifactCount int `json:"artifact_count"`
ArtifactTotal int `json:"artifact_total"`
TaskCount int `json:"task_count"`
TaskTotal int `json:"task_total"`
AnyTaskWorking bool `json:"any_task_working"`
CurrentTaskID string `json:"current_task_id"`
CurrentTask string `json:"current_task"`
ArchivedDate string `json:"archived_date"`
Worktree string `json:"worktree"`
}
StateItem represents a single navigatable entry in the Specforce Console.
type StateTree ¶
type StateTree struct {
Categories map[StateCategory][]StateItem `json:"categories"`
}
StateTree represents the full hierarchical state of a Specforce project.
func NewStateTree ¶
func NewStateTree() *StateTree
NewStateTree initializes a new, empty state tree.