Skip to content

feat(plugin): plugin install/remove, bundled + external sources - #148

Merged
rucka merged 14 commits into
mainfrom
feature/US-100-gilberto-plugin-install-remove-bundled-external
Nov 6, 2026
Merged

rucka merged 14 commits into
mainfrom
feature/US-100-gilberto-plugin-install-remove-bundled-external

Conversation

@rucka

@rucka rucka commented Nov 3, 2026 •

Copy link
Copy Markdown
Owner

PR Information

Story: #100 · Type: Feature

Closes #100

Summary

  • gilberto plugin install <name|repo-url> / remove <name> replace placeholders; cwd = vault
  • Sources: bundled plugins/<name>, single-plugin repo, multi-plugin repo (subdirs with manifest); git clone --depth 1 to temp, always cleaned
  • Install: validateManifest → plan (traversal/symlink/collision checks) → stage → backup → move → row; any failure rolls back (vault unchanged)
  • Skills never copied; hint skills present (via installed_plugins.json, best-effort) or /plugin install <name>
  • AC1–AC9 covered: per-AC vitest on temp vaults, file:// git fixtures, failure injection

Decisions

  • Contribution record anatomy/.plugins/<name>.json (path → sha256): remove deletes exactly those, keeps user-edited unless --purge
  • plugins.md row: name | manifest version (default 0.0.0; |/newline refused) | YYYY-MM-DD
  • Templates require gilberto.pillar → anatomy/templates/<pillar>/<basename>/
  • Bundled root resolved from CLI package (plugins/ copied in by postbuild, listed in files); override GILBERTO_PLUGINS_DIR
  • ADL: .pair/adoption/decision-log/2026-11-03-plugin-install-contribution-record.md

Changes Made

  • Added: apps/cli/src/commands/plugin/{registry,source,marketplace,plan,record,install,remove}.ts + tests, testkit.ts
  • Modified: handler.ts, metadata.ts (flags/help), manifest.ts (export insidePluginDir), placeholders.test.ts
  • Packaging: scripts/postbuild.js copies repo plugins/ into the package; package.json files ships it; packed-layout test (source.packed.test.ts)
  • Added: changeset (minor), ADL

Testing

  • pnpm quality-gate:ci green (ts:check, tests, lint, prettier, mdlint, hygiene)

🤖 Generated with Claude Code

@rucka

rucka commented Nov 3, 2026

Copy link
Copy Markdown
Owner Author

Code Review — PR #148

Verdict

risk:red · cost:green — CHANGES-REQUESTED — 3 blocking Minor (r0-1..3).

Open findings: 4 (3 Minor, 1 Question).

Classification changed: unclassified → risk:red — untrusted remote repo content.

PR: #148 · Date: 2026-11-03 · Story: US-100

Classification matrix — per dimension
Dimension Tier Source Note
Service/domain criticality yellow KB default
Change/diff risk yellow diff multi-module
Business impact yellow subdomain supporting
Security relevance red security pass untrusted input
Coupling balance green coupling pass balanced

Tier = max(assessed).

Assessments

Security — Input validation

Verdict: yellow — paths/names/keys validated; manifest version written unsanitized to plugins.md (r0-1).

Details
  • realpath containment, symlink refusal, SAFE names/keys, -- + protocol.ext.allow=never on clone: verified.

Security — Output handling

Verdict: yellow — markdown table row built from untrusted version (r0-1).

Security — Authentication

Verdict: green — none touched.

Security — Authorization

Verdict: green — none touched.

Security — Introduced vulnerabilities

Verdict: yellow — 1 introduced (registry injection, r0-1), 0 pre-existing.

Cost

Verdict: cost:green — no cost signal (local git subprocess only).

Architecture (Coupling)

Verdict: green — new modules within plugin command; anatomy paths per ADL file map.

Bug fix — Red test before fix

Verdict: not applicable — not a bug fix.

Details

Findings by severity

