Documentation
¶
Overview ¶
CANARY: REQ=ENG-4316; FEATURE="AspectIDGenerator"; ASPECT=Engine; STATUS=IMPL; UPDATED=2025-10-16
CANARY: REQ=ENG-4316; FEATURE="AspectIDParser"; ASPECT=Engine; STATUS=IMPL; UPDATED=2025-10-16
CANARY: REQ=REQ-151; FEATURE="FixedPrefixes"; ASPECT=Engine; STATUS=IMPL; UPDATED=2025-11-01
CANARY: REQ=ENG-4316; FEATURE="AspectValidator"; ASPECT=Engine; STATUS=IMPL; UPDATED=2025-10-16
Index ¶
- Constants
- Variables
- func GenerateNextID(key, aspect string) (string, error)
- func GenerateNextIDIn(root, key, aspect string) (string, error)
- func GenerateNextIDInContext(ctx context.Context, root, key, aspect string) (string, error)
- func NormalizeAspect(input string) string
- func SuggestAspect(typo string) string
- func ValidateAspect(aspect string) error
- type ID
- type IDType
- type RequirementID
Constants ¶
const MaxSpecEntries = 10000
MaxSpecEntries bounds ID discovery, including unrelated entries. A suggested ID is not a reservation; callers still own concurrent creation coordination.
Variables ¶
var ErrSpecEntryLimit = errors.New("requirement ID discovery entry limit exceeded")
Functions ¶
func GenerateNextID ¶
GenerateNextID generates the next requirement ID for a given aspect using the cwd-relative .canary/specs directory.
func GenerateNextIDIn ¶ added in v0.3.0
GenerateNextIDIn generates the next requirement ID for a given aspect within a specific root directory. The root parameter is used to locate .canary/specs; for cwd-relative behavior, pass ".".
func GenerateNextIDInContext ¶ added in v0.3.9
GenerateNextIDInContext discovers IDs only inside root, reading directories in bounded batches and checking cancellation between filesystem operations. Cancellation cannot interrupt a blocked kernel filesystem call.
func NormalizeAspect ¶
NormalizeAspect normalizes aspect casing to the canonical form
func SuggestAspect ¶
SuggestAspect returns fuzzy match suggestions for invalid aspects
func ValidateAspect ¶
ValidateAspect checks if the given aspect is valid Accepts: exact canonical form, all-lowercase, or all-uppercase Rejects: partial capitalizations (e.g., "Frontend" when it should be "FrontEnd")
Types ¶
type ID ¶
type ID struct {
Type IDType // REQ, TASK, or BUG
Number int // Numeric identifier (e.g., 123)
// Relationships
ParentID string // For TASK/BUG: the REQ or TASK this relates to (optional)
}
ID represents a parsed identifier (REQ, TASK, or BUG)
type RequirementID ¶
type RequirementID struct {
Key string // e.g., "CBIN"
Aspect string // e.g., "CLI", "API" (empty for v1 format)
ID string // e.g., "001", "042"
Format string // "v1" (CBIN-XXX) or "v2" (CBIN-SECURITY_REVIEW-XXX)
}
RequirementID represents a parsed requirement identifier
func ParseRequirementID ¶
func ParseRequirementID(reqID string) (*RequirementID, error)
ParseRequirementID parses a requirement ID string into its components
func (*RequirementID) String ¶
func (r *RequirementID) String() string
String returns the string representation of the RequirementID