refactor(Scripts): make mutations transactional - #287
Open
kyleve wants to merge 6 commits into
Open
Conversation
kyleve
commented
Aug 17, 2026
| add_operation(target: target, staged: nil) | ||
| end | ||
|
|
||
| def commit |
Owner
Author
There was a problem hiding this comment.
Posted by an AI agent on kve's behalf.
Review focus: this ordering is load-bearing. Apply failures roll back while every backup still exists; backup cleanup starts only after the whole replacement commits, and a cleanup failure reports the committed state instead of attempting a now-unsafe partial rollback.
kyleve
force-pushed
the
codex/transactional-script-mutations
branch
3 times, most recently
from
August 19, 2026 02:58
c6e3b12 to
5f0dae7
Compare
kyleve
force-pushed
the
codex/transactional-script-mutations
branch
from
August 19, 2026 03:06
5f0dae7 to
ace4f75
Compare
kyleve
force-pushed
the
codex/transactional-script-mutations
branch
from
August 19, 2026 03:22
ace4f75 to
77eaf54
Compare
kyleve
force-pushed
the
codex/transactional-script-mutations
branch
3 times, most recently
from
August 19, 2026 04:07
f18daf5 to
6562984
Compare
kyleve
force-pushed
the
codex/transactional-script-mutations
branch
from
August 19, 2026 04:09
6562984 to
ee96f79
Compare
kyleve
force-pushed
the
codex/transactional-script-mutations
branch
from
August 19, 2026 04:14
ee96f79 to
2e4b0cf
Compare
kyleve
force-pushed
the
codex/transactional-script-mutations
branch
from
August 19, 2026 04:20
2e4b0cf to
79c7c86
Compare
kyleve
force-pushed
the
codex/transactional-script-mutations
branch
from
August 19, 2026 04:37
79c7c86 to
c6c0051
Compare
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
--dry-rundevicectlJSON and makeWhere/installdry-runnable/Applications/Ledger.appWhy
This final layer covers commands that mutate tracked catalogs, install to physical hardware, or replace an application bundle. Their policy is now directly testable without automating destructive real operations.
Design decisions
FileTransactionvalidates every boundary before commit, rejects symlink/cross-filesystem replacement boundaries, keeps backups through commit, and reports cleanup or rollback failuresCompatibility
Public paths, existing flags, defaults, output streams, and usage statuses remain stable.
--dry-runis additive on mutating commands.Adversarial coverage
Testing
./shellcheck,./swiftformat --lint,./attribution --check,./snapshot-shards check./test StuffCoreTestspassed./profile --tests-only --no-snapshotspassed (2,119 tests)./flaky --suite-runs 1 --iterations 2 --no-updatepassed (2,120 tests observed)./test --everythingpassed (1,957 unit tests + 46 snapshot suites)tuist test Ledger-macOS-Testspassedmanual_full_gatepassed on the exact stack tip: shared build, unit worker, and snapshot workerStack
Fourth and final PR; based on #288. The entire stack is rebased onto current
main.