fix(#799): preserve child pre_script during base forge composition - #823
fix(#799): preserve child pre_script during base forge composition#823fullsend-ai-coder[bot] wants to merge 2 commits into
Conversation
When a child harness declares a top-level pre_script and inherits from a base that has forge.<platform>.pre_script, mergeBaseIntoChild correctly preserves the child's top-level value but also merges the base's forge section. ResolveForge then unconditionally overwrites the top-level pre_script with the forge-level value — silently dropping the child's explicit script. Fix: after merging forge blocks, clear forge-level pre_script and post_script entries that were inherited from the base (not authored by the child). This prevents ResolveForge from overwriting the child's explicit declarations while preserving child-authored forge-level scripts. Add triage-specific runAgent tests verifying pre-script execution for the triage agent (exit 1 aborts, exit 0 proceeds to sandbox). Note: pre-commit could not run (network error in sandbox). The post-script runs an authoritative pre-commit check on the runner. Closes #799
|
🤖 Finished Review · ✅ Success · Started 3:16 AM UTC · Completed 3:31 AM UTC |
ReviewFindingsLow
Previous runReviewFindingsLow
Labels: PR fixes a bug in harness base composition (forge script inheritance), part of the dispatch/composition system |
|
/fs-fix |
|
🤖 Finished Fix · ✅ Success · Started 6:48 AM UTC · Completed 6:53 AM UTC |
Add a brief note to the base→child merge rules documenting that forge-level pre_script/post_script inherited from a base are cleared when the child explicitly declares the corresponding top-level field. This exception was introduced by the #799 fix to prevent ResolveForge from silently overriding child-authored scripts. Addresses review feedback on #823
🔧 Fix agent — iteration 1 (human-triggered)Addressed 1 review finding: added a brief addendum to ADR-0045 documenting the forge-script clearing exception introduced by the #799 fix. The annotation notes that inherited forge-level pre_script/post_script values are cleared when the child declares top-level equivalents, preventing ResolveForge from silently overriding child-authored scripts. Fixed (1):
Tests: passedNext steps:
|
|
🤖 Finished Review · ✅ Success · Started 6:58 AM UTC · Completed 7:11 AM UTC |
|
This pull request has been automatically marked as stale because it has not had any activity in the last month. It will be closed in 2 weeks if no further activity occurs. Remove the |
Summary
pre_scriptwas silently overwritten by the base'sforge.<platform>.pre_scriptduringResolveForgemergeForgeBlocks, clear forge-levelpre_script/post_scriptentries inherited from the base when the child explicitly declared the corresponding top-level fieldrunAgenttests verifying pre-script abort on exit 1 and proceed on exit 0Root cause
mergeBaseIntoChildcorrectly preserves the child's top-levelpre_scriptduring scalar merge. However, it also merges the base'sforgesection viamergeForgeBlocks. When the child has no forge section, it inherits the base's forge configs entirely — includingforge.github.pre_script. Later,ResolveForgeunconditionally overwrites the top-levelpre_scriptwith the non-empty forge-level value, silently dropping the child's explicit declaration.Test plan
TestMergeBaseIntoChild_ChildPreScriptSurvivesBaseForge— child top-level pre_script survives when base has forge.github.pre_scriptTestMergeBaseIntoChild_ChildForgePreScriptPreserved— child-authored forge-level pre_script is preserved (not cleared)TestLoadWithBase_ChildPreScriptSurvivesBaseForgeResolution— end-to-end: child pre_script survives full LoadWithBase + ResolveForge pipelineTestLoadWithBase_BaseForgePreScriptInheritedWhenChildOmits— existing behavior unchanged: base forge pre_script inherited when child omitsTestRunAgent_TriagePreScriptExitsNonZero— triage agent aborts on pre-script exit 1TestRunAgent_TriagePreScriptExitsZero_ProceedsToSandbox— triage agent proceeds past pre-script on exit 0🤖 Generated with Claude Code
Closes #799
Post-script verification
agent/799-triage-pre-script)ba77dbdbbd17e9bb18c47bf6efa023c98b697158..HEAD)