@@ -2,14 +2,28 @@
22 id: 1023
33 title: Hidden or renamed projects stay in public/ after a rebuild
44 type: bug
5-status: inbox
5+status: review
66 priority: p2
77 area: site
88 created: 2026-11-08T04:09:56Z
9-updated: 2026-11-08T04:09:56Z
9+updated: 2026-11-08T05:26:20Z
1010 source: agent
11+moves: 2026-11-08T05:07:41Z inbox doing drag; 2026-11-08T05:26:20Z doing review agent
1112 ---
1213
1314 Build (internal/site/build.go) writes only shown projects and never removes others. When a project becomes hidden (overrides.txt 'hide', a fork flag) or is renamed, its old public/projects/<name>/ pages, and since 1015 its public/<name>.git clone, stay in public/ and keep being served.
1415
1516 Seen in the code: the only removals are browse.go:55 (tree/ and blob/ inside a shown project) and clone.go (its own <name>.git). Not reproduced: I did not hide a project and rebuild to watch it.
17+
18+## Notes
19+
20+- 2026-11-08 05:26Z (agent): Fixed: a build now removes what earlier builds wrote for projects that are no longer shown, whether hidden or renamed. That covers public/projects/<name>/ and public/<name>.git. New internal/site/prune.go runs at the end of Build and keeps only the shown names plus projects/index.html.
21+
22+ /activity is now cleared before it's written. That also covers the leftover year and page folders I noted on 1030, for example when a year drops from 21 pages to 20.
23+
24+ Checked:
25+ - TestBuild plants projects/a-fork/, a-fork.git and activity/1999/ before building, then checks all three are gone.
26+ - With the real data I created public/projects/ghost/, public/ghost.git and public/activity/2026/99/, ran make build, and all three were removed. Left in place: 82 project folders plus index.html, and 82 clones. /activity/ and /activity/2026/21/ still serve.
27+ - go vet and go test pass.
28+
29+ Not checked: hiding a real project through overrides.txt and rebuilding. The planted folders exercise the same path.