{"record":{"id":"afdfc66914b8d81f","repo":"gastownhall/beads","slug":"invalid-status-s","errorCode":null,"errorMessage":"invalid status: %s","messagePattern":"invalid status: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/query/evaluator.go","lineNumber":215,"sourceCode":"\tcase \"mol_type\":\n\t\treturn e.applyMolTypeFilter(comp, filter)\n\tcase \"has_metadata_key\":\n\t\treturn e.applyHasMetadataKeyFilter(comp, filter)\n\tdefault:\n\t\tif strings.HasPrefix(comp.Field, \"metadata.\") {\n\t\t\treturn e.applyMetadataFilter(comp, filter)\n\t\t}\n\t\treturn fmt.Errorf(\"unknown field: %s\", comp.Field)\n\t}\n}\n\nfunc (e *Evaluator) applyStatusFilter(comp *ComparisonNode, filter *types.IssueFilter) error {\n\tif comp.Op != OpEquals && comp.Op != OpNotEquals {\n\t\treturn fmt.Errorf(\"status only supports = and != operators\")\n\t}\n\tstatus := types.Status(strings.ToLower(comp.Value))\n\tif !status.IsValid() {\n\t\treturn fmt.Errorf(\"invalid status: %s\", comp.Value)\n\t}\n\tif comp.Op == OpEquals {\n\t\tfilter.Status = &status\n\t} else {\n\t\tfilter.ExcludeStatus = append(filter.ExcludeStatus, status)\n\t}\n\treturn nil\n}\n\nfunc (e *Evaluator) applyPriorityFilter(comp *ComparisonNode, filter *types.IssueFilter) error {\n\tpriority, err := strconv.Atoi(comp.Value)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"invalid priority value: %s\", comp.Value)\n\t}\n\tif priority < 0 || priority > 4 {\n\t\treturn fmt.Errorf(\"priority must be between 0 and 4\")\n\t}\n","sourceCodeStart":197,"sourceCodeEnd":233,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/query/evaluator.go#L197-L233","documentation":"After checking the operator, applyStatusFilter lowercases the value and validates it via types.Status.IsValid(), which only accepts the built-in statuses: open, in_progress, blocked, deferred, closed, pinned, hooked (types.AllStatuses in internal/types/types.go:521). Any other string — including custom statuses registered via config — is rejected with this error. Note the query path uses the strict built-in-only check, unlike the transaction layer which accepts custom statuses.","triggerScenarios":"Queries like `status = In-Progress`, `status = done`, `status = wip`, `status = \"\"`, or using a custom status name defined with `bd config set status.custom ...` — all fail IsValid() and raise this error.","commonSituations":"Using Jira/GitHub vocabulary (done, wip, review) instead of beads' enum; misremembering \"in progress\" as \"in_progress\" vs \"in-progress\"; expecting custom statuses to work in queries when the evaluator only accepts built-ins; trailing whitespace or capitalization differences (only case is normalized, not hyphens/underscores).","solutions":["Use one of the exact built-in statuses (case-insensitive): open, in_progress, blocked, deferred, closed, pinned, hooked.","If using a custom status, do not query by `status =` — filter on another field or extend the code to use IsValidWithCustom and thread the custom statuses into the evaluator.","Trim whitespace and normalize hyphens to underscores before parsing user input into a query string.","Check `bd schema` for the authoritative status enum."],"exampleFix":"// before\n\"status = done\"\n// after\n\"status = closed\"\n// before\n\"status = in-progress\"\n// after\n\"status = in_progress\"","handlingStrategy":"validation","validationCode":"var validStatuses = []string{\"open\", \"in_progress\", \"blocked\", \"deferred\", \"closed\", \"pinned\", \"hooked\"}\nfunc isValidStatus(s string) bool {\n    n := strings.ToLower(strings.TrimSpace(strings.ReplaceAll(s, \"-\", \"_\")))\n    return slices.Contains(validStatuses, n)\n}","typeGuard":"func toStatus(v string) (types.Status, bool) {\n    s := types.Status(strings.ToLower(strings.TrimSpace(v)))\n    return s, s.IsValid()\n}","tryCatchPattern":"if err := e.applyComparison(comp, filter); err != nil {\n    if strings.HasPrefix(err.Error(), \"invalid status:\") {\n        return fmt.Errorf(\"%w (valid: open, in_progress, blocked, deferred, closed, pinned, hooked)\", err)\n    }\n    return err\n}","preventionTips":["Validate status values against types.AllStatuses before interpolation into queries.","Normalize hyphens/spaces to underscores and lowercase user input.","Do not assume custom statuses are queryable — the evaluator uses the strict built-in-only IsValid check.","Surface the valid enum in CLI help/messages next to the input."],"tags":["query","status","validation","beads"],"backgroundTag":"invalid-enum-value","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}