Skip to content

Expose first-class version history and point-in-time file access #36

@justrach

Description

@justrach

Problem

codedb2 already maintains per-file version chains and sequence numbers, but the public API only exposes coarse changes since polling. There is no way for clients to retrieve version history for a file, fetch the latest version metadata, read a file at a specific cursor/sequence, or retrieve stored edit payloads.

Why this matters

The program is not just an indexer; it also keeps mutation history. Without APIs for that history, one of the core internal subsystems is effectively inaccessible.

Evidence

  • src/store.zig implements getLatest() and getAtCursor() and stores data_offset/data_len
  • src/version.zig defines the version model
  • HTTP/MCP only expose changes and current status, not history lookup

Expected outcome

Add HTTP and MCP support for version-aware access, for example:

  • file history for a path
  • latest version metadata for a path
  • version lookup by seq/cursor
  • point-in-time read or reconstruction for a path
  • optional access to stored edit payload/diff data

Acceptance

  • clients can inspect version history for a file
  • clients can retrieve a file's state at or before a sequence number
  • tests cover history ordering, tombstones, and edge cases around missing files/cursors

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions