Manifest-driven deploy: pilot driver with dry-run, backup-on-conflict and audit#10
Draft
nonrational wants to merge 8 commits into
Draft
Manifest-driven deploy: pilot driver with dry-run, backup-on-conflict and audit#10nonrational wants to merge 8 commits into
nonrational wants to merge 8 commits into
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0117PaLyHdWjQwzFbdP34Hft
Parses [--dry-run] [apply|audit] and validates every manifest line (column count, condition key, source existence) before acting. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0117PaLyHdWjQwzFbdP34Hft
Reconciles each condition-matched manifest entry: correct link is a no-op, missing target is linked (creating parents), wrong symlink is replaced, and a regular file or directory is moved to <target>.bak first. Refuses to clobber an existing .bak and exits non-zero instead. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0117PaLyHdWjQwzFbdP34Hft
Prints the same per-entry decisions prefixed "would:" and touches nothing, proven in tests by checksumming the tree before and after. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0117PaLyHdWjQwzFbdP34Hft
Read-only drift report per manifest entry: ok, missing or drift, with non-zero exit when anything is missing or drifted. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0117PaLyHdWjQwzFbdP34Hft
Verified against the live machine from the main checkout: dry-run apply proposes zero changes and audit exits clean. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0117PaLyHdWjQwzFbdP34Hft
Reject targets that are neither absolute nor ~/-prefixed (a dropped prefix would otherwise scatter symlinks relative to the CWD), and make condition_matches fail closed on unrecognized conditions. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0117PaLyHdWjQwzFbdP34Hft
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.
Spike for #6, answered yes: a small manifest + bash driver reaches parity with
link-dotfiles.shfor the pilot slice, with no external engine. Full findings: #6 (comment)What
deploy.sh(162 lines, bash 3.2 + coreutils only). Reads a 3-columnmanifest(source, target, optionalos=/host=condition) and reconciles each matching entry to a symlink. Modes:apply(default),--dry-run,audit. Validates the whole manifest before acting; backup-on-conflict is non-interactive and refuses to clobber an existing.bak; entries whose condition doesn't match are skipped, never removed.manifest. Pilot slice only:bin.Darwin,bin.Linux,.bashrc.nyx.link-dotfiles.shis untouched and keeps handling everything else until migration.test_deploy.sh. 23 tests, fully sandboxed (own repo copy + fake$HOMEunder mktemp); covers fault injection and a checksum proof that--dry-runchanges nothing.docs/superpowers/.Verification
./test_deploy.sh: 23 passed, 0 failed on /bin/bash 3.2.deploy.sh --dry-run applyproposes zero changes;deploy.sh auditexits 0. Output captured in the findings comment.Next steps (post-merge)
bin.$(uname)special case fromlink-dotfiles.shonce the manifest covers it.