Code reference detail
load-native.ts
packages/analytical/src/native/load-native.ts
| Idea | Status | Tags | Summary | Katz |
|---|---|---|---|---|
| extension_host_target | in-progress | The extension host must load the native core engine for its machine. The selection strategy is ["./native_host_binary.rq".native_host_binary]. IndexService and WorkspaceIndex use `NativeWorkspaceIndex` ( ["../core_analysis/rust_port.rq".native_bridge] ). If the engine is missing, activation fails. Loader: ["../../packages/analytical/src/native/load-native.ts"]. The extension registers search folders from ["../../packages/extension/src/analytical_submodule/index.ts"]. | 0.268 | |
| stopgap | Stopgap distribution is at https://marketplace.visualstudio.com/manage/publishers/reqlan | 0.040 | ||
| native_host_binary | done | Select the native core-engine binary from the extension host. The host is the Node process that runs the extension. Read `process.platform` and `process.arch` from that process. Do not use the platform of the VS Code UI client. Examples: - UI on Windows and host on Linux SSH: use a linux tuple. - UI on Windows and host on WSL: use a linux tuple. - UI and host on macOS: use a darwin tuple. Map the platform and the arch to one tuple in ["./distribution.rq".native_targets]. Load only the binary that matches that tuple. Do not load a binary for a different tuple. If the platform and the arch are not in ["./distribution.rq".native_targets], fail. If the binary is missing, fail. Do not use sql. js. Keep the loader map the same as ["../../scripts/native-targets.mjs"]. Local development: [native_host_binary_development]. Production distribution: [native_host_binary_distributed]. Implementation: ["../../packages/analytical/src/native/load-native.ts"]. | 0.144 | |
| native_host_binary_distributed | in-progress | Use this procedure for a published VSIX and for published npm packages. VS Code extension: The registry installs the VSIX that has `targetPlatform` equal to the extension host. Each VSIX contains one `.node` file for one ["./distribution.rq".native_targets] tuple. The file name is `native/reqlan_napi.node`. The VSIX also contains `native/target.json`. At run time, read `process.platform` and `process.arch` on the extension host. If `target.json` records a different tuple, do not load `native/reqlan_napi.node`. Do not put binaries for other platforms in that VSIX. The Azure pipeline compiles each platform binary from this git commit ( `build_native` + `collect-napi-binary.mjs` + `prepare-native-packages.mjs --binary-dir` ). Package versions in git are canonical. The pipeline does not wait for npm. Related: ["./distribution.rq".vsix_export], ["./distribution.rq".extension_distribution], ["./distribution.rq".vsix_native_not_from_npm]. CLI and MCP: npm installs the host package from `optionalDependencies` on the published `@reqlan/analytical` tarball. Git does not list those entries. ["../../scripts/prepare-native-packages.mjs"] `--publish-versions` writes them at npm publish. The loader resolves that package from `@reqlan/analytical/package.json` ( `createRequire` ), which is where the optional dependency is attached after `npm install`. Published installs also run [published_host_native_install]. Related: ["./distribution.rq".rust_binary_distribution], [rust_port.native_bridge]. Implementation: ["../../scripts/package-extension-targets.mjs"], ["../../scripts/prepare-native-packages.mjs"], ["../../packages/analytical/src/native/load-native.ts"], ["../../packages/analytical/scripts/check-host-native.mjs"], ["../../azure-pipelines.yml"]. | 0.129 | |
| extension_startup_reliability | done | Reqlan startup must make the activity-bar shell and contributed commands available before optional indexing, parser construction, database initialization, or language-client startup can monopolize the extension host. The implementation contract is [first_paint_contract], [webview_claim_race], [deferred_startup_sequence], [lazy_runtime_dependencies], and [development_bundle_freshness]. Operational diagnosis follows [startup_diagnostics]. [activation.activation_sequence] [activitybar.loading_state] [indexer.nonblocking_index] [build.extension_bundle] | 0.046 | |
| invalid_url_activation_failure | done | The concrete incident failed while requiring `out/extension/main.cjs`, before `activate()` ran: `TypeError: Invalid URL` in `embedPhysicsCoreSource`. Runtime `readFileSync(new URL(..., import.meta.url))` is unsafe when esbuild emits CommonJS for an ES2017 target: `import.meta.url` is unavailable / empty and source-relative assets do not exist beside the bundled entry. The HTML export used to embed physics via `html-export-assets.ts` `embedPhysicsCoreSource`. That writer is gone; export now inlines assets from ["../../../crates/reqlan-export/assets/app.js"]. Code that still needs a module directory or `createRequire` ( core engine loader and parse worker ) must not mention `import.meta` statically in a way that esbuild CJS empties: prefer CJS `__dirname` / `__filename` when those exist ( extension host bundle ), and `import.meta.url` on the Node ESM path ( CLI / MCP ). The host esbuild step defines `import.meta.url` as `import_meta_url` from this file's `__filename` so the CJS bundle stays valid and does not warn `empty-import-meta`. CLI / MCP keep the TypeScript `import.meta.url` emit. Do not eval `import.meta.url` — Node 24 treats that as a script eval and throws `Cannot use 'import.meta' outside a module`. ["../../../packages/analytical/src/native/load-native.ts"] ["../../../packages/language/src/reqlan-async-parser.ts"] ["../../../packages/extension/esbuild.mjs"] | 0.040 | |
| site | the / site folder contains a static Next. js App Router landing page for reqlan. should align with [brand] Copy modules: [copy] Document head: [meta_tags] | 0.040 | ||
| spec_html_export | done | The site static build exports the workspace requirement graph ( excluding `*.secret.rq` ) under `out/spec/` via `reqlan export`. It must pass [html_export.html_export_url_base] for `/spec` ( honouring `SITE_BASE_PATH`, e. g. `/reqlan/spec` in production ) so `/spec` loads with or without a trailing slash. It must pass [html_export.html_export_header_link] pointing at the marketing site home so readers can leave the embedded spec and return to the parent site. Embedded `/spec` graph pages inherit [html_export.html_export_graph_background_load] so large workspace graphs do not freeze the page while settling. Pipeline: ["../../site/scripts/build-static.mts"] → ["../../site/scripts/export-spec.mts"] → ["../../site/scripts/verify-static-export.mts"]. Host options come from [html_export.html_export] / CLI [cli_package.commands], including native CLI export via ["../core_analysis/rust_port.rq".native_bridge]. CI must build / stage host `reqlan-napi` before this pipeline ( [distribution_reqs.site_distribution] ); the loader probes repo-root `crates/target`, not `packages/crates`. | 0.142 |
Reference labels
"../../../packages/analytical/src/native/load-native.ts", "../../packages/analytical/src/native/load-native.ts", ../../../packages/analytical/src/native/load-native.ts, ../../packages/analytical/src/native/load-native.ts