Skip to content

feat: add Compass VS Code code intelligence extension#33

Draft
forhappy wants to merge 8 commits into
mainfrom
feature/compass-vscode-extension
Draft

feat: add Compass VS Code code intelligence extension#33
forhappy wants to merge 8 commits into
mainfrom
feature/compass-vscode-extension

Conversation

@forhappy

Copy link
Copy Markdown
Contributor

Summary

Add the first-party Compass VS Code extension and the versioned CLI/view-model contracts it uses.

  • provide a VS Code-native React, Tailwind, and shadcn interface with Lucide Compass branding
  • reuse the same versioned graph model and interactive graph UX as Compass offline exports
  • add cursor-centered caller/callee exploration with resolved, inferred, ambiguous, and unresolved evidence
  • add separate architecture call-flow and natural-language/CompassQL query workspaces
  • add all-local-ref history navigation with materialization states, exact revision loading, structural change counts, parent comparison, semantic findings, and revision-bound queries
  • add adaptive watch lifecycle support, cancellable JSONL progress, CLI discovery, capability negotiation, and guided setup
  • reject older or Graphify-compatible binaries before running unsupported commands, with actions to select a newer Compass CLI or open setup
  • add deterministic offline assets, real VS Code host tests, Chromium qualification, packaging, and release automation

Motivation

Compass users need to understand current architecture and codebase evolution without leaving the editor or learning every CLI invocation. The CLI remains the authoritative local engine while the extension provides purpose-built graph, call, query, history, and diff workflows. The extension requires a separately installed Compass CLI and never bundles a platform binary.

The compatibility gate also prevents the raw graphify export <format> usage failure that occurs when an older compass binary is first on PATH and does not support export viewer-json.

Verification

The completed branch was verified with:

cargo fmt --all -- --check
cargo clippy -p compass-cli -p compass-history -p compass-analysis -p compass-output --all-targets -- -D warnings
cargo test --workspace --exclude compass-parity --lib --bins --locked
cargo test -p compass-cli --test capabilities_cli --test progress_events_cli --test history_cli --test program_cli --test viewer_export_cli
npm run typecheck:js
npm run test:js
npm run test:integration -w compass-vscode
node scripts/check_viewer_assets.mjs
npm audit --omit=dev
npm run package -w compass-vscode
npm run smoke:vsix -w compass-vscode
target/debug/compass capabilities --format json
target/debug/compass update . --no-viz

Results: Rust workspace tests and strict Clippy passed; 15 JS unit tests, 10 Chromium checks, and the real VS Code activation test passed; the production dependency audit reported zero vulnerabilities; deterministic asset and VSIX smoke checks passed. The branch Compass CLI advertised every extension contract and updated the repository graph successfully.

Compatibility and documentation

New versioned contracts include compass.viewer.graph/1, compass.program.call_graph/1, compass.viewer.callflow/1, compass.history.timeline/1, compass.history.change_counts/1, compass.history.viewer_graph/1, and compass.ide.progress/1.

New machine-readable surfaces are exposed through compass capabilities, compass export viewer-json, compass export callflow-json, compass program call-graph, compass history timeline, compass history change-counts, and historical viewer export. Existing human output remains unchanged unless --events jsonl is explicitly selected. Graphify compatibility behavior remains isolated.

Documentation is included in docs/guides/vscode.md and the extension README, changelog, and security policy.

Checklist

  • Extension uses a separately installed Compass CLI
  • Current graph, call graph, architecture flow, query, history, and diff workflows are included
  • Versioned contracts are validated before commands run
  • Older/incompatible CLIs receive guided recovery
  • Unit, browser, real VS Code, packaging, and smoke checks pass
  • No CLI binary, telemetry, remote webview assets, source maps, or tests are bundled in the VSIX

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant