Referenced by34
Labels7

Referencing ideas

IdeaStatusTagsSummaryKatz
active_base_switchdoneChanging the active base is a **pointer swap** onto a per-base `WorkspaceIndex` / store. - Do **not** await soft-sync, hard-rebuild, or a full `.rq` walk on the switch call itself. - Host surfaces rebind views to the newly active store ( status snapshot, tables, context panes ) immediately. - If the selected base is not yet ready, show its readiness / progress and **schedule** the normal activate catch-up ( open if needed, then one soft sync ) fire-and-forget — same path as ["../indexer/indexer.rq".triggers] / ["../extension/index-host/graph-analysers.rq".indexing_trigger_open], not a special switcher rebuild. - Idle staleness checks only touch bases that are already open; they must not reopen every discovered base ( ["../extension/index-host/sqlite-artifact-lifecycle.rq".release_when_idle] ). - Open failures stay isolated per base so one bad base cannot leave siblings stranded in `uninitialized`. - Editor-follow must not overwrite a user pin on the same refresh that applies the selection. - Inactive bases release SQLite artifacts when the active pointer moves away ( ["../extension/index-host/sqlite-artifact-lifecycle.rq".sqlite_artifact_lifecycle] ). Surfaces: activity bar ["../extension/local-context/activitybar-panels/workspace.rq".workspace_base_picker], Ideas Summary ["../extension/workspace-summary/ideas_summary/base-scope.rq".ideas_summary_base_scope]. Implemented by [editor_index_adapter] ( `setActiveBaseId` / `scheduleBaseCatchUp` ); engine: [base_registry] `ensureBaseReady` / `releaseArtifacts`, [workspace_index] `ensureReady` / `deactivate`.0.093
create_base_onboardingWhen discovery finds **zero** bases under any VS Code workspace folder ( root or child ), the extension prompts the user to create a reqlan base at the workspace-folder root. Do not auto-create `.reqlan`. Command `reqlan.createBase` creates `<folder>/.reqlan/` ( empty directory is a valid marker ) via [create_base_impl], then calls [base_registry] `refresh` so the new marker is registered and the returned [base] descriptor matches discovery ( [refresh_rediscovers_bases] ). With multiple workspace folders and no bases, prompt against the first folder. Headless create-base helper: [create_base_impl] ( also used by CLI `init` ).0.172
implied_contextThe **active base** for editor-adjacent surfaces is the longest-matching base root that contains the focused file path. When no file is focused, the last selected base ( Ideas Summary switcher / activity bar ) or the first discovered base is used. Context, local graph, and analysers bind to the active base's index — not a merged global graph. User / explicit pin is a pointer swap only — [active_base_switch]. Core selection: [base_discovery] ( `baseForPath` / `selectDefaultBase` ); editor pin / switch: [editor_index_adapter].0.075
multi_base_environmentAnalytical features are multibase aware via [base_registry]: one [ideas_index] / `WorkspaceIndex` per base, isolated catalogs ( no cross-base idea-id collision ). Surfaces list all discovered bases; Ideas Summary and context panes scope to the active / selected base ( [active_base_switch] ). Cross-base reference resolution and merged graphs are out of scope for the first multi-base pass. Headless ( CLI / MCP ) selects one base via [analysis_runtime]; the editor hosts [editor_index_adapter].0.134
refresh_rediscovers_basesdoneManual Refresh ( command `reqlan.refreshIndex`, activity-bar / Ideas Summary Refresh buttons ) and Clear & rebuild must **always rediscover** `.reqlan` markers under workspace roots before soft-sync or rebuild. Do not skip discovery when bases are already registered — a new nested or sibling base created on disk must appear after Refresh. Discovery and registration live in [base_registry] ( `refresh` → `rediscover` → optional `ensureBaseReady` for the active base ). The extension adapter ( [editor_index_adapter] ) calls that analytical API; it must not invent a parallel discovery walk. Create Base follows the same refresh path after [create_base_impl] so the new marker is visible immediately ( [create_base_onboarding] ). Related: [multi_base_environment], ["../extension/index-host/graph-analysers.rq".indexing_trigger_manual], ["../extension/index-host/sqlite-artifact-lifecycle.rq".event_driven_base_access].0.075
cli_package`packages/cli` ( `@reqlan/cli` ) is the Clipanion CLI published to npm as the `reqlan` ( and `rq` ) binary. Headless commands go through the core analytical engine ( `@reqlan/analytical/core` / `reqlan-napi` ), not Langium. Entry: ["../../packages/cli/src/main.ts"] via ["../../packages/cli/bin/cli.js"] ( [windows_esm_entry] ). Analysis commands reuse [application_memory] ( `<base>/.reqlan` ) and the analytical ["../indexer/indexer.rq".index] so the CLI shares the ideas index with the extension and MCP.0.214
initdoneThe cli should be able to initialise a new [base]. Creates `<path>/.reqlan/` ( empty directory is a valid marker ), matching [create_base_onboarding]. Headless helper lives in `@reqlan/analytical` so CLI and extension share one create-base path.0.162
extension_package`packages/extension` ( npm `reqlan-extension` ) is the editor product per [distribution.extension_package]. It registers `.rq` language support, TextMate grammars, starts the language client, and owns activity bar, Ideas Summary, chat, skills, and mutation hooks. Ideas index engine lives in [analytical_package] / [indexer]; the extension only hosts a thin VS Code adapter ( [editor_index_adapter] ) for watchers and UI. Host entry: [extension_main]. LSP process: [lsp_rust.language_server_rust]. Node fallback: [language_server_main]. Depends on [language_package] and [analytical_package]. Follows [extension_architecture.event_driven] and [extension_architecture.state_machine_mindset] for JS state; webview UI standards in ["./codestyle/typescript.rq".ui_state_management]. This is the one Marketplace / Open VSX shippable; see [package_versioning].0.128
ideas_indexThe ideas index is built and maintained by the [indexer] in [analytical_package]. Path: Rust parse / extract → SQLite via [workspace_index] ( [rust_port.analytical_rust_port] ). Application memory: each [bases.base] holds SQLite under `<base>/.reqlan/` ( shared by extension, [cli_package], and [mcp_package] ) — see ["./extension/index-host/index.rq".application_memory]. Multi-base: a BaseRegistry owns one [workspace_index] per discovered base; the extension adapter routes file events to the owning base. In the editor, [editor_index_adapter] watches `**\*.rq` and forwards changes to the owning base's [workspace_index]; it serves UIs, commands, chat, and analysers. The Rust language server reads the same store for catalogs, rename, and find-references ( [lsp_rust.language_server_rust] ). Headless ( MCP / CLI ) uses [analysis_runtime] ( nearest base containing cwd when several exist ). Capability requirements: [indexer.index_ideas], [indexer.index_technology], and sibling analysers in that file. Triggers: [indexer.triggers] and ["./extension/index-host/index.rq".idea_index_triggers].0.100
runtime_topologyThe editor and the index do not share one process. - LSP process: `reqlan-lsp` for live `.rq` editing ( [lsp_rust.language_server_rust] ). - Analytical [workspace_index] ( extension host via [editor_index_adapter], MCP / CLI via [analysis_runtime] ): full-workspace graph for tables, local graph, chat, MCP. Editor ↔ extension host: VS Code APIs and webview postMessage. Editor ↔ LSP: vscode-languageclient over stdio. The language server reads the ideas index directly. Host catalog notifications are optional. Stack sketch: [development_core.stack].0.040
indexing_trigger_autodoneWhen 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_filesaveindexing should be triggered by. rq file create / change / delete via watchers, and by allowlisted source files that may contain comment references.0.106
indexing_trigger_manualIndexing should be triggered by manual indexing commands ( Refresh / Clear & rebuild ). Refresh and Clear & rebuild always rediscover bases first via ["../../bases/base.rq".refresh_rediscovers_bases] / ["../../../packages/analytical/src/index-store/base-registry.ts"] `refresh`, then soft-sync or rebuild the active base.0.092
analysis_api_disposedone[analysis_runtime] `openAnalysisApi` dispose must close the native analysis runtime and drop its SQLite connection ( ideas index and click-sessions ). A no-op dispose is a defect. Extension commands use a short-lived `withAnalysisApi` ( open → run → dispose ) mediated by [analysis_runtime]; they must not cache `NativeAnalysisApi` for the session.0.040
event_driven_base_accessdoneExtension interaction with bases is event-driven and goes through the analytical package: - Discover / pin / focus / file watch / command / UI query → open or `ensureBaseReady` - Sync, stale check, or analysis work runs - Quiet idle → [release_when_idle] No always-on connection and no continuous reconnect loop. Headless CLI / MCP already open per command via [analysis_runtime] ( [headless_sync_on_ready] ).0.057
release_when_idledoneAfter an index or analysis pass finishes, and after the idle quiet period ( [idle_stale_check] / indexing_trigger_auto ), [editor_index_adapter] must release every open base SQLite handle via [base_registry] `releaseArtifacts` → [workspace_index] `deactivate`. Descriptors stay registered so the next event can reopen the same base. Idle must not leave connections open after a heal / sync, and must not schedule another open unless a real host event arrives ( file change, pin / switch, focus reopen, command, UI query ).0.077
sqlite_artifact_lifecycledoneBase 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
index_file_search_coalescedoneIndex startup does not call `findFiles` or ripgrep / `searchtext.exe`. The native workspace scan ( ["../../../indexer/cache-reuse.rq".single_sync_walk] ) is the one directory walk. Overlapping rediscover and sync callers share that in-flight scan. The scan applies `.rqignore` ( ["../../../indexer/indexer.rq".nonblocking_index] ). Related: [lsp_file_watch], ["../../index-host/index.rq".rqignore], ["../../../indexer/sequencing.rq".scan_limits].0.051
lsp_file_watchdoneThe language server must register workspace file watchers for `.rq` files only. It must not register a recursive all-files watcher. Watched-file events whose path contains a `node_modules`, `.git`, `.reqlan`, `out`, or `dist` segment must not start a document rebuild. Directory URIs without a trailing slash, Windows paths, and percent-encoded URIs must use the same segment rules. A kept `.rq` change replaces that buffer's model when the text changed ( [ast_lifecycle] ). Related: [language_server], [index_file_search_coalesce], [open_file_algorithm].0.085
refactor_changesOn rename, move, or delete of files or symbols, the extension should update the idea index, import statements, embedded file references, comment references, and other idea references that are affected. The index should be resilient to duplication, particularly when ideas move between files: the old hosting file URI must be cleared before or when the destination is reindexed. [refactor_file_moves] [refactor_symbol_rename] [refactor_symbol_move] [refactor_symbol_delete] [comment_reference_refactor_support] Implemented by ["../../../packages/analytical/src/index-store/workspace-index.ts"], ["../../../packages/extension/src/analytical_submodule/index-store/index-service.ts"], ["../../../packages/language/src/reqlan-idea-refactor.ts"], and ["../../../packages/extension/src/mutation_module/register-file-mutation-hooks.ts"].0.114
refactor_file_movesThe extension should watch for file moves and renames, including a renamed folder. A folder rename is expanded to every file inside it, then the index is migrated for moved . rq files, and imports and path references are updated both inside the moved file ( outbound ) and in other files that pointed at it or at the folder ( inbound ), including comment paths in code files ( [comment_reference_refactor_support] ). Import-root aliases such as `@/old/file.rq` are rewritten when that target moves ( `@/new/file.rq` ). There should be a single prompt per batch asking whether to apply path updates, aligned with [move_file] and [rename_file]. While a rename is in flight, the index file watcher must not delete the pre-move URI before inbound import planning runs — `onWillRenameFiles` marks pending paths and `migrateRenamedFile` clears the old URI after path edits are planned. Implemented by ["../../../packages/extension/src/mutation_module/register-file-mutation-hooks.ts"], ["../../../packages/extension/src/mutation_module/expand-renamed-paths.ts"], ["../../../packages/extension/src/mutation_module/file-move-plan.ts"], ["../../../packages/extension/src/mutation_module/file-mutation-gate.ts"], ["../../../packages/extension/src/mutation_module/collect-inbound-referencers-core.ts"], ["../../../packages/extension/src/analytical_submodule/index-store/pending-rename-paths.ts"], ["../../../packages/extension/src/analytical_submodule/index-store/index-service.ts"], ["../../../packages/language/src/file-path-rewrite.ts"], and ["../../../packages/language/src/reqlan-path-references.ts"].0.106
index_cache_reusedraftIdentify where the ideas index, diagnostics store, or in-process caches already hold data that other modules recompute. Goal: one walk, one sync, one open store where possible; reuse SQLite edges and mtime maps instead of rebuilding graphs from scratch. Related: [nonblocking_index], [indexing_incrementality], [consumers.index_consumers], [sequencing.index_sequencing].0.164
single_sync_walkdoneOne native directory walk records base roots, `.rq` paths, and allowlisted code paths. The walk does not read file bodies. Startup, Refresh, and create-base each run that walk once. They do not call `findFiles` and they do not run a second native `syncWorkspace` walk. Soft sync indexes the path list and skips unchanged mtimes. Idle stale check stats paths already stored in SQLite. New files arrive from the file watcher. The language server does not walk. The extension sends the base roots after the scan. Overlapping callers share one in-flight scan. CLI and MCP `sync_workspace` uses the same walk ( one pass, stop at nested bases ). [index_cache_reuse] [sequencing.soft_sync] [sequencing.scan_limits]0.080
extension_ui_consumersVS Code surfaces that query the live ideas store through [editor_index_adapter]: - Activity bar workspace / search / minigraph / todo ( [activity_bar_host] ) - Ideas Summary panel ( [ideas_summary_panel] ) — prefer paged SQL and capped graph queries - Reference-search and wildcard-match panels ( may call `listAllIdeas`; see [cache_reuse.avoid_full_list_all_ideas] ) - Chat / AI commands that call `getFileContext`, `getLocalGraph`, or semantic search - Refactor and mutation hooks that read inbound edges from the store - Name and attribute catalog sync that pushes index rows into the language server The Rust language server may open the ideas index read-only for rename, find-references, and fallback completion. Open-file inbound inlays and file CodeLens use the host-pushed snapshot first ( no SQLite in those handlers ). [index_consumers]0.086
index_consumersdoneModules that read or write [ideas_schema.ideas_index_sqlite] / [index]: - Engine write / read: [workspace_index], Rust sync / store under [ownership] - Extension adapter: [editor_index_adapter] ( watchers, Uri conversion, multi-base ) - Headless: [analysis_runtime] for [cli_package] and [mcp_server] - Activity bar: [activity_bar_host] ( ideas-in-file, hop refs, search via fuzzy ) - Ideas Summary: [ideas_summary_panel] ( table SQL, graph slices, overview ) - Search: [fuzzy_search], [file_search] - Check / analyse / export: [check], analytical export APIs - Local graph: [local_graph_analysis] Product aliases: [index_ideas], [index_technology], [consumption]. Related: [cache_reuse.index_cache_reuse], ["./sequencing.rq".index_sequencing].0.169
consumptionConsumers of the analytical [index]: - [extension] — thin VS Code adapter [editor_index_adapter] ( file watchers, Uri conversion, UI status ) - CLI ( `["../cli/cli_package.rq".cli_package]` ) and MCP — headless [analysis_runtime] The extension does not own the indexing engine; it only hosts the adapter. Module map: [consumers.index_consumers].0.146
definitionThe indexer should live in the [core_analysis] module. On-disk schema: [sqlite_schema.ideas_index_sqlite] and [diagnostics_schema.diagnostics_sqlite]. Layout and WAL sidecars: [sidecars.reqlan_directory_layout]. Consumers: [consumers.index_consumers] ( extends [consumption] ). Sequencing and triggers: [sequencing.index_sequencing] ( extends [triggers] ). Cache reuse opportunities: [cache_reuse.index_cache_reuse].0.040
index_code_filesdoneIndex non- `.rq` source files that contain [comment_reference] ( `rq:[idea]` / `rq:["path".idea]` ). The same directory scan records allowlisted text paths ( respecting `.rqignore`, [app_memory_doc.binary_ignore], [app_memory_doc.commentless_file_ignore], and nested child bases ). Content reads use that list. They are not a second directory walk. [app_memory_doc.text_prefix_skip] skips non-text before a full read. Binary files stay out unless a negation such as `!*.bin` opts them in. The walk cheap-filters on `rq:`, and persists matching files as documents plus `comment_link` edges. Edge shape: source = referenced idea, `target_file` = code file URI, kind `comment_link` ( no synthetic file ideas ). Reindex of a `.rq` file updates kept ideas in place, so their comment links stay. Deletion of a removed idea cascades to its links. Code documents are re-linked only when the set of idea names in that `.rq` file changes, because links resolve on names only. A body edit must not read the code files again. Watcher + idle stale check cover code documents as well as `.rq` files ( [triggers], [nonblocking_index] ). Consumers: [graph_analysers.file_related_requirements], ["../core_analysis/search.rq".file_search], ["../core_analysis/html_export.rq".html_export_code_reference_pages], Ideas Summary comment-reference rows, local graph ( idea → external file node ), ["../cli/click.rq".click_code_file]. See [index_comment_reference_inclusion], ["../ontology.rq".referenced_files].0.394
index_ideasEach ["../bases/base.rq".base] maintains an index of its ideas for fast lookup and navigation ( [index] ). The index should update incrementally as. rq files change within that base ( nested child bases excluded ). Persistence lives in [app_memory_doc.application_memory] per base, shared with CLI and MCP — not VS Code extension storage. Engine ownership: [workspace_index] in `@reqlan/analytical`; multi-base via BaseRegistry; editor watches via [editor_index_adapter].0.173
index_technologyThe [index_ideas] graph database is rusqlite via the core native engine. On-disk location is [app_memory_doc.application_memory] ( `<base>/.reqlan/ideas-index.sqlite` ), not `context.globalStorageUri`. Implementation: [application_memory_impl], [workspace_index], headless [analysis_runtime] for CLI / MCP, and [editor_index_adapter] for the VS Code host.0.152
nonblocking_indexdoneIndex sync must stay non-blocking for the host UI ( notably [activity_bar_doc.activity_bar] and [workspace_pane_doc.workspace_loading] ). Editor startup is gated by ["../extension/host/activation.rq".first_paint_startup]; discovering a base must not construct Langium services, which are initialized lazily on the first parse. While syncing, surface progress — state, processed / total, and the current file — in [workspace_pane_doc.workspace_pane] and [ideas_summary_doc.index_panel]. In-flight sync must be cancellable from those surfaces; cancel keeps already-indexed rows and returns the index to ready. Incremental behaviour ( see also [indexing_incrementality] ): - Single-file create / change / delete via watchers indexes only that file — never a full base walk. - Soft full sync ( `syncWorkspace` / Refresh ) skips parse + persist when the file's mtime matches the value stored on the documents row. - Hard refresh ( `clearAndRebuildIndex` / Clear & rebuild ) wipes the store and reindexes every file. - Every sync and stale check applies `.rqignore` to the paths it receives, the same as the base walk; the native single-file index also drops an ignored path. Thus base discovery cannot make the first sync index ignored files. Implemented by [workspace_index]; editor adapter [editor_index_adapter].0.372
triggersIndex refresh behaviour: - [indexing_incrementality] / [nonblocking_index] — incremental where possible - [graph_analysers.indexing_trigger_filesave] / [app_memory_doc.idea_index_triggers] — on `.rq` or indexed code-file change - [graph_analysers.indexing_trigger_manual] — manual reindex commands - [graph_analysers.indexing_trigger_open] — one soft sync after the activity-bar first-paint gate - [graph_analysers.indexing_trigger_auto] — idle background mtime staleness check ( cheap; not a full reindex ) Editor watches + idle scheduler: [editor_index_adapter]; headless syncs on runtime activate. Full sequence: [sequencing.index_sequencing].0.148
extension_startup_sequenceExtension host order ( [first_paint_startup], [background_startup] ): 1. `activate` registers UI only; it must not await index sync. 2. Activity bar paints → startup gate; language client may start on a short fallback. 3. Index adapter activates after paint ( or a short fallback timer ). 4. One native scan ( [cache_reuse.single_sync_walk], [scan_limits] ) records bases and file paths. Soft [soft_sync] then runs for the **active** base only ( [indexing_trigger_open] ); other bases stay closed until pin / focus / file events ( ["../extension/index-host/sqlite-artifact-lifecycle.rq".event_driven_base_access] ). 5. Install watchers for `.rq` and code globs; watch `.reqlan` marker create / delete for rediscovery ( not SQLite child writes ). 6. Idle timer runs [idle_stale_check] on already-open bases, then releases unused SQLite artifacts ( ["../extension/index-host/sqlite-artifact-lifecycle.rq".release_when_idle] ). [index_sequencing] [editor_index_adapter] Open-file editor links follow ["../extension/language/support/open-file-sequencing.rq".open_file_algorithm] and must not wait for this crawl.0.054
index_sequencingdoneDescribe when the ideas index starts, updates, and idles, and which trigger owns each pass. Capability aliases live in [triggers] and [idea_index_triggers]. Detail ideas below; keep [nonblocking_index] and [indexing_incrementality] as the UX rules. Related: [consumers.index_consumers], [cache_reuse.index_cache_reuse], [ideas_schema.documents_table], [diagnostics_schema.sync_runs_table].0.179

Reference labels

"../../../../packages/extension/src/analytical_submodule/index-store/index-service.ts", "../../../packages/extension/src/analytical_submodule/index-store/index-service.ts", "../../packages/extension/src/analytical_submodule/index-store/index-service.ts", ../../../../packages/extension/src/analytical_submodule/index-store/index-service.ts, ../../../packages/extension/src/analytical_submodule/index-store/index-service.ts, ../../packages/extension/src/analytical_submodule/index-store/index-service.ts, ../packages/extension/src/analytical_submodule/index-store/index-service.ts