feat: transactional Design Intelligence bank bootstrap - #6
Merged
Conversation
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
marked this pull request as ready for review
August 17, 2026 05:21
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.
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
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_STAGEDdrops unused staging. Failure after promotion moves a bank created this run to~/DesignIntelligence.recovery.<id>instead of deleting it../install.sh --recoverand./restore.sh --listunderstand bank-creating journals. A reused healthy bank is never moved or deleted.Existing bank policy
If
~/DesignIntelligenceis already a healthy exact snapshot:REUSE_EXISTING. If it is a symlink, corrupt, or a different snapshot:EXISTING_BANK_CONFLICT. No--force-replacein 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:
./install.sh --doctor --strictstill fails on engine damage andBANK_BLOCKED. Missing bank and expected limitations areDEGRADED/ WARN, not an engine failure.Security boundaries
~/DesignIntelligenceas 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:
tests/test-design-intelligence-bootstrap.py,tests/test-design-intelligence-bank-install.sh-S errorod-packs-2026-07-20printedWOULD_*and created no staging/targetOut of scope
GROK_DESIGN_BANKRefero/Motionsites