neurocore.runtime.executor

Blueprint executor — wires skills into FlowEngine and runs them.

The executor is the bridge between NeuroCore’s skill system and FlowEngine’s execution engine. It:

  1. Resolves skill names from the blueprint to Skill classes via the registry

  2. Merges config: neurocore.yaml skills.<name> (base) + blueprint config (overlay)

  3. Creates and initializes Skill instances

  4. Builds a FlowEngine FlowConfig and component dict

  5. Executes via FlowEngine (sync or async)

Usage:

from neurocore.runtime import execute_blueprint, load_and_run

# Low-level result = execute_blueprint(blueprint, registry, config)

# High-level (load + discover + execute) result = load_and_run(blueprint_path, project_root=Path(“.”))

# Streaming async for event in execute_blueprint_stream(bp, registry, cfg):

print(event.event_type, event.step_name)

Attributes

log

Functions

merge_skill_config(→ dict[str, Any])

Merge skill configuration from neurocore.yaml and blueprint.

execute_blueprint(→ flowengine.FlowContext)

Execute a blueprint. Supports both sync and async skills.

execute_blueprint_stream(...)

Execute a blueprint, yielding FlowEvents as each step runs.

load_and_run(→ flowengine.FlowContext)

High-level function: load config, discover skills, execute blueprint.

Module Contents

neurocore.runtime.executor.log
neurocore.runtime.executor.merge_skill_config(neurocore_config: neurocore.config.schema.NeuroCoreConfig, skill_name: str, blueprint_config: dict[str, Any]) dict[str, Any][source]

Merge skill configuration from neurocore.yaml and blueprint.

Priority (highest wins):
  1. Blueprint component config (overlay)

  2. neurocore.yaml skills.<name> (base)

Parameters:
  • neurocore_config – The project’s NeuroCoreConfig.

  • skill_name – The skill’s registered name (for neurocore.yaml lookup).

  • blueprint_config – Config from the blueprint’s component definition.

Returns:

Merged config dict.

neurocore.runtime.executor.execute_blueprint(blueprint: neurocore.runtime.blueprint.Blueprint, registry: neurocore.skills.registry.SkillRegistry, neurocore_config: neurocore.config.schema.NeuroCoreConfig, *, initial_data: dict[str, Any] | None = None) flowengine.FlowContext[source]

Execute a blueprint. Supports both sync and async skills.

This is the core execution function. It: 1. Validates skill references 2. Creates and initializes skill instances with merged config 3. Detects async skills and chooses execution path 4. For sync-only blueprints, delegates to FlowEngine 5. For async blueprints, uses asyncio event loop

Parameters:
  • blueprint – Parsed Blueprint.

  • registry – SkillRegistry with discovered skills.

  • neurocore_config – Project configuration.

  • initial_data – Optional initial context data (key-value pairs).

Returns:

FlowContext with execution results.

Raises:
async neurocore.runtime.executor.execute_blueprint_stream(blueprint: neurocore.runtime.blueprint.Blueprint, registry: neurocore.skills.registry.SkillRegistry, config: neurocore.config.schema.NeuroCoreConfig, initial_data: dict[str, Any] | None = None) collections.abc.AsyncIterator[Any][source]

Execute a blueprint, yielding FlowEvents as each step runs.

Usage:
async for event in execute_blueprint_stream(bp, registry, cfg):

print(event.event_type, event.step_name)

neurocore.runtime.executor.load_and_run(blueprint_path: pathlib.Path, *, project_root: pathlib.Path | None = None, initial_data: dict[str, Any] | None = None) flowengine.FlowContext[source]

High-level function: load config, discover skills, execute blueprint.

Convenience wrapper that does everything: 1. Load neurocore.yaml config 2. Discover all skills (directory + entry points) 3. Load and parse the blueprint 4. Execute via FlowEngine

Parameters:
  • blueprint_path – Path to the blueprint YAML file.

  • project_root – Optional project root (auto-detected if not provided).

  • initial_data – Optional initial context data.

Returns:

FlowContext with execution results.