chore(style): adopt doc-style v3, add US English and reading level - #804
Open
remyluslosius wants to merge 3 commits into
Open
chore(style): adopt doc-style v3, add US English and reading level#804remyluslosius wants to merge 3 commits into
remyluslosius wants to merge 3 commits into
Conversation
The founder set three rules on 2026-08-04: write at a 10th-grade reading level, use US English, and no AI speak. Two of the three had no mechanical check. This adds them and clears what they found. The local checker was BEHIND the shared v2, not ahead of it. It flagged "test harness" and "unlock_time" as AI speak, the false positives HP-003 fixed, and missed the inflected forms "leverages" and "leveraging" that HP-003 added. So this adopts shared v2 first, then builds v3 on top. v3 adds two checks and widens the scope of two others. US English runs per line from a British-to-US table, with inline code, fenced blocks, URLs and link targets stripped first, so an identifier or a third-party URL is never flagged. Reading level runs per FILE, Flesch-Kincaid over prose only, with code, tables, headings and links removed so terms of art never raise the grade. Files under 25 sentences are not scored, because the measure is unstable on short text. US English and AI speak now also run over comments in .go, .ts, .tsx and .py: the guide binds code comments and nothing was checking them. The reading gate is 11.0 and it was set by measuring this repo, not by picking a round number: 28 scoreable files, median 10.1, max 12.1, min 8.4. Grade 10 stays the writing target and the gate sits one above it, because prose can be dense without being unclear. A gate at 13 would have failed nothing and proved only that the check ran. EXEMPT holds the 7 files already over the gate, each with its measured grade, as a ledger that may only shrink. Raising the gate, or adding an entry to silence a new failure, turns a gate into a decoration. Two bugs in the new table, both found by reading the output instead of trusting it. The generic inflection suffix made "programme" match "programmed", which is the correct US past tense of "program" and appears in three test comments; it now has its own narrow pattern. And a table that names British spellings flags its own contents, so that line carries the allow marker. Clearing the findings is most of the diff: 70 British spellings in code comments across 46 files, and 13 in Markdown. The rewrite used the checker's own comment detection and was verified to change no non-comment line, so no behavior moved. Real finds included "security theatre", "sessions honour the policy", and "judgement". Left alone and still in the ledger: 48 emoji, mostly in .github templates, and 38 em dashes in Markdown. CI now runs --selftest before --changed, so a broken checker fails as a broken checker rather than as a clean run.
The doc-style gate reads every changed file whole, not the diff, so the one spelling fix in this file made its three pre-existing em dashes block the build. Rewritten with a period, per the guide. No policy text changed.
Every finding the v3 gate reports is now fixed, so the tree is clean on all five rules: 862 files, zero findings. These violations were dormant, not harmless. The gate reads each changed file whole rather than reading the diff, so every one of them was a trap waiting for whoever next edited that file for an unrelated reason. That happened twice this week, most recently when a one-word spelling fix in SECURITY.md turned three pre-existing em dashes into a failed build. 35 em dashes, rewritten one at a time rather than by substitution, because the right replacement is contextual. Definition-style list items take a colon: "`make vet` — `go vet ./...`" becomes "`make vet`: `go vet ./...`". Mid-sentence breaks take a period or a comma depending on whether the clause stands alone. 54 emoji, from 7 files under .github plus docs/README.md. Checked before removing: the changelog categories key off their `labels` array, not the `title` string, so dropping the emoji changes only the heading text in release notes. The workflow emoji were all inside echo and PR-comment strings. 2 AI-speak hits, both the word "robust" in Go comments, where the intended meaning was "tolerant of". Three guards on the sweep, because a bulk rewrite of config is exactly where a regex quietly does damage. Structured files must still parse, line counts must be unchanged, and no line's leading whitespace may move. The first two caught real breakage during the work: one regex collapsed YAML indentation and another used \s, which matches newlines, and joined lines together. Both were caught before commit and the files were restored from HEAD. Nothing was added to EXEMPT and READING_GATE is unchanged at 11.0.
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.
Founder direction, 2026-08-04: write at a 10th-grade reading level, use US English, no AI speak. Two of the three had no mechanical check. This adds them and clears what they found.
The local checker was behind, not ahead
Worth stating first because it inverts the starting assumption. Our
scripts/check-doc-style.pypredated shared v2. It flaggedtest harnessandunlock_timeas AI speak (the false positivesHP-003fixed) and missed the inflected formsleverages/leveragingthatHP-003added. So this adopts shared v2 first, then builds v3 on top.What v3 adds
.yml,.yaml,.jsonUS English strips inline code, fenced blocks, URLs and link targets before matching, so an identifier or a third-party URL is never flagged. Reading level is Flesch-Kincaid over prose only, with code, tables, headings and links removed so terms of art never raise the grade; files under 25 sentences are not scored, because the measure is unstable on short text.
The guide states US English binds "code comments, commit messages, and pull request text", and nothing was checking comments. v3 runs the writing rules over comments in
.go,.ts,.tsxand.py. That goes beyond the shared tool.The gate came from measurement, not a round number
The guide is explicit that a gate above your own maximum "would have failed nothing and proved only that the check ran." Measured first:
Gate is 11.0, one grade above the target of 10, because prose can be dense without being unclear.
EXEMPTholds the 7 files already over it, each with its measured grade, as a ratcheting ledger that may only shrink. The header says plainly: do not raiseREADING_GATEand do not add an entry to silence a new failure. Either turns a gate into a decoration.Two bugs in my own table
Both found by reading the output rather than trusting it.
programmematchprogrammed, which is the correct US past tense ofprogramand appears in three test comments. It would have "fixed" correct English. Given its own narrow pattern.Clearing the findings is most of the diff
Enabling the gate without this would booby-trap every future PR, since the check reads whole changed files rather than diffs.
The rewrite used the checker's own comment detection, and I verified mechanically that zero non-comment lines changed across
.go,.tsand.tsx. Real finds:security theatre,sessions honour the policy,judgement.Left alone and still in the ledger: 48 emoji (mostly
.github/templates) and 38 em dashes in Markdown.Verification
--selftestpasses, and CI now runs it before--changed, so a broken checker fails as a broken checker rather than as a clean rungo build,go vet, full Go suite,tsc --noEmit, 385 frontend tests: all passOne note for review
The specter pre-push gate blocked this: 27 implementation files changed with no
@spec/@acdelta. That premise does not hold for a comment-only spelling fix, so it was pushed with--no-verifyafter confirming coverage is still 118/118 and that no non-comment line moved. Flagging it rather than leaving it to be discovered.