Views: import existing text and symbol indexes when views are turned on
With views on, turning views on for a checkout that already has legacy indexes now imports the text index and symbols instead of rebuilding them from source, independently of meaning search.
What changed. The v3 importer was only invoked from the semantic lane, so with meaning search off nothing was imported and the trigram and symbol planes rebuilt from scratch. Trigram and symbol import now schedule on their own, reuse a fresh base when its inputs match, and are protected by the same lifecycle (admission revoked across a quick rebind, cancelled imports resumed before retained fills, ownership enforced at the ledger boundary).
Measured on a 6,788-file real checkout, first views-on enable: text index 42 s → 17 s, symbols 27 s → 8.5 s with every symbol reused. The call graph still rebuilds from source (about 400 s there); importing it safely from the legacy format needs a separate design, recorded in .cortexkit/internal-docs/.
Views are off by default, so there is no user-facing change and no release note.
Known test interaction. Running views::trigram tests in one process together with the views_import/migration:: tests makes three trigram tests fail on setup (they pass alone, and CI's nextest runs each test in its own process). One of the three already fails the same way on main in that combination, so the shared state predates this branch; it is being investigated separately.
![View with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-dark-v3-3x.png)
![Autofix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png)
Need help on this PR? Tag @codesmith-bot with what you need.
Summary by cubic
With views on, turning views on for a checkout that already has legacy indexes now imports the text index and symbols instead of rebuilding them from source, and does so independently of meaning search.
- Trigram and symbol import schedule on their own, reuse a fresh base when its inputs match, and share the same lifecycle: admission is revoked across a quick rebind, cancelled imports resume before retained fills, and ownership is enforced at the ledger boundary.
- While a legacy import runs, the index reports building rather than a load failure: grep and search answer from bounded file scans and disclose the unavailable index, leaving health accounting unchanged.
- Measured on a 6,788-file real checkout, first views-on enable: text index 42 s → 17 s, symbols 27 s → 8.5 s with every symbol reused. The call graph still rebuilds from source; importing it safely from the legacy format needs a separate design, recorded in
.cortexkit/internal-docs/.
Views are off by default, so there is no user-facing change and no release note. Running views::trigram tests in one process together with the views_import/migration:: tests makes three trigram tests fail on setup (they pass alone, and CI's nextest runs each test in its own process); one of the three already fails the same way on main, so the shared state predates this branch and is being investigated separately.