Skip to content

feat: git history visualization mode - #3

Open
tcsenpai wants to merge 1 commit into
cosmtrek:masterfrom
tcsenpai:feat/git-history-mode
Open

feat: git history visualization mode#3
tcsenpai wants to merge 1 commit into
cosmtrek:masterfrom
tcsenpai:feat/git-history-mode

Conversation

@tcsenpai

Copy link
Copy Markdown
Contributor

Replay a repository's commit history on the code city — one commit per event, oldest→newest — so the repo grows from nothing as it plays. Builds on the map/video work that just merged (#1); it's another trace source through the same pipeline.

What it does

  • New internal/githistory package builds a trace from git log --numstat, reusing the existing trace / playback / citymap / ghost pipeline unchanged. Each commit → one event with an edit target per changed file; per-file churn (added+deleted) rides on the target. History is capped via --max-count to bound memory on large repos.
  • Empty-repo seed event at t=0 so the first commit reads as the first change, not the starting frame.
  • mindwalk history <repo> CLI, ?history=1 UI mode, and GET /api/history[?repo=<path>] emitting the full {trace, city} snapshot. Cached per repo with a TTL + bounded eviction; the git log + citymap build runs outside the cache lock so concurrent requests for other repos aren't serialized behind it (mirrors the existing inflight intent).
  • Reachable from a running serve UI via the HUD Explore menu and the sidebar "Explore a repository" picker — each offering Map and History.
  • Terrain colors in history mode: each file colored by the size (churn) of the commit that last touched it on the LOC ramp (grey→red) against a fixed ceiling; files touched by the commit at the playhead glow blue to mark whose turn it is.

Notes

  • Deleted-over-history files render as ghosts (existing mechanism).
  • No changes to the model, schema, playback engine, or the session / static-map paths — history is just another trace source.
  • Tests: internal/githistory (replay ordering, rename→new-path, delete→ghost, numstat churn, seed event, non-repo error) and internal/server (history endpoint, 404 without repo, cache TTL + eviction bound). make test passes; gofmt-clean.
  • Embedded assets regenerated via make build.

Replay a repository's commit history on the code city: one commit per event,
oldest to newest, so the repo grows from nothing as it plays.

- New internal/githistory package builds a trace from `git log --numstat`,
  reusing the existing trace/playback/citymap/ghost pipeline unchanged. Each
  commit becomes one event with an "edit" target per changed file; per-file
  churn (added+deleted lines) rides on the target so the view can color by
  commit size. History is capped (--max-count) to bound memory on large repos.
- A synthetic seed event at t=0 represents the empty repository, so the first
  commit reads as the first change rather than the starting frame.
- New `mindwalk history <repo>` CLI command, `?history=1` UI mode, and a
  `GET /api/history[?repo=<path>]` route emitting the full {trace, city}
  snapshot. The build is cached per repo with a TTL and bounded eviction, and
  the git log + citymap build runs outside the cache lock so concurrent
  requests for other repos aren't serialized behind it.
- Reachable from a running serve UI via the HUD "Explore" menu and the sidebar
  "Explore a repository" picker, each offering Map and History.
- Terrain colors in history mode: each file is colored by the size of the
  commit that last touched it on the LOC ramp (grey to red) against a fixed
  ceiling, and files touched by the commit at the playhead glow blue.

Deleted-over-history files render as ghosts (existing mechanism). No changes to
the model, schema, playback engine, or the session/static-map paths. Embedded
frontend assets regenerated via `make build`.
medecau added a commit to medecau/mindwalk that referenced this pull request Jul 14, 2026
medecau added a commit to medecau/mindwalk that referenced this pull request Jul 14, 2026
Both landed via the cosmtrek#4/cosmtrek#3 merge; AGENTS.md still named only Claude
Code and Codex and omitted githistory from the architecture list.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant