Shared transcript-core
Per-provider store locations, record parsing, and structural filtering for
Claude Code, Codex, and Cursor start in
src/transcript/core/runtimes.ts. Cursor's reliability contract adds two
canonical modules beside it:
src/transcript/core/cursor-frames.tsstreams physical JSONL frames, preserving closed, blank, malformed, partial, repaired, and replaced boundaries plus file identity and prefix-verification evidence.src/transcript/core/cursor-analysis.tsassembles turns and separates prefix-stable content availability from terminal lifecycle outcomes.
Rather than cross-skill runtime imports, each consumer ships committed
generated copies under its own scripts/lib/. pnpm run build materializes
those copies, so each skill remains dependency-free and install-free while
tracing back to canonical TypeScript.
Consumers
Current consumers of the shared transcript-core:
session-observer— shipsruntimes.mjs,cursor-frames.mjs, andcursor-analysis.mjs, plus its generated digest, locate, observe, state, and watch pipeline.export-session-transcript— shipsruntimes.mjs,cursor-frames.mjs, andcursor-analysis.mjs.
The lower-level Cursor normalizer remains terminal-only for Export Session
Transcript compatibility. Session Observer explicitly requests the
content-first observation projection. Session Observer Collaboration
explicitly requests confirmed-completion from the observer-generated modules;
its control, hook, completion, and lease files remain authored JavaScript.
Schema and position semantics
The public digest is a discriminated union:
- Schema v1 keeps existing non-Cursor behavior and
zero-based-jsonl-record-indexaccounting. - Cursor schema v2 uses
zero-based-jsonl-frame-index.fromIndexis inclusive,nextIndexis the first unconsumed safe frame, andtoIndexisnextIndex - 1ornull. An entry'srecordIndexis its delivery frame;sourceFrameIndexretains the original content frame.
Consumers dispatch on both fields. They never infer an index base from the runtime name or convert a persisted record position into a frame position. Cursor observation may expose stable content with lifecycle pending, while the completion projection remains terminal-success-only.
Editing the source
Edit the applicable canonical module under src/transcript/core/ or
src/transcript/session-observer/, then run pnpm run build to update every
declared committed output.
The drift guard makes skipping the rebuild a hard error: pnpm run build:check
regenerates expected output in check mode and fails on any divergence, and the
same guard runs in pnpm test through tests/tooling/generated-output-sync.test.ts.
Editing the canonical module without rebuilding the generated output breaks the
suite.
Compatibility wrapper
pnpm run sync:transcript-core remains as a compatibility command for existing
habits and automation. It delegates to scripts/build-generated.mjs, and
node scripts/sync-transcript-core.mjs --check delegates to
scripts/build-generated.mjs --check.
Architecture
The single-source-of-truth and generated-runtime philosophy behind this repo: shipped skills run with no install step, built from canonical TypeScript that is developer tooling only.
Cursor Collaboration Reliability
How exact identity, physical-frame observation, isolated continuity state, and lease-scoped completion make Cursor a reliable observed collaboration peer.