Skip to content

feat: clone external oh-my-zsh plugins on snapshot restore#120

Merged
fullstackjam merged 1 commit into
mainfrom
feat/zsh-external-plugins
Jun 1, 2026
Merged

feat: clone external oh-my-zsh plugins on snapshot restore#120
fullstackjam merged 1 commit into
mainfrom
feat/zsh-external-plugins

Conversation

@fullstackjam
Copy link
Copy Markdown
Collaborator

Summary

  • OpenBoot wrote plugin names into .zshrc's plugins=() 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 (mirrors the screen-recording-packages.yaml precedent) mapping known external plugin names → https git repos, exposed via config.ZshPluginRepoURL(name).
  • On RestoreFromSnapshot, any plugin in the catalog is git-cloned into $ZSH_CUSTOM/plugins before plugins=() is written. Built-in and unknown names are left untouched.

Invariants held

  • Contract unchanged: plugins stays []string; the URL never enters .zshrc or the snapshot.
  • No new no-direct-exec: the only exec stays in internal/system via a cloneRunner seam — baseline diff is a pure line-number shift from the added import (reason annotations preserved).
  • cfg.DryRun gated, 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 remote probing + a contract migration.

Test plan

  • go vet ./...
  • make test-unit (L1, incl. archtest + integration) — green, no failures
  • New L1 tests: 7 cases in internal/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 in internal/config/zshplugins_test.go
  • archtest baseline diff verified to be line-number shifts only

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.
@github-actions github-actions Bot added the tests Tests only label Jun 1, 2026
@fullstackjam fullstackjam merged commit d917270 into main Jun 1, 2026
12 checks passed
@fullstackjam fullstackjam deleted the feat/zsh-external-plugins branch June 1, 2026 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests Tests only

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant