Repository navigation
C3: Migrate installer and config machinery to v2-native registrations #26
Copy link
Copy link
Closed
Labels
ready-for-agentFully specified, ready for an AFK agentFully specified, ready for an AFK agent
Description
Parent
Part of #23 (Spec: opencode-architect 1.0.0)
What to build
The config editor writes v2-native plugin registration entries; legacy v1 entries are tolerated read-only with an upgrade advisory. Manifest gating, registration-scope detection (never keyed off the launch directory), zero-write no-op, partial-cache-artifact detection, legacy copy-manifest migration, and the copy-mode refusal for code-backed packages are preserved. Cache-pruning and cache-location assumptions are re-validated against the verified-facts record and corrected where v2 changed them. CLI surface (install/uninstall/status/clear-cache) is unchanged for consumers.
Acceptance criteria
- Install writes a v2-native registration entry; zero-write no-op holds on repeat installs
- Legacy v1 entries are detected, left functional read-only, and advised to upgrade
- Uninstall, status, and clear-cache behave as before against v2 reality
- Scope detection still never writes and never keys off the launch directory
- Migrated config-editor and installer tests green
Blocked by
- #C2
Verification (PR #34)
- v2-native entry + zero-write no-op — installer writes/verifies the
pluginskey;installer.test.ts: "registers the plugin entry and writes a plugin-mode manifest" (plugins: ["opencode-architect@latest"]), "re-running with a matching manifest and entry is a zero-write no-op" (byte-identical manifest + config), and the legacy variant "a legacy v1 entry is left read-only with an advisory and never registered twice". - Legacy v1 read-only + advisory —
plugin-config.test.ts: legacy entry is a zero-write noop with an upgrade advisory;config.jsonentries flagged inert per opencode-v2-facts §5/§13-3; "left functional" rests on the settled fact that v2 migratesplugin→pluginsat runtime (facts §5, §7). Verified end-to-end viacli.test.ts(exit 0, file untouched, advisory on stderr) and ininstaller.test.tsinstall/uninstall/status legacy tests. - Uninstall/status/clear-cache against v2 reality — migrated
installer.test.tsuninstall/status suites andcache-cleaner.test.ts+cli.test.tsclear-cache suites now operate on the v2 generation cache (<XDG_CACHE_HOME|~/.cache>/opencode/npm/<key>/<generation>), including a generation-layout seeding test; pinned/foreign keys preserved;--package/--all/--dry-run/--yessemantics unchanged. - Scope detection — detection paths (
findRegistration/status) are read-only and derive candidates from the explicit scope +projectDironly (.opencode/scope base, repo root, XDG global); neverprocess.cwd()below the CLI boundary. Covered by "scope base config wins over repo root", "global scope creates scope-base opencode.jsonc", "re-registering one scope leaves the other scope untouched", "detects a registration without a manifest". - Tests green —
bun run checkclean;bun test156 pass / 5 fail, where the 5 are the pre-existing Windows-environment baseline of this branch (3 chmod-dir-bit removal tests + 2 tarball POSIX-path tests; pass on Linux CI). Zero new failures; +13 tests over baseline.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
ready-for-agentFully specified, ready for an AFK agentFully specified, ready for an AFK agent
Activity
refactor(cache): shared NpmCache class; XDG-aware stale-copy advisory…
refactor(config): mixed-key uninstall warns about leftover legacy ent…
fix(tests): stale v1-era cache paths left from the layout migration (…