{"record":{"id":"49a3ed019eeb56fd","repo":"gastownhall/beads","slug":"unexpected-operator-s","errorCode":null,"errorMessage":"unexpected operator: %s","messagePattern":"unexpected operator: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/query/evaluator.go","lineNumber":769,"sourceCode":"\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}\n\nfunc (e *Evaluator) buildTypePredicate(comp *ComparisonNode) (func(*types.Issue) bool, error) {\n\tissueType := types.IssueType(strings.ToLower(comp.Value))\n\tswitch comp.Op {\n\tcase OpEquals:\n\t\treturn func(i *types.Issue) bool { return i.IssueType == issueType }, nil\n\tcase OpNotEquals:\n\t\treturn func(i *types.Issue) bool { return i.IssueType != issueType }, nil\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"type does not support %s operator\", comp.Op.String())\n\t}\n}\n\nfunc (e *Evaluator) buildAssigneePredicate(comp *ComparisonNode) (func(*types.Issue) bool, error) {\n\tvalue := comp.Value\n\tisNone := value == \"\" || strings.ToLower(value) == \"none\" || strings.ToLower(value) == \"null\"","sourceCodeStart":751,"sourceCodeEnd":787,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/query/evaluator.go#L751-L787","documentation":"After successfully parsing the priority value, buildPriorityPredicate switches on the operator. Equality, inequality, and all four ordering operators are supported; anything else reaches the default case and returns this error. Practically this means the operator token was not recognized by the parser or is invalid for this field.","triggerScenarios":"A priority comparison with a malformed or non-comparison operator token, e.g. `priority 1`, or a custom/internal operator string that Op.String() renders but the priority switch does not handle.","commonSituations":"Missing the operator entirely in hand-written queries; using a symbol from another query dialect (e.g. `:`, `=~`); programmatic construction of ComparisonNode with an operator not in the standard set.","solutions":["Use a supported operator: =, !=, <, <=, >, >=.","Verify there is exactly one operator between field and value (`priority = 1`, not `priority 1`).","If building queries programmatically, only pass the defined Op constants."],"exampleFix":"// before\nbd list --query \"priority : 1\"\n// after\nbd list --query \"priority = 1\"","handlingStrategy":"validation","validationCode":"// Go: whitelist operators accepted for priority\nvar priorityOps = map[query.Op]bool{\n    query.OpEquals: true, query.OpNotEquals: true,\n    query.OpLess: true, query.OpLessEq: true,\n    query.OpGreater: true, query.OpGreaterEq: true,\n}\nif !priorityOps[comp.Op] { return fmt.Errorf(\"unsupported priority operator %s\", comp.Op) }","typeGuard":null,"tryCatchPattern":"// Go\npred, err := e.buildComparisonPredicate(node)\nif err != nil {\n    return fmt.Errorf(\"invalid filter %q: %w\", node.String(), err)\n}","preventionTips":["Use only the six standard comparison operators with priority.","Never construct ComparisonNode values with ad-hoc operator strings.","Parse user queries with the official parser instead of string assembly."],"tags":["query-language","unsupported-operator","priority"],"backgroundTag":"query-unsupported-operator","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}