Documentation
¶
Overview ¶
Package verify implements `canary verify`: the evidence-backed answer to "are this project's claims true right now?". It reads declarations from the tree, claims from a gap-analysis file, and passing-test evidence from the evidence store, then delegates the verdict to pkg/evidence.Complete — the single completion function. Nothing here decides completeness on its own.
Index ¶
Constants ¶
const ( FormatJSON = "json" FormatText = "text" )
Format values accepted by --format.
const DefaultEvidencePath = ".canary/evidence.json"
DefaultEvidencePath is the evidence store's path relative to the project root.
Variables ¶
var VerifyCmd = &cobra.Command{ Use: "verify [flags]", Short: "Verify claimed requirements against passing-test evidence", Long: `Verify that every requirement claimed in a gap-analysis file has passing evidence recorded at the current commit. Claims are lines like "✅ <REQ-ID>" in the claims file. For each claimed requirement, every feature/aspect it declares in source must have a PASS evidence record for this project at HEAD. Declarations alone (STATUS=TESTED, TEST=...) never verify anything. Exit codes: 0 verified, 1 not verified (or unknowable). Flags: --root <dir> Project root to scan (default ".") --claims <file> Claims file (default "GAP_ANALYSIS.md") --evidence <file> Evidence store (default ".canary/evidence.json") --format json|text Output format (default "json") --project <id> Override the configured project key --allow-empty Treat a claims file with no claims as verified --allow-unknown-external Do not block on unresolvable external dependencies --allow-dirty Accept a working tree that does not match HEAD Examples: canary verify canary verify --format text --claims GAP_ANALYSIS.md`, PersistentPreRunE: func(cmd *cobra.Command, args []string) error { return nil }, RunE: func(cmd *cobra.Command, args []string) error { opts := Options{} opts.Root, _ = cmd.Flags().GetString("root") opts.ClaimsPath, _ = cmd.Flags().GetString("claims") opts.EvidencePath, _ = cmd.Flags().GetString("evidence") opts.Format, _ = cmd.Flags().GetString("format") opts.ProjectID, _ = cmd.Flags().GetString("project") opts.AllowEmpty, _ = cmd.Flags().GetBool("allow-empty") opts.AllowUnknownExternal, _ = cmd.Flags().GetBool("allow-unknown-external") opts.AllowDirty, _ = cmd.Flags().GetBool("allow-dirty") if opts.Format != FormatJSON && opts.Format != FormatText { return fmt.Errorf("unknown --format %q (want %q or %q)", opts.Format, FormatJSON, FormatText) } if code := Run(opts, cmd.OutOrStdout(), cmd.ErrOrStderr()); code != 0 { os.Exit(code) } return nil }, }
CANARY: REQ=CP-236; FEATURE="EvidenceVerify"; ASPECT=CLI; STATUS=TESTED; TEST=TestAuditF01CLI,TestAuditF01CLI_PartialDeclaredTestsUnproven,TestAuditF15CLI,TestAuditF22,TestVerifyRun_EvidenceMissing,TestVerifyRun_Verified,TestVerifyRun_WrongCommitIsNotVerified,TestVerifyRun_TextFormat,TestVerifyRun_ScanIssueIsIncomplete,TestVerifyRun_UndeclaredClaim,TestVerifyRun_MissingClaimsFileIsUnknown,TestVerifyRun_ExternalUnknownBlocks,TestVerifyRun_ProjectOverride,TestVerifyRun_DirtyTreeRefused,TestVerifyRun_AllowDirtyOptsOut,TestVerifyRun_RelativeClaimsResolvesUnderRoot; UPDATED=2026-08-31 VerifyCmd is the `canary verify` command.
Functions ¶
Types ¶
type Options ¶
type Options struct {
Root string
ClaimsPath string
EvidencePath string
Format string
// ProjectID overrides the configured project.key when non-empty.
ProjectID string
AllowEmpty bool
AllowUnknownExternal bool
// AllowDirty accepts a working tree that does not match HEAD. Without
// it, Run refuses with DIRTY_TREE: evidence bound to HEAD cannot answer
// for a tree HEAD no longer describes.
AllowDirty bool
}
Options are the resolved inputs of one verification run.