Bring CLAUDE.md up to date, and prune what --help now owns - #146
Merged
Conversation
Six gaps, all from the same branch: the README restructure (#102) added a package, exported a function, added two make targets and introduced a generated artifact, and none of it reached this file. A docs-only branch felt like it needed no architecture note while changing all four of those. Added: make docs/docs-check in the Commands list and in the make check ordering; tools/gendocs in the layout list; a Documentation section covering the README-is-a-50'-view split, that docs/commands/ is *generated* and must never be hand-edited, why cmd.Root() is exported for exactly one caller, and what the drift guard is for; the three new docs/ files; and escapeLinkText's rule, which is the kind of thing that gets re-broken -- it applies to raw sources only, because an ac:link-body has already been rendered to markdown and escaping it yields a literal \*\*bold\*\*. Removed, on one criterion: keep what carries a because, a test name, an issue number or a guarantee id; drop bare behaviour statements that `--help` or docs/ now own. The frontmatter-driven-publishing section was the outlier, 3501 chars mostly restating field domains and per-verb flag behaviour -- written before --help became the reference. Now 2323, keeping only what neither --help nor docs/markdown_file.md records: parent being an opaque id whichever kind it names, the validate-before-write/apply-after ordering and #127's reasoning for it, L9's asymmetry and fix's tri-state nil, and the two output rules that look arbitrary and are not. Also 270 chars of text now verbatim in --help (search's archived-and-folders, children's folder-counts-as-a-level, the find/search complement). Deliberately *not* regenerated from scratch. /init would produce a competent structural summary and lose every "that missing fallback was #68", "pinned by TestErrorDoesNotDependOnTheIndex", "the clamp must never exist in two copies" -- none of which is recoverable by reading the repo, and which is the entire reason the file is worth having. An audit found no broken path or package reference in it, so nothing was wrong; it was only incomplete.
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.
CLAUDE.md had gone stale, and the cause is worth naming: the README restructure (#102) added a package, exported a function, added two make targets, and introduced a generated-artifact contract — and none of it reached this file, because a docs-only branch didn't feel like it needed an architecture note. It was changing all four of those.
Not a regeneration, deliberately
The first instinct was to delete it and re-run
/init. That would have produced a competent structural summary and lost every one of these:None of which is recoverable by reading the repo — and which is the entire reason the file is worth having.
An audit first, rather than a rewrite: every file path and every
cmd/*/internal/*/schema/*package reference in it still resolves. Nothing was wrong. It was incomplete.Added
make docs/make docs-check, in the Commands list and in themake checkordering.tools/gendocsin the layout list — the only thing outsidecmd/internal/schema.--helpis the command reference; thatdocs/commands/is generated and must never be hand-edited; whycmd.Root()is exported for exactly one caller; and what the drift guard is for, including whyDisableAutoGenTagis set.docs/files.escapeLinkText's rule — raw sources only, never already-rendered output. This is the kind of thing that gets re-broken: the obvious "fix" is to escape insidemdLink, which turns a bold link body into a literal\*\*bold\*\*. Code review caught that exact mistake in read/export: render <ri:user> mentions readably, and republish them as mentions #91.Removed, on one criterion
Keep what carries a because, a test name, an issue number, or a guarantee id. Drop bare behaviour statements that
--helpordocs/now own.The frontmatter-driven-publishing section was the outlier: 3501 chars mostly restating field domains and per-verb flag behaviour, written before
--helpbecame the reference. Now 2323, keeping only what neither--helpnordocs/markdown_file.mdrecords —parentbeing an opaque id whichever kind it names, the validate-before-write/apply-after ordering and #127's reasoning for it, L9's asymmetry andfix's tri-statenil, and the two output rules that look arbitrary and are not.Plus 270 chars found mechanically by diffing against real
--helpoutput:search's archived-pages-and-folders,children's folder-counts-as-a-level, thefind/searchcomplement.Why the cut is small, and why that is the right answer
I went looking for more and mostly did not find it.
cmd/search/is the largest bullet at 3300 chars and I expected a big trim; nearly every sentence carries a measurement or a warning —text ~ranking uselessly againstsiteSearch,siteSearchbeing silently discarded as the middle clause of three,scorearriving as0.0on every row so nothing may re-sort a result set. That length is earned, and padding the diff by cutting it would trade a real asset for a smaller number.On keeping it accurate
What has worked is folding it into each change, not periodic regeneration — it only drifted when a branch didn't feel architectural. Two mechanical guards would make that a guarantee rather than a habit, and I have not added either:
cmd/*/,internal/*/andtools/*/package is named in CLAUDE.md would have caughttools/gendocson the branch that added it.Worth a follow-up issue if you want them. Docs only —
make checkpasses.