{"record":{"id":"21b394d2396f66f0","repo":"gastownhall/beads","slug":"owner-filtering-requires-predicate-mode","errorCode":null,"errorMessage":"owner filtering requires predicate mode","messagePattern":"owner filtering requires predicate mode","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/query/evaluator.go","lineNumber":289,"sourceCode":"\t}\n\treturn nil\n}\n\nfunc (e *Evaluator) applyAssigneeFilter(comp *ComparisonNode, filter *types.IssueFilter) error {\n\tif comp.Op != OpEquals {\n\t\treturn fmt.Errorf(\"assignee only supports = operator\")\n\t}\n\tif comp.Value == \"\" || strings.ToLower(comp.Value) == \"none\" || strings.ToLower(comp.Value) == \"null\" {\n\t\tfilter.NoAssignee = true\n\t} else {\n\t\tfilter.Assignee = &comp.Value\n\t}\n\treturn nil\n}\n\nfunc (e *Evaluator) applyOwnerFilter(comp *ComparisonNode, filter *types.IssueFilter) error {\n\t// Owner filtering requires predicate\n\treturn fmt.Errorf(\"owner filtering requires predicate mode\")\n}\n\nfunc (e *Evaluator) applyLabelFilter(comp *ComparisonNode, filter *types.IssueFilter) error {\n\tif comp.Op != OpEquals {\n\t\treturn fmt.Errorf(\"label only supports = operator\")\n\t}\n\tif comp.Value == \"\" || strings.ToLower(comp.Value) == \"none\" || strings.ToLower(comp.Value) == \"null\" {\n\t\tfilter.NoLabels = true\n\t} else {\n\t\tfilter.Labels = append(filter.Labels, comp.Value)\n\t}\n\treturn nil\n}\n\nfunc (e *Evaluator) applyTitleFilter(comp *ComparisonNode, filter *types.IssueFilter) error {\n\tif comp.Op != OpEquals {\n\t\treturn fmt.Errorf(\"title only supports = operator (use title contains pattern)\")\n\t}","sourceCodeStart":271,"sourceCodeEnd":307,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/query/evaluator.go#L271-L307","documentation":"The bd query evaluator rejects owner comparisons outright in filter mode: applyOwnerFilter always returns this error regardless of the operator or value used. Owner filtering was only implemented for predicate mode (full in-memory evaluation), so any query like `owner = alice` that goes down the IssueFilter path fails. It is a deliberate capability gate, not a data problem.","triggerScenarios":"Running a query containing an `owner <op> value` comparison (e.g. `owner = alice`, `owner != bob`) that is evaluated via applyComparison in filter mode; the function returns this error unconditionally, before even inspecting comp.Op.","commonSituations":"Users migrating queries from assignee to owner fields (assignee supports =, owner does not); scripts written against predicate-mode docs; hand-written bd filter strings assuming owner is a first-class filterable field.","solutions":["Rewrite the query to use `assignee = <name>`, which is supported in filter mode","Switch the evaluation to predicate mode if available in the calling code path","If owner semantics are truly needed, filter results in application code after fetching by other criteria"],"exampleFix":"// before\nbd list 'owner = alice'\n// after\nbd list 'assignee = alice'","handlingStrategy":"validation","validationCode":"// Reject owner comparisons before invoking the evaluator\nfunc usesOwnerField(q string) bool {\n\treturn regexp.MustCompile(`\\bowner\\s*(=|!=|<|>|>=|<=)`).MatchString(q)\n}\nif usesOwnerField(query) {\n\treturn fmt.Errorf(\"rewrite query: use 'assignee = <name>' instead of owner\")\n}","typeGuard":"func isSupportedFilterField(field string) bool {\n\tswitch field {\n\tcase \"owner\":\n\t\treturn false // owner requires predicate mode\n\t}\n\treturn true\n}","tryCatchPattern":"if err := evaluator.Apply(comp, filter); err != nil {\n\tif strings.Contains(err.Error(), \"owner filtering requires predicate mode\") {\n\t\t// fall back to predicate-mode evaluation or rewrite to assignee\n\t}\n}","preventionTips":["Use assignee instead of owner in filter-mode queries","Check the field's supported mode before constructing comparisons","Add a query lint step that flags owner in filter-mode contexts"],"tags":["query","filter","unsupported-operator"],"backgroundTag":"unsupported-query-field","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}