Skip to content

feat: Engine Decomposition Phase 4 — structural tests, plugin dev guide & requires validation (#84)#128

Merged
intel352 merged 2 commits intomainfrom
feat/issue-84-engine-decomp-p4
Feb 23, 2026
Merged

feat: Engine Decomposition Phase 4 — structural tests, plugin dev guide & requires validation (#84)#128
intel352 merged 2 commits intomainfrom
feat/issue-84-engine-decomp-p4

Conversation

@intel352
Copy link
Contributor

Engine Decomposition Phase 4 — Clean Core

Implements key Phase 4 tasks from the Engine Decomposition Plan.

Changes

Structural Tests (engine_structural_test.go)

9 new tests verifying engine decomposition integrity:

  • TestCoreRejectsUnknownModuleType — engine with no plugins loaded returns clear "unknown module type" error
  • TestCoreRejectsMultipleUnknownTypes — error message includes the specific unknown type
  • TestRequiresValidation_MissingCapabilityrequires.capabilities fails when a capability has no provider
  • TestRequiresValidation_SatisfiedCapabilities — succeeds when all required capabilities are provided
  • TestRequiresValidation_MissingPluginrequires.plugins fails when a named plugin isn't loaded
  • TestSelectivePluginLoading_HTTPOnly — loading only HTTP plugin makes HTTP types available, messaging types remain unknown
  • TestAllPluginsProvideFactories — all 17 plugins have valid name, version, and manifest
  • TestEngineFactoryMapPopulatedByPlugins — factory map contains expected types from all plugins
  • TestSchemaKnowsPluginModuleTypes — every factory type is registered in schema.KnownModuleTypes()

Plugin Development Guide (docs/PLUGIN_DEVELOPMENT.md)

Comprehensive guide for creating internal EnginePlugin plugins:

  • EnginePlugin interface and BaseEnginePlugin embedding
  • ModuleFactories, StepFactories, TriggerFactories, WorkflowHandlers
  • Capability contracts and workflow dependency validation (requires: section)
  • WiringHooks for cross-module integration
  • UI schemas, plugin manifest, testing patterns
  • Reference table of all 17 existing plugins

Example Config

  • Added requires section to example/license-validator.yaml (the only example missing it)

Related

…de, requires validation (#84)

Add structural tests verifying:
- Engine rejects unknown module types with clear errors
- Workflow dependency validation fails for missing capabilities
- Workflow dependency validation fails for missing plugins
- Selective plugin loading: only loaded plugin types are available
- All plugins have valid metadata (name, version, manifest)
- Factory map populated correctly by plugins
- Schema registry tracks all plugin module types

Create docs/PLUGIN_DEVELOPMENT.md:
- Comprehensive guide for creating internal EnginePlugin plugins
- Covers ModuleFactories, StepFactories, TriggerFactories, WiringHooks
- Documents capability contracts and workflow dependency validation
- Includes example plugin structure and testing patterns

Add requires section to license-validator example config.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings February 23, 2026 11:22
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements Phase 4 of the Engine Decomposition Plan, adding structural tests to verify the plugin-based architecture, creating a comprehensive plugin development guide, and updating the license-validator example config with the missing requires section.

Changes:

  • Added 9 structural tests verifying that the core engine properly rejects unknown module types, validates workflow requirements (capabilities and plugins), supports selective plugin loading, and ensures all 17 plugins are properly registered
  • Created a comprehensive plugin development guide documenting the EnginePlugin interface, plugin structure, capabilities system, wiring hooks, and testing patterns
  • Added requires section to license-validator.yaml example to align it with all other example configs

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
engine_structural_test.go New file with 9 tests validating core engine behavior: unknown type rejection, capability/plugin requirement validation, selective plugin loading, and plugin factory registration
docs/PLUGIN_DEVELOPMENT.md New comprehensive guide for developing internal engine plugins, including interface documentation, step-by-step creation guide, code examples, and a reference table of all 17 existing plugins
example/license-validator.yaml Added requires.plugins section declaring dependency on the "license" plugin, bringing this example in line with all other configs

Comment on lines +359 to +362
func TestPluginLoads(t *testing.T) {
app := modular.NewStdApplication(modular.NewStdConfigProvider(nil), nil)
engine := workflow.NewStdEngine(app, slog.Default())

Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test example uses slog.Default() but the imports section doesn't include "log/slog". Add "log/slog" to the imports, or consider using a mock logger from the test helpers as done in the actual structural tests.

Copilot uses AI. Check for mistakes.
@intel352
Copy link
Contributor Author

@copilot open a new pull request to apply changes based on the comments in this thread

Copy link
Contributor

Copilot AI commented Feb 23, 2026

@intel352 I've opened a new pull request, #141, to work on those changes. Once the pull request is ready, I'll request review from you.

…141)

* Initial plan

* docs: fix PipelineStep signature, add slog import, and handle LoadPlugin error in PLUGIN_DEVELOPMENT.md

Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>
@intel352 intel352 merged commit 00f7208 into main Feb 23, 2026
14 checks passed
@intel352 intel352 deleted the feat/issue-84-engine-decomp-p4 branch February 23, 2026 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Engine Decomposition: Clean core — eliminate BuildFromConfig switch & add workflow dependencies (Phase 4)

3 participants