fix(engine): teach merger fix agent to rebuild stale dist artifacts
The verification-fix agent prompt previously forbade modifying files unrelated to the failure, which blocked the natural fix when deterministic merge verification failed because of stale/missing plugin `dist/` outputs in sibling workspace packages (e.g. `Failed to resolve import "./cli-spawn.js"` from `fusion-plugin-hermes-runtime/dist`). - Add explicit guidance to detect stale-artifact failure signatures and rebuild the affected package(s) before editing source. - Allow the agent to fix pre-existing breakage on the base branch, preferring the smallest change that makes verification green. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
5
.changeset/merger-fix-agent-rebuild-stale-dist.md
Normal file
5
.changeset/merger-fix-agent-rebuild-stale-dist.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@runfusion/fusion": patch
|
||||
---
|
||||
|
||||
Improve merger verification-fix agent: detect stale/missing sibling-workspace `dist/` artifacts (e.g. `Failed to resolve import "./X.js"`, `ERR_MODULE_NOT_FOUND` into another package) and rebuild before assuming a code fix is needed. The agent may also modify files unrelated to the task's original change when needed to make pre-existing build/test breakage on the base branch pass.
|
||||
@@ -945,11 +945,12 @@ Do not refactor, rename broadly, or make opportunistic improvements.
|
||||
|
||||
## Rules
|
||||
1. Read the error output carefully to understand what is failing before editing anything
|
||||
2. Make targeted fixes to the failing code path
|
||||
3. After fixing, run the verification command to confirm the fix works
|
||||
4. Do NOT make any git commits — just fix the code
|
||||
5. Do NOT modify files unrelated to the failure
|
||||
6. If you cannot fix the issue within scope, explain why and what evidence indicates a deeper/root problem`,
|
||||
2. Before assuming a code fix is needed, check whether the failure is caused by stale/missing build artifacts in a sibling workspace package — typical signatures: \`Failed to resolve import "./X.js"\` pointing into another package's \`dist/\`, \`Cannot find module\`, or \`ERR_MODULE_NOT_FOUND\` referencing a workspace-internal path. In that case, rebuild the affected package(s) (e.g. \`pnpm --filter <pkg> build\`, or \`pnpm --filter "<scope>/*" build\` for a group) and re-run verification before editing source files.
|
||||
3. Make targeted fixes to the failing code path
|
||||
4. After fixing, run the verification command to confirm the fix works
|
||||
5. Do NOT make any git commits — just fix the code
|
||||
6. You MAY modify any files needed to make the verification pass, including files unrelated to this task's original change. Pre-existing build/test breakage on the base branch is in scope: fix it. Prefer the smallest change that makes verification green.
|
||||
7. If you cannot fix the issue within scope, explain why and what evidence indicates a deeper/root problem`,
|
||||
tools: "coding", // Agent needs read/write file access
|
||||
onText: logger.onText,
|
||||
onThinking: logger.onThinking,
|
||||
|
||||
Reference in New Issue
Block a user