feat(plugin): add validators and custom step types (C069)#285
Merged
Conversation
- `CHANGELOG.md`: Document C069 plugin extensibility feature - `README.md`: Update feature list with validator and step type capabilities - `docs/README.md`: Update docs index for new plugin capabilities - `docs/user-guide/commands.md`: Add --skip-plugins and --validator-timeout flag docs - `docs/user-guide/plugins.md`: Add validator and step_type plugin authoring guide - `docs/user-guide/workflow-syntax.md`: Add custom step type syntax documentation - `examples/plugins/awf-plugin-database/Makefile`: Add build targets for database plugin - `examples/plugins/awf-plugin-database/README.md`: Document database plugin example - `examples/plugins/awf-plugin-database/main.go`: Implement database step type plugin - `examples/plugins/awf-plugin-database/main_test.go`: Add tests for database plugin - `examples/plugins/awf-plugin-database/plugin.yaml`: Add database plugin manifest - `examples/plugins/awf-plugin-echo/README.md`: Update echo plugin docs for BasePlugin pattern - `examples/plugins/awf-plugin-echo/main.go`: Remove redundant Name/Version method overrides - `examples/plugins/awf-plugin-echo/main_test.go`: Fix tests to initialize BasePlugin fields - `examples/plugins/awf-plugin-echo/plugin.yaml`: Update manifest with step_types capability - `examples/plugins/awf-plugin-security-validator/Makefile`: Add build targets for security plugin - `examples/plugins/awf-plugin-security-validator/README.md`: Document security validator plugin - `examples/plugins/awf-plugin-security-validator/main.go`: Implement security validator plugin - `examples/plugins/awf-plugin-security-validator/main_test.go`: Add tests for security validator - `examples/plugins/awf-plugin-security-validator/plugin.yaml`: Add security validator manifest - `internal/application/execution_service.go`: Wire step type provider for custom step execution - `internal/application/plugin_operation_test.go`: Update test for renamed capability field - `internal/application/service.go`: Inject validator and step type providers into service - `internal/application/service_plugin_step_type_test.go`: Add tests for step type provider wiring - `internal/application/service_plugin_validator_test.go`: Add tests for validator provider wiring - `internal/domain/pluginmodel/info.go`: Add StepTypes field to PluginInfo - `internal/domain/pluginmodel/manifest.go`: Rename CapabilityCommands to CapabilityStepTypes - `internal/domain/pluginmodel/manifest_test.go`: Update manifest tests for renamed capability - `internal/domain/ports/plugin_validator.go`: Add WorkflowValidatorProvider port interface - `internal/domain/ports/plugin_validator_test.go`: Add tests for validator port interface - `internal/domain/workflow/context.go`: Add plugin step type data to execution context - `internal/domain/workflow/context_test.go`: Add context tests for plugin step type data - `internal/domain/workflow/conversation.go`: Add step type awareness to conversation steps - `internal/domain/workflow/conversation_test.go`: Add conversation step type tests - `internal/domain/workflow/doc.go`: Update package documentation - `internal/domain/workflow/step.go`: Add Config field and step type checker support - `internal/domain/workflow/step_agent_test.go`: Update step tests for Config field - `internal/domain/workflow/step_command_test.go`: Update command step tests - `internal/domain/workflow/step_config_test.go`: Add tests for step Config field parsing - `internal/domain/workflow/step_loop_test.go`: Update loop step tests - `internal/domain/workflow/step_message_test.go`: Update message step tests - `internal/domain/workflow/step_script_file_test.go`: Update script file step tests - `internal/domain/workflow/step_type_checker_test.go`: Add StepTypeChecker function tests - `internal/domain/workflow/workflow.go`: Add plugin alias resolution and step type validation - `internal/domain/workflow/workflow_plugins_test.go`: Add plugin alias functionality tests - `internal/domain/workflow/workflow_test.go`: Update workflow tests for new fields - `internal/domain/workflow/workflow_validate_test.go`: Update validation tests - `internal/infrastructure/pluginmgr/grpc_step_type.go`: Add gRPC step type adapter - `internal/infrastructure/pluginmgr/grpc_step_type_test.go`: Add gRPC step type adapter tests - `internal/infrastructure/pluginmgr/grpc_validator.go`: Add gRPC validator adapter - `internal/infrastructure/pluginmgr/grpc_validator_test.go`: Add gRPC validator adapter tests - `internal/infrastructure/pluginmgr/loader.go`: Set Type field on loaded plugins - `internal/infrastructure/pluginmgr/loader_test.go`: Update loader tests - `internal/infrastructure/pluginmgr/manifest_parser_test.go`: Update manifest parser tests - `internal/infrastructure/pluginmgr/rpc_manager.go`: Add multi-directory discovery and step type querying - `internal/infrastructure/pluginmgr/rpc_manager_test.go`: Update RPC manager tests for new capabilities - `internal/infrastructure/repository/yaml_mapper.go`: Add Config field mapping for custom steps - `internal/infrastructure/repository/yaml_mapper_config_test.go`: Add Config mapping tests - `internal/infrastructure/repository/yaml_repository.go`: Update repository for config field - `internal/infrastructure/repository/yaml_types.go`: Add Config field to YAML step type - `internal/infrastructure/repository/yaml_types_config_test.go`: Add YAML config type tests - `internal/interfaces/cli/arch_lint_config_test.go`: Add arch lint tests for new provider wiring - `internal/interfaces/cli/config.go`: Make AWF_PLUGINS_PATH exclusive for test isolation - `internal/interfaces/cli/plugin_cmd.go`: Add step type and validator display to plugin list - `internal/interfaces/cli/plugin_cmd_test.go`: Update plugin command tests - `internal/interfaces/cli/plugins.go`: Update plugin list output for new capabilities - `internal/interfaces/cli/plugins_internal_test.go`: Update internal plugin tests - `internal/interfaces/cli/plugins_test.go`: Update plugin list tests - `internal/interfaces/cli/run.go`: Wire validator and step type providers in run command - `internal/interfaces/cli/run_plugin_provider_wiring_test.go`: Add provider wiring tests - `internal/interfaces/cli/run_skip_plugins_test.go`: Add --skip-plugins flag tests - `internal/interfaces/cli/ui/output.go`: Add step type and validator output rendering - `internal/interfaces/cli/ui/output_test.go`: Add output rendering tests - `internal/interfaces/cli/validate.go`: Add --skip-plugins and --validator-timeout flags - `internal/interfaces/cli/validate_skip_plugins_test.go`: Add skip plugins validation tests - `internal/testutil/fixtures/fixtures_test.go`: Update fixture tests - `pkg/interpolation/resolver.go`: Add plugin step type data resolution - `pkg/interpolation/resolver_data_test.go`: Add resolver data tests - `pkg/plugin/sdk/grpc_plugin.go`: Register validator and step type services in SDK - `pkg/plugin/sdk/step_type.go`: Add StepTypeHandler SDK interface and helpers - `pkg/plugin/sdk/step_type_test.go`: Add step type SDK tests - `pkg/plugin/sdk/validator.go`: Add ValidatorHandler SDK interface and helpers - `pkg/plugin/sdk/validator_test.go`: Add validator SDK tests - `proto/plugin/v1/plugin.pb.go`: Add ValidatorService and StepTypeService protobuf messages - `proto/plugin/v1/plugin.proto`: Define ValidatorService and StepTypeService gRPC services - `proto/plugin/v1/plugin_grpc.pb.go`: Add generated gRPC service stubs - `proto/plugin/v1/plugin_test.go`: Add proto tests for new services - `tests/fixtures/plugins/valid-full/plugin.yaml`: Update fixture for renamed capability field - `tests/integration/plugins/plugin_test.go`: Update plugin integration tests - `tests/integration/plugins/plugin_validation_manifest_test.go`: Update manifest validation tests Closes #280
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
awf validate) and custom step types (execute new step kinds defined by plugins)ValidatorServiceandStepTypeServicegRPC services with corresponding domain ports (WorkflowValidatorProvider,StepTypeProvider) so third-party plugins can extend the workflow engine without touching core code--skip-pluginsand--validator-timeoutCLI flags toawf runandawf validate, and new--step-types/--validatorsflags toawf plugin listfor capability inspectionawf-plugin-database,awf-plugin-security-validator) demonstrating both capabilities end-to-endChanges
Protocol Buffers
proto/plugin/v1/plugin.proto: AddValidatorServiceandStepTypeServicewithRegisterStepType,ValidateStepConfig,ValidateWorkflowRPC methodsproto/plugin/v1/plugin.pb.go: Regenerated protobuf typesproto/plugin/v1/plugin_grpc.pb.go: Regenerated gRPC stubsproto/plugin/v1/plugin_test.go: Tests for new proto messagesDomain
internal/domain/ports/plugin_validator.go: NewWorkflowValidatorProviderandStepTypeProviderport interfacesinternal/domain/ports/plugin_validator_test.go: Tests for port interfaces and error typesinternal/domain/workflow/step.go: AddConfig map[string]anyfield for plugin step configurationinternal/domain/workflow/context.go: Extend execution context with plugin step datainternal/domain/workflow/conversation.go: Minor additions for plugin step supportinternal/domain/workflow/workflow.go: RegisterStepTypeCheckerfor plugin-defined step type validationinternal/domain/pluginmodel/info.go: AddStepTypes []stringfield toPluginInfointernal/domain/pluginmodel/manifest.go: UpdateCapabilityStepTypes(breaking rename fromCapabilityCommands)Application
internal/application/execution_service.go: Invoke validator plugins during workflow loading; route plugin step types to their provider at execution timeinternal/application/service.go: WireValidatorProviderandStepTypeProviderinto the service; exposeSetValidatorProvider/SetStepTypeProvidersettersInfrastructure — Plugin Manager
internal/infrastructure/pluginmgr/grpc_validator.go: gRPC adapter implementingWorkflowValidatorProviderviaValidatorServiceRPCinternal/infrastructure/pluginmgr/grpc_step_type.go: gRPC adapter implementingStepTypeProviderviaStepTypeServiceRPCinternal/infrastructure/pluginmgr/rpc_manager.go: Register and expose validator/step-type adapters per plugin; populateStepTypesonPluginInfo; multi-directory plugin discoveryinternal/infrastructure/pluginmgr/loader.go: SetTypefield on loaded pluginsInfrastructure — Repository
internal/infrastructure/repository/yaml_mapper.go: Mapconfig:block from YAML step toStep.Configinternal/infrastructure/repository/yaml_types.go: AddConfigfield toyamlStepCLI
internal/interfaces/cli/run.go: Wire--skip-pluginsand--validator-timeoutflags; register validator/step-type providers intoExecutionServiceinternal/interfaces/cli/validate.go: Wire--skip-pluginsinto validation pathinternal/interfaces/cli/plugin_cmd.go: Add--step-typesand--validatorsflags toawf plugin list; display capability columnsinternal/interfaces/cli/plugins.go: Update plugin list rendering to support new capability columnsinternal/interfaces/cli/config.go: RestrictAWF_PLUGINS_PATHenv var to exclusive overrideCLI UI
internal/interfaces/cli/ui/output.go: AddPrintStepTypesandPrintValidatorstable renderersPlugin SDK
pkg/plugin/sdk/validator.go: SDK helpers for implementingValidatorProviderin plugin binariespkg/plugin/sdk/step_type.go: SDK helpers for implementingStepTypeProviderin plugin binariespkg/plugin/sdk/grpc_plugin.go: Register validator and step-type gRPC servers inServe()Interpolation
pkg/interpolation/resolver.go: Expose stepConfigmap to template resolverExample Plugins
examples/plugins/awf-plugin-database/: New plugin implementing SQL query step type with connection poolingexamples/plugins/awf-plugin-security-validator/: New plugin implementing validator that blocks hardcoded secrets and dangerous commandsexamples/plugins/awf-plugin-echo/main.go,main_test.go,README.md,plugin.yaml: Simplified to useBasePlugindefaults (remove redundantName/Versionoverrides)Tests
internal/application/service_plugin_step_type_test.go: Tests for step-type routing inExecutionServiceinternal/application/service_plugin_validator_test.go: Tests for validator invocation inExecutionServiceinternal/infrastructure/pluginmgr/grpc_step_type_test.go: Unit tests for gRPC step-type adapterinternal/infrastructure/pluginmgr/grpc_validator_test.go: Unit tests for gRPC validator adapterinternal/infrastructure/pluginmgr/rpc_manager_test.go: Updated for multi-directory discovery and new capability queriesinternal/infrastructure/repository/yaml_mapper_config_test.go: Tests forConfigfield YAML mappinginternal/infrastructure/repository/yaml_types_config_test.go: Tests foryamlStep.Configparsinginternal/interfaces/cli/run_plugin_provider_wiring_test.go: Tests verifying validator/step-type providers are wired into the run commandinternal/interfaces/cli/run_skip_plugins_test.go: Tests for--skip-pluginsbehaviourinternal/interfaces/cli/validate_skip_plugins_test.go: Tests for--skip-pluginsin validate commandinternal/interfaces/cli/arch_lint_config_test.go: Architecture lint rules for new packagesinternal/interfaces/cli/plugin_cmd_test.go,plugins_test.go,plugins_internal_test.go,ui/output_test.go: Updated for new flags and renderersinternal/domain/workflow/step_config_test.go,step_type_checker_test.go,workflow_plugins_test.go: New domain-level testsinternal/domain/workflow/context_test.go,conversation_test.go: Extended testspkg/plugin/sdk/validator_test.go,step_type_test.go: SDK unit testsexamples/plugins/awf-plugin-database/main_test.go,awf-plugin-security-validator/main_test.go: Example plugin unit testspkg/interpolation/resolver_data_test.go: Tests for Config map exposureinternal/testutil/fixtures/fixtures_test.go: Updated fixture teststests/integration/plugins/plugin_test.go,plugin_validation_manifest_test.go: Updated integration testsDocumentation & Config
docs/user-guide/plugins.md: Document validator and step-type plugin capabilities with SDK usage examplesdocs/user-guide/workflow-syntax.md: Documentconfig:block on plugin step typesdocs/user-guide/commands.md: Document--skip-plugins,--validator-timeout,--step-types,--validatorsflagsCHANGELOG.md: Entry for C069README.md,docs/README.md: Update feature listtests/fixtures/plugins/valid-full/plugin.yaml: Update fixture for renamedcapability_step_typesTest plan
go test ./internal/... ./pkg/... ./examples/...— all unit tests passawf validateon a workflow containing hardcoded secrets, confirm validation errors are reportedconfig:block, runawf runand confirm the plugin step executesawf plugin list --step-types --validatorsand confirm capability columns populate for loaded plugins; run with--skip-pluginsand confirm plugins are bypassedCloses #280
Generated with awf commit workflow