feat: clone external oh-my-zsh plugins on snapshot restore#120
Merged
Conversation
OpenBoot only wrote plugin names into .zshrc's plugins=() array but never cloned external plugins (zsh-autosuggestions, zsh-syntax-highlighting, ...) into $ZSH_CUSTOM/plugins, so those plugins silently failed to load on a restored machine. Add a curated embedded catalog (internal/config/data/zsh-plugins.yaml, mirroring the screen-recording-packages.yaml precedent) mapping known external plugin names to https git repos. On RestoreFromSnapshot, any plugin present in the catalog is git-cloned into $ZSH_CUSTOM/plugins before plugins=() is written; built-in and unknown names are left untouched. - Snapshot/contract unchanged: plugins stays []string, URL never persisted to .zshrc and never enters the snapshot. - The only exec stays in internal/system via a cloneRunner seam, so no new no-direct-exec violation (baseline diff is a line shift from the import). - cfg.DryRun gated, https-only, idempotent skip-if-exists, non-fatal clone. Baseline edits are line-number shifts only (import added one line); the hand-authored reason annotations are preserved.
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
.zshrc'splugins=()but never cloned external plugins (zsh-autosuggestions,zsh-syntax-highlighting, …) into$ZSH_CUSTOM/plugins— so those plugins silently failed to load on a restored machine.internal/config/data/zsh-plugins.yaml(mirrors thescreen-recording-packages.yamlprecedent) mapping known external plugin names → https git repos, exposed viaconfig.ZshPluginRepoURL(name).RestoreFromSnapshot, any plugin in the catalog is git-cloned into$ZSH_CUSTOM/pluginsbeforeplugins=()is written. Built-in and unknown names are left untouched.Invariants held
[]string; the URL never enters.zshrcor the snapshot.no-direct-exec: the only exec stays ininternal/systemvia acloneRunnerseam — baseline diff is a pure line-number shift from the added import (reason annotations preserved).cfg.DryRungated, https-only, idempotent skip-if-exists, non-fatal clone (one bad repo never aborts a restore).Known boundary (intentional)
Plugins not in the catalog (private/obscure repos) still restore as bare names with no clone — the structural cost of keeping the snapshot contract untouched. Supporting arbitrary private plugins would need capture-time
git remoteprobing + a contract migration.Test plan
go vet ./...make test-unit(L1, incl. archtest + integration) — green, no failuresinternal/shell/clone_plugins_test.go(clone known / skip built-in / idempotent / dry-run no-op / non-https skip / non-fatal failure / bare-names-in-zshrc) + 4 ininternal/config/zshplugins_test.go