Skip to content

Hivemind for Cursor extension + memory-recall hook instrumentation (by Legion Code Inc.)#263

Open
thenotoriousllama wants to merge 39 commits into
activeloopai:mainfrom
legioncodeinc:fix/cursor-hooks-update
Open

Hivemind for Cursor extension + memory-recall hook instrumentation (by Legion Code Inc.)#263
thenotoriousllama wants to merge 39 commits into
activeloopai:mainfrom
legioncodeinc:fix/cursor-hooks-update

Conversation

@thenotoriousllama

@thenotoriousllama thenotoriousllama commented Jun 13, 2026

Copy link
Copy Markdown

Summary

Contributes the Hivemind for Cursor extension and supporting fixes, built by Legion Code Inc.

  • Cursor extension: activity-bar dashboard with KPIs, Sessions, Graph, Rules, Goals, and Skills tabs, plus health checks and a skill-sync bridge.
  • Dashboard data-layer fixes:
    • Corrected loader script path resolution (dist/../scripts, not ../../scripts) so the Rules/Goals/Sessions/KPI loaders run when packaged.
    • Real KPIs: live GET /me/hivemind-stats for org stats and a distinct-session count from the sessions table (consistent with the Sessions tab).
    • Codebase-graph rendering: synchronous force-simulation settle + fit-to-bounds so the graph is centered and fully visible; vendored d3 locally to avoid the webview CSP/CDN failure that left the graph blank.
    • Skills tab reconciliation (pulled team skills surface correctly; no broken re-publish path).
  • Memory-recall hook instrumentation: the Cursor pre-tool-use hook now records each successful memory recall (count + bytes delivered) to ~/.deeplake/recall-events.jsonl, so the dashboard can show real memory-search and token-savings metrics for Cursor sessions. Previously these read zero because the only recall accounting was a Claude Code transcript parser that Cursor never populates.

Credit

The Cursor extension and the accompanying dashboard and recall-tracking work were designed and built by Legion Code Inc. Please retain attribution to Legion Code Inc. for the Cursor extension.

Notes for reviewers

  • The Cursor hooks bundle (harnesses/cursor/bundle/) is a build artifact produced by tsc && node esbuild.config.mjs. The recall instrumentation lives in TypeScript source (src/hooks/cursor/pre-tool-use.ts, src/notifications/recall-tracker.ts) and is regenerated at release-build time.
  • This branch carries the full fork divergence (223 files). We are happy to rescope to a focused Cursor-extension-only PR if that is preferred.

Test plan

  • npm run build (tsc + esbuild) regenerates the cursor bundle with the recall instrumentation.
  • Install harnesses/cursor/extension/hivemind-cursor-extension-0.1.5.vsix in Cursor; verify KPIs (real Sessions count), the Sessions/Rules/Goals/Skills tabs, and a centered Graph.
  • Recall memory in a Cursor session; verify ~/.deeplake/recall-events.jsonl populates and the Memory searches / Tokens saved KPIs update.

thenotoriousllama and others added 30 commits June 12, 2026 19:37
…005)

Add a comprehensive suite of four main feature PRDs and their child specifications
to design a first-class Cursor extension. This addresses the silent failure of
the wiki-worker, automates pre-requisite health checks and hook auto-wiring,
and provides rich in-editor Webviews for live KPIs, graphical settings,
interactive codebase graph visualization, and team-wide rules/skills sync.
Documents Hivemind architecture, plugins, AI pipelines, data layer, auth, security, and operations from source and existing docs, with security and QA gate reports.
Introduced two new skills: `hivemind-goals` for managing team goals and KPIs via CLI, and `hivemind-graph` for querying the local code graph. Updated .gitignore to exclude cursor-related files.
docs: reverse-engineer Hivemind knowledge base
…extension-prds

docs: Cursor Hivemind Extension specifications (PRD-002 to PRD-005)
Move claude-code, codex, openclaw, and pi into harnesses/, add cursor and hermes placeholders, and update build, CI, installers, docs, and tests for the new paths.
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…ile'

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…ile'

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
The openclaw skillify-worker esbuild outdir moved to harnesses/openclaw/dist
during the harness reorganization; align the config regex assertion.
…harnesses-folder

