{"record":{"id":"9bfe2c5c2505fe76","repo":"gastownhall/beads","slug":"invalid-boolean-value-for-s-s","errorCode":null,"errorMessage":"invalid boolean value for %s: %s","messagePattern":"invalid boolean value for (.+?): (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/query/evaluator.go","lineNumber":473,"sourceCode":"\t\treturn fmt.Errorf(\"parent only supports = operator\")\n\t}\n\tfilter.ParentID = &comp.Value\n\treturn nil\n}\n\nfunc (e *Evaluator) applyBoolFilter(comp *ComparisonNode, filter *types.IssueFilter, field string) error {\n\tif comp.Op != OpEquals {\n\t\treturn fmt.Errorf(\"%s only supports = operator\", field)\n\t}\n\tval := strings.ToLower(comp.Value)\n\tvar boolVal bool\n\tswitch val {\n\tcase \"true\", \"yes\", \"1\":\n\t\tboolVal = true\n\tcase \"false\", \"no\", \"0\":\n\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))","sourceCodeStart":455,"sourceCodeEnd":491,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/query/evaluator.go#L455-L491","documentation":"Thrown when the value in a boolean field comparison (pinned, ephemeral, ...) is not one of the accepted literals: true/false, yes/no, 1/0 (case-insensitive). The field name and offending value are included in the message.","triggerScenarios":"Queries like `pinned = maybe`, `ephemeral = 2`, `pinned = 'TRUE '` (with stray whitespace/quotes surviving shell parsing), or localized booleans like `pinned = wahr`.","commonSituations":"Localized or yes-with-exclamation values in saved queries; shell quoting leaving inner quotes in the value; numeric flags other than 0/1.","solutions":["Change the value to one of true/false, yes/no, or 1/0.","Strip surrounding quotes/whitespace from the literal in the query string.","If the shell mangles the value, quote the whole query with single quotes."],"exampleFix":"// before\nbd list 'pinned = \"yes\"'\n// after\nbd list 'pinned = yes'","handlingStrategy":"validation","validationCode":"func isValidBoolLiteral(v string) bool {\n\tswitch strings.ToLower(strings.TrimSpace(v)) {\n\tcase \"true\", \"yes\", \"1\", \"false\", \"no\", \"0\":\n\t\treturn true\n\t}\n\treturn false\n}","typeGuard":null,"tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"invalid boolean value for\") {\n\t// prompt the user for true/false/yes/no/1/0\n}","preventionTips":["Normalize input to true/false before interpolating into queries.","Trim whitespace and strip stray quotes from literals.","Whitelist 0/1/yes/no/true/false in any UI accepting boolean filters."],"tags":["query-language","boolean","validation"],"backgroundTag":"invalid-boolean-value","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}