feat(wizard): Phase 2 — use-case package opt-in (Matilde) via trust-gated install#97
Merged
Merged
Conversation
…ated install Adds an opt-in 'use-case package' picker to create-new (folded into the Identity step) backed by a server-side registry (infra/usecase-templates.json). - lib/services/usecase-templates.ts: registry loader + installUseCaseTemplate, which installs a template's git-sourced artifacts via the shared trust-gated installArtifacts and seeds its SOUL (the SOUL file is scanned in isolation by the same gate before it overwrites SOUL.md). Copy + gate only — no script exec. - GET /api/usecase-templates: lists templates (id/name/description/recommends). - Deploy route: resolves the template id (unknown -> 400), enables its plugins in config.yaml, and installs it after the baseline (fails the create before the container starts if the gate refuses anything). - Wizard: package picker prefills recommended provider/model; threads template id. - Registry: Matilde (science) as the first entry, pinned to v0.1.0. Tests: usecase-templates (install + SOUL gate + poisoned-SOUL refusal) + route wiring (install called; unknown id 400; plugin enabled). tsc clean; next build ok; full suite 474 pass / 2 pre-existing fail. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…eanup, name guard) Independent audit (MERGE-WITH-NITS) findings, now fixed: - HIGH: gate scanned only at 'context' scope, so exfil/persistence/secret/ config-mod patterns weren't caught — and Phase 2 routes a SOUL (identity prompt) + skills through it. gateArtifactDir now takes a scope; use-case template artifacts AND the SOUL are gated at 'strict'. Verified Matilde's real SOUL+skill have zero strict findings (no false positives); added a test using a strict-only exfil payload to prove strict is active. - MEDIUM: a template-install failure left a half-written agent dir (.env secrets) on disk. Deploy now removes agentDataDir on provisioning failure (before any container starts) + frees the slug for retry; covered by a route test. - LOW: artifact name from the manifest now traversal-validated (GIT_NAME_RE + no '..') before becoming a path segment / config.yaml entry. Full suite 475 pass / 2 pre-existing fail; tsc clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Phase 2 — use-case packages in create-new
Builds on the trust-gate (#96). Lets a user opt into an opinionated public package when creating an agent; Matilde (science) is the first. Everything a template pulls is fetched from a pinned git ref and scanned by the trust gate before install — copy + gate only, no script execution.
What's added
lib/services/usecase-templates.ts— registry loader +installUseCaseTemplate: installs a template's git-sourced artifacts via the shared trust-gatedinstallArtifacts, then seeds its SOUL. The SOUL file is scanned in isolation (copied alone into a scratch dir →gateArtifactDir) so sibling files (e.g. a setup script) can't taint the scan and a poisoned SOUL is refused.GET /api/usecase-templates— lists templates (id/name/description/recommends).config.yaml, installs it after the baseline; a gate refusal fails the create before the container starts.infra/usecase-templates.json— Matilde entry, pinned toNimbleCoAI/Matilde#v0.1.0(pluginmatilde_plugin, skillhermes-skill, SOULdocker/SOUL.Matilde.md). Matilde was packaged self-contained in refactor: self-contained plugin (vendor engine into matilde_plugin) for HSM install NimbleCoOrg/Matilde#7 and tagged v0.1.0.Decisions
instance-setup.shis never run; artifacts are overlaid + scanned.Verification
next buildok · full suite 474 pass / 2 fail (pre-existingharness-image,harness-compose-fallback)usecase-templates(install + SOUL gate + poisoned-SOUL refusal). Route: template install called; unknown id → 400; plugin enabled in config.ARTIFACT_GIT_TOKEN(private Matilde repo) on the Mac Mini, same as Phase 1.🤖 Generated with Claude Code