Artifact dd0fae2bc70c1d86cfc7334e469e69165e084927cb4198eb2ae947121d8f5f94:
- File
src/tidy.zig
-
2026-07-19 23:11:53
— part of check-in
[a8d7f6b621]
on branch s1-tidy
— Add tidy dead-file guard over the src test surface
Zig runs only the tests reachable from a root the build compiles. A .zig file that no root imports still compiles -- its tests simply stop running and coverage evaporates with no error. tidy.zig walks src/**/*.zig, builds the @import graph, and asserts every file is reachable from one of the three test roots: root.zig (exported module), main.zig's test block (CLI surface), and dst.zig (harnesses). An allowlist carries the files build.zig wires as their own roots -- e2e, smoke, and the benchmarks -- each verified rather than papered over, and a hygiene check fails if an allowlist entry goes stale or becomes reachable. On a miss the failure names the file and the one-line import that re-roots it.
This lands before the main.zig to src/cmd split so that move cannot silently orphan a file's tests.
Mechanism borrowed from TigerBeetle's src/tidy.zig DeadFilesDetector, which walks its own tree and fails the build when a file falls out of the import graph. (user: dmestas, size: 12777) [annotate] [blame] [check-ins using]
-
2026-07-19 23:18:29
— part of check-in
[60b10a6332]
on branch trunk
— Merge s1-tidy: a dead-file guard before the cmd/ split
Zig runs only the tests reachable from a root the build compiles. A source file no root imports still compiles -- its tests just stop running, and nothing fails. That is the defining hazard of the coming main.zig split, so the guard lands first. A test walks every src/**/*.zig, builds the import graph, and asserts each file is reachable from one of the three roots: root.zig, main.zig's test block, or dst.zig. The failure names the file and the one-line import that fixes it. Six files that build.zig wires as their own roots are allowlisted, and the list itself is checked so a stale or newly-reachable entry fails rather than hiding a real orphan.
The DeadFilesDetector pattern is borrowed from TigerBeetle's src/tidy.zig. (user: dmestas, size: 12777) [annotate] [blame] [check-ins using]
-
2026-07-19 23:11:53
— part of check-in
[a8d7f6b621]
on branch s1-tidy
— Add tidy dead-file guard over the src test surface