# 15 — Context-aware symbol index and persistent generations Status: PLANNED; no implementation claim Requirements: R-008,R-014,R-015,R-021 Dependencies: 03,05,09,10,12; coordinates16 coverage and11 dependency edges. ## Ownership and boundaries Proposed Astra schema/publication design, Sol bounded storage/query packages. NEW include/vls/index/, src/index/, tests/index/. Root owns migrations/schema. Future assignments must verify the then-current baseline and exact disjoint paths; these proposed scopes do not authorize work in another repository. ## Contracts and data flow Persist symbol identities, declarations/references, context membership, dependency edges, source content identity and provenance. Index generations record backend/schema versions and completeness domains. Valid empty query results differ from incomplete coverage. Use Void::Sqlite only after verifying transactional behavior and dependency packaging. ## Implementation sequence 1. Ingest compiler-produced symbol/reference records for explicit contexts. Separate unsaved document overlay records from committed disk generations and reconcile on save/close. 2. Build incremental dependency invalidation for edits, added/deleted/renamed sources, include shadowing, provider/context removal and module graph changes. 3. Publish completed batches transactionally, with crash recovery and bounded readers. Never hold a global storage transaction across compiler execution. 4. Implement workspace symbol/reference queries, context filtering and completeness reporting. Rebuild incompatible versions into a new generation; account for disk quotas without evicting active readers' data. ## Failure behavior and constraints Corrupt/incompatible storage triggers quarantine/rebuild with visible status. Cancelled or partial indexing never marks coverage complete. A last-good index may support degraded navigation but cannot authorize rename when its coverage is unknown. ## Acceptance scenarios 1. Compare incremental results with clean rebuilds after edits, deletions, context switches and restored-mtime changes. 2. Crash during ingestion/publication and validate recovery, reader lifetime and schema/backend rejection. 3. Test same spellings/different bindings, unsaved overlays, generated provenance, completeness queries and disk quota handling. ## Verification and integration Proposed NEW CTest label: `index`. Once implemented, register a nonzero suite and run: ```sh dev cpp-gcc -c ctest --test-dir build/bootstrap -L index --output-on-failure ``` This future command is not evidence that the label/tests exist now. Before dispatch, bind the fixtures above to actual targets and record prerequisites/side effects. Require fresh independent review of the implemented contract and affected integrations. Retain previous complete generations during migration, never rewrite incompatible bytes in place. Reverting storage/backend versions may require rebuilding rather than loading older assumptions.