Documentation
ΒΆ
Index ΒΆ
- Constants
- func CheckStaleness(rep Report, dur time.Duration) error
- func FormatFilesList(fileGroups map[string][]*storage.Token) string
- func FormatGrepResults(tokens []*storage.Token) string
- func FormatGrepResultsByRequirement(tokens []*storage.Token) string
- func FormatTokensTable(tokens []*storage.Token, groupBy string) string
- func GrepTokens(db *storage.DB, pattern string, limit int) ([]*storage.Token, error)
- func GroupTokens(tokens []*storage.Token, groupBy string) map[string][]*storage.Token
- func ParseGAPClaims(path string) (map[string]claim, error)
- func Run(rep Report, out, csv string) error
- func VerifyClaims(rep Report, claims map[string]claim) error
- func WriteCSV(rep Report, path string) error
- type Canary
- type Report
Constants ΒΆ
const CanaryEnd = "END"
const CanaryKey = "CANARY"
const CanaryStart = "START"
const CommentPrefix = "<!--"
const CommentSuffix = "-->"
Variables ΒΆ
This section is empty.
Functions ΒΆ
func CheckStaleness ΒΆ
CheckStaleness delegates to gate.CheckStalenessTokens for consistency.
func FormatFilesList ΒΆ
FormatFilesList converts fileGroups (map[file][]tokens) into a human-readable summary grouped by aspect.
func FormatGrepResults ΒΆ
FormatGrepResults returns human readable list output for grep tokens.
func FormatGrepResultsByRequirement ΒΆ
FormatGrepResultsByRequirement groups grep tokens by requirement.
func FormatTokensTable ΒΆ
FormatTokensTable renders grouped tokens (used by show command).
func GrepTokens ΒΆ
CANARY: REQ=ENG-4323; FEATURE="ContextCaps"; ASPECT=API; STATUS=IMPL; UPDATED=2026-08-28 GrepTokens returns tokens whose feature/file/test/bench/reqID match pattern (case-insensitive substring), bounded by limit (<=0 uses the storage layer's own small default; see storage.DefaultSearchLimit).
NOTE: SearchTokens' SQL already matches keywords, feature, req_id, file_path, test, and bench columns (bounded by LIMIT), so a single bounded call covers every column this function's contract advertises. Previously this loaded the entire token table via db.ListTokens(nil, "", "", 0) to catch file/test/bench matches that the old (narrower) SearchTokens couldn't produce; that full-table union is no longer needed now that SearchTokens covers those columns itself.
func GroupTokens ΒΆ
GroupTokens groups tokens by aspect/status (default aspect).
func ParseGAPClaims ΒΆ
func Run ΒΆ
Run executes a scan and writes JSON/CSV outputs. Caller supplies already-built report. This separates CLI main from library logic.
func VerifyClaims ΒΆ
Types ΒΆ
Directories
ΒΆ
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
canary
command
CANARY: REQ=CBIN-CLI-104; FEATURE="CanaryCLI"; ASPECT=CLI; STATUS=IMPL; OWNER=canary; UPDATED=2025-10-16
|
CANARY: REQ=CBIN-CLI-104; FEATURE="CanaryCLI"; ASPECT=CLI; STATUS=IMPL; OWNER=canary; UPDATED=2025-10-16 |
|
pkg
|
|
|
canaryscan
CANARY: REQ=CP-268; FEATURE="MermaidRefs"; ASPECT=Engine; STATUS=TESTED; TEST=TestCANARY_CBIN_202_ExtractDiagramRefs; UPDATED=2026-08-28
|
CANARY: REQ=CP-268; FEATURE="MermaidRefs"; ASPECT=Engine; STATUS=TESTED; TEST=TestCANARY_CBIN_202_ExtractDiagramRefs; UPDATED=2026-08-28 |
|
cmds/drift
Package drift wires the pkg/drift engine into `canary drift`: a fresh scan (matching `canary scan`'s own default-skip + .canaryignore behavior), drift detection, and a bounded, agent-friendly report.
|
Package drift wires the pkg/drift engine into `canary drift`: a fresh scan (matching `canary scan`'s own default-skip + .canaryignore behavior), drift detection, and a bounded, agent-friendly report. |
|
cmds/gap
CANARY: REQ=ENG-4317; FEATURE="GapCLI"; ASPECT=CLI; STATUS=IMPL; UPDATED=2025-10-17
|
CANARY: REQ=ENG-4317; FEATURE="GapCLI"; ASPECT=CLI; STATUS=IMPL; UPDATED=2025-10-17 |
|
cmds/implement
CANARY: REQ=CP-253; FEATURE="RequirementLookup"; ASPECT=API; STATUS=TESTED; UPDATED=2026-08-29
|
CANARY: REQ=CP-253; FEATURE="RequirementLookup"; ASPECT=API; STATUS=TESTED; UPDATED=2026-08-29 |
|
cmds/next
CANARY: REQ=CP-252; FEATURE="NextPriorityCommand"; ASPECT=CLI; STATUS=BENCHED; TEST=TestCANARY_CBIN_132_CLI_NextPrioritySelection; BENCH=BenchmarkCANARY_CBIN_132_CLI_PriorityQuery; OWNER=canary; UPDATED=2026-08-29
|
CANARY: REQ=CP-252; FEATURE="NextPriorityCommand"; ASPECT=CLI; STATUS=BENCHED; TEST=TestCANARY_CBIN_132_CLI_NextPrioritySelection; BENCH=BenchmarkCANARY_CBIN_132_CLI_PriorityQuery; OWNER=canary; UPDATED=2026-08-29 |
|
cmds/onboard
Package onboard analyzes a codebase that has few or no CANARY tokens and produces the agent hand-off needed to begin adoption: a language histogram, top-level directory layout, best-effort entry-point detection, any existing CANARY tokens, pre-seeded CANARY:MIGRATE guidance, the configured requirement-ID sources, the next available flatfile ID, and a next_steps checklist.
|
Package onboard analyzes a codebase that has few or no CANARY tokens and produces the agent hand-off needed to begin adoption: a language histogram, top-level directory layout, best-effort entry-point detection, any existing CANARY tokens, pre-seeded CANARY:MIGRATE guidance, the configured requirement-ID sources, the next available flatfile ID, and a next_steps checklist. |
|
cmds/project
CANARY: REQ=ENG-4319; FEATURE="ProjectCLI"; ASPECT=CLI; STATUS=IMPL; UPDATED=2025-10-18
|
CANARY: REQ=ENG-4319; FEATURE="ProjectCLI"; ASPECT=CLI; STATUS=IMPL; UPDATED=2025-10-18 |
|
cmds/specify
CANARY: REQ=ENG-4314; FEATURE="SpecModification"; ASPECT=CLI; STATUS=IMPL; DOC=user:docs/user/spec-modification-guide.md; DOC_HASH=676eb2a18c9d002a; UPDATED=2025-10-17
|
CANARY: REQ=ENG-4314; FEATURE="SpecModification"; ASPECT=CLI; STATUS=IMPL; DOC=user:docs/user/spec-modification-guide.md; DOC_HASH=676eb2a18c9d002a; UPDATED=2025-10-17 |
|
cmds/ticket
Package ticket wires pkg/ticket into `canary ticket sync`: computing a codified ticket-source synchronization plan from indexed tokens and the configured `sources:` registry, and β only when JIRA credentials are present and --apply is set β applying it via the JIRA REST client and writing a completed plan plus a remap map for `canary upgrade --map`.
|
Package ticket wires pkg/ticket into `canary ticket sync`: computing a codified ticket-source synchronization plan from indexed tokens and the configured `sources:` registry, and β only when JIRA credentials are present and --apply is set β applying it via the JIRA REST client and writing a completed plan plus a remap map for `canary upgrade --map`. |
|
cmds/upgrade
Package upgrade wires the pkg/upgrade legacy-token rewriter into the CLI.
|
Package upgrade wires the pkg/upgrade legacy-token rewriter into the CLI. |
|
cmds/view
Package view aggregates everything known about one requirement β tokens, files, tests, dependencies, spec/plan, diagrams, ticket link β into one bounded, agent-friendly answer.
|
Package view aggregates everything known about one requirement β tokens, files, tests, dependencies, spec/plan, diagrams, ticket link β into one bounded, agent-friendly answer. |
|
config
CANARY: REQ=ENG-4317; FEATURE="ProjectConfig"; ASPECT=Storage; STATUS=IMPL; UPDATED=2025-10-16
|
CANARY: REQ=ENG-4317; FEATURE="ProjectConfig"; ASPECT=Storage; STATUS=IMPL; UPDATED=2025-10-16 |
|
drift
Package drift detects mismatches between what a CANARY token claims and what the repository actually shows: code committed after a token's UPDATED date (code-drift), tokens that have aged past the staleness window (stale), and β when a CANARY index database is present β documentation that has fallen out of sync with its source (doc-drift).
|
Package drift detects mismatches between what a CANARY token claims and what the repository actually shows: code committed after a token's UPDATED date (code-drift), tokens that have aged past the staleness window (stale), and β when a CANARY index database is present β documentation that has fallen out of sync with its source (doc-drift). |
|
external
Package external resolves whether a CANARY requirement ID is satisfied as an external dependency β one owned by a ticket-source (e.g.
|
Package external resolves whether a CANARY requirement ID is satisfied as an external dependency β one owned by a ticket-source (e.g. |
|
gap
CANARY: REQ=ENG-4317; FEATURE="GapService"; ASPECT=Engine; STATUS=IMPL; UPDATED=2025-10-17
|
CANARY: REQ=ENG-4317; FEATURE="GapService"; ASPECT=Engine; STATUS=IMPL; UPDATED=2025-10-17 |
|
matcher
CANARY: REQ=CP-253; FEATURE="FuzzyMatcher"; ASPECT=Engine; STATUS=TESTED; TEST=TestCANARY_CBIN_133_Engine_Levenshtein; OWNER=canary; UPDATED=2026-08-29
|
CANARY: REQ=CP-253; FEATURE="FuzzyMatcher"; ASPECT=Engine; STATUS=TESTED; TEST=TestCANARY_CBIN_133_Engine_Levenshtein; OWNER=canary; UPDATED=2026-08-29 |
|
migrate
CANARY: REQ=ENG-4313; FEATURE="MigrateFrom"; ASPECT=CLI; STATUS=IMPL; OWNER=canary; UPDATED=2025-10-16
|
CANARY: REQ=ENG-4313; FEATURE="MigrateFrom"; ASPECT=CLI; STATUS=IMPL; OWNER=canary; UPDATED=2025-10-16 |
|
reqid
CANARY: REQ=ENG-4316; FEATURE="AspectIDGenerator"; ASPECT=Engine; STATUS=IMPL; UPDATED=2025-10-16
|
CANARY: REQ=ENG-4316; FEATURE="AspectIDGenerator"; ASPECT=Engine; STATUS=IMPL; UPDATED=2025-10-16 |
|
sources
Package sources resolves requirement-ID prefixes to their origin: a local flatfile series (e.g.
|
Package sources resolves requirement-ID prefixes to their origin: a local flatfile series (e.g. |
|
specs
CANARY: REQ=ENG-4314; FEATURE="ExactIDLookup"; ASPECT=Engine; STATUS=IMPL; UPDATED=2025-10-16
|
CANARY: REQ=ENG-4314; FEATURE="ExactIDLookup"; ASPECT=Engine; STATUS=IMPL; UPDATED=2025-10-16 |
|
storage
CANARY: REQ=ENG-4319; FEATURE="ContextManagement"; ASPECT=Engine; STATUS=IMPL; UPDATED=2025-10-18
|
CANARY: REQ=ENG-4319; FEATURE="ContextManagement"; ASPECT=Engine; STATUS=IMPL; UPDATED=2025-10-18 |
|
storage/testutil
CANARY: REQ=ENG-4319; FEATURE="TestInfrastructure"; ASPECT=Storage; STATUS=IMPL; UPDATED=2025-10-18
|
CANARY: REQ=ENG-4319; FEATURE="TestInfrastructure"; ASPECT=Storage; STATUS=IMPL; UPDATED=2025-10-18 |
|
ticket
Package ticket computes and applies ticket-source synchronization plans: comparing a requirement's rollup CANARY status against its owning non-flatfile source's remote status (proposing "transition" actions), and codifying flatfile-to-ticket promotion as paired "create_issue" + "remap" actions.
|
Package ticket computes and applies ticket-source synchronization plans: comparing a requirement's rollup CANARY status against its owning non-flatfile source's remote status (proposing "transition" actions), and codifying flatfile-to-ticket promotion as paired "create_issue" + "remap" actions. |
|
upgrade
Package upgrade rewrites legacy on-disk CANARY token shapes into the current parseable form: markdown `# CANARY:` headings into HTML comments, unicode hyphens inside IDs into ASCII hyphens, unpadded flatfile IDs into zero-padded IDs, bare legacy ID segments into keyed REQ= tokens, bug tokens missing FEATURE= into scan-parseable single lines, STATUS=FIXED into STATUS=REMOVED, missing UPDATED= into stamped tokens, the old multi-line bug-create continuation shape into one line, and (when an ID map is supplied) old requirement IDs into new ones across both CANARY tokens and GAP_ANALYSIS.md "β
<ID>" claim lines.
|
Package upgrade rewrites legacy on-disk CANARY token shapes into the current parseable form: markdown `# CANARY:` headings into HTML comments, unicode hyphens inside IDs into ASCII hyphens, unpadded flatfile IDs into zero-padded IDs, bare legacy ID segments into keyed REQ= tokens, bug tokens missing FEATURE= into scan-parseable single lines, STATUS=FIXED into STATUS=REMOVED, missing UPDATED= into stamped tokens, the old multi-line bug-create continuation shape into one line, and (when an ID map is supplied) old requirement IDs into new ones across both CANARY tokens and GAP_ANALYSIS.md "β <ID>" claim lines. |
|
tools
|
|
|
canary
command
|