Documentation
¶
Overview ¶
Package sources resolves requirement-ID prefixes to their origin: a local flatfile series (e.g. CBIN-105) or an external ticket system (JIRA, GitLab, GitHub) configured in .canary/project.yaml under `sources:`. CANARY: REQ=CP-267; FEATURE="TicketSources"; ASPECT=Engine; STATUS=TESTED; TEST=TestCANARY_CBIN_201_RegistryPattern; UPDATED=2026-08-28
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry answers ID-shaped questions for a set of sources.
func Default ¶
func Default() *Registry
Default returns the registry used when no sources are configured: the historical CBIN flatfile series.
func FromProjectConfig ¶
func FromProjectConfig(cfg *config.ProjectConfig) *Registry
FromProjectConfig builds a registry from a parsed project config. When the config declares no sources, a flatfile source is synthesized from project.key; if the key is empty or invalid, falls back to Default() (CBIN).
func LoadFromRoot ¶
LoadFromRoot reads .canary/project.yaml under root. Any error falls back to Default() — sources config must never break a scan.
func NewRegistry ¶
NewRegistry validates the sources and builds the combined ID pattern.
func (*Registry) ClaimPattern ¶
ClaimPattern matches "✅ <ID>" gap-analysis claim lines (ID in group 1).
func (*Registry) Normalize ¶
Normalize zero-pads flatfile IDs to at least 3 digits (CBIN-42 → CBIN-042). External ticket IDs and unknown prefixes are returned verbatim.
type Source ¶
type Source struct {
Name string
Type string // flatfile | jira | github | gitlab
Key string // uppercase ID prefix, e.g. "CBIN", "PLAT"
URL string // optional template; {id} = full ID, {num} = numeric part
// API is the ticket system's REST base URL, used by `canary ticket
// sync` when set (falls back to its own defaults, e.g. env vars,
// otherwise). Empty for flatfile sources.
API string
// StatusMap overrides the default CANARY-status -> remote-status-name
// mapping (STUB/IMPL/TESTED/BENCHED keys) for this source only.
StatusMap map[string]string
}
Source is one configured requirement-ID origin.