| name | scene |
| description | Render the commit scene — a black-and-white network graph of a repo's whole git DAG (branches, worktrees, merges, tags) as one fixed-template HTML page in ~/.anu/scene/<repo>. The trunk is the left lane, each divergent branch/worktree gets its own, time flows down, old history collapses into ▸N pills, and a frontier rail lists every branch with ahead/behind + dirty so you can see "every direction the work is going" at a glance. No LLM — pure git plumbing. Use when the user runs `scene` or asks to see/visualize the git graph, commit network, branches, or what's diverging in this repo. |
scene — the commit network graph
scene reconstructs a repo's git history into a readable structured DAG and renders it
as one fixed B&W HTML page, the same parse→JSON→template→serve pattern as trail and map.
It answers one question fast: what directions is the work going, and what still needs to be
dealt with? It is the visual companion to review/pd (which are terminal/fzf).
Run it
scene # build + render + open ~/.anu/scene/<repo>/index.html
scene open # re-open the last render without rebuilding
scene watch # live: re-render as you (or sibling agents in worktrees) commit
scene serve [port] # serve the render over http (default 8787, bound 0.0.0.0 for Tailscale)
From an agent pane you can just run scene (it is a bash function on PATH via anu's fns).
There is nothing to fill in — the whole graph is reconstructed from git, no trailers, no LLM.
What it shows (the design)
The guiding invariant is ingest everything, render the frontier first. A repo with
hundreds of commits is mostly one long trunk; drawing every commit as an equal node is a
hairball. So:
- Trunk (the default branch's first-parent spine) holds lane 0, the left column.
- Every divergent branch / worktree / tag tip is rendered in full in its own lane to the
right — these are the live "directions."
- Boring linear runs collapse into a single edge carrying a
▸N count, so the trunk
stays a clean line and the eye goes to what's diverging.
- Already-merged history is hidden by default (an old PR that's done), revealable with the
"show merged history" toggle.
- A frontier rail lists every branch sorted current → live → parked, each with
⇡ahead ⇣behind vs the trunk, a worktree marker, and a ●N dirty count. Click a branch to
jump to its head; click any commit for a detail card (full sha, author, time, refs).
- HEAD is ringed; merges are diamonds; a dirty worktree shows a filled dot.
Data model (build.py → scene.json)
Pure git plumbing: log --all --topo-order --parents, for-each-ref, worktree list,
rev-list --left-right --count for ahead/behind, merge-base to attach divergences.
build.py precomputes topology, lanes, collapse counts and the frontier so the template just
draws. The JSON reserves an empty agents[] array: the swarm/pane overlay (which agent
authored which branch, joined on branch+worktree from ~/.local/share/anu/swarms/*) slots in
there later with no schema change.
Output: ~/.anu/scene/<repo>/scene.json + index.html. The template never varies per repo.