Cap dry-run jobs to a single pass regardless of passes.max - #75
Merged
Merged
Conversation
A dry run never writes anything (copy/metadata/delete execution is stubbed - see --dry-run in DESIGN-jobspec.md), so a second pass would just re-walk and re-diff the same, unchanged source and destination trees. There is nothing a later pass could see that pass 1 didn't already report, so running passes.max passes for a dry-run job (the prior behavior) was pure wasted work at scale. decideNextPass now caps the effective pass ceiling to 1 whenever job.DryRun is set, regardless of what the spec's passes.max says - operators don't need to remember to also set passes.max: 1 on a dry-run job spec. Verified via falsification: reverted the cap, confirmed the new test fails (pass 2 gets seeded instead of the job completing), restored the fix, confirmed it passes. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PsdNZLfmAFrMX2VUtkLtmm
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
would_copy/would_delete), but nothing is ever written. A second pass therefore just re-walks and re-diffs the same, unchanged source and destination trees; there's nothing a later pass could report that pass 1 didn't already.decideNextPass(coordinator/internal/passctrl/passctrl.go) now caps the effective pass ceiling to 1 wheneverjob.DryRunis set, regardless of the spec'spasses.max— an operator doesn't need to remember to also setpasses.max: 1on a dry-run job.docs/DESIGN-jobspec.md's--dry-rundescription.Test plan
gofmt -l ./go vet ./...cleango test -count=1 ./...— all greenTestDryRunStopsAfterOnePass— verified via deliberate-breakage falsification: reverted the cap, confirmed the test fails (pass 2 gets seeded instead of the job completing), restored the fix, confirmed it passes🤖 Generated with Claude Code
https://claude.ai/code/session_01PsdNZLfmAFrMX2VUtkLtmm