{"record":{"id":"e3dd9c64b4d21b38","repo":"gastownhall/beads","slug":"id-does-not-support-s-operator","errorCode":null,"errorMessage":"id does not support %s operator","messagePattern":"id does not support (.+?) operator","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/query/evaluator.go","lineNumber":996,"sourceCode":"\thasWildcard := strings.HasSuffix(value, \"*\")\n\tif hasWildcard {\n\t\tprefix := strings.TrimSuffix(value, \"*\")\n\t\tswitch comp.Op {\n\t\tcase OpEquals:\n\t\t\treturn func(i *types.Issue) bool { return strings.HasPrefix(i.ID, prefix) }, nil\n\t\tcase OpNotEquals:\n\t\t\treturn func(i *types.Issue) bool { return !strings.HasPrefix(i.ID, prefix) }, nil\n\t\tdefault:\n\t\t\treturn nil, fmt.Errorf(\"id with wildcard only supports = and != operators\")\n\t\t}\n\t}\n\tswitch comp.Op {\n\tcase OpEquals:\n\t\treturn func(i *types.Issue) bool { return i.ID == value }, nil\n\tcase OpNotEquals:\n\t\treturn func(i *types.Issue) bool { return i.ID != value }, nil\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"id does not support %s operator\", comp.Op.String())\n\t}\n}\n\nfunc (e *Evaluator) buildSpecPredicate(comp *ComparisonNode) (func(*types.Issue) bool, error) {\n\tvalue := comp.Value\n\thasWildcard := strings.HasSuffix(value, \"*\")\n\tif hasWildcard {\n\t\tprefix := strings.TrimSuffix(value, \"*\")\n\t\tswitch comp.Op {\n\t\tcase OpEquals:\n\t\t\treturn func(i *types.Issue) bool { return strings.HasPrefix(i.SpecID, prefix) }, nil\n\t\tcase OpNotEquals:\n\t\t\treturn func(i *types.Issue) bool { return !strings.HasPrefix(i.SpecID, prefix) }, nil\n\t\tdefault:\n\t\t\treturn nil, fmt.Errorf(\"spec with wildcard only supports = and != operators\")\n\t\t}\n\t}\n\tswitch comp.Op {","sourceCodeStart":978,"sourceCodeEnd":1014,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/query/evaluator.go#L978-L1014","documentation":"The id field only supports the = and != operators. buildIDPredicate returns this error when a non-wildcard id value is compared with any other operator (>, <, >=, <=, contains, etc.), since ids have no meaningful ordering in this query language.","triggerScenarios":"A query like `id > bd-123` or `id < bd-999` — a plain id value paired with an ordering operator.","commonSituations":"Template-driven query generation applying the same operators to every field; users expecting lexicographic id ranges to work; migration from another issue tracker whose query syntax allows id ranges.","solutions":["Use exact match: id = bd-123, or exclusion: id != bd-123.","For multiple ids, OR exact equality clauses: id = bd-1 OR id = bd-2.","Use a prefix wildcard for a family of ids: id = bd-1* (with = only).","Fix query-builder templates to restrict id comparisons to = and !=."],"exampleFix":"// before\nbd list --query \"id > bd-100\"\n// after\nbd list --query \"id = bd-100*\"   // or exact: id = bd-123","handlingStrategy":"validation","validationCode":"func checkIDOperator(op Operator) error {\n\tif op != OpEquals && op != OpNotEquals {\n\t\treturn fmt.Errorf(\"id supports only = and !=, got %s\", op)\n\t}\n\treturn nil\n}","typeGuard":"func isIDEqualityQuery(op Operator) bool { return op == OpEquals || op == OpNotEquals }","tryCatchPattern":"if err := checkIDOperator(op); err != nil { return err } // before building the query\n// or at runtime:\nif err != nil && strings.Contains(err.Error(), \"id does not support\") {\n\treturn fmt.Errorf(\"rewrite id clause with = or !=: %w\", err)\n}","preventionTips":["Treat id as an identity, not an ordered value","Use = / != or prefix wildcards, never ranges","For batches of ids, OR equality clauses","Constrain query-builder templates per field type"],"tags":["query","operators","bd-cli"],"backgroundTag":"unsupported-operator-for-field","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}