fable-agent/PHASES/phase-11-execution-engine.md

932 B

Phase 11: Execution Engine

Purpose: Load a skill, prepare context, execute steps with deliberate practice. TS Module: src/tier2-primitives/routines/execution-engine.ts

What It Does

  • Loads the skill definition and context template
  • Executes each step sequentially with lifecycle hooks
  • Records timing, quality, and issues per execution
  • Validates output against step criteria

Lifecycle Hooks

onBeforeStep(step, context)   // Prepare for step execution
onAfterStep(step, result, context)  // Process step result
onBeforeAll(skill, context)   // Pre-execution setup
onAfterAll(skill, result, context)  // Post-execution processing

Key Rules

  • Each execution is fully recorded in the skill's history
  • Quality score is calculated from step success ratio minus issue penalty
  • Template variables ({{var}}) are substituted from context
  • Validation criteria are checked after each step