chore: consolidate agent harnesses under harnesses/
Implement the full Cursor/VS Code extension with health checks, auth,
status bar, dashboard webview (KPIs, settings, sessions, graph, rules,
skills), graph editor sync and impact overlay, and Cursor skill symlink
bridge. Extend detectAgentSkillsRoots for ~/.cursor/skills-cursor and
project .cursor/skills paths.

Security fixes: execFileSync for browser open and hivemind login, session
ID path validation, crypto CSP nonce.
Use vscode.env.openExternal with HTTPS host allowlist instead of shell
browser launch. Validate API URLs and credential fields before network
requests and credential file writes.
…-dev

feat(cursor): Hivemind Cursor extension (PRD-002 through PRD-005)
Wire canonical dashboard data, org publish promote, graph UX, skill sync
honesty, auth/offline fixes, bundle provisioning, and session summary loaders.
Add security and QA pass reports; move PRD folders to completed/.
Refactor API URL and credential validation to prevent potential security issues. Update the method for opening external links to ensure compliance with HTTPS host allowlist. This addresses previous CodeQL alerts and improves overall security posture.
…-dev

feat(cursor): complete PRD-002–005 acceptance criteria (post-PR #4)
# Conflicts:
#	.claude-plugin/marketplace.json
#	.claude-plugin/plugin.json
#	harnesses/claude-code/.claude-plugin/plugin.json
#	harnesses/codex/package.json
#	harnesses/openclaw/openclaw.plugin.json
#	harnesses/openclaw/package.json
#	package-lock.json
#	package.json
…e and Dashboard. This includes the deletion of index files, health check specifications, and QA reports, streamlining the project structure as we move forward with new features and improvements.
thenotoriousllama and others added 9 commits June 13, 2026 05:32
…nd improve session handling

- Added goals management features to the dashboard, including the ability to add and filter goals.
- Updated the dashboard UI to include a new goals section.
- Improved session loading logic to better handle recent sessions and their associated data.
- Refactored existing scripts for loading dashboard data, rules, and session summaries to streamline functionality and enhance performance.
…-0.1.0

feat(cursor): enhance dashboard functionality with goals management a…
…dashboard functionality

- Updated version to 0.1.4 in package.json and package-lock.json.
- Removed deprecated vsix file for the extension.
- Improved dashboard data handling with new caching mechanisms and enhanced session statistics.
- Adjusted paths for loading scripts to ensure proper functionality within the webview.
- Enhanced memory recall tracking for better KPI reporting.
Version bump for the upstream PR carrying the Cursor extension dashboard
fixes (loader script paths, real KPIs, graph centering, vendored d3) and
the memory-recall hook instrumentation. Rebuilds the packaged vsix so the
tracked artifact matches the manifest version.
@coderabbitai

coderabbitai Bot commented Jun 13, 2026

Copy link
Copy Markdown

Important

Review skipped

Too many files!

This PR contains 219 files, which is 69 over the limit of 150.

To get a review, narrow the scope:
• coderabbit review --type committed # exclude uncommitted changes
• coderabbit review --dir # limit to a subdirectory
• coderabbit review --base # compare against a closer base

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 0711a286-2e76-482f-918e-4eee6311ee77

📥 Commits

Reviewing files that changed from the base of the PR and between c8cda4f and 1b74562.

⛔ Files ignored due to path filters (4)
  • harnesses/cursor/extension/media/d3.v7.min.js is excluded by !**/*.min.js
  • harnesses/cursor/extension/media/icon.svg is excluded by !**/*.svg
  • harnesses/cursor/extension/package-lock.json is excluded by !**/package-lock.json, !**/package-lock.json
  • package-lock.json is excluded by !**/package-lock.json, !**/package-lock.json
📒 Files selected for processing (219)
  • .claude-plugin/marketplace.json
  • .claude-plugin/plugin.json
  • .github/workflows/ci.yaml
  • .github/workflows/release.yaml
  • .gitignore
  • .jscpd.json
  • README.md
  • docs/ARCHITECTURE.md
  • docs/SKILLIFY.md
  • docs/SUMMARIES.md
  • esbuild.config.mjs
  • harnesses/claude-code/.claude-plugin/plugin.json
  • harnesses/claude-code/commands/login.md
  • harnesses/claude-code/commands/update.md
  • harnesses/claude-code/hooks/hooks.json
  • harnesses/claude-code/skills/hivemind-goals/SKILL.md
  • harnesses/claude-code/skills/hivemind-graph/SKILL.md
  • harnesses/claude-code/skills/hivemind-memory/SKILL.md
  • harnesses/claude-code/tsconfig.json
  • harnesses/codex/.codex-plugin/plugin.json
  • harnesses/codex/INSTALL.md
  • harnesses/codex/commands/login.md
  • harnesses/codex/commands/update.md
  • harnesses/codex/hooks/hooks.json
  • harnesses/codex/install.sh
  • harnesses/codex/package.json
  • harnesses/codex/skills/deeplake-memory/SKILL.md
  • harnesses/codex/skills/hivemind-goals/SKILL.md
  • harnesses/codex/skills/hivemind-graph/SKILL.md
  • harnesses/cursor/extension/.vscodeignore
  • harnesses/cursor/extension/README.md
  • harnesses/cursor/extension/hivemind-cursor-extension-0.1.5.vsix
  • harnesses/cursor/extension/package.json
  • harnesses/cursor/extension/scripts/lib/deeplake.mjs
  • harnesses/cursor/extension/scripts/load-dashboard.mjs
  • harnesses/cursor/extension/scripts/load-goals.mjs
  • harnesses/cursor/extension/scripts/load-rules.mjs
  • harnesses/cursor/extension/scripts/load-session-summary.mjs
  • harnesses/cursor/extension/scripts/load-sessions.mjs
  • harnesses/cursor/extension/src/auth/api-key.ts
  • harnesses/cursor/extension/src/auth/detector.ts
  • harnesses/cursor/extension/src/auth/device-flow.ts
  • harnesses/cursor/extension/src/auth/index.ts
  • harnesses/cursor/extension/src/auth/logout.ts
  • harnesses/cursor/extension/src/auth/safe-url.ts
  • harnesses/cursor/extension/src/bridge/auto-sync.ts
  • harnesses/cursor/extension/src/bridge/skill-sync.ts
  • harnesses/cursor/extension/src/extension.ts
  • harnesses/cursor/extension/src/graph/editor-sync.ts
  • harnesses/cursor/extension/src/graph/impact-overlay.ts
  • harnesses/cursor/extension/src/graph/snapshot-loader.ts
  • harnesses/cursor/extension/src/graph/types.ts
  • harnesses/cursor/extension/src/health/checker.ts
  • harnesses/cursor/extension/src/health/index.ts
  • harnesses/cursor/extension/src/health/wirings.ts
  • harnesses/cursor/extension/src/statusbar/commands.ts
  • harnesses/cursor/extension/src/statusbar/detail-view.ts
  • harnesses/cursor/extension/src/statusbar/indicator.ts
  • harnesses/cursor/extension/src/statusbar/poller.ts
  • harnesses/cursor/extension/src/types/health.ts
  • harnesses/cursor/extension/src/utils/fs-json.ts
  • harnesses/cursor/extension/src/utils/output.ts
  • harnesses/cursor/extension/src/utils/paths.ts
  • harnesses/cursor/extension/src/webview/DashboardPanel.ts
  • harnesses/cursor/extension/src/webview/data-bridge.ts
  • harnesses/cursor/extension/src/webview/html/dashboard-shell.ts
  • harnesses/cursor/extension/tsconfig.json
  • harnesses/cursor/extension/webpack.config.js
  • harnesses/hermes/.gitkeep
  • harnesses/openclaw/README.md
  • harnesses/openclaw/openclaw.plugin.json
  • harnesses/openclaw/package.json
  • harnesses/openclaw/skills/SKILL.md
  • harnesses/openclaw/skills/hivemind-goals/SKILL.md
  • harnesses/openclaw/src/index.ts
  • harnesses/openclaw/src/setup-config.ts
  • harnesses/pi/extension-source/hivemind.ts
  • library/README.md
  • library/issues/README.md
  • library/issues/backlog/README.md
  • library/issues/completed/README.md
  • library/issues/in-work/README.md
  • library/knowledge/README.md
  • library/knowledge/private/README.md
  • library/knowledge/private/ai/embeddings-retrieval.md
  • library/knowledge/private/ai/session-capture.md
  • library/knowledge/private/ai/skillify-pipeline.md
  • library/knowledge/private/ai/wiki-summary-workers.md
  • library/knowledge/private/architecture/session-lifecycle.md
  • library/knowledge/private/architecture/system-overview.md
  • library/knowledge/private/auth/auth-architecture.md
  • library/knowledge/private/collaboration/team-skills-sharing.md
  • library/knowledge/private/data/codebase-graph.md
  • library/knowledge/private/data/deeplake-tables-schema.md
  • library/knowledge/private/data/memory-virtual-filesystem.md
  • library/knowledge/private/frontend/cursor-extension-architecture.md
  • library/knowledge/private/infrastructure/monorepo-build-release.md
  • library/knowledge/private/multi-tenant/org-workspace-model.md
  • library/knowledge/private/operations/cli-command-architecture.md
  • library/knowledge/private/operations/notifications-and-health.md
  • library/knowledge/private/overview.md
  • library/knowledge/private/plugins/hook-lifecycle.md
  • library/knowledge/private/plugins/integration-model.md
  • library/knowledge/private/plugins/mcp-and-extension-surfaces.md
  • library/knowledge/private/reports/2026-06-12-reverse-document-qa-report.md
  • library/knowledge/private/security/credential-storage.md
  • library/knowledge/private/security/trust-boundaries.md
  • library/knowledge/private/standards/documentation-framework.md
  • library/knowledge/public/README.md
  • library/notes/README.md
  • library/qa/cursor-extension/2026-06-12-qa-report.md
  • library/qa/cursor-extension/2026-06-13-security-audit.md
  • library/qa/security/2026-06-12-security-audit-cursor-extension.md
  • library/qa/security/2026-06-12-security-audit.md
  • library/requirements/README.md
  • library/requirements/backlog/README.md
  • library/requirements/completed/README.md
  • library/requirements/completed/prd-002-cursor-extension-core/prd-002-cursor-extension-core-index.md
  • library/requirements/completed/prd-002-cursor-extension-core/prd-002a-health-check.md
  • library/requirements/completed/prd-002-cursor-extension-core/prd-002b-auth-secrets.md
  • library/requirements/completed/prd-002-cursor-extension-core/prd-002c-status-bar.md
  • library/requirements/completed/prd-002-cursor-extension-core/qa/2026-06-13-qa-report.md
  • library/requirements/completed/prd-003-cursor-extension-dashboard/prd-003-cursor-extension-dashboard-index.md
  • library/requirements/completed/prd-003-cursor-extension-dashboard/prd-003a-kpi-webview.md
  • library/requirements/completed/prd-003-cursor-extension-dashboard/prd-003b-settings-manager.md
  • library/requirements/completed/prd-003-cursor-extension-dashboard/prd-003c-session-viewer.md
  • library/requirements/completed/prd-003-cursor-extension-dashboard/qa/2026-06-13-qa-report.md
  • library/requirements/completed/prd-004-cursor-graph-visualizer/prd-004-cursor-graph-visualizer-index.md
  • library/requirements/completed/prd-004-cursor-graph-visualizer/prd-004a-graph-webview.md
  • library/requirements/completed/prd-004-cursor-graph-visualizer/prd-004b-editor-sync.md
  • library/requirements/completed/prd-004-cursor-graph-visualizer/prd-004c-impact-visualizer.md
  • library/requirements/completed/prd-004-cursor-graph-visualizer/qa/2026-06-13-qa-report.md
  • library/requirements/completed/prd-005-cursor-skillify-bridge/prd-005-cursor-skillify-bridge-index.md
  • library/requirements/completed/prd-005-cursor-skillify-bridge/prd-005a-skillify-bridge.md
  • library/requirements/completed/prd-005-cursor-skillify-bridge/prd-005b-rules-manager.md
  • library/requirements/completed/prd-005-cursor-skillify-bridge/prd-005c-skill-promoter.md
  • library/requirements/completed/prd-005-cursor-skillify-bridge/qa/2026-06-13-qa-report.md
  • library/requirements/in-work/README.md
  • library/requirements/reports/README.md
  • package.json
  • scripts/audit-openclaw-bundle.mjs
  • scripts/sync-versions.mjs
  • skills/hivemind-goals/SKILL.md
  • skills/hivemind-graph/SKILL.md
  • src/cli/embeddings.ts
  • src/cli/index.ts
  • src/cli/install-codex.ts
  • src/cli/install-cursor.ts
  • src/cli/install-hermes.ts
  • src/cli/install-openclaw.ts
  • src/cli/install-pi.ts
  • src/cli/skillify-spec.ts
  • src/cli/util.ts
  • src/commands/skillify.ts
  • src/dashboard/data.ts
  • src/graph/build-lock.ts
  • src/hooks/cursor/pre-tool-use.ts
  • src/hooks/cursor/session-end.ts
  • src/hooks/graph-on-stop.ts
  • src/hooks/hermes/session-end.ts
  • src/hooks/hermes/session-start.ts
  • src/hooks/pi/wiki-worker.ts
  • src/hooks/session-notifications.ts
  • src/hooks/shared/context-renderer.ts
  • src/hooks/shared/skillopt-hook.ts
  • src/notifications/recall-tracker.ts
  • src/notifications/sources/org-stats.ts
  • src/skillify/agent-model.ts
  • src/skillify/agent-roots.ts
  • src/skillify/autopull-worker.ts
  • src/skillify/gate-runner.ts
  • src/skillify/pull.ts
  • src/skillify/skill-invocations.ts
  • src/skillify/skillopt-worker.ts
  • tests/claude-code/dashboard-data.test.ts
  • tests/claude-code/dashboard-render.test.ts
  • tests/claude-code/embeddings-bundle-scan.test.ts
  • tests/claude-code/notifications.test.ts
  • tests/claude-code/periodic-summary-bundles.test.ts
  • tests/claude-code/plugin-cache-bundles.test.ts
  • tests/claude-code/plugin-cache-gc-bundle.integration.test.ts
  • tests/claude-code/plugin-cache-gc.test.ts
  • tests/claude-code/plugin-cache.test.ts
  • tests/claude-code/plugin-version-resolution.test.ts
  • tests/claude-code/pre-tool-use.test.ts
  • tests/claude-code/session-start.test.ts
  • tests/claude-code/shell-bundle-sql-trace-silence.test.ts
  • tests/claude-code/skillify-agent-roots.test.ts
  • tests/claude-code/skillify-bundle-scan.test.ts
  • tests/claude-code/skillify-cli.test.ts
  • tests/claude-code/skillify-promote-team.test.ts
  • tests/claude-code/skillify-session-start-injection.test.ts
  • tests/claude-code/utils-version-check.test.ts
  • tests/claude-code/version-check.test.ts
  • tests/claude-code/version-define-bundles.test.ts
  • tests/claude-code/wiki-next-steps-contract.test.ts
  • tests/claude-code/wiki-worker-plugin-version.test.ts
  • tests/claude-code/wiki-worker-upload-sql.test.ts
  • tests/cli/cli-embeddings.test.ts
  • tests/cli/cli-install-codex-fs.test.ts
  • tests/cli/cli-install-cursor-fs.test.ts
  • tests/cli/cli-install-hermes.test.ts
  • tests/cli/cli-install-openclaw.test.ts
  • tests/cli/cli-install-pi-fs.test.ts
  • tests/cli/install-end-to-end.test.ts
  • tests/codex/codex-capture.test.ts
  • tests/codex/codex-hooks.test.ts
  • tests/codex/codex-integration.test.ts
  • tests/openclaw/auto-recall.test.ts
  • tests/openclaw/hivemind-tools.test.ts
  • tests/openclaw/openclaw-embed-bundle.test.ts
  • tests/openclaw/setup-command.test.ts
  • tests/pi/pi-extension-source.test.ts
  • tests/pi/skillify-spec-drift.test.ts
  • tests/scripts/sync-versions.test.ts
  • tests/shared/agent-model.test.ts
  • tests/shared/embeddings-schema.test.ts
  • tests/shared/skillopt-hook.test.ts
  • vitest.config.ts

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@thenotoriousllama

Copy link
Copy Markdown
Author

I also:

  • Reverse documented the entire code base.
  • Documented all of our work with PRDs.
  • Updated the locations of some of the harness files to ~/harnesses/{name-of-harness} for housekeeping.

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