Fix declarative engine version validation - #50915
Conversation
Allow shared declarative engine definitions to specify their default CLI version and recognize imported lifecycle step fields during relaxed validation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 81e8fc1c-e66d-431d-94b5-ee3faf3d90e9
|
|
|
No ADR enforcement needed: PR does not have the 'implementation' label and has ≤100 new lines of code in business logic directories (61 additions detected). |
🧪 Test Quality Sentinel Report
📊 Metrics (19 tests)
Per-Test Summary:
AnalysisStrengths:
Design vs. Implementation Split:
Why This Scores 62 (Not Higher):
Verdict
Recommendation: This PR correctly validates the schema changes and adds appropriate test coverage for the new declarative engine fields. The score of 62/100 reflects good core behavioral validation (design tests) balanced with necessary regression coverage (implementation tests). The absence of mock libraries and comprehensive typo-detection testing (Test 4) demonstrates solid schema validation practices. Analysis: 19 Go tests, line counts (test: +35, prod: +22). Build tags verified. No test infrastructure changes.
|
|
🎉 This pull request is included in a new release. Release: |
Overview
Fixes validation errors when a shared/included workflow file defines a declarative engine with a default
versionand usespre-agent-steps. Two independent gaps in schema/validation were closed.Root cause
versionproperty, so declarative engine definitions specifying a default CLI version failed schema validation.steps, notpre-steps,pre-agent-steps, orpost-steps, so shared engine files using these fields were rejected as having "unexpected fields".Changes
pkg/parser/schemas/main_workflow_schema.json: Addedversion(stringornumber) to the engine schema object — "Default CLI version applied when a workflow references this engine without specifying engine.version".pkg/parser/include_processor.go: Addedpre-steps,pre-agent-steps, andpost-stepstocollectUnexpectedIncludedFrontmatterFields's valid-fields list (plus gofmt realignment).pkg/parser/schema_location_test.go: AddedTestValidateIncludedFileFrontmatterWithSchemaAndLocation_DeclarativeEngineWithVersionAndPreAgentSteps, asserting that a declarative engine (id, version, display-name, description, experimental, provider, behaviors) combined withpre-agent-stepsandruntimespasses included-frontmatter validation.Impact
Non-breaking. Enables shared engine definition files (e.g. a custom
aiderengine) to declare a default version and pre-agent install steps without failing validation — previously blocked scenario now supported.Testing
New unit test added and passing; covers the previously-failing combination directly.> Generated by PR Description Updater for #50915 · auto · 37.4 AIC · ⊞ 6.8K · ◷