On this page
UnresolvedInputError๏
Use md.UnresolvedInputError from the public package namespace.
- class UnresolvedInputError(*, spell_id: str, spell_name: str, message: str, node_id: str | None = None, param_name: str | None = None, inner: BaseException | None = None, expected_type: str, unresolved_params: Tuple[str, ...], hidden_spell_ids: Tuple[str, ...] = ())[source]๏
- Purpose:
Signal that a meld had to construct an object whose typed constructor parameter has no registered provider, and the meld did not supply the value. Names the consumer, the parameter, the expected type and how to supply it, instead of a bare Python missing-argument error.
- Raised When:
Constructing an object whose Phase-3 topology carries an UNRESOLVED_INPUT socket (a single typed dependency no registered spell provides, or - since 2026-11-16, GitHub #329 - a SpellMap default whose address has nothing bound), and the constructing call's overrides did not supply that parameter. It fires only when that object is actually built: a stored (reused) object never demands its unresolved inputs, and conjure succeeds regardless. It is decided before construction: the many_only and generalized plans raise it before building anything under that object, and a solo root's call target raises it instead of calling the constructor (2026-09-26).
- What To Do About It:
Supply the value in the meld's override payload: the parameter name when melding the consumer itself, a path key ending in >param (or a broadcast **param) when the consumer is built as a dependency. Or bind a provider for the expected type; the consumer re-resolves into a normal dependency on its next meld. When the expected class is registered, but only under a spellframe or a binding name - where a class lookup does not reach it - the message names each such address and the lookup that reaches it, and hidden_spell_ids lists those spells (2026-11-07). For a SpellMap parameter the message names the SpellMap as written and asks for a spell at that address; binding one there re-gates the consumer.
Contract:
A MeldExecutionError: code that catches MeldExecutionError keeps catching it. node_id is the consumer's spell id and param_name the first missing parameter.
expected_type is the parameter annotation's display name, read from the constructor signature on the failure path (Optional and forward references unwrapped); the lowercased frame key is used only if that is unreadable. For a parameter whose default is a SpellMap it is that SpellMap rendered as written (_spellmap_address_name), whatever the annotation.
unresolved_params lists every missing unresolved parameter of the consumer, in signature order.
inner is None: nothing has been called when it is raised.
The text says "nothing registered provides it" only when nothing does. When the first missing parameter is a class lookup whose class is bound only under a spellframe or a binding name (found live in the consumer's Spellbook pool on this failure path, patch hidden_provider_2026_11_07), the text names each address and the SpellMap that reaches it, and hidden_spell_ids carries their ids. A socket whose Phase 3 recorded such candidates refuses its spell in Phase 4 (HIDDEN_PROVIDER), so this arises with candidates only where they appeared after the consumer compiled and nothing re-gated it.
Owned State:
Inherited spell_id, spell_name, node_id, param_name, inner.
expected_type: display name of the first missing parameter's type.
unresolved_params: names of all missing unresolved parameters.
hidden_spell_ids: sorted ids of the spells of the expected class a class lookup does not reach; empty when there are none.
- Registration:
A public exception type; import, raise, and catch freely. Like every Melder class it is refused as a spell registration.
- Subsystem Context:
One of the utilities/custom_exceptions/ types; the specific form of MeldExecutionError for the unresolved-input socket contract.
- System Context:
Fires in the resolution layer at meld, after conjure produced the Conduit, before construction: from a plan (many_only, generalized) or from a solo root's call target. Successful melds never evaluate it.
AGENT_ACCESS: public
- AGENT_PURPOSE:
access: public. Raised at meld when an object whose typed parameter has no registered provider, or whose SpellMap default's address has nothing bound, is built without that value; supply it by override (root key, >param path key or **param), or bind a provider for expected_type (for a SpellMap, a spell at its address).
- static expected_type_name(annotation: Any) str[source]๏
Render a parameter annotation as the expected-type display name.
- Purpose:
One naming rule for the Phase-4 UNRESOLVED_INPUT warning and this error, so both name the type identically.
Contract:
Unwraps Optional[T] / Union[T, None] to T, and a forward reference to its written name, mirroring Phase-3 matching.
A class renders as its __qualname__; any other annotation object as its repr.
A string renders as itself, minus one layer of matching quotes: a quoted annotation in a module using postponed evaluation arrives as the source text 'Name'.
Pure: no lookups, no side effects.
- Parameters:
annotation -- The parameter's annotation: Phase-1 requirements at conjure, the constructor signature at meld.
- Returns:
Display name of the expected type.
- Return type:
str
- classmethod for_unsupplied(spell: Spell, param_names: Collection[str]) UnresolvedInputError[source]๏
Build the error for unresolved inputs a plan knows are unsupplied, before any construction.
- Purpose:
The decision before construction (design v2 S4, B6): a many_only or generalized plan, or a solo root's call target, raises this instead of calling a constructor that must fail.
Contract:
Selects the consumer's UNRESOLVED_INPUT sockets named in param_names from its live Phase-3 topology and builds the message and fields in signature order; inner is None (nothing was called).
- Parameters:
spell -- The consumer about to be built.
param_names -- Its UNRESOLVED_INPUT parameters that the call does not supply.
- Raises:
RuntimeError -- When the topology has none of those sockets: the plan is stale (a plan is rebuilt whenever the topology re-resolves).
- Returns:
The error to raise.
- Return type: