Skip to content

feat(cursor): Cursor sessions as the third index source - #48

Merged
AbsoluteMode merged 1 commit into
mainfrom
feat/cursor-source
Aug 3, 2026
Merged

feat(cursor): Cursor sessions as the third index source#48
AbsoluteMode merged 1 commit into
mainfrom
feat/cursor-source

Conversation

@AbsoluteMode

Copy link
Copy Markdown
Owner

«надо cursor добавить» — done. The format was captured from a live Cursor 3.14.7 install (Maxim installed it for exactly this experiment): SQLite state.vscdb, composerHeaders catalog (incl. isSubagent — skipped like Claude sidechains), composerData:<id> bubble order + ISO timestamps, bubbleId:* messages typed 1=user/2=assistant with thinking as empty-text bubbles.

Design points:

  • No file per session → virtual indexed paths cursor:<composerId>, lastUpdatedAt in the signature; reconciliation follows Cursor's catalog, not the disk (prune_deleted skips the virtual prefix — asserted).
  • WAL-safe: the live db is snapshotted before reading; a missing install is silent (absence is not an error).
  • Workspace→folder via the VS Code workspace.json convention; empty-window → empty project.
  • --source cursor across index/search/recent/grep/prune + MCP validation.
  • Bonus fix: the vector reuse-cache could leak vectors across embedding spaces after a model swap (in metadocs too) — reuse is now gated on the old signature carrying the current fingerprint; test asserts a swap re-embeds.

Synthetic-fixture tests reproduce the captured shape end-to-end (surface extraction incl. thinking bubbles, workspace mapping, incremental re-index on appended bubble, catalog reconciliation, silent absence, fp-gated reuse). Live proof will come from the first machine with Cursor present — the format itself was read from a real install, not imagined.

Suite 334 passed.

🤖 Generated with Claude Code

Format captured from a LIVE Cursor 3.14.7 install before it was removed
(the install existed for exactly this): one SQLite database
User/globalStorage/state.vscdb — composerHeaders as the session catalog,
composerData:<id> for bubble order + ISO timestamps, bubbleId:* rows typed
1=user / 2=assistant, thinking as empty-text bubbles. The surface rule stays
the project invariant: non-empty text only.

No file per session, so incremental indexing keys on virtual paths
cursor:<composerId> with lastUpdatedAt in the signature; reconciliation
compares Cursor's catalog against indexed_files instead of the disk, and
prune_deleted skips the virtual prefix. The live db is snapshotted (WAL)
before reading. Subagent sessions are skipped like Claude sidechains.
Workspace→folder mapping follows the VS Code workspace.json convention;
empty-window sessions index with an empty project.

Also fixes a reuse-cache hole this work surfaced, in both cursor and
metadocs indexing: embeddings_by_hash reuse is now gated on the OLD
signature carrying the current embed fingerprint — vectors never cross
embedding spaces via the by-hash cache.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@AbsoluteMode
AbsoluteMode merged commit 9b57d68 into main Aug 3, 2026
8 checks passed
@AbsoluteMode
AbsoluteMode deleted the feat/cursor-source branch August 3, 2026 11:51
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.

2 participants