Skip to content

feat: transactional Design Intelligence bank bootstrap - #6

Merged
kuker24 merged 3 commits into
mainfrom
v1.3.1-design-intelligence-bank-bootstrap
Aug 17, 2026
Merged

feat: transactional Design Intelligence bank bootstrap#6
kuker24 merged 3 commits into
mainfrom
v1.3.1-design-intelligence-bank-bootstrap

Conversation

@kuker24

@kuker24 kuker24 commented Aug 17, 2026

Copy link
Copy Markdown
Owner

Why this PR

Laptop-new install already packages the Design Intelligence engine. It did not build the searchable bank. Operators who legally hold the four Open Design ZIPs need a transactional, fail-closed importer. The ZIPs stay local. They are not git objects and they are not a GitHub Release.

How local archive bootstrap works

./install.sh
# engine + Refero/Motionsites. Bank stays missing/DEGRADED.

./install.sh --with-design-intelligence-bank /path/to/OpenDesignPacks
# same, plus exact-snapshot import into ~/DesignIntelligence

Authority: CLI path → GROK_DESIGN_INTELLIGENCE_ARCHIVE_DIR → no source. No home-wide ZIP scan. No --force / --trust / --ignore-hash / --allow-unsafe.

Automatic import is allowed only when the four archives are the exact known snapshot od-packs-2026-07-20 (906 / 151 / 114 / 479 / 162). A new snapshot needs a later policy PR.

Transaction and rollback

PREPARING → stage bank (BANK_STAGED) → swap ~/.grok (GROK_SWAPPED) → atomic rename (BANK_PROMOTED) → COMMITTED.

Interrupted BANK_STAGED drops unused staging. Failure after promotion moves a bank created this run to ~/DesignIntelligence.recovery.<id> instead of deleting it. ./install.sh --recover and ./restore.sh --list understand bank-creating journals. A reused healthy bank is never moved or deleted.

Existing bank policy

If ~/DesignIntelligence is already a healthy exact snapshot: REUSE_EXISTING. If it is a symlink, corrupt, or a different snapshot: EXISTING_BANK_CONFLICT. No --force-replace in v1.3.1.

Doctor DEGRADED semantics

Integrity failures (schema, lock, hash, secret leak, home-path leak, count mismatch, BANK_BLOCKED) fail the install and roll back.

Expected content limitations stay honest:

BANK_INTEGRITY = PASS
BANK_CONTENT_READINESS = DEGRADED
INSTALL_RESULT = SUCCESS_WITH_EXPECTED_LIMITATIONS

./install.sh --doctor --strict still fails on engine damage and BANK_BLOCKED. Missing bank and expected limitations are DEGRADED / WARN, not an engine failure.

Security boundaries

  • Static ZIP inspection only. No plugin, recipe, stub, specialist, or community execution.
  • Community stays quarantined. Stubs stay non-runnable.
  • Unknown-license items stay local-only and are not official kits.
  • Manifest stores tilde bank path, snapshot id, generation, counts, and sanitized archive name+sha256. It does not store the source directory, tokens, or home-absolute archive paths.
  • Uninstall keeps ~/DesignIntelligence as user data.

New-laptop install

See README and docs/new-laptop.md. Bring the four ZIPs through private media or a lawful upstream copy. This repository does not redistribute them.

Test evidence

Ran locally:

  • New: tests/test-design-intelligence-bootstrap.py, tests/test-design-intelligence-bank-install.sh
  • Overlay, runtime policy, MCP state/config, routing eval (163), doctor dry-run, no-secrets, gitleaks (no leaks), source integrity, snapshot allowlist, transactional install, design-bank dest, Design Intelligence suite (archive/catalog/classify/search/authority/integration 50/selection/doctor), node preflight, shellcheck -S error
  • Optional live dry-run against local od-packs-2026-07-20 printed WOULD_* and created no staging/target

Out of scope

  • No merge
  • No GitHub Release of Open Design packs
  • No routing / authority-ladder / second-router change
  • No change to GROK_DESIGN_BANK Refero/Motionsites

Add an explicit installer path for user-supplied Open Design packs
without redistributing the ZIPs. Standard install stays backward
compatible; --with-design-intelligence-bank imports only the exact
od-packs-2026-07-20 snapshot into a staged ~/DesignIntelligence.

Keep community, stubs, and specialists as catalog metadata. Existing
healthy banks are reused; corrupt or different banks are not overwritten.
Uninstall retains the bank as user data.

Bump product version to 1.3.1.
Restrict staging deletion and recovery to marked home namespaces,
reload journal state in a new process, verify search before promote,
rewrite reuse manifests, and keep dry-run free of directory mutation.
Validate the bank path in preflight and again before promote so a
bank cannot land in /, $HOME, ~/.grok, a Git repo, the archive
directory, or a symlink parent. Dry-run fails closed with no mutation.
@kuker24
kuker24 marked this pull request as ready for review August 17, 2026 05:21
@kuker24
kuker24 merged commit 212c80d into main Aug 17, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant