fix(#5448): merge validation_loop at field level during composition - #6310
fix(#5448): merge validation_loop at field level during composition#6310myukitty wants to merge 1 commit into
Conversation
…mposition When a child harness overrides specific fields of validation_loop (such as schema), whole-struct replacement in mergeBaseIntoChild, mergeForgeConfigInto, and mergeForgeConfig discarded base-defined script and max_iterations. This patch replaces whole-struct replacement with field-level merge (child fields win, base fills gaps), matching Env/RunnerEnv composition semantics. Fixes fullsend-ai#5448 Signed-off-by: myukitty <myukittyy@gmail.com>
|
Thank you for your interest in contributing to fullsend, @myukitty. This project uses a vouch system for first-time contributors. Before submitting a pull request, you need to be vouched by a maintainer. To get vouched:
See CONTRIBUTING.md for details. |
E2E tests did not runE2E tests run automatically for org/repo members and collaborators on pull requests. For other contributors, a maintainer must add the See E2E testing guide for details. |
PR Summary by QodoMerge validation loop fields during harness composition
AI Description
Diagram
High-Level Assessment
Files changed (4)
|
Code Review by Qodo
1. Forge partial loops fail validation
|
| merged := *fc.ValidationLoop | ||
| mergeValidationLoopInto(h.ValidationLoop, &merged) | ||
| h.ValidationLoop = &merged |
There was a problem hiding this comment.
1. Forge partial loops fail validation 🐞 Bug ≡ Correctness
Public loading paths call validateForge before ResolveForge, so a forge loop that only overrides schema is rejected for missing script before the new merge can inherit the top-level script. The added test bypasses this failure by calling ResolveForge directly.
Agent Prompt
## Issue description
Forge-specific `validation_loop` overrides cannot omit `script`, even though the new field-level merge is intended to inherit it from the top-level loop. Public loading paths validate forge blocks before resolving them, so schema-only overrides fail before reaching the merge.
## Issue Context
Update forge validation to account for the effective merged validation loop, while retaining required-script and URL validation after inheritance. Add a test through a public loading path rather than invoking `ResolveForge` directly.
## Fix Focus Areas
- internal/harness/forge.go[105-115]
- internal/harness/forge.go[203-210]
- internal/harness/forge_test.go[209-235]
- internal/harness/harness.go[363-382]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Description
When a child harness inherits from a base harness that defines
validation_loopand the child only overrides specific fields (such asvalidation_loop.schemato provide a custom validation schema),mergeBaseIntoChild,mergeForgeConfigInto, andmergeForgeConfigpreviously treatedValidationLoopas a whole-struct replacement (only carrying forwardPreflightCheck). As a result, the base'sscript,max_iterations, andfeedback_modewere silently discarded, causing subsequent validation errors:validation_loop.script is required when validation_loop is setSolution
mergeValidationLoopIntoto perform field-level merge forValidationLoopacross all composition paths (mergeBaseIntoChild,mergeForgeConfigInto, andmergeForgeConfig).compose_test.goandforge_test.goverifying field-level merge, conflict resolution, and immutability of source configs.Related Issue
Fixes #5448