chore: remove every comment from the Zig sources - #37
Merged
pfriedrix merged 3 commits intoAug 7, 2026
Conversation
4,422 comment lines across build.zig and src/, stripped by a scan that knows where a `//` is not a comment — inside a string, inside a char literal, or on a `\\` multiline-string line, which is where all 21 URLs in the tree live. All of them survived; test count is unchanged at 266, so no module dropped out of the test root's import list. CLAUDE.md's Style section said these comments were the only rationale record in the repo, and it was right, so it now says where a "why" goes instead: the commit message, its own Traps section, or README. The traps worth losing sleep over — keychain's five narrow C headers, build.zig's signing, the test-root import list — were already written down there. YAML and Markdown are untouched; the Zig version pin still carries its "must match README" note in ci.yml.
The daemon matched every report against the worktree path in the payload and took the first session it found there. A worktree is not a unique key — `lcc open` will start a second session in one that already has another — so with four sessions in the same worktree every hook landed on the same row. Measured on PE-289, four sessions deep: the row the reports landed on had already exited, `apply` keeps `exited` terminal, so nothing moved except its `last_event_at`, which is why a dead session carried an activity timestamp two minutes younger than its own death. The two live agents under it were never updated at all — frozen at the `idle` their first byte of output set, whatever they went on to do. The dashboard then merged the worktree onto that same first row, so it reported a corpse for a worktree with two agents working in it, and enter on that row could not attach. Each session now gets its own settings file, `hooks-<id>.json`, with its id baked into every hook command line beside the event — the same reason the event is baked in rather than parsed out of a payload. Reports name their session and route exactly. A report with no id still falls back to the worktree, which is what a session started by an older daemon sends, and both that fallback and the dashboard's merge now prefer a session that is still alive over one that has exited.
fix(watch): route a hook report to the session that sent it
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.
build.zigandsrc/. The scan knows where a//is not a comment — inside a string, inside a char literal, or on a\\multiline-string line, which is where all 21 URLs in the tree live. All 21 survived, and the test count is unchanged at 266, so no module silently dropped out of the test root's import list.CLAUDE.md's Style section claimed these comments were the only rationale record in the repo. It was right, so it now says where a "why" goes instead: the commit message, its own Traps section, or README.Review notes
Stacked on #36 rather than cut from
master, because both touchwatch_status.zigandwatch_session.zigand cutting frommasterwould have guaranteed a conflict. GitHub retargets this tomasteronce #36 merges.YAML and Markdown are untouched, so the Zig version pin keeps its "must match README" note in
ci.yml.