Skip to content

feat(miner): freeze/snapshot mechanism for historical replay targets #3010

Description

@JSONbored

Context

Part of the internal historical-replay calibration harness roadmap. The harness needs a way to reconstruct exactly what a real repo looked like at a chosen past commit T, without any information from after T leaking in. The discover and analyze phases of the miner pipeline already read git history to understand a target repo's shape and recent activity; that history-reading logic is the natural starting point for a freeze/snapshot exporter rather than writing a second implementation.

Goal

Given a repo and a commit T, produce a reproducible export of the working tree and a knowable-at-T-only context bundle for use as replay input.

Requirements

  • Accept a repo reference and a commit SHA T; export the full working tree checked out at T via a git worktree or equivalent, without mutating the caller's working directory.
  • Export a context snapshot alongside the tree: commit history up to and including T, tags/releases dated at or before T, and the README as it existed at T.
  • Exclude any repo metadata dated after T (later commits, later tags, later issue/PR references) from both the tree export and the context bundle.
  • Reuse the existing git-history-reading utilities from the discovery/analyze phases rather than reimplementing commit/tag enumeration.
  • Persist the snapshot in a content-addressed or commit-keyed form so the same (repo, T) pair always reproduces an identical snapshot.
  • Add a validation step that fails fast if any exported artifact contains a timestamp after T.

Deliverables

  • Snapshot export function taking (repo, commit T) and producing a working-tree export plus a context bundle
  • Post-export validation that rejects any artifact with a timestamp after T
  • Reuse of existing discovery/analyze git-history utilities, documented at the call site
  • Unit tests covering a repo with tags, a repo with no tags, and a commit at the very first commit of history

Expected outcomes

  • A frozen snapshot for a given (repo, T) is byte-reproducible across repeated exports
  • Zero post-T timestamps present in any exported artifact, verified by the validation step

Part of the historical-replay calibration roadmap: #2994

Metadata

Metadata

Assignees

Labels

gittensor:featureGittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.gittensor:priorityMaintainer-selected Gittensor priority — scores a 1.5x multiplier.

Projects

Status
Done
Status
Done

Relationships

None yet

Development

No branches or pull requests

Issue actions