bd cook resolves its argument as a formula name from the search paths
and, failing that, as a path to a formula file. The resolver behind
bd mol pour, wisp, bond and seed (resolveAndCookFormulaWithVars) only
ever tried the name, so a formula file outside every search path cooked
but would not pour: `bd mol pour ./x.formula.toml` failed with "not
found as formula or proto ID" while `bd cook ./x.formula.toml` worked.
The two near-identical resolvers drifted when 44853d169 taught only the
cook one about registry names; nothing records an intent to keep file
paths cook-only.
Both resolvers, and the two places where bd mol bond describes an
operand before cooking it (discoverMolBondOperand and resolveOrDescribe,
which call the parser directly and refuse the bond before the shared
resolver runs), now go through one loadFormulaByNameOrPath: registry
name first, file path second. Name lookup keeps precedence, so no
existing name resolves differently.
When both lookups miss, the error names what the argument was written
as. A path reports the file error, so an unreadable or syntactically
broken formula file is named as such instead of as a registry miss. A
bare name reports the registry miss, so pour, wisp and bond keep falling
through to their proto or issue lookup with the same message as before.
Tests: TestLoadFormulaByNameOrPath_{PathFallback,RegistryWins,
ErrorNamesWhatWasTried}, TestResolveAndCookFormulaWithVars_AcceptsPath,
TestMolBondResolversAcceptFormulaPath, all hermetic under t.TempDir().
Refs #3874, #5761.
Agent-Signature: claude-code-claude-fable-5-1-unknown-reasoning on behalf of Rand
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>