Repository navigation
Comments only where the code cannot say it; explanations move to docs/ARCHITECTURE.md - #71
Merged
Merged
Conversation
dinooo13
force-pushed
the
t3code/comments-say-why
branch
from
October 9, 2026 17:39
fc91aca to
bc34d2b
Compare
dinooo13
added this pull request to stack #72
October 9, 2026 17:40
dinooo13
force-pushed
the
t3code/comments-say-why
branch
from
October 9, 2026 17:51
bc34d2b to
c31e32e
Compare
…ove to docs/ARCHITECTURE.md (#71) A comment stays for an outside constraint, a measured number or a trap; everything else is said by the code, a name, docs/ARCHITECTURE.md or CLAUDE.md. Apart from comments, whitespace and the renames the PR lists, the code is the one the architecture review (#70) landed. The PR's own history is on its original head, 9807051. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
dinooo13
force-pushed
the
t3code/comments-say-why
branch
from
October 15, 2026 17:40
9807051 to
5333248
Compare
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.
Stacked on #70. Comments went from 4,744 lines to 1,060. The design explanations moved into a new
docs/ARCHITECTURE.md, and the code is unchanged apart from a handful of renames in their own commits.The rule
A comment stays only when it says something the code cannot, and a reader would otherwise get it wrong. That is either a constraint from outside, a measured number with its source, or a trap that looks removable but isn't. Doc comments that restate a name go, as do narration, history, and repeats of CLAUDE.md. Where a comment only explained what something is, the fix is a better name. The rule is now in CLAUDE.md under "Code style", so the code doesn't drift back.
Kept on purpose:
@unchecked Sendable// MARK:in sourcesHow to review it
Comment-only commits (Core, System, Refine, Engines/Audio/Bench, CLI, App, Tests, and one more): each passes a checker that strips comments and whitespace from every Swift file before and after, and finds no code change. A second check compares every string literal, multi-line prompts included, file by file, because the first check can't see whitespace inside strings. It finds none changed. These commits can be skimmed.
Naming commits (2), checked by the build and all 558 tests:
HotkeyEvent.cancelled→.interrupted. That's the word the trackers already used, and it no longer reads like the Escape cancel key.hotkeyOverride→standInHotkey, the nameHotkeyRouterandHotkeyWarningalready use.recordingcounter →recordingID.PasteWindowfields →pasteStart,pasteLength,fieldLengthAtPaste.ClipboardKeeper.left→leftBehind.term→termIndex.Three of these renames sit on the release-to-paste path, as renames only. Nothing persisted, logged or localised was renamed.
Docs commit:
docs/ARCHITECTURE.md(389 lines) has these sections:It links to the CLAUDE.md Decisions table, PERFORMANCE.md and BENCHMARKS.md rather than repeating them. Code points into it with one line where a reader needs it, and every pointer names a section that exists. README and CLAUDE.md link to it.
No benchmark: no code on the release path changed beyond the three renames.
Review fixes
update(_:standInHotkey:monitor:),currentStandInHotkey,recordingID). Checked again with a comment- and whitespace-stripping comparison of every Swift file: apart from the documented renames, the code here equals Architecture review: every bug fixed with a regression test, polish and clipboard robustness, and the structural work #70's head (5b2afc3).UtteranceSlot, each cancel waiting for the one before, a press cancelled while it waits, the monitor a chord change picks, the processors rebuilt for the dictionary only, the checksum a cancel reaches,firstOfin Core.KeyNames.xcstringsin PladderSystem.eventuallyandwaitForSleeperwait in real time, the lifecycle's rule for every session end, Carbon taking only a bare Escape, and a cancelled download starting over where a failed one resumes.ClipboardKeeper's header point at CLAUDE.md's Output, Send key, Toggle key and Interrupted press rows instead of repeating them.The line counts in the table above are from before these commits.
swift test: 590 tests by swift-testing's count, all passing;swift buildandswift build -c releasehave no warnings inSources/.🤖 Generated with Claude Code