On this page

MeldExecutionError๏ƒ

Use md.MeldExecutionError from the public package namespace.

Implementation source

class MeldExecutionError(*, spell_id: str, spell_name: str, message: str, node_id: str | None = None, param_name: str | None = None, inner: BaseException | None = None)[source]๏ƒ
Purpose:

Represent any failure of DAG-based meld execution inside the Meld runtime as ONE stable error type, so the Conduit/Meld boundary has a single "resolution failed" signal instead of leaking a dozen low-level exception types.

Contract:

  • Wraps the underlying failure rather than replacing it; inner is preserved untouched.

  • Carries root spell identity always, and node/parameter attribution when the runtime can determine it.

  • __str__ renders identity, node, parameter, message, and inner exception into one diagnostic line, degrading gracefully when optional fields are absent.

  • Subclasses RuntimeError.

This is a high-level wrapper around any internal exception thrown while resolving a spell via the Meld engine.

Why this exists๏ƒ

  • From the Conduit / Meld boundary we want a single, stable error type to represent "DI / resolution failed".

  • Internally, the engine may encounter:

    • Constructor/type errors

    • Missing dependency instances

    • Invalid override payloads

    • Unexpected DAG structure

  • MeldExecutionError captures:

    • The root spell identity (spell_id, spell_name).

    • Optional node_id if the error occurred at a specific DAG node.

    • Optional param_name if the failure is tied to a specific constructor parameter.

    • The underlying inner exception, if any.

This gives callers and tooling enough context to log, trace, or present detailed diagnostics without having to interpret dozens of low-level exception types.

Raised When:

  • A constructor, override payload, or DAG node fails while the Meld runtime is resolving a spell.

  • Change control has marked the target root dirty for the active conduit, so execution is gated until revalidation clears it.

What To Do About It:

Start with inner - it holds the real cause. node_id and param_name narrow the failure to a specific DAG node or constructor parameter when the runtime could attribute it. A dirty-root gate is not a defect: it means structure changed under a live conduit and the next resolution revalidates.

Owned State:

  • spell_id / spell_name: the root spell being resolved.

  • node_id: DAG node where the failure occurred, when attributable.

  • param_name: constructor parameter involved, when attributable.

  • inner: the underlying exception.

Registration:

Exported on the public root surface; import, raise, and catch freely.

Subsystem Context:

One of the 11 utilities/custom_exceptions/ types and the primary error of the Meld resolution runtime. It is the runtime counterpart to SpellbookValidationError, which is raised at build time before any Conduit exists.

System Context:

Fires in the resolution layer of the DGR, after conjure has produced a Conduit. Because instances may already be registered in Creations when it raises, a failed meld does NOT roll back the conduit - the object world stays live and the caller decides whether to retry, rebind, or tear down.

AGENT_ACCESS: public

AGENT_PURPOSE:

access: public. The single 'resolution failed' signal from the Meld runtime; start at inner for the real cause, node_id/param_name narrow it. A dirty-root gate means revalidate, not a defect.

Topic reference ยท Full contents