Code reference detail
create-runtime.ts
packages/analytical/src/create-runtime.ts
| Idea | Status | Tags | Summary |
|---|---|---|---|
| base | A base is a container for ideas, ideasets, and files. It forms the boundary of one ideas graph and is consumed by the CLI and the extension. Marker: a directory is a base only when it owns a `.reqlan` folder ( [app_memory_doc.application_memory] ). No bare workspace folder is treated as a base until the user creates `.reqlan` there ( [create_base_onboarding] ). Aligns with [ontology_base]. Discovery and registry: [base_discovery], [base_registry]. Marker path helpers: [application_memory_impl]. | ||
| multi_base_environment | Analytical 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]. | ||
| analytical_package | `packages/analytical` ( `@reqlan/analytical` ) is the shared requirement graph index and analysis layer. It owns the [indexer]: extracts ideas and edges from Langium ASTs into a sql. js SQLite store ( [workspace_index] ), holds Zustand analytical state, and exposes analysers and an analysis API. Headless entry is [analysis_runtime] via `createAnalysisRuntime` / `WorkspaceIndex`. Consumers: [extension_package] ( thin editor adapter ), [mcp_package], [cli_package]. Depends on [language_package]. Published to npm alongside [cli_package]; version graph role: [package_versioning]. | ||
| ideas_index | The ideas index is built and maintained by the [indexer] in [analytical_package]. Path: parse with [language_package] → extract ideas / edges → SQLite via [workspace_index]. Application memory: each [bases.base] holds SQLite under `<base>/.reqlan/` ( shared by extension, [cli_package], and [mcp_package] ) — see ["./extension/module/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. Headless ( MCP / CLI ) uses [analysis_runtime] ( nearest base containing cwd when several exist ). Capability requirements: [graph_analysers.index_ideas], [graph_analysers.index_technology], and sibling analysers in that file. Triggers: [indexer.triggers] and ["./extension/module/index.rq".idea_index_triggers]. | ||
| runtime_topology | Two Langium runtimes share [language_package] but not one process. - LSP process: live `.rq` editing intelligence via [language_server_main]. - 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 IPC. Attribute catalog and similar custom notifications may sync from the index side into the LSP for completions. Stack sketch: [development_core.stack]. | ||
| scope | These requirements describe the cross-package system architecture of the reqlan monorepo: language definition, language server, ideas index, editor product, and companion tools. They are distinct from [extension_scope.scope], which bounds only the VS Code extension and LSP product surface. Language concepts live in [ontology]; syntax truth lives in [syntax]; editor module contracts live under extension / module. Grouped as [workspace_packages], [language_runtime], and [product_map]. | ||
| index_ideas | Each ["../bases/base.rq".base] maintains an index of its ideas for fast lookup and navigation ( ["../indexer/indexer.rq".index] ). The index should update incrementally as. rq files change within that base ( nested child bases excluded ). Persistence lives in [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]. | ||
| index_technology | The [index_ideas] graph database is sql. js SQLite, aligned with [graph_design]. On-disk location is [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. | ||
| consumption | Consumers 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. | ||
| index | The ideas graph indexer: parse `.rq` with `@reqlan/language`, extract ideas / edges, persist to sql. js SQLite. Owned by [ownership]; consumed per [consumption]. | ||
| ownership | The [index] / indexer lives in `packages/analytical` ( `@reqlan/analytical` ). Canonical single-base engine: [workspace_index] ( `WorkspaceIndex` facade ). Sync / idle impl: [workspace_index_sync]; one-file parse + persist: [workspace_index_file]; mtime stale diff: [workspace_mtime]. Multi-base registry: one `WorkspaceIndex` per discovered ["../bases/base.rq".base] under [app_memory_doc.application_memory] ( `<base>/.reqlan/` ). Headless entry: [analysis_runtime] via `createAnalysisRuntime` ( CLI / MCP ) — discovers bases under the resolved root and defaults to the nearest base containing cwd. On-disk store path: [application_memory_impl] under `<base>/.reqlan/` — see [app_memory_doc.application_memory]. |
Reference labels
../../packages/analytical/src/create-runtime.ts, ../packages/analytical/src/create-runtime.ts, analysis_runtime