feat(storage): import Cursor sessions via the state.vscdb adapter #6039
All Vouch review confidence checks passed
Residual risk 0.27 = Change Risk (0.48) × (1 − Review Confidence (0.43)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.48 · 379 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.355
Shallow Review Depth
shallow_review_depth
0.344
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #6039"
general
weight: 0.35
ggbdpq
Summary
Adds a fourth external-session adapter that imports Cursor conversations from the local
state.vscdbSQLite database, per #5964's design sketch. The adapter follows the same contract and hardening rules as the existing Codex, Claude Code, and OpenCode adapters: read-onlynode:sqliteaccess, all five limit kinds active, sanitized titles, and error messages that carry no source paths or transcript content.Shape notes from the real database (macOS,
_v10 through 14):composerData:<id>holds the display name, epoch-millis stamps, and the orderedfullConversationHeadersOnlyindex;bubbleId:<composerId>:<bubbleId>holds one message body (bubbletype1 = user, 2 = assistant).toolFormerData;completedanderrorconvert to paired tool results,cancelledcalls stay unanswered and mark the turn aborted.composerHeaderstable) is left as a natural follow-up.The maintainer questions on the issue are answered by proceeding the way its author proposed: the format is non-public like the three sources already imported, and the import page enumerates registry adapters, so no desktop UI change is included.
Fixes #5964
Verification
| Check | Result |
| --- | --- |
| New fixture suite (in-code
state.vscdb) | 14/14 green (detect/catalog/paging/full mapping/pruned+corrupt gaps/not-found/hostile id/all five limit kinds/path-free errors/title sanitize/registry) || Adjacent adapters + importer suites | 114/114 green (registry change breaks nothing) |
| Real database smoke (1.3 GB,
_vup to 14) |detecttrue; catalog lists; one session read end-to-end: 925 messages = 5 user, 182 assistant, 368 tool calls, 365 paired results (the 3 unpaired are the source's cancelled tools) ||
biome checkon touched files | clean ||
npm run check:asf-headers| green (4242 files audited) ||
protocol-epoch-check --base 1e80e3b88| no protocol changes (epoch 202) || Not run locally | Windows/Linux behavior of
node:sqliteon the spaced path (opened through the driver only, per the Codex adapter precedent); CI will cover |AI use
Generated with an AI coding assistant (ZCode / GLM-5.3-Flash) under human direction; the design, schema measurements, and verification runs against a real database are recorded in the issue and this PR.
Checklist