Minor (must fix before merge)

  • r0-1 install.ts:38, registry.ts:49 — manifest version "1.0 | x |\n| ghost | 9 | 2020-01-01" ⇒ readRows = [p 1.0 x, ghost 9 …]: phantom plugin row; "1.0 | evil" ⇒ installed: "evil". Reject/escape | and newlines in version.
  • r0-2 source.ts:10, apps/cli/package.json files, metadata.ts example — npm-installed CLI has no plugins/ ⇒ gilberto plugin install gilberto-core (the help example) fails "bundled: none". Ship plugins/ with the package and resolve from it.
  • r0-3 handler.test.ts:51, source.test.ts:59 — AC2 "temp removed": replacing source.cleanup() in handler with no-op leaves all 76 plugin tests green; clone-failure test asserts no temp-dir absence. Assert temp dir gone after handler install and after clone failure.

Questions (informational, never blocking)

  • r0-4 remove.ts:35, install.ts:56 — remove keeps edited file, deletes record ⇒ reinstall refused even with --force ("not contributed by p"). Intended?
Positive feedback
  • Stage/backup/undo rollback, tested by failure injection incl. --force.
  • Traversal hardening via realpath + symlink refusal.
Functionality & requirements (AC coverage)
  • AC1, AC3–AC9 proven; AC2 weak (r0-3).
Testing & quality gates
  • pnpm quality-gate:ci exit 0 on 7a70808 (setup pnpm install --frozen-lockfile exit 0).
Adoption compliance
  • ADL recorded; no new deps.

@rucka

rucka commented Nov 3, 2026 •

Copy link
Copy Markdown
Owner Author

Open findings

Re-review r2: 2 new (r1-5 new in r1, r2-6 new in r2), 3 still open.

id severity found status location summary resolution
r0-4 Questions r0 open apps/cli/src/commands/plugin/remove.ts:35, apps/cli/src/commands/plugin/install.ts:56 Carried advisory question: remove keeps edited files but deletes ownership, so reinstall --force refuses coll… —
r1-5 Minor r1 open apps/cli/scripts/postbuild.js:6, .gitignore, turbo.json:6 (build.outputs) (new) postbuild generates apps/cli/plugins/ (98 files) but it is neither gitignored nor a declared turbo buil… —
r2-6 Minor r2 open .pair/adoption/decision-log/2026-11-03-plugin-install-contribution-record.md:13, .pair/adoption/decision-log/2026-11-03- (new) Accepted ADL still says published CLI files do not ship plugins/ and bundled installation works only fr… —

rucka and others added 14 commits November 6, 2026 14:09
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Pair-RED-Snapshot: pr=148; phase=r1-g1; base=7a70808f31c76ff99cd45c0ca66b35160618c22e; manifest=.pair/red-snapshots/pr-148-r1-g1.json
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Pair-RED-Snapshot: pr=148; phase=r1-g2; base=30a1a771b8e4feff9b9b4a2f0a70f939fc65e46b; manifest=.pair/red-snapshots/pr-148-r1-g2.json
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Pair-RED-Snapshot: pr=148; phase=r1-g2-rev2; base=e11705d65f4171aba9ecf0900ba4ba8326b1884d; manifest=.pair/red-snapshots/pr-148-r1-g2-rev2.json
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Pair-RED-Snapshot: pr=148; phase=r1-g3; base=57f03067c1dd5293ff1aa23b8a79a22a5b1b9e22; manifest=.pair/red-snapshots/pr-148-r1-g3.json
r1-5: apps/cli/plugins gitignored, turbo build output, root plugins/ input.
r2-6: ADL reflects packaged plugins/ preference.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rucka
rucka force-pushed the feature/US-100-gilberto-plugin-install-remove-bundled-external branch from b71049f to 96ce90e Compare November 6, 2026 13:12
@rucka
rucka merged commit 1a66600 into main Nov 6, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gilberto plugin install/remove (bundled + external sources)

1 participant