Skip to content

Cap dry-run jobs to a single pass regardless of passes.max - #75

Merged
srhoods merged 1 commit into
masterfrom
dry-run-single-pass
Sep 7, 2026
Merged

srhoods merged 1 commit into
masterfrom
dry-run-single-pass

Conversation

@srhoods

@srhoods srhoods commented Sep 7, 2026

Copy link
Copy Markdown
Owner

Summary

  • A dry-run job stubs out copy/metadata/delete execution entirely — everything is walked, diffed, and journaled (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 whenever job.DryRun is set, regardless of the spec's passes.max — an operator doesn't need to remember to also set passes.max: 1 on a dry-run job.
  • Documented in docs/DESIGN-jobspec.md's --dry-run description.

Test plan

  • gofmt -l . / go vet ./... clean
  • go test -count=1 ./... — all green
  • New test TestDryRunStopsAfterOnePass — 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

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
@srhoods
srhoods merged commit b3b754f into master Sep 7, 2026
24 checks passed
@srhoods
srhoods deleted the dry-run-single-pass branch September 7, 2026 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant