Code reference detail
workspace-index.ts
reqlan rq/extension/index-host/packages/analytical/src/index-store/workspace-index.ts
| Idea | Status | Tags | Summary | Katz |
|---|---|---|---|---|
| indexing_trigger_auto | done | When the editor host is idle, run a **background staleness check** — not a reindex and not a soft full sync UI pass. Philosophy: computationally cheap. Load document mtimes in **one** SQLite read, compare each file's FS mtime in memory, and only then index mismatched or new files; drop deleted docs in one batched delete. A single MAX ( mtime ) watermark is not sufficient ( one file can get newer while another gets older ). If nothing is stale: no state transition, no progress UI, no parse. If some files are stale: index **only those files** under [indexer.nonblocking_index]. Schedule after a quiet period with no index activity; prefer running when the window is unfocused; defer or cancel if the user becomes active again. Extension host only ( [editor_index_adapter] ); CLI / MCP have no idle loop ( they sync on activate / command ). | 0.113 | |
| indexing_trigger_open | After the activity bar's first painted frame / base activate, run one soft sync ( mtime-skipped ) so the index is warm without delaying the sidebar shell. This is a startup pass — not the idle checker ( [indexing_trigger_auto] ). | 0.102 | ||
| index_diagnostics_metrics | done | For each sync / index run on a base, record: - wall-clock **sum / total duration** of the pass - **file count** ( visited ), skipped-by-mtime count, indexed ( parse / persist attempted ) count, error count - **average path depth** of visited files ( segments under the base root ) - per-file **duration** and outcome ( `mtime_skip` | `mtime_refresh` | `hash_skip` | `persisted` | `error` ) Runs are attributable to a trigger ( `soft_sync` | `rebuild` | `enqueue` | `stale` ). Instrumentation wraps [workspace_index] soft sync and [indexer.nonblocking_index] single-file paths via [diagnostics_store]. | 0.120 | |
| sqlite_artifact_lifecycle | done | Base SQLite artifacts under `<base>/.reqlan/` ( [base_ownership] ) must not stay locked for the whole extension session. The host opens them only while work runs, then releases file handles so users can delete or replace the files. Aligns with [event_driven]: open and close are reactions to index or analysis events, not a permanent connection or a reconnect loop. Mediation: only [workspace_index] / [analysis_runtime] own SQLite connections. The extension adapter ( [editor_index_adapter] ) must not keep a second long-lived analysis runtime beside the index, and must not call native open without a matching dispose / release. Related: [index_sequencing], [idle_stale_check], [headless_consumers], [multi_base_environment]. | 0.052 |
Reference labels
index_diagnostics_metrics, indexing_trigger_auto, indexing_trigger_open, sqlite_artifact_lifecycle