Documentation
¶
Index ¶
- Constants
- func FindProjectRoot() (string, error)
- func FindProjectRootFrom(dir string) (string, error)
- func HasYAMLMetadata(projectRoot string) bool
- func Save(metadata *ProjectMetadata, path string) error
- func SaveToProject(metadata *ProjectMetadata, projectRoot string) error
- func ValidateArtifactPath(path string) error
- func ValidateCommitSHA(sha string) error
- func ValidateGitURL(url string) error
- func ValidateProjectName(name string) error
- func ValidateShortCode(code string) error
- type Dependency
- type FrameworkChoice
- type FrameworkInfo
- type PlaybookInfo
- type ProjectInfo
- type ProjectMetadata
- type TaskTrackerChoice
- type TaskTrackerInfo
- type ToolCategory
- type ToolStatus
Constants ¶
const ( // MetadataVersion is the current schema version MetadataVersion = "1.0.0" // DefaultMetadataFile is the default filename for project metadata DefaultMetadataFile = "specledger/specledger.yaml" )
Variables ¶
This section is empty.
Functions ¶
func FindProjectRoot ¶ added in v1.0.62
FindProjectRoot walks from the current working directory upward to find the nearest directory containing specledger/specledger.yaml.
func FindProjectRootFrom ¶ added in v1.0.62
FindProjectRootFrom walks from the given directory upward to find the nearest directory containing specledger/specledger.yaml.
func HasYAMLMetadata ¶
HasYAMLMetadata checks if a project has the new YAML metadata file
func Save ¶
func Save(metadata *ProjectMetadata, path string) error
Save writes ProjectMetadata to a YAML file
func SaveToProject ¶
func SaveToProject(metadata *ProjectMetadata, projectRoot string) error
SaveToProject saves metadata to a project directory It writes to specledger/specledger.yaml relative to projectRoot
func ValidateArtifactPath ¶ added in v1.0.6
ValidateArtifactPath validates artifact path format (relative, no parent directory references)
func ValidateCommitSHA ¶
ValidateCommitSHA validates commit SHA format (40-character hex)
func ValidateGitURL ¶
ValidateGitURL validates git URL format (SSH, HTTPS, or local path)
func ValidateProjectName ¶
ValidateProjectName validates project name format
func ValidateShortCode ¶
ValidateShortCode validates short code format
Types ¶
type Dependency ¶
type Dependency struct {
URL string `yaml:"url"`
Branch string `yaml:"branch,omitempty"`
Alias string `yaml:"alias,omitempty"`
ArtifactPath string `yaml:"artifact_path,omitempty"` // Path to artifacts within dependency repo
ResolvedCommit string `yaml:"resolved_commit,omitempty"`
Framework FrameworkChoice `yaml:"framework,omitempty"` // speckit, openspec, both, none
ImportPath string `yaml:"import_path,omitempty"` // @alias/spec format for AI imports
}
Dependency represents an external spec dependency
type FrameworkChoice ¶
type FrameworkChoice string
FrameworkChoice is an enum (deprecated)
const ( FrameworkSpecKit FrameworkChoice = "speckit" FrameworkOpenSpec FrameworkChoice = "openspec" FrameworkBoth FrameworkChoice = "both" FrameworkNone FrameworkChoice = "none" )
type FrameworkInfo ¶
type FrameworkInfo struct {
Choice FrameworkChoice `yaml:"choice"`
InstalledAt *time.Time `yaml:"installed_at,omitempty"`
}
FrameworkInfo records SDD framework choice (deprecated, kept for migration compatibility)
type PlaybookInfo ¶
type PlaybookInfo struct {
Name string `yaml:"name"` // Name of the playbook (e.g., "specledger")
Version string `yaml:"version"` // Version of the playbook that was applied
AppliedAt *time.Time `yaml:"applied_at,omitempty"` // When the playbook was applied
Structure []string `yaml:"structure,omitempty"` // Folder structure created by the playbook
}
PlaybookInfo records the playbook applied to this project
type ProjectInfo ¶
type ProjectInfo struct {
ID string `yaml:"id,omitempty"` // Supabase project UUID (for session capture)
Name string `yaml:"name"`
ShortCode string `yaml:"short_code"`
Created time.Time `yaml:"created"`
Modified time.Time `yaml:"modified"`
Version string `yaml:"version"`
}
ProjectInfo contains project identification
type ProjectMetadata ¶
type ProjectMetadata struct {
Version string `yaml:"version"`
Project ProjectInfo `yaml:"project"`
Playbook PlaybookInfo `yaml:"playbook"`
TemplateVersion string `yaml:"template_version"`
TaskTracker TaskTrackerInfo `yaml:"task_tracker,omitempty"`
ArtifactPath string `yaml:"artifact_path,omitempty"`
Dependencies []Dependency `yaml:"dependencies,omitempty"`
Agent *config.AgentConfig `yaml:"agent,omitempty"`
Profiles map[string]*config.AgentConfig `yaml:"profiles,omitempty"`
ActiveProfile string `yaml:"active-profile,omitempty"`
// BranchAliases maps non-standard branch names to spec feature names (FR-012)
BranchAliases map[string]string `yaml:"branch_aliases,omitempty"`
}
ProjectMetadata represents specledger.yaml
func Load ¶
func Load(path string) (*ProjectMetadata, error)
Load reads and parses a specledger.yaml file
func LoadFromProject ¶
func LoadFromProject(projectRoot string) (*ProjectMetadata, error)
LoadFromProject loads metadata from a project directory It looks for specledger/specledger.yaml relative to projectRoot
func NewProjectMetadata ¶
func NewProjectMetadata(name, shortCode string, playbookName string, playbookVersion string, playbookStructure []string, templateVersion string) *ProjectMetadata
NewProjectMetadata creates a new ProjectMetadata with default values
func (*ProjectMetadata) GetArtifactPath ¶ added in v1.0.6
func (m *ProjectMetadata) GetArtifactPath() string
GetArtifactPath returns the artifact path, with default fallback
func (*ProjectMetadata) Validate ¶
func (m *ProjectMetadata) Validate() error
Validate validates the entire ProjectMetadata structure
type TaskTrackerChoice ¶
type TaskTrackerChoice string
TaskTrackerChoice is an enum for task/issue tracking systems
const ( TaskTrackerBuiltin TaskTrackerChoice = "builtin" // Built-in sl issue tracking TaskTrackerBeads TaskTrackerChoice = "beads" // Deprecated: use builtin TaskTrackerNone TaskTrackerChoice = "none" )
type TaskTrackerInfo ¶
type TaskTrackerInfo struct {
Choice TaskTrackerChoice `yaml:"choice"`
EnabledAt *time.Time `yaml:"enabled_at,omitempty"`
}
TaskTrackerInfo records task/issue tracker choice
type ToolCategory ¶
type ToolCategory string
ToolCategory is an enum
const ( ToolCategoryCore ToolCategory = "core" ToolCategoryFramework ToolCategory = "framework" )
type ToolStatus ¶
type ToolStatus struct {
Name string
Installed bool
Version string
Path string
Category ToolCategory
}
ToolStatus represents runtime tool detection (not persisted)