setup: Replace directory-level install with per-asset merge-aware install - #180
Open
davidabram wants to merge 2 commits into
Open
setup: Replace directory-level install with per-asset merge-aware install#180davidabram wants to merge 2 commits into
davidabram wants to merge 2 commits into
Conversation
davidabram
force-pushed
the
non-desctructive-setup
branch
from
August 4, 2026 08:58
b08af36 to
1c043e9
Compare
davidabram
force-pushed
the
non-desctructive-setup
branch
2 times, most recently
from
August 4, 2026 14:08
1c043e9 to
c4efb12
Compare
davidabram
force-pushed
the
non-desctructive-setup
branch
from
August 7, 2026 17:51
0e7c843 to
cb7da31
Compare
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…tall sce setup previously staged the full catalog into a temp directory and swapped it over the whole .claude/, .opencode/, or .pi/ target directory, destroying any user-owned files (skills, settings.local.json, CLAUDE.md, etc.) living alongside SCE's own assets. The two generated JSON configs (.claude/settings.json, .opencode/opencode.json) had the same problem one level down: written whole, they clobbered a user's permissions, env, model, mcp, or non-SCE hook/plugin entries. Installation now happens per asset: each embedded file is staged and atomically renamed into place individually, and assets the current selection or catalog no longer owns are pruned by relative path instead of the whole directory being rebuilt. The two config files are merged via a new config_merge module that replaces only the SCE-owned fragment (hook entries by marker, plugin paths by prefix) and leaves every other key and entry untouched, idempotently across repeated installs. sce doctor's integration inspection is updated to match: the two merge-target configs are checked by whether their SCE-owned fragment is current rather than by byte-exact sha256, and `--fix` gained a repair path that reinstalls just a drifted merge-target asset. Co-authored-by: SCE <sce@crocoder.dev>
…iting them Every setup write — config assets and required git hooks alike — unlinked the destination file before renaming the staged replacement over it. The staging file already lives in the destination's directory, so the rename alone is atomic; the unlink only opened a window where the file did not exist, and on a rename failure the error path deleted the staging copy too, leaving neither. This mattered once `.claude/settings.json` and `.opencode/opencode.json` became merge targets holding user-owned keys that setup cannot reconstruct. Both pre-deletes are dropped in favor of atomic rename. `sce setup --hooks` also replaced `pre-commit`, `commit-msg`, and `post-commit` wholesale, destroying any hook a repository already ran (husky, lefthook, hand-written). Each canonical hook payload is now delimited by an SCE managed block marker pair. Install creates the full script when no hook exists, replaces the block in place when one already carries it, recognizes and replaces a legacy pre-marker SCE payload wholesale, and otherwise appends the block after a foreign hook's content so SCE always runs last. A last-effective-line heuristic reports an advisory when a foreign hook's trailing zero-indent `exec`/`exit` would make the appended block unreachable. `sce doctor` now classifies hook content by managed-block currency instead of byte-exact comparison, so foreign content around a current block does not read as drift. Co-authored-by: SCE <sce@crocoder.dev>
davidabram
force-pushed
the
non-desctructive-setup
branch
from
August 8, 2026 08:45
cb7da31 to
4bf785a
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.
No description provided.