Repository navigation
What's Changed
Full Changelog: v0.17.0...v0.18.0
cursor-history 0.18.0
Corrective release, following 0.17.0.
Restores byte-exact v0.16 Composer identity, and makes the upgrade to a merged Composer-backed view safe for downstream consumers that persist what this library returns.
Do you need to act?
- You parse fatal
--jsonoutput. It moved to stderr. Your script will now read an empty stdout. - You persisted search coordinates (
messageIndex,offset,match, context). They now address a different coordinate space and must be recomputed. - You rely on restore warnings. A warned file is no longer written. Do not assume it landed.
- You run Node 21, or created backups spanning several workspaces with an older version.
None of the above? Upgrading is additive — read "What does not change" and move on.
The fix
A Composer message keeps the identity v0.16 gave it. Identity is frozen before any Store merge, so native Cursor IDs stay byte-for-byte identical and Store-only messages take a separate versioned namespace instead of competing for the same keys.
That is what makes the upgrade safe downstream: a v0.16 Composer-only archive can become a complete Composer-backed merged session through the consumer's existing whole-session replacement, and the sync after it performs no session or content mutations. Middle insertions, enrichment, relationships, and tool calls no longer depend on a timestamp watermark to be noticed.
What you must do
| Change | Action |
|---|---|
Fatal --json now writes to stderr; stdout stays empty |
Parse stderr after a nonzero exit. Field names, types, values, and exit-category meaning are unchanged. |
| Public search coordinates corrected | Recompute persisted messageIndex, offset, match, and context. They now address the complete message array, complete original content in zero-based UTF-16 code units, and complete source lines. v0.16 and v0.17 returned placeholder or snippet-relative values. |
| Restore treats validation as a publication gate | Stop assuming a warned entry was written. filesRestored counts only intact published entries; warnings name skipped paths. |
| Node range narrowed to 20.x and 22.x–26.x | Move off Node 21 — the packaged native SQLite fallback does not support it. Node 20.0.0 remains the floor. |
| Legacy multi-workspace backups need recreation | Recreate them. Such archives now fail before database extraction with BACKUP_WORKSPACE_SCOPE_METADATA_REQUIRED and recreation guidance. Single-workspace archives stay readable. |
| Session IDs stay case-sensitive | Reuse the exact spelling Cursor returned. Differently cased values are distinct IDs even in canonical UUID syntax; do not rely on case folding. |
What does not change
Every non-additive public value and own-property, null, and omission shape stays exact, including:
Native Cursor session IDs · nonempty native message IDs · tool-call IDs · identity-to-content, relationship, and tool bindings · Composer tool-call order and the ordinal-derived keys downstream systems built on it.
New provenance arrives as additive fields — resolvedSource, sources, resolution, workspace membership and source-instance metadata, and timestamp provenance — so a reader that ignores unknown fields sees no difference.
Three deliberate exceptions
These are the only non-additive value changes, each versioned and each applied only when the source itself is absent.
Missing message id. A missing, null, or empty Composer message id is materialized as exactly msg:<zero-based v0.16 Composer index> — the same durable key the unchanged consumer already synthesized. No other token is permitted.
Timestamps without a source. Inferred message timestamps become deterministic and carry provenance, and a missing Composer update time no longer falls back to read time.
Pathless workspace. The internal (workspace: <directory-id>) placeholder was never a real path. Public-library output now returns "unknown"; core and CLI structured output return null and omit canonical path metadata.
Upgrading safely
- Back up the downstream archive before the first corrective sync.
- If you persist this library's output incrementally, keep v0.16 pinned until you have validated the transition against your own data.
- For complete v0.17 Store or merged data, allow one full replacement and confirm the next sync is a no-op. For degraded data, pin or retry from complete sources — never let a partial view overwrite a complete archived session.
- The no-consumer-change guarantee covers confirmed v0.16 Composer-only archives becoming complete Composer-backed merged sessions. It does not claim preservation of every v0.17 Store-only or cross-format synthetic ID.
- Numeric indices remain presentation addresses: CLI, core, and migration selectors are one-based; public-library reads are zero-based. Carry native session IDs across invocations and scopes, not numbers.
The canonical compatibility and migration contract is docs/compatibility.md. Full detail for this release lives in CHANGELOG.md. Release verification procedure: docs/release-verification.md.