{"record":{"id":"12914a7ad2071a7d","repo":"gastownhall/beads","slug":"invalid-priority-s","errorCode":null,"errorMessage":"invalid priority: %s","messagePattern":"invalid priority: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/query/evaluator.go","lineNumber":753,"sourceCode":"\t}\n}\n\nfunc (e *Evaluator) buildStatusPredicate(comp *ComparisonNode) (func(*types.Issue) bool, error) {\n\tstatus := types.Status(strings.ToLower(comp.Value))\n\tswitch comp.Op {\n\tcase OpEquals:\n\t\treturn func(i *types.Issue) bool { return i.Status == status }, nil\n\tcase OpNotEquals:\n\t\treturn func(i *types.Issue) bool { return i.Status != status }, nil\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"status does not support %s operator\", comp.Op.String())\n\t}\n}\n\nfunc (e *Evaluator) buildPriorityPredicate(comp *ComparisonNode) (func(*types.Issue) bool, error) {\n\tpriority, err := strconv.Atoi(comp.Value)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"invalid priority: %s\", comp.Value)\n\t}\n\tswitch comp.Op {\n\tcase OpEquals:\n\t\treturn func(i *types.Issue) bool { return i.Priority == priority }, nil\n\tcase OpNotEquals:\n\t\treturn func(i *types.Issue) bool { return i.Priority != priority }, nil\n\tcase OpLess:\n\t\treturn func(i *types.Issue) bool { return i.Priority < priority }, nil\n\tcase OpLessEq:\n\t\treturn func(i *types.Issue) bool { return i.Priority <= priority }, nil\n\tcase OpGreater:\n\t\treturn func(i *types.Issue) bool { return i.Priority > priority }, nil\n\tcase OpGreaterEq:\n\t\treturn func(i *types.Issue) bool { return i.Priority >= priority }, nil\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unexpected operator: %s\", comp.Op.String())\n\t}\n}","sourceCodeStart":735,"sourceCodeEnd":771,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/query/evaluator.go#L735-L771","documentation":"Priority filters require an integer value. buildPriorityPredicate calls strconv.Atoi on the comparison value before applying the operator; a non-numeric value fails conversion and produces this error. Note priority in bd is a plain integer, not the P0-P4 label.","triggerScenarios":"A query filter like `priority = P1`, `priority > high`, or `priority = \"\"` — any comparison whose value cannot parse as an int.","commonSituations":"Typing the priority label (P1, high) instead of the numeric value; extra whitespace or quotes left in the query; confusion after a schema change from string priorities to integers.","solutions":["Use the bare integer in the filter, e.g. `priority = 1` or `priority <= 2`.","Strip stray quotes, spaces, or P prefixes from the value.","Check the issue's actual priority with `bd show <id>` to confirm the numeric form."],"exampleFix":"// before\nbd list --query \"priority = P1\"\n// after\nbd list --query \"priority = 1\"","handlingStrategy":"validation","validationCode":"// Go: ensure priority values are integers before querying\nif _, err := strconv.Atoi(value); err != nil {\n    return fmt.Errorf(\"priority must be a number, got %q\", value)\n}","typeGuard":null,"tryCatchPattern":"// Go\npred, err := e.buildComparisonPredicate(node)\nif err != nil {\n    return fmt.Errorf(\"filter %q rejected: %w\", node.String(), err)\n}","preventionTips":["Always pass priorities as bare integers (1, not P1 or high).","Trim whitespace and quotes from values interpolated into queries.","Map label-to-number in UI/CLI layers before building the filter."],"tags":["query-language","type-conversion","priority"],"backgroundTag":"invalid-numeric-value","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}