neofoam.framework.initialization.execution

Execution layer for the lazy-init framework.

Given a list of InitStep objects, this layer:

  1. Validates the dependency graph (validation).

  2. Topologically sorts the steps using the graph package’s sorter (ordering).

  3. Executes each step in order, capturing results as InitResult (executor).

  4. Routes each result into the appropriate slot of a Context via a CategoryRouter (context_builder).

The public entry point is execute_initialization() — one call that runs all four stages and returns the populated Context. For finer-grained control, the package re-exports the individual building blocks (execute_step(), execute_lazy_inits(), validate(), CategoryRouter, InitResult, InitializationGraphError).

The routing layer is open for extension: register a new category handler with CategoryRouter.register() and pass the router to execute_initialization() to dispatch unknown categories without modifying framework code.