{"record":{"id":"121a41aa21246808","repo":"gastownhall/beads","slug":"mol-type-only-supports-operator","errorCode":null,"errorMessage":"mol_type only supports = operator","messagePattern":"mol_type only supports = operator","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/query/evaluator.go","lineNumber":489,"sourceCode":"\t\tboolVal = false\n\tdefault:\n\t\treturn fmt.Errorf(\"invalid boolean value for %s: %s\", field, comp.Value)\n\t}\n\n\tswitch field {\n\tcase \"pinned\":\n\t\tfilter.Pinned = &boolVal\n\tcase \"ephemeral\":\n\t\tfilter.Ephemeral = &boolVal\n\tcase \"template\":\n\t\tfilter.IsTemplate = &boolVal\n\t}\n\treturn nil\n}\n\nfunc (e *Evaluator) applyMolTypeFilter(comp *ComparisonNode, filter *types.IssueFilter) error {\n\tif comp.Op != OpEquals {\n\t\treturn fmt.Errorf(\"mol_type only supports = operator\")\n\t}\n\tmt := types.MolType(strings.ToLower(comp.Value))\n\tif !mt.IsValid() {\n\t\treturn fmt.Errorf(\"invalid mol_type: %s\", comp.Value)\n\t}\n\tfilter.MolType = &mt\n\treturn nil\n}\n\n// applyMetadataFilter handles metadata.<key>=<value> queries (GH#1406).\nfunc (e *Evaluator) applyMetadataFilter(comp *ComparisonNode, filter *types.IssueFilter) error {\n\tif comp.Op != OpEquals {\n\t\treturn fmt.Errorf(\"metadata fields only support = operator\")\n\t}\n\tkey := strings.TrimPrefix(comp.Field, \"metadata.\")\n\tif err := storage.ValidateMetadataKey(key); err != nil {\n\t\treturn err\n\t}","sourceCodeStart":471,"sourceCodeEnd":507,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/query/evaluator.go#L471-L507","documentation":"Thrown when the `mol_type` field is compared with an operator other than `=`. Molecule-type filtering only supports equality against a valid MolType value.","triggerScenarios":"Queries like `mol_type != molecule`, `mol_type ~ mol*`, or `mol_type > x` reaching applyMolTypeFilter.","commonSituations":"Trying prefix or exclusion matching on mol_type; assuming it supports the same operators as text fields; old queries written before the field existed.","solutions":["Use `mol_type = <type>` (e.g. the exact molecule type literal).","For exclusion, use top-level negation if available or filter client-side.","Check MolType.IsValid()-accepted values to know the exact literals."],"exampleFix":"// before\nbd list 'mol_type ~ mol*'\n// after\nbd list 'mol_type = molecule'","handlingStrategy":"validation","validationCode":"func validateMolTypeComparison(op string) error {\n\tif op != \"=\" {\n\t\treturn fmt.Errorf(\"mol_type supports only =, got %q\", op)\n\t}\n\treturn nil\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use `mol_type = <type>` only.","Do not attempt prefix or inequality operators on mol_type.","Validate full queries before running them in scripts."],"tags":["query-language","filter","operator-unsupported"],"backgroundTag":"unsupported-query-operator","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}