Skip to content

feat: time-travel via epoch markers (git mind at) #202

@flyingrobots

Description

@flyingrobots

Summary

The README claims git checkout syncs the knowledge graph to that commit's point in time. This is false — the CRDT graph lives in refs/warp/gitmind/* and doesn't move with checkout.

Solution

Implement epoch markersepoch:<sha8> nodes stored in the CRDT graph that correlate git commits to Lamport ticks. git mind at <ref> resolves ref → SHA → epoch → tick → graph.materialize({ ceiling: tick }).

Changes

  • New src/epoch.js module (getCurrentTick, recordEpoch, lookupEpoch, lookupNearestEpoch, getEpochForRef)
  • src/hooks.js — processCommit records epoch after directive processing
  • src/cli/commands.js + bin/git-mind.js — new at command
  • src/cli/format.js — formatAtStatus formatter
  • src/validators.js — add epoch to SYSTEM_PREFIXES
  • src/export.js — exclude epoch nodes from export
  • src/doctor.js — exclude epoch nodes from orphan detection
  • src/index.js — export epoch functions
  • README.md + GUIDE.md — fix false time-travel claims, document git mind at
  • New test/epoch.test.js

Acceptance Criteria

  • git mind at HEAD shows current graph state with epoch metadata
  • git mind at HEAD~N materializes graph at that point in time
  • Epoch nodes excluded from export and doctor
  • All tests pass

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions