feat: evolve plugin as primary install mode with content-aware deployment and cache hygiene - #21
Merged
Merged
Conversation
added 24 commits
September 22, 2026 08:16
Packager derives the package.json content declaration from its asset inventory (ADR-0008): assets for skills/commands-only packages, code when any agent, tool, or plugin content ships. Templates carry the field defaulting to assets; publisher verifies it at intake, carries it through expansion, and covers it in post-publish verification. Closes #16.
…#17) install ensures the plugin entry via the surgical editor, writes a generalized plugin-mode manifest, and is a zero-write no-op when up to date; --mode copy is refused for this code-backed package. Legacy copy installs migrate: payload removed per the old manifest (after a read-only config parse check) with a printed notice, before the entry is added. uninstall surgically removes the entry plus manifest and residual payload; status reports mode, version, and registration file. Manifest schema also covers copy mode with a folder-hash content-hash. README and CHANGELOG updated. Grounded in ADR-0008, supersedes ADR-0004.
…#18) Installer template reads the content declaration: assets-only packages copy-install by default (no config writes) with --mode plugin as the opt-in; code-backed packages always register and --mode copy throws CopyModeUnsupportedError. Plugin-array edits go through a ported surgical editor (plugin-config.template.txt), the manifest generalizes to record mode, entry, and target config file (preserving payload hashes across both paths), registration detection adds global config.json, and status/uninstall reflect mode, version, and registration. The load-time hook ensures assets only in registered scopes, performs zero writes when the manifest matches and the entry is present, and never throws.
Checklist adds B5 (surgical writes), B6 (registration zero-write no-op), E1 (content declaration consistency), E2 (binary mode enforcement), with E1-E2/B5-B6 in the hard non-conformance set; the auditor reviews A-E. Plugins and config references document the allowed config patterns (including global config.json), the repo-root opencode.jsonc create-default, and the surgical-writer rule. Closes #19
Every install invocation, including a no-op, removes opencode-architect, opencode-architect@latest, and opencode-architect@<version> from the OpenCode package cache (XDG_CACHE_HOME || ~/.cache + opencode/packages) so OpenCode re-fetches the just-installed version on next start. Pinned versions and other packages are preserved; removal failures warn without failing the install, and cleared paths are reported.
…ispatch, print cleared cache
…omoted-source retirement
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
--mode copyis refused for code-backed packages (ADR-0008, supersedes ADR-0004).clear-cacheCLI subcommand with confirmation gates,--dry-run, and a class-based CacheCleaner; installs prune stale package-cache copies so OpenCode re-fetches the just-installed version.bunx <pkg> clear-cache.Why
Plugin-mode installs are safer and reversible than copying payload files, and stale OpenCode cache entries were causing outdated versions to load after install. Content declarations let generated packages pick the correct deployment strategy automatically.
Testing
bun testwired via a start script.