Repository navigation
Description
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-patternsships// BEGIN/END GENERATED USAI MODELSmarkers in the usai-provider kit'sopencode.jsonc, andsync-usai-models.mjssplices only between the markers (replaceBetween()), with bounded timeout + size + shape validation. So "update models easily" is already anpm run sync:usai-models+ review + commit workflow. - Delivery to a sandbox: the kit's
merge-global-config.mjsruns 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 userpermissionsub-keys (per-leaf override only), and the kit ships nomcp, so user MCP allow-lists are untouched. - The real gap: for an existing sandbox,
acq run→acq_backend_ensure_kits_appliedon sbx only injects kits that are absent (feature-probe); it does not detect an installed bundle older than the localPATTERNS_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_REFis a full 40-char SHA (acq.backends/common.sh); built-in bundle = usai-provider, agentic-coding-playbook, zscaler-ca-certificate, git-ssh-sign.acqruns 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)
- PR1 (Patterns): additive
provenancefield on the hybrid/v1 kit schema (repo + full SHA + bundle version + kit names) + a permission-preservation regression test (prove a user'spermissionsub-keys survive a merge — no behavior change; audit showed the current merge is already safe) + a drift-guard test (fail if the acq-kits and sbx-kitsopencode.jsoncpayloads ever diverge, so a model update to one but not the other is caught). PR1: kit-bundle provenance schema field + permission-preservation & acq/sbx drift-guard tests agentic-coding-patterns#273 - PR2 (Quickstart, pinned to merged PR1 SHA):
acq rundetects stale / legacy / unknown-provenance sandboxes vs the localPATTERNS_KIT_REFand offers a safe in-place refresh (interactive, default No, EOF=decline, non-interactive never blocks); explicitacq kit check(no mutation) +acq kit update SANDBOX [--yes];ACQ_UPDATE_CHECK=0+acq run --no-update-check; write provenance only after successful application; preserve SHA pinning + backend abstraction; whole-bundle reconcile. PR2: acq detects stale sandboxes vs local PATTERNS_KIT_REF + acq kit check|update #236 - PR3 (deferred follow-up): advisory "your Quickstart checkout is behind origin" check (cached 24h, ff-only, fail-open). PR3 (deferred): advisory 'Quickstart checkout is behind origin' update check #237
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
feat(acq): detect stale sandboxes + acq kit check|update (#236)
feat(acq): detect stale sandboxes + acq kit check|update (#236)
docs(acq): strip in-development PR/issue references from #236 work (r…
feat(acq): detect stale sandboxes + acq kit check|update (#236) (#241)
wz-gsa commentedon Aug 4, 2026
Grooming update (2026-08-03): epic status —
acq runrefresh offer,acq kit check|update, ADR-0016). Issue PR2: acq detects stale sandboxes vs local PATTERNS_KIT_REF + acq kit check|update #236 now closed.kit addvalidation (the one thing the offline harness can't prove for the force-reapply refresh path).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.
fix(usai-provider): symlink sbx-kits' opencode.jsonc to the acq-kits …
fix(usai-provider): USAi model catalog refresh + NIST-grounded permis…