How to build, package, deploy, and verify Searchlight: Local Code Review. All commands assume the
repo root C:\REPOS\searchlight-localcodereview.
- Node.js 20.x (matches
@types/node ^20.11). - VS Code ≥ 1.85 (
engines.vscode ^1.85.0). @vscode/vscefor packaging (a dev dependency; no global install needed).- git on
PATH.
The conversation page uses markdown-it at runtime for safe Markdown formatting. It is loaded
lazily, not on the startup critical path. VSCE includes production dependencies; do not exclude
all of node_modules from the VSIX.
| Path | Contents |
|---|---|
src/ |
TypeScript sources (see the module graph in architecture.md) |
out/ |
Compiled *.js (gitignored build output; what VS Code actually runs) |
scripts/deploy-local.ps1 |
Package + sideload into the host VS Code |
docs/ |
This knowledge base |
package.json |
Manifest: commands, views, menus, configuration, activation |
tsconfig.json |
TS config (target/module, out/ outDir) |
# 1. Compile TypeScript -> out/
npm run compile
npm test # compile + built-in Node comparison regression tests
# 2. Package the VSIX (rebuilds the gitignored searchlight-0.0.1.vsix, ~26 files / ~65 KB)
npx @vscode/vsce package
# 3. Sideload into the host VS Code (installs local.searchlight@0.0.1)
scripts\deploy-local.ps1deploy-local.ps1emits a benignDEP0169Node deprecation warning — ignore it.- Never commit
searchlight-0.0.1.vsix— it is gitignored build output and is rebuilt on every package. - After deploying, Reload Window in the target VS Code to pick up the new build.
To confirm the install:
code --list-extensions --show-versions | Select-String searchlight
# -> local.searchlight@0.0.1publisher:TimothyMothra;repository.url:https://github.com/TimothyMothra/Searchlight-LocalCodeReview.git.activationEvents:onStartupFinishedplusworkspaceContains:.vscode/searchlight-reviews/**/comments.json.capabilities.untrustedWorkspaces.supported:true(works in Restricted Mode).- ~40 commands and four views under the
searchlightcontainer. - Comparison title-bar order:
copyCompareBranch@1·copyComparePath@2·openTerminal@3·refreshAll@4.
| Key | Default | Purpose |
|---|---|---|
searchlight.tags |
[idea, question, bug, change, todo, nit, praise] |
/tag autocomplete set |
searchlight.copilotPath |
"copilot" |
CLI invoked by Ask-Copilot |
searchlight.copilotArgs |
["-p"] |
args prepended before the prompt |
searchlight.defaultRemote |
— | preferred remote for branch listing |
searchlight.autoCreateOnEmpty |
— | auto-create a review when none exists |
searchlight.perfLogging |
— | verbose [perf] timings to the OUTPUT channel |
searchlight.usageLogging |
true |
local [usage] actions/exposure summaries; no remote telemetry |
searchlight.deferThreadsOnLoad |
— | defer CommentController render for faster first paint |
- Fast-return activation.
activate()does no awaited git work; the real repo root + default resolution +refreshAll()run in a background IIFE. Seearchitecture.md§5. Root cause: on Windows, Defender scansgit.exeon every spawn during the startup burst (measured tens of seconds), so git must not be awaited inactivate(). - No-shell git helpers ("KB-001").
git.tsuseschild_processwith an argv array (no shell), e.g.listWorktreesCli/gitv, to avoid flashing shell windows and reduce spawn overhead on the hot path. - Memoized comparison.
changedFiles/logRangeresults are cached keyed by the effective baseline/compare commit pair, so changing an upstream or pin invalidates the right results. - Turn on
searchlight.perfLoggingand watch the Searchlight OUTPUT channel to see[perf]structured timings. Searchlight: Export Startup Diagnostics saves the bounded trace, milestones, aggregates and outstanding operations to JSON. See Startup diagnostics for the capture protocol and interpretation.
Behavioral verification is done in an isolated Windows Sandbox VM (wsb-test) so a flaky first
comment or a stale-branch update can be exercised end-to-end without touching the host.
- Harness:
$hl = "$env:LOCALAPPDATA\Hyperloop\bin\hyperloop.exe".copy-file … tovmthe.vsix, install into an isolated--user-data-dir/--extensions-dir, launch (Escape past Welcome/Sign-in), then drive via keyboard verbs. - git in the VM is on
PATHviaC:\slh\tools\git\cmd. - Keyboard verbs:
hotkey --combo Ctrl+Shift+P(key combos) andtype --hwnd <h> --text/--keys(text / SendKeys). Note:press-keys/type-textare not valid verbs. - Screen capture: use
PrintWindow(hwnd, hdc, 2). GDICopyFromScreenis permanently frozen in a disconnected console session;PrintWindowbypasses the compositor and produces live captures.
- Linear history on
main. No merges, no feature-branch PRs for routine work. - Every commit carries the trailer:
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>. - Never stage or commit
searchlight-0.0.1.vsix(gitignored). - No push / PR without explicit instruction.
| Package | Version | Why |
|---|---|---|
@types/node |
^20.11 |
matches Node 20 runtime |
@types/vscode |
^1.85 |
matches engines.vscode floor |
@vscode/vsce |
^3.9.2 |
packaging |
typescript |
^5.4 |
compiler |
Production dependencies for the conversation renderer ship with the compiled out/; dev-only
tooling and TypeScript declarations used solely for development are not runtime requirements.
npm test compiles and runs scripts/comparison.test.cjs and scripts/diagnostics.test.cjs with
Node's built-in test runner, plus usage.test.cjs and usage-integration.test.cjs.
Diagnostic tests cover span correlation, failures, bounded retention,
logging controls, pane readiness and the webview acknowledgement protocol.
Comparison tests also cover branch-query coalescing, namespace batching, catalog invalidation,
cross-repository isolation, path normalization and stale-state suppression.
Usage tests cover privacy filtering, action counts versus exposure, focused-time accounting,
editor classification, early inline discussions and shared on-demand comparison initialization.
conversation.test.cjs covers full transcript rendering, deleted/uncommitted-file independence,
live reply updates, legacy identity, workspace-scoped references and separate Read/Code actions.
review-discovery.test.cjs covers targeted multi-root/nested scans, absent stores, permission
failures, in-flight sharing and linked-directory cycle avoidance. Branch tests cover large
unambiguous catalogs, batched shortening exceptions and older Git capability fallback.
pane-defaults.test.cjs covers pane order/collapse contributions, toolbar removal, initial Files
expansion without repeated refresh overrides, and the persisted resolved-thread visibility toggle.
conversation-page.test.cjs covers review-wide topics, safe Markdown, lazy first persistence,
queued/guarded updates, explicit Copilot launch, deleted-code independence and draft/reference restoration.
The read-only Git-query fixtures cover advancing/stale target refs, rebases, stacked targets,
explicit remote selection, ambiguous ancestry, pin persistence/reset/invalidation, and consistent
baseline endpoints across file lists, commits and diff editors. They do not modify any Git refs,
index, or working-tree files. No extension host or additional test dependency is required.
- Windows-first tooling:
deploy-local.ps1and the VM harness are PowerShell; the extension itself is cross-platform. - The Ask-Copilot round-trip depends on the
copilotCLI being installed and on the personal instruction file that teaches the agent to read.vscode/searchlight-reviews/. - Single workspace folder is assumed for the review store.