Skip to content

Epic: safe kit-bundle update propagation — acq detects stale sandboxes + offers refresh #235

Open

Description

@wz-gsa

Goal

When USAi adds models (or any built-in kit config changes) a maintainer updates the canonical config in agentic-coding-patterns once, pins it in Quickstart, and existing sandboxes can then be safely refreshed. Today the model-catalog authoring path works, but existing sandboxes silently drift.

Investigation summary (verified against code)

  • Model-catalog authoring already works. agentic-coding-patterns ships // BEGIN/END GENERATED USAI MODELS markers in the usai-provider kit's opencode.jsonc, and sync-usai-models.mjs splices only between the markers (replaceBetween()), with bounded timeout + size + shape validation. So "update models easily" is already a npm run sync:usai-models + review + commit workflow.
  • Delivery to a sandbox: the kit's merge-global-config.mjs runs at startup — COPY verbatim into an empty global ~/.config/opencode/opencode.jsonc, else DEEP-MERGE the kit's keys in. Audit confirms it preserves unrelated keys and user permission sub-keys (per-leaf override only), and the kit ships no mcp, so user MCP allow-lists are untouched.
  • The real gap: for an existing sandbox, acq run → acq_backend_ensure_kits_applied on sbx only injects kits that are absent (feature-probe); it does not detect an installed bundle older than the local PATTERNS_KIT_REF, nor offer a refresh. msb re-applies all four idempotently every run.
  • No provenance: nothing inside a sandbox records the installed patterns SHA / bundle version, so "is this sandbox current?" is unanswerable today.
  • PATTERNS_KIT_REF is a full 40-char SHA (acq.backends/common.sh); built-in bundle = usai-provider, agentic-coding-playbook, zscaler-ca-certificate, git-ssh-sign. acq runs from a git checkout (symlink-aware).

Design approved 7/7 via multi-model higher-order consensus (architect, security, devex, ai_ml, pm, contrarian, scope_steward).

Phases (2 ordered PRs + deferred follow-up)

Source-of-truth discipline

The local Quickstart checkout (its pinned PATTERNS_KIT_REF) is the approved source of truth — never mutable patterns main. Two ordered PRs; Quickstart PR pins to the merged Patterns commit.

Non-goals / guardrails

No eval; bounded timeouts; treat kit/GitHub metadata as untrusted; never print secrets; never destroy sandbox state; fail-open when the check can't run. Do not weaken SHA pinning or backend abstraction.

Related patterns issue: GSA-TTS/agentic-coding-patterns (PR1 provenance/schema).

Co-authored-by: OpenCode Agent [email protected]

Activity

  1. wz-gsa commented on Aug 4, 2026

    @wz-gsa
    ContributorAuthor

    Grooming update (2026-08-03): epic status —

    The core epic goal (maintainer bumps the pin once → existing sandboxes detect drift + can refresh) is delivered. Remaining children (#237, #240) are follow-ons; recommend keeping this epic open until they land, or converting to a checklist.

  2. added
    epicParent tracking issue coordinating multiple child issues
    on Aug 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestepicParent tracking issue coordinating multiple child issues

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions