xonecas.io
8356
Wx

www-xonecas-io / commit 8d7af2a

commit log and commit pages with capped diffs, rebuilt only when new or the program changes (1009)

Co-Authored-By: Claude Opus 5.5

Sean Caetano Martin2026-11-08 8d7af2a2fe5592c82ab2a759101611ddd2a05de7 parent b1a5f41

20 files changed

internal/site/assets/site.css+10−0
@@ -77,3 +77,13 @@
7777 .prose :where(pre) { border-radius: 2px; font-size: 12.5px; }
7878 .prose :where(img) { display: inline; margin: 0; }
7979 .prose :where(code)::before, .prose :where(code)::after, .prose :where(blockquote p)::before, .prose :where(blockquote p)::after { content: none; }
80+
81+/* One diff line. Commit pages hold thousands, so the markup stays short. */
82+@layer components {
83+ .dl { display: grid; grid-template-columns: 2.5rem 2.5rem 1rem 1fr; width: max-content; min-width: 100%; }
84+ .dl.add { background: var(--color-add); }
85+ .dl.del { background: var(--color-del); }
86+ .dl > i { font-style: normal; text-align: right; padding-right: .5rem; color: var(--color-soft); user-select: none; }
87+ .dl > b { user-select: none; }
88+ .dl > span { white-space: pre; padding-right: 1rem; }
89+}
internal/site/build.go+33−3
@@ -2,6 +2,7 @@
22 package site
33
44 import (
5+ "crypto/sha256"
56 "embed"
67 "errors"
78 "fmt"
@@ -23,9 +24,12 @@ var templates embed.FS
2324 var static embed.FS
2425
2526 var funcs = template.FuncMap{
26- "list": func(v ...any) []any { return v },
27- "lower": strings.ToLower,
28- "web": func(url string) string { return strings.TrimSuffix(strings.TrimPrefix(url, "https://"), ".git") },
27+ "list": func(v ...any) []any { return v },
28+ "lower": strings.ToLower,
29+ "inc": func(i int) int { return i + 1 },
30+ "maxDiff": func() int { return MaxDiffLines },
31+ "dec": func(i int) int { return i - 1 },
32+ "web": func(url string) string { return strings.TrimSuffix(strings.TrimPrefix(url, "https://"), ".git") },
2933 "dict": func(kv ...any) (map[string]any, error) {
3034 if len(kv)%2 != 0 {
3135 return nil, errors.New("dict needs key, value pairs")
@@ -44,10 +48,20 @@ var pages = template.Must(template.New("").Funcs(funcs).ParseFS(templates, "temp
4448 func Build(projects []project.Project, out, tailwind string) error {
4549 shown := slices.DeleteFunc(slices.Clone(projects), func(p project.Project) bool { return p.Hidden != "" })
4650 rows := Rows(shown)
51+ stamp, fresh, err := readStamp(out)
52+ if err != nil {
53+ return err
54+ }
4755 for i, p := range shown {
4856 if err := writeProject(out, p, rows[i]); err != nil {
4957 return fmt.Errorf("%s: %w", p.Name, err)
5058 }
59+ if err := writeCommits(out, p, rows[i], fresh); err != nil {
60+ return fmt.Errorf("%s: %w", p.Name, err)
61+ }
62+ }
63+ if err := os.WriteFile(filepath.Join(out, ".stamp"), []byte(stamp), 0o644); err != nil {
64+ return err
5165 }
5266 for path, page := range map[string]struct {
5367 name string
@@ -69,6 +83,22 @@ func Build(projects []project.Project, out, tailwind string) error {
6983 return cmd.Run()
7084 }
7185
86+// readStamp hashes this program, which holds every template, and says whether out was built by it.
87+// Pages that never change, such as commits, are only rendered again by a different program.
88+func readStamp(out string) (stamp string, fresh bool, err error) {
89+ exe, err := os.Executable()
90+ if err != nil {
91+ return "", false, err
92+ }
93+ b, err := os.ReadFile(exe)
94+ if err != nil {
95+ return "", false, err
96+ }
97+ stamp = fmt.Sprintf("%x", sha256.Sum256(b))
98+ old, _ := os.ReadFile(filepath.Join(out, ".stamp"))
99+ return stamp, string(old) == stamp, nil
100+}
101+
72102 func render(path, name string, data any) error {
73103 if err := os.MkdirAll(filepath.Dir(path), 0o755); err != nil {
74104 return err
internal/site/commits.go+117−0
@@ -0,0 +1,117 @@
1+package site
2+
3+import (
4+ "errors"
5+ "fmt"
6+ "os"
7+ "path/filepath"
8+ "regexp"
9+ "runtime"
10+ "slices"
11+ "strings"
12+ "sync"
13+
14+ "xonecas.io/site/internal/project"
15+ "xonecas.io/site/internal/repo"
16+)
17+
18+// PerPage is how many commits one page of a project's log lists.
19+const PerPage = 50
20+
21+// LogEntry is one commit of a project, from any of its sources.
22+type LogEntry struct {
23+ Hash, Short, Author, Date, Subject, Body, Dir string
24+ Parents []string
25+}
26+
27+// LogPage is one page of a project's commit log.
28+type LogPage struct {
29+ Row ProjectRow
30+ Name string
31+ Commits []LogEntry
32+ Page, Pages, Total int
33+}
34+
35+// CommitPage is one commit with its diff.
36+type CommitPage struct {
37+ Row ProjectRow
38+ Name string
39+ C LogEntry
40+ Diffs []Diff
41+ Cut bool // the diff is over MaxDiffLines and was cut short
42+}
43+
44+// email is an address in angle brackets, as in Co-authored-by trailers. The site shows names only.
45+var email = regexp.MustCompile(`\s*<[^<>\s]+@[^<>\s]+>`)
46+
47+// readLog is every commit on every ref of every source, newest first, each hash once.
48+func readLog(p project.Project) ([]LogEntry, error) {
49+ var log []LogEntry
50+ seen := map[string]bool{}
51+ for _, s := range p.Sources {
52+ if s.Commits == 0 {
53+ continue
54+ }
55+ out, err := repo.Git(s.Dir, "log", "--all", "--date-order", "--format=%x1e%H%x1f%h%x1f%an%x1f%as%x1f%P%x1f%B")
56+ if err != nil {
57+ return nil, err
58+ }
59+ for _, rec := range strings.Split(out, "\x1e")[1:] {
60+ f := strings.SplitN(rec, "\x1f", 6)
61+ if len(f) < 6 || seen[f[0]] {
62+ continue
63+ }
64+ seen[f[0]] = true
65+ subject, body, _ := strings.Cut(strings.TrimSpace(email.ReplaceAllString(f[5], "")), "\n")
66+ log = append(log, LogEntry{Hash: f[0], Short: f[1], Author: f[2], Date: f[3], Parents: strings.Fields(f[4]),
67+ Subject: subject, Body: strings.TrimSpace(body), Dir: s.Dir})
68+ }
69+ }
70+ slices.SortStableFunc(log, func(a, b LogEntry) int { return strings.Compare(b.Date, a.Date) })
71+ return log, nil
72+}
73+
74+// writeCommits writes the log pages, and a page for each commit not already built by this
75+// same build of the site (stamp), so a rebuild only renders new commits.
76+func writeCommits(out string, p project.Project, row ProjectRow, fresh bool) error {
77+ log, err := readLog(p)
78+ if err != nil {
79+ return err
80+ }
81+ base := filepath.Join(out, "projects", p.Name, "commits")
82+ pages := max(1, (len(log)+PerPage-1)/PerPage)
83+ for i := range pages {
84+ dir := base
85+ if i > 0 {
86+ dir = filepath.Join(base, fmt.Sprint(i+1))
87+ }
88+ page := LogPage{Row: row, Name: p.Name, Commits: log[i*PerPage : min(len(log), (i+1)*PerPage)], Page: i + 1, Pages: pages, Total: len(log)}
89+ if err := render(filepath.Join(dir, "index.html"), "commits.html", page); err != nil {
90+ return err
91+ }
92+ }
93+ var wg sync.WaitGroup
94+ errs := make([]error, len(log))
95+ sem := make(chan struct{}, runtime.NumCPU())
96+ for i, c := range log {
97+ path := filepath.Join(out, "projects", p.Name, "commit", c.Hash, "index.html")
98+ if _, err := os.Stat(path); err == nil && fresh {
99+ continue
100+ }
101+ wg.Go(func() {
102+ sem <- struct{}{}
103+ defer func() { <-sem }()
104+ patch, err := repo.Git(c.Dir, "-c", "core.quotePath=false", "show", "--format=", "--no-color", "-M", "--diff-merges=first-parent", c.Hash)
105+ if err == nil {
106+ diffs := parseDiff(patch)
107+ cut := slices.ContainsFunc(diffs, func(d Diff) bool { return strings.HasPrefix(d.Note, "Cut short") })
108+ err = render(path, "commit.html", CommitPage{Row: row, Name: p.Name, C: c, Diffs: diffs, Cut: cut})
109+ }
110+ if err != nil {
111+ errs[i] = fmt.Errorf("%s: %w", c.Short, err)
112+ }
113+ })
114+ }
115+ wg.Wait()
116+ return errors.Join(errs...)
117+}
internal/site/diff.go+73−0
@@ -0,0 +1,73 @@
1+package site
2+
3+import (
4+ "fmt"
5+ "regexp"
6+ "strconv"
7+ "strings"
8+)
9+
10+// MaxDiffLines is how many diff lines one commit page shows. The rest of its files are listed with their counts.
11+const MaxDiffLines = 1000
12+
13+// maxLine cuts minified one-line files down to something a page can hold.
14+const maxLine = 500
15+
16+var hunk = regexp.MustCompile(`^@@ -(\d+)(?:,\d+)? \+(\d+)`)
17+
18+// parseDiff splits git's patch output into files, keeping at most MaxDiffLines lines in all.
19+func parseDiff(patch string) []Diff {
20+ var diffs []Diff
21+ var d *Diff
22+ budget, old, nw, in := MaxDiffLines, 0, 0, false
23+ for _, l := range strings.Split(patch, "\n") {
24+ switch {
25+ case strings.HasPrefix(l, "diff --git a/"):
26+ rest := l[len("diff --git a/"):] // "P b/P"
27+ diffs = append(diffs, Diff{Path: rest[:max(0, len(rest)-3)/2]})
28+ d, in = &diffs[len(diffs)-1], false
29+ case d == nil:
30+ case !in && strings.HasPrefix(l, "rename to "):
31+ d.Path = l[len("rename to "):]
32+ case !in && strings.HasPrefix(l, "Binary files "):
33+ d.Note = "Binary file, not shown."
34+ case strings.HasPrefix(l, "@@"):
35+ m := hunk.FindStringSubmatch(l)
36+ if m == nil {
37+ continue
38+ }
39+ old, _ = strconv.Atoi(m[1])
40+ nw, _ = strconv.Atoi(m[2])
41+ in = true
42+ d.add(&budget, DiffLine{Op: "@", Text: l})
43+ case !in || l == "" || l[0] == '\\':
44+ case l[0] == '+':
45+ d.Adds++
46+ d.add(&budget, DiffLine{"+", 0, nw, l[1:]})
47+ nw++
48+ case l[0] == '-':
49+ d.Dels++
50+ d.add(&budget, DiffLine{"-", old, 0, l[1:]})
51+ old++
52+ default:
53+ d.add(&budget, DiffLine{" ", old, nw, l[1:]})
54+ old, nw = old+1, nw+1
55+ }
56+ }
57+ return diffs
58+}
59+
60+// add keeps line while the commit's budget lasts, and says so on the file once it runs out.
61+func (d *Diff) add(budget *int, line DiffLine) {
62+ if *budget == 0 {
63+ if d.Note == "" {
64+ d.Note = fmt.Sprintf("Cut short: this commit's diff is over %d lines.", MaxDiffLines)
65+ }
66+ return
67+ }
68+ *budget--
69+ if len(line.Text) > maxLine {
70+ line.Text = line.Text[:maxLine] + " …"
71+ }
72+ d.Lines = append(d.Lines, line)
73+}
internal/site/diff_test.go+27−0
@@ -0,0 +1,27 @@
1+package site
2+
3+import (
4+ "fmt"
5+ "strings"
6+ "testing"
7+)
8+
9+func TestParseDiff(t *testing.T) {
10+ patch := "diff --git a/a.go b/a.go\nindex 1..2 100644\n--- a/a.go\n+++ b/a.go\n@@ -3,2 +3,2 @@ func f()\n x\n-y\n+z\n" +
11+ "diff --git a/old.txt b/new.txt\nsimilarity index 90%\nrename from old.txt\nrename to new.txt\n" +
12+ "diff --git a/i.png b/i.png\nnew file mode 100644\nBinary files /dev/null and b/i.png differ\n"
13+ d := parseDiff(patch)
14+ if len(d) != 3 || d[0].Path != "a.go" || d[1].Path != "new.txt" || d[2].Note == "" {
15+ t.Fatalf("files: %+v", d)
16+ }
17+ want := []DiffLine{{"@", 0, 0, "@@ -3,2 +3,2 @@ func f()"}, {" ", 3, 3, "x"}, {"-", 4, 0, "y"}, {"+", 0, 4, "z"}}
18+ if fmt.Sprint(d[0].Lines) != fmt.Sprint(want) || d[0].Adds != 1 || d[0].Dels != 1 {
19+ t.Errorf("a.go: %+v", d[0])
20+ }
21+
22+ big := "diff --git a/b b/b\n@@ -0,0 +1 @@\n" + strings.Repeat("+x\n", MaxDiffLines+10)
23+ d = parseDiff(big)
24+ if len(d[0].Lines) != MaxDiffLines || d[0].Adds != MaxDiffLines+10 || !strings.HasPrefix(d[0].Note, "Cut short") {
25+ t.Errorf("cap: %d lines, %d adds, note %q", len(d[0].Lines), d[0].Adds, d[0].Note)
26+ }
27+}
internal/site/style.go+3−2
@@ -32,7 +32,8 @@ func styleData() map[string]any {
3232 },
3333 },
3434 "Code": map[string]any{"Name": "README.md · Usage", "Code": "ffmpeg.call(\n [ ... ], // array of ffmpeg flags\n callback // function to call after ffmpeg is done\n);\n\nffmpeg.call(['-i', 'input.avi', '-vcodec', 'libx264', 'output.mp4'], function (err, stdout) {\n if (err) throw err;\n});"},
35- "Diff": Diff{"ffmpeg-node.js", 3, 2, "@@ -12,7 +12,8 @@ ffmpeg.exec = function (params, callback) {", []DiffLine{
35+ "Diff": Diff{"ffmpeg-node.js", 3, 2, []DiffLine{
36+ {"@", 0, 0, "@@ -12,7 +12,8 @@ ffmpeg.exec = function (params, callback) {"},
3637 {" ", 12, 12, " var args = ['-y'];"},
3738 {"-", 13, 0, " args = args.concat(params);"},
3839 {"-", 14, 0, " exec('ffmpeg ' + args.join(' '), callback);"},
@@ -40,7 +41,7 @@ func styleData() map[string]any {
4041 {"+", 0, 14, " args.push(key, params[key]);"},
4142 {"+", 0, 15, " }"},
4243 {" ", 15, 16, "};"},
43- }},
44+ }, ""},
4445 "Commits": []Commit{
4546 {Element{56, 96, "Df", "dotfiles", "none", true}, "c1dddf3", "dotfiles: sync", "xonecas", "2026-11-07"},
4647 {Element{79, 113, "Mi", "mini-coding-agent", "be", true}, "4cf0bc6", "feat: suggest models to use the cwd param instead of cd spam", "xonecas", "2026-10-28"},
internal/site/templates/commit.html+17−0
@@ -0,0 +1,17 @@
1+{{define "commit.html"}}{{template "head" (printf "%s · %s" .C.Subject .Name)}}{{template "nav" "Projects"}}
2+<main class="px-4 sm:px-8 py-6 max-w-[1440px] mx-auto">
3+ {{template "project-head" (dict "Row" .Row "Here" (printf "commit %s" .C.Short))}}
4+ <article class="border-[1.5px] border-ink rounded-[2px] bg-card mb-6">
5+ <h2 class="px-4 pt-3 text-xl font-bold break-words">{{.C.Subject}}</h2>
6+ {{with .C.Body}}<pre class="px-4 pt-2 font-sans whitespace-pre-wrap break-words">{{.}}</pre>{{end}}
7+ <p class="flex flex-wrap gap-x-3 px-4 py-3 mt-3 border-t border-line text-sm bg-empty">
8+ <b>{{.C.Author}}</b><span class="text-soft">{{.C.Date}}</span>
9+ <code class="font-mono text-accent break-all">{{.C.Hash}}</code>
10+ {{range .C.Parents}}<span class="text-soft">parent <a href="/projects/{{$.Name}}/commit/{{.}}/" class="font-mono">{{slice . 0 7}}</a></span>{{end}}
11+ </p>
12+ </article>
13+ <p class="text-sm text-soft mb-3">{{len .Diffs}} file{{if ne (len .Diffs) 1}}s{{end}} changed</p>
14+ {{if .Cut}}<p class="mb-4 px-4 py-2 border-[1.5px] border-accent rounded-[2px] text-sm"><b>This diff is too big to show in full.</b> The first {{maxDiff}} lines are below, and every file is listed with its counts.</p>{{end}}
15+ <div class="space-y-4">{{range .Diffs}}{{template "diff" .}}{{end}}</div>
16+</main>
17+{{template "foot"}}{{end}}
internal/site/templates/commits.html+18−0
@@ -0,0 +1,18 @@
1+{{define "commits.html"}}{{template "head" (printf "%s commits" .Name)}}{{template "nav" "Projects"}}
2+<main class="px-4 sm:px-8 py-6 max-w-[1440px] mx-auto">
3+ {{template "project-head" (dict "Row" .Row "Here" "commits")}}
4+ <p class="text-sm text-soft mb-3">{{.Total}} commits on every branch and tag, newest first{{if gt .Pages 1}} · page {{.Page}} of {{.Pages}}{{end}}</p>
5+ <ol class="@container border-t border-line">{{range .Commits}}
6+ <li class="grid grid-cols-[4.5rem_minmax(0,1fr)] @xl:grid-cols-[4.5rem_minmax(0,1fr)_11rem_6rem] gap-x-3 items-baseline py-1.5 border-b border-line text-[14.5px]">
7+ <a href="/projects/{{$.Name}}/commit/{{.Hash}}/" class="font-mono text-[12.5px] text-accent no-underline hover:underline">{{.Short}}</a>
8+ <a href="/projects/{{$.Name}}/commit/{{.Hash}}/" class="truncate no-underline hover:underline">{{.Subject}}</a>
9+ <span class="col-start-2 @xl:col-auto truncate text-sm text-soft"><b class="text-ink font-semibold">{{.Author}}</b><span class="@xl:hidden"> · {{.Date}}</span></span>
10+ <span class="hidden @xl:block text-right text-sm text-soft">{{.Date}}</span>
11+ </li>{{end}}
12+ </ol>
13+ {{if gt .Pages 1}}<nav class="flex justify-between mt-4 font-semibold">
14+ <span>{{if gt .Page 1}}<a href="/projects/{{.Name}}/commits/{{if gt .Page 2}}{{dec .Page}}/{{end}}">← Newer</a>{{end}}</span>
15+ <span>{{if lt .Page .Pages}}<a href="/projects/{{.Name}}/commits/{{inc .Page}}/">Older →</a>{{end}}</span>
16+ </nav>{{end}}
17+</main>
18+{{template "foot"}}{{end}}
internal/site/templates/components.html+9−5
@@ -59,11 +59,8 @@
5959 <div class="border-[1.5px] border-ink rounded-[2px] bg-card overflow-hidden">
6060 <div class="flex gap-3 px-4 py-2 border-b-[1.5px] border-ink text-sm"><b class="font-mono min-w-0 truncate">{{.Path}}</b><span class="ml-auto text-h4 font-semibold">+{{.Adds}}</span><span class="text-accent font-semibold">−{{.Dels}}</span></div>
6161 <div class="overflow-x-auto [scrollbar-width:thin] [scrollbar-color:var(--color-soft)_transparent] font-mono text-[12.5px] leading-relaxed">
62- <div class="px-4 py-1 bg-empty text-soft">{{.Hunk}}</div>
63- {{range .Lines}}<div class="grid grid-cols-[2.5rem_2.5rem_1rem_1fr] w-max min-w-full {{if eq .Op "+"}}bg-add{{else if eq .Op "-"}}bg-del{{end}}">
64- <span class="text-right pr-2 text-soft select-none">{{if .Old}}{{.Old}}{{end}}</span><span class="text-right pr-2 text-soft select-none">{{if .New}}{{.New}}{{end}}</span>
65- <span class="select-none font-bold">{{.Op}}</span><span class="whitespace-pre pr-4">{{.Text}}</span>
66- </div>{{end}}
62+ {{range .Lines}}{{if eq .Op "@"}}<div class="px-4 py-1 bg-empty text-soft whitespace-pre">{{.Text}}</div>{{else}}<div class="dl{{if eq .Op "+"}} add{{else if eq .Op "-"}} del{{end}}"><i>{{if .Old}}{{.Old}}{{end}}</i><i>{{if .New}}{{.New}}{{end}}</i><b>{{.Op}}</b><span>{{.Text}}</span></div>{{end}}{{end}}
63+ {{with .Note}}<div class="px-4 py-2 font-sans text-sm text-soft italic">{{.}}</div>{{end}}
6764 </div>
6865 </div>
6966 {{end}}
@@ -77,3 +74,10 @@
7774 <span class="hidden @xl:block text-right text-sm text-soft">{{.Date}}</span>
7875 </div></div>
7976 {{end}}
77+
78+{{define "project-head"}}{{/* dict "Row" ProjectRow "Here" string: the subpage, after the project name */}}
79+<header class="flex items-center gap-3 mb-5 min-w-0">
80+ {{template "element" (dict "El" .Row.El "Size" "sm")}}
81+ <h1 class="text-2xl font-bold min-w-0 truncate"><a href="/projects/{{.Row.El.Name}}/" class="no-underline hover:underline">{{.Row.El.Name}}</a> <span class="text-soft font-semibold">/ {{.Here}}</span></h1>
82+</header>
83+{{end}}
internal/site/templates/project.html+1−1
@@ -7,7 +7,7 @@
77 <p class="mt-1 text-lg">{{or .P.Description "No description"}}</p>
88 <div class="flex flex-wrap gap-1 mt-3">{{range .P.Tags}}{{template "tag" .}}{{end}}</div>
99 <p class="mt-3 text-sm text-soft">
10- <b class="text-ink">{{.P.Commits}}</b> commits{{if ne .P.Commits .P.Total}} of {{.P.Total}}{{end}} ·
10+ <a href="commits/" class="text-ink"><b>{{.P.Commits}}</b> commits{{if ne .P.Commits .P.Total}} of {{.P.Total}}{{end}}</a> ·
1111 {{.P.First}} to {{.P.Last}} · {{.P.Files}} files{{if .P.Stars}} · {{.P.Stars}} ★{{end}}
1212 </p>
1313 </div>
internal/site/view.go+2−2
@@ -32,7 +32,7 @@ type Commit struct {
3232 Hash, Msg, Author, Date string
3333 }
3434
35-// DiffLine is one line of a unified diff. Op is "+", "-" or " ".
35+// DiffLine is one line of a unified diff. Op is "+", "-", " ", or "@" for a hunk header.
3636 type DiffLine struct {
3737 Op string
3838 Old, New int // line numbers, 0 where the side has none
@@ -43,6 +43,6 @@ type DiffLine struct {
4343 type Diff struct {
4444 Path string
4545 Adds, Dels int
46- Hunk string
4746 Lines []DiffLine
47+ Note string // why lines are missing: a binary file, or a diff cut short
4848 }
tickets/1008-build-the-read-only-file-browser-with-syntax.md+15−2
@@ -6,9 +6,9 @@ status: doing
66 priority: p2
77 area: site
88 created: 2026-11-07T19:30:00Z
9-updated: 2026-11-08T01:09:41Z
9+updated: 2026-11-08T01:42:31Z
1010 source: agent
11-moves: 2026-11-07T19:30:00Z inbox todo agent; 2026-11-08T01:09:41Z todo doing drag
11+moves: 2026-11-07T19:30:00Z inbox todo agent; 2026-11-08T01:09:41Z todo doing drag; 2026-11-08T01:38:14Z doing blocked agent; 2026-11-08T01:42:28Z blocked todo note; 2026-11-08T01:42:31Z todo doing drag
1212 ---
1313
1414 Browse directories and view files on the default branch, with syntax highlighting and line anchors.
@@ -18,3 +18,16 @@ Binary and very large files show a placeholder and their size, not their content
1818 Needs from xonecas: default branch only, or all branches and tags? I recommend default only to start, because static output grows with every ref.
1919
2020 Done when: every file link in a repo resolves, and a binary file does not break the build.
21+
22+## Notes
23+
24+- 2026-11-08 01:38Z (agent): Blocked: one question before I start. Default branch only, or all branches and tags?
25+
26+ - Default branch only (recommended): one tree per project. Measured: 81 projects have about 3,900 files on HEAD, so it stays small and fast.
27+ - All branches and tags: every ref multiplies the output, and the URLs need a ref segment (/tree/<ref>/<path>). I can add that later without breaking default-branch URLs if I keep the default at /tree/<path>.
28+
29+ The URLs are already set by 1007: /projects/<name>/tree/<path>/, /projects/<name>/blob/<path>/ and /projects/<name>/raw/<path>. Links from READMEs and the root tree already point there and 404 until this lands.
30+
31+- 2026-11-08 01:39Z (agent): Correction: I wrote 'about 3,900 files' before measuring. The 81 shown projects have 3,954 files on HEAD (from data/projects.json).
32+
33+- 2026-11-08 01:42Z (human): main branch only for now.
tickets/1009-build-commit-history-and-diff-pages.md+25−3
@@ -2,13 +2,13 @@
22 id: 1009
33 title: Build commit history and diff pages
44 type: feature
5-status: doing
5+status: review
66 priority: p2
77 area: site
88 created: 2026-11-07T19:30:00Z
9-updated: 2026-11-08T01:09:40Z
9+updated: 2026-11-08T01:55:07Z
1010 source: agent
11-moves: 2026-11-07T19:30:00Z inbox todo agent; 2026-11-08T01:09:40Z todo doing drag
11+moves: 2026-11-07T19:30:00Z inbox todo agent; 2026-11-08T01:09:40Z todo doing drag; 2026-11-08T01:55:07Z doing review agent
1212 ---
1313
1414 Per project: a paginated commit log and one page per commit with its message, author name, date and diff.
@@ -18,3 +18,25 @@ Real commit messages are the best content on the site, for example zen's 2011 'o
1818 Cap large diffs. Static output is the risk here, so measure the total size and build time across all projects and put the numbers on this ticket.
1919
2020 Done when: mini-coder's 885 commits build and page correctly, an oversized diff is truncated with a clear message, and a rebuild only regenerates what changed.
21+
22+## Notes
23+
24+- 2026-11-08 01:55Z (agent): Done: every shown project has a commit log at /projects/<name>/commits/ (50 per page) and a page per commit at /projects/<name>/commit/<hash>/ with the full message, author name, date, parents and diff. The project page's commit count links to the log. Screenshots are attached.
25+
26+ NUMBERS (81 projects, 2,762 commits, 8 cores in the VM):
27+ | | time | output |
28+ |---|---|---|
29+ | full build (after any code or template change) | 45s | 127 MB in public/, of which commit pages are 109 MB |
30+ | rebuild, nothing changed | 5.6s | 0 commit pages rewritten |
31+ | commit page | median 18 KB, largest 1.0 MB | |
32+ For comparison, repos/ is 351 MB.
33+
34+ HOW:
35+ - The log covers every branch and tag, so mini-coder shows all 885 commits. Only 135 are on its HEAD, because the history was rewritten. The log has 18 pages, the last with 35. Commits are deduped by hash across sources and listed newest first.
36+ - Messages are shown as written, except that emails in angle brackets are removed (names only, per 1005). Across all repos that touched exactly 2 messages, both 'Signed-off-by: dependabot[bot]'.
37+ - Cap: 1,000 diff lines per commit, and lines over 500 characters are cut. Past the cap, every file is still listed with its +/- counts and a note, and a banner at the top says the diff is cut. 344 commits hit it, mostly vendored libraries. Binary files show 'Binary file, not shown.' Merges diff against the first parent.
38+ - Rebuilds: commit pages never change, so each is written only if missing or if the site program changed. public/.stamp holds a hash of the program, which embeds every template. A new commit renders just its own page. Log and project pages are always rewritten (cheap).
39+ - Diff lines use a compact CSS class (.dl) instead of Tailwind utilities per line. That cut the output from 392 MB to 153 MB, and the 1,000-line cap took it to 127 MB.
40+
41+ CHECKED: go test (diff parser: line numbers, renames, binary files, the cap), mini-coder's 885 commits (18 pages, page 18 serves 200 with 35 rows), zen's 2011 commit renders unedited, a capped diff shows the banner, and the phone width of the log. Two back-to-back 'make build' runs: the second rewrote 0 commit pages.
42+ NOT CHECKED: every commit page by eye. Pages of commits that disappear from a remote (a force-push) stay in public/ until it is wiped; the build never deletes. Diff file links to the file browser wait on 1008.
tickets/1010-build-the-xonecas-io-homepage.md+15−2
@@ -6,9 +6,9 @@ status: doing
66 priority: p1
77 area: site
88 created: 2026-11-07T19:30:00Z
9-updated: 2026-11-08T01:09:31Z
9+updated: 2026-11-08T01:42:00Z
1010 source: agent
11-moves: 2026-11-07T19:30:00Z inbox todo agent; 2026-11-08T01:09:31Z todo doing drag
11+moves: 2026-11-07T19:30:00Z inbox todo agent; 2026-11-08T01:09:31Z todo doing drag; 2026-11-08T01:38:14Z doing blocked agent; 2026-11-08T01:40:47Z blocked todo note; 2026-11-08T01:42:00Z todo doing drag
1212 ---
1313
1414 The home page: who this is, a way into /projects, and links to the game and chat. Those stay as they are: space-browser.xonecas.io and irvc.xonecas.io. No changes to either.
@@ -19,3 +19,16 @@ Needs from xonecas:
1919 3. The current page links to /mini-coding-agent, which you called outdated. I recommend dropping the link. Should that page survive the redo?
2020
2121 Done when: all links work locally and the page matches the style guide at desktop and phone width.
22+
23+## Notes
24+
25+- 2026-11-08 01:38Z (agent): Blocked: four questions only you can answer. Nothing is built for this ticket yet.
26+
27+ 1. Bio text. Write it, or point me at it. The old sites say 'Sean Caetano Martin'.
28+ 2. The voice note said people 'can request to...' and trailed off. Was that a feature (requesting access, a contact form), or drop it?
29+ 3. The current page links to /mini-coding-agent, which you called outdated. I recommend dropping the link, since the project now has its own page at /projects/mini-coding-agent/. Keep or drop?
30+ 4. CONFLICT: this ticket says to link the game and chat (space-browser.xonecas.io, irvc.xonecas.io), but on 1001 you said 'Dont advertise irvc or space browser'. I've already hidden irvc from /projects. Options: (a) no links to either (recommended, matches your note); (b) small plain links in the footer only; (c) as the ticket says.
31+
32+ What I'd build once answered, from the style guide: bio, the all-history heat wall (your commits per month since 2011), the stat block (81 projects · 2,7xx commits), the latest commits, and a link into /projects.
33+
34+- 2026-11-08 01:40Z (human): Decision: IRVC is private and should not be shared publicly in the site. It's an invite only chat. the space browser game we can hide as a easter egg, like clicking on my face on the top right 10 times in 10 seconds, navigates to it.
tickets/1012-rats-injection-script.md+3−2
@@ -2,12 +2,13 @@
22 id: 1012
33 title: rats injection script
44 type: feature
5-status: inbox
5+status: todo
66 priority: p2
77 created: 2026-11-08T01:09:27Z
8-updated: 2026-11-08T01:10:14Z
8+updated: 2026-11-08T01:43:50Z
99 source: human
1010 area: site
11+moves: 2026-11-08T01:43:50Z inbox todo drag
1112 ---
1213
1314 Rats provider a script
tickets/1013-dev-server-should-be-reachable-from-the-host.md+12−0
@@ -0,0 +1,12 @@
1+---
2+id: 1013
3+title: dev server should be reachable from the host
4+type: bug
5+status: todo
6+priority: p2
7+created: 2026-11-08T01:43:32Z
8+updated: 2026-11-08T01:43:49Z
9+source: human
10+moves: 2026-11-08T01:43:44Z inbox doing drag; 2026-11-08T01:43:49Z doing todo drag
11+---
12+
tickets/attachments/1009/a capped diff, dark.png+0−0
Binary file, not shown.
tickets/attachments/1009/mini-coder log, last page, phone.png+0−0
Binary file, not shown.
tickets/attachments/1009/mini-coder log, page 1 of 18.png+0−0
Binary file, not shown.
tickets/attachments/1009/zen, our space hero now moves left to right.png+0−0
Binary file, not shown.