Overview
The final phase: eliminate the BuildFromConfig switch statement entirely, remove all post-init wiring from engine.go, and add workflow dependency validation.
Reference: docs/PLAN_ENGINE_DECOMPOSITION.md — Phase 4
Depends on: Phase 3 (#83)
Tasks
Remove Switch Statement
Remove Post-Init Wiring
Remove Direct Imports
Workflow Dependency Validation
Testing
Documentation
Success Criteria (from docs)
engine.go contains no module type switch statement
engine.go does not import module/ or handlers/
- All negative tests pass (core rejects unknown types)
- All positive tests pass (plugins provide types)
- All 37+ example configs load successfully
- A new plugin can be created without modifying any core file
- Two plugins providing the same capability can be swapped without config changes
- Core
engine.go reduced to ~400 lines (from ~1647)
Post-Decomposition Core
StdEngine retains only: YAML parsing, module lifecycle, service registry, workflow dispatch, pipeline execution, trigger dispatch, and plugin loading.
Overview
The final phase: eliminate the
BuildFromConfigswitch statement entirely, remove all post-init wiring fromengine.go, and add workflow dependency validation.Reference:
docs/PLAN_ENGINE_DECOMPOSITION.md— Phase 4Depends on: Phase 3 (#83)
Tasks
Remove Switch Statement
switch modCfg.Type {block with plugin factory map lookup:Remove Post-Init Wiring
canHandleTrigger()function — use trigger registryRemove Direct Imports
engine.gono longer importsmodule/,handlers/, or modularcache/database/reverseproxy/schedulermodular,config,schema,capability,secrets,pluginWorkflow Dependency Validation
requiressection parsing toBuildFromConfig(validates before building)requiressectionsrequiresis omittedTesting
engine.gohas no forbidden importsDocumentation
CLAUDE.mdwith new plugin-based architecturedocs/PLUGIN_DEVELOPMENT.md— guide for creating new pluginsSuccess Criteria (from docs)
engine.gocontains no module type switch statementengine.godoes not importmodule/orhandlers/engine.goreduced to ~400 lines (from ~1647)Post-Decomposition Core
StdEngineretains only: YAML parsing, module lifecycle, service registry, workflow dispatch, pipeline execution, trigger dispatch, and plugin loading.