feat: git history visualization mode - #3
Open
tcsenpai wants to merge 1 commit into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
internal/githistorypackage builds a trace fromgit log --numstat, reusing the existing trace / playback / citymap / ghost pipeline unchanged. Each commit → one event with anedittarget per changed file; per-file churn (added+deleted) rides on the target. History is capped via--max-countto bound memory on large repos.mindwalk history <repo>CLI,?history=1UI mode, andGET /api/history[?repo=<path>]emitting the full{trace, city}snapshot. Cached per repo with a TTL + bounded eviction; thegit log+ citymap build runs outside the cache lock so concurrent requests for other repos aren't serialized behind it (mirrors the existinginflightintent).serveUI via the HUD Explore menu and the sidebar "Explore a repository" picker — each offering Map and History.Notes
internal/githistory(replay ordering, rename→new-path, delete→ghost, numstat churn, seed event, non-repo error) andinternal/server(history endpoint, 404 without repo, cache TTL + eviction bound).make testpasses;gofmt-clean.make build.