{"record":{"id":"5f97f8f3cef62ae4","repo":"gastownhall/beads","slug":"formula-q-not-accessible-w","errorCode":null,"errorMessage":"formula %q not accessible: %w","messagePattern":"formula %q not accessible: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/mol_seed.go","lineNumber":87,"sourceCode":"\treturn nil\n}\n\n// verifyFormula checks if a formula can be loaded and cooked\nfunc verifyFormula(formulaName string, vars map[string]string) error {\n\t// Try to cook the formula - this verifies:\n\t// 1. Formula exists in search path\n\t// 2. Formula syntax is valid\n\t// 3. Formula can be resolved (extends, etc.)\n\t// 4. Formula can be cooked to subgraph\n\t_, err := resolveAndCookFormulaWithVars(formulaName, nil, vars)\n\tif err != nil {\n\t\tif errors.Is(err, formula.ErrVarValidation) {\n\t\t\t// Don't double-wrap: the --var values fail enum/pattern/\n\t\t\t// required-empty constraints, which is a distinct condition\n\t\t\t// from the formula itself being inaccessible.\n\t\t\treturn err\n\t\t}\n\t\treturn fmt.Errorf(\"formula %q not accessible: %w\", formulaName, err)\n\t}\n\treturn nil\n}\n\nfunc init() {\n\tmolSeedCmd.Flags().StringArray(\"var\", []string{}, \"Variable substitution for condition filtering (key=value)\")\n\tmolCmd.AddCommand(molSeedCmd)\n}\n","sourceCodeStart":69,"sourceCodeEnd":96,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/mol_seed.go#L69-L96","documentation":"verifyFormula confirms that a named formula exists and its variables validate before mol seed proceeds. If the lookup fails for any reason other than ErrVarValidation, it is wrapped as 'formula %q not accessible: %w' — the formula itself cannot be loaded (missing, unreadable, or a lower-level access error), as distinct from bad --var values.","triggerScenarios":"bd mol seed --formula <name> where the formula name does not exist, the formula file/registry entry cannot be read, or the embedded formula table lacks the name. Explicitly NOT raised for invalid --var values (those pass through unwrapped).","commonSituations":"Typo in the formula name; running in a repo/directory where the formula is not installed; older bd version that predates the formula; formula deleted or renamed upstream.","solutions":["Run bd formula list (or the equivalent) to see available formula names and correct the spelling","Check that the formula exists in this repo/version; upgrade bd if the formula is newer","If loading from a file/path, verify the file exists and is readable","If the wrapped cause indicates permissions, fix file permissions or reinstall formulas"],"exampleFix":"// before: guessing at the name\nbd mol seed --formula auth-flw\n// after: verify first\nbd formula list | grep auth\nbd mol seed --formula auth-flow --var env=prod","handlingStrategy":"validation","validationCode":"// Verify the formula exists before mol seed\nif !formulaExists(name) {\n    return fmt.Errorf(\"unknown formula %q; run bd formula list\", name)\n}","typeGuard":"func formulaAccessible(name string) bool {\n    _, err := formula.Lookup(name)\n    return err == nil\n}","tryCatchPattern":"if err := verifyFormula(ctx, formulaName); err != nil {\n    if errors.Is(err, formula.ErrVarValidation) {\n        // bad --var values: fix the variables\n    } else {\n        // formula not accessible: fix the name/install\n    }\n    return err\n}","preventionTips":["Tab-complete or list formula names instead of typing from memory","Keep bd upgraded so bundled formulas match your workflows","Validate --var pairs (key=value) before invoking mol seed"],"tags":["go","formula","cli","validation"],"backgroundTag":"formula-not-found","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}