Skip to content

Disambiguate checkpoint basis evidence from current-buffer evidence #284

Description

@flyingrobots

Classification

Response-contract correctness and semantic clarity.

Problem

A checkpoint may lawfully name any retained rope head that belongs to the stated worldline, including a noncanonical historical head.

The native response currently combines two coordinate sets:

  • basisHeadId and basisByteLength describe the retained checkpoint basis;
  • the embedded BufferResponse describes the current canonical buffer snapshot, including headId, rootNodeId, byteLength, lineCount, and bufferVersion.

The TypeScript adapter then constructs textBasis from the retained basis but places the current canonical bufferVersion beside it in CreateTextBufferCheckpointResult. Nothing in the type names tells a consumer that those values may refer to different heads.

Evidence

Why it matters

A caller can incorrectly interpret bufferVersion as the version of textBasis.headId, which would produce a false coordinate claim. The implementation is authoritative; the response vocabulary is underspecified.

Constraints

  • Do not change checkpoint identity or mint a text mutation.
  • Do not require the checkpoint basis to be the canonical head.
  • Do not synthesize a historical buffer version if Echo/Jim does not store one.
  • Preserve opaque checkpoint, receipt, and tick identities.
  • Any compatibility alias must state exactly which head it describes.

Acceptance criteria

  • Choose and document explicit roles such as checkpointBasis and currentBuffer, or rename/omit fields that do not share a basis.
  • Make it impossible, or at least conspicuously difficult, to pair the current canonical version with a retained historical basis accidentally.
  • Add a deterministic test where the checkpoint basis is retained and noncanonical while the current buffer has a different head/version.
  • Assert the declared checkpoint still names the requested retained basis.
  • Assert no RopeHead, RopeRewrite, RopeDiff, root, length, line count, or version is mutated.
  • Update process JSONL and TypeScript schemas together if the response shape changes.
  • Preserve restart reconstruction from Echo history/WAL.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    causal-ropeCausal rope text authority roadmapenhancementNew feature or requestsliceImplementable roadmap slicetext-authorityText authority and storage invariantswork-in-progressCycle or PR is intentionally in progress and not ready to merge

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions