Fail-fast on compile errors in refactor convergence loop#945
Merged
Conversation
Add a compile check (validate_only) after each convergence iteration applies fixes. If the code no longer compiles — e.g. 'failed to resolve mod' parse errors — further iterations cannot recover, so bail immediately with 'stopped_compile_failure' status. Previously the loop would retry up to 3 times, each with a cold compile in the sandbox, burning 20+ minutes of CI time on errors that are structurally unrecoverable. Now it stops after the first iteration that breaks compilation.
When the stage loop runs audit → lint → test, if the audit stage's fixes break compilation in the sandbox, subsequent lint and test stages run on broken code — producing bogus findings and wasting CI time. After each stage that modifies files, run validate_only() on the sandbox. If compilation fails, log the error, record the stage's results, and skip all remaining stages. The final validate_write() in the planner still catches the failure on the real tree and rolls back.
Contributor
Homeboy Results —
|
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
validate_only) after each convergence iteration. If code no longer compiles (e.g.failed to resolve mod, parse errors), breaks immediately withstopped_compile_failureinstead of retryingaudit → lint → test). If a stage breaks sandbox compilation, skips remaining stages instead of running lint/test on broken codeProblem
Two layers of wasted CI time on unrecoverable errors:
1. Convergence loop (verify.rs)
The loop retries up to 3 times when fixes don't converge. Each retry is a cold compile in the sandbox. When a fix introduces a parse/resolve error, no amount of retrying will fix it:
2. Stage loop (planner.rs)
When
--from allrunsaudit → lint → test, if audit fixes break compilation:Fix
Convergence loop
After
run_fix_iteration()applies fixes, runvalidate_only()before the structural re-audit. If compilation fails, log the error and break withstopped_compile_failure.Stage loop
After each stage that modifies files, run
validate_only()on the sandbox. If broken, log + skip remaining stages.Both checks use the existing
validate_only()function — no new infrastructure needed.