Skip to content

Stop cataloguing code in the documentation - #171

Merged
DetweilerRyan merged 4 commits into
mainfrom
docs/stop-cataloguing-code
Nov 30, 2026
Merged

DetweilerRyan merged 4 commits into
mainfrom
docs/stop-cataloguing-code

Conversation

@DetweilerRyan

Copy link
Copy Markdown
Owner

Stops the rule documents cataloguing the code that follows them, and adds a rule so the habit doesn't come back.

Stacked on #169, since it covers #169's documentation too. Retarget it to main once #169 merges.

Change Where
A rule, "Referencing code": a rule says what to do, not where the code already does it. It names code only for a file the reader opens or changes, a fact the code owns, or one example a rule needs, preferably written in the document. Tool documentation and sidecars' history are exempt. single-source-of-truth.md, with a new sidecar
The sweep: removed catalogues of files, components, hooks and functions, "as Foo does" clauses, and descriptions of what particular code does today. Where a rule needed an example, a made-up one stands in, such as OrderView, Pick<Provider, …>, a DraftKey snippet or a JoinForm test. Code design principles, code layout, sync, types and schemas, and the testing documents
Unchanged: documents that name only files a reader opens, edits or runs AGENTS.md, the engineering index, CI, dependencies, dependency direction, the workflow procedures, sandbox secrets

What to look at

  • Whether the line between a catalogue and "the point" sits where you want it. For example, these were kept:
    • config files a rule is about, such as .oxlintrc.json and vitest.config.ts;
    • the screenplay's files a reader edits;
    • the deep-module table in feature testing conventions, which records your decisions rather than listing code.
  • The made-up examples, which replace real code in a few rules.

Decisions made

  • Sidecars are left as they are. They record cases as they were, and the new rule says so. A few still quote text this PR removed, as history.
  • Concepts aren't code. Lists such as the services a test must never call, or "Yjs documents, claim math and seed validation", stay, since they set a rule's scope and name no file.
  • Facts a removed example carried are kept as generic rules. Examples include the readOnly hazard of a served JSON Schema, mutation testing's scope, and the provider example's "within one module".

For the owner to confirm

Nothing.

Verification

  • The comparison: an independent reviewer compared old and new text rule by rule. It found no catalogue left behind. Its findings, which were references that had been the point, are fixed.
  • Sentence length: no new sentence is over 25 words.
  • Definition of done: see the comment that marks this ready.

🤖 Generated with Claude Code

@vercel

vercel Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
split Ready Ready Preview Nov 30, 2026 5:58pm UTC

@DetweilerRyan

Copy link
Copy Markdown
Owner Author

Request given in a Claude Code session, 2026-11-27:

for the most part we need to stop referening the code in our documentation. every rule does not need to list out every place that the rule is applied in the codebase. doing so results in an ever growing driftable serffice in the documenation and creates more and more churn in the documentation. overtime, the documentation should change less and less frequently. that being said there are places in the documentation where it's relevant to reference code but do not catalog every ts file that is utilizing a rule or section from the documentation.

@DetweilerRyan

Copy link
Copy Markdown
Owner Author

Answering the owner's request:

  • A rule, "Referencing code" in `docs/prose/single-source-of-truth.md":
    • a rule says what to do, not where the code already does it;
    • code is named only for a file the reader opens or changes, a fact the code owns, or one example a rule needs;
    • an example written in the document is preferred to a pointer at code;
    • tool documentation and sidecars' history are exempt.
    • Its reasons are in a new sidecar.
  • The sweep: catalogues are gone from code design principles, code layout, sync, types and schemas, and the testing documents. Where a rule needed an example, a made-up one stands in.
  • Unchanged: AGENTS.md, the workflow procedures, CI, dependencies and dependency direction, which name only files a reader opens, edits or runs.

Self-review: an independent reviewer compared old and new text rule by rule. It found no catalogue left behind, but found references that had been the point. All are fixed, as generic rules where they can be:

  • A lost hazard: a served JSON Schema's readOnly hazard had lived only in a removed example.
  • A wrong scope: mutation testing's scope had become wrong.
  • A lost condition: the provider example had lost "within one module".
  • Two lost files: actor.ts, and the browser test suffix.
  • No complete test: component testing had no complete test; one is now written in the document.
  • An example that failed lint: the made-up DraftKey example used an arrow function.

I also restored two lists the sweep had cut that name concepts, not code: the services a test must never call, and the app logic that runs for real.

Checks: the definition of done passes locally: lint, format, typecheck, npm test, tooling tests, oxcrap, build and e2e (6 passed).

@DetweilerRyan
DetweilerRyan marked this pull request as ready for review November 27, 2026 04:56
@DetweilerRyan
DetweilerRyan marked this pull request as draft November 27, 2026 15:22
@DetweilerRyan

DetweilerRyan commented Nov 27, 2026 •

Copy link
Copy Markdown
Owner Author

Rebased onto #169's latest commits (fb40f07), which apply #170. Two conflicts in component and hook testing were catalogue lines about RoomViewRoot that #169 had updated. This pull request removes them, so its side was kept. #169's new layout rules carry over unchanged; their one code name, mergeClasses in src/utils/, is the helper a reader calls.

No rule document names a room component after the rebase. Lint and format pass. (A first lint run here failed on mergeClasses, because this worktree was set up before #169 added tailwind-merge. After npm ci, lint passes.) Back to draft until #169 is ready, since this is stacked on it.

@DetweilerRyan
DetweilerRyan force-pushed the docs/stop-cataloguing-code branch 3 times, most recently from 910d123 to 270eb2c Compare November 27, 2026 16:41
@DetweilerRyan
DetweilerRyan marked this pull request as ready for review November 27, 2026 16:41
@DetweilerRyan

DetweilerRyan commented Nov 27, 2026 •

Copy link
Copy Markdown
Owner Author

Rebased onto #169's latest commit, 0152eef, which adds docs/engineering/component-layout.md. The rebase was clean. The new document follows this pull request's "Referencing code" rule: it names only mergeClasses, the helper a reader calls, plus a made-up snippet.

Checks: lint and format pass locally. CI's definition of done passed on this head, 270eb2c, in run 46035669259. I first reported a stale pass from the previous commit, and held this back until the right run finished.

Marked ready. It's stacked on #169, so merge #169 first. Then I'll retarget this to main.

@DetweilerRyan
DetweilerRyan marked this pull request as draft November 27, 2026 16:41
@DetweilerRyan
DetweilerRyan marked this pull request as ready for review November 27, 2026 16:43
@DetweilerRyan
DetweilerRyan force-pushed the docs/stop-cataloguing-code branch from 270eb2c to 48aacf2 Compare November 27, 2026 17:21
@DetweilerRyan

Copy link
Copy Markdown
Owner Author

Rebased onto #169's 1206849, which names the container RoomView.tsx and its composition root RoomView.root.tsx.

Checks: lint and format pass locally. CI's definition of done passed on this head, 48aacf2.

@DetweilerRyan
DetweilerRyan force-pushed the docs/stop-cataloguing-code branch from 48aacf2 to 94f221b Compare November 27, 2026 17:43
@DetweilerRyan

Copy link
Copy Markdown
Owner Author

Rebased onto #169's dee9d29, which moves how a container is written into docs/engineering/components.md. One conflict, in component and hook testing's container rule: #169 had restructured it, so #169's text was kept, and this PR's change, removing the two RoomView catalogue lines, was applied on top.

After the rebase, no rule document names a room component or component-layout.md. Lint and format pass locally, and CI's definition of done passed on this head, 94f221b.

@DetweilerRyan
DetweilerRyan force-pushed the docs/stop-cataloguing-code branch from 94f221b to a5bc47b Compare November 27, 2026 17:59
@DetweilerRyan

Copy link
Copy Markdown
Owner Author

Rebased onto #169's e6ae09f, which adds components.md's Code design principles section. The rebase was clean. The new section names no room component, so it needs nothing from this PR's code-reference sweep. CI passed on a5bc47b.

@DetweilerRyan
DetweilerRyan force-pushed the docs/stop-cataloguing-code branch from a5bc47b to c75c727 Compare November 27, 2026 18:22
@DetweilerRyan

Copy link
Copy Markdown
Owner Author

Rebased onto #169's 7e4a489, which fixes the room code's review findings and rewords one Layout rule in components.md. The rebase was clean, and CI passed on c75c727.

@DetweilerRyan
DetweilerRyan force-pushed the docs/stop-cataloguing-code branch from c75c727 to 2981b46 Compare November 27, 2026 18:59
@DetweilerRyan

Copy link
Copy Markdown
Owner Author

Rebased onto #169's 7e2343d, which applies the research into components.md's open questions. There was one conflict, the RoomView catalogue line in component and hook testing, which this PR removes, so I kept the removal. CI passed on 2981b46.

@DetweilerRyan
DetweilerRyan changed the base branch from refactor/room-view-inversion to main November 28, 2026 15:12
@DetweilerRyan

Copy link
Copy Markdown
Owner Author

@copilot please fix the merge conflicts in this pull request.

Copilot AI commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

@copilot please fix the merge conflicts in this pull request.

This branch needs a rebase onto main: the stacked commits landed there with different commit IDs. The repository prohibits merging main, and I cannot publish the required force-update from this environment. Could you rebase and force-push the branch, or provide an authorized way to publish the rebased branch?

@DetweilerRyan

DetweilerRyan commented Nov 29, 2026 •

Copy link
Copy Markdown
Owner Author

Rebased onto main (9305452) now that #169 is merged. Only this PR's four commits were replayed, with no conflicts, and CI passed on 817e873. Correction: it does conflict with #181, in code-layout.md; whichever merges second gets rebased onto the other.

agent and others added 4 commits November 30, 2026 12:58
As the owner asked: a rule says what to do, not where the code already does it. Documents name code only where the name is the point: the file a reader opens or changes, a fact the code owns, or one example a rule needs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Following the new "Referencing code" rule: rules no longer list the files, components, hooks or functions that follow them, nor describe what particular code does today. They keep the files a reader opens or changes, pointers to facts code owns, and at most one example, made generic where it can be. Sidecars are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Restores, in generic terms, what removed examples carried: the readOnly hazard of a served JSON Schema, mutation testing's scope and its .stryker-tmp rule, the provider example's one-module condition, actor.ts, both test suffixes, and a whole component test written in the document. The DraftKey example now passes the repository's lint.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Records the owner's request, why a catalogue of code is a second copy, what counts as the point, and when to reopen it; the document links its sidecar in a closing section.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@DetweilerRyan
DetweilerRyan force-pushed the docs/stop-cataloguing-code branch from 817e873 to 2137fe1 Compare November 30, 2026 17:58
@DetweilerRyan

Copy link
Copy Markdown
Owner Author

Rebased onto main (c25cccd) now that #181 is merged. The one conflict was in code-layout.md, and I kept this PR's text, as planned: #181 had renamed the _header example to _app-bar, and this PR replaces that example with an invented one. No rule document names a room component after the rebase. CI passed on 2137fe1.

@DetweilerRyan
DetweilerRyan merged commit 8231aae into main Nov 30, 2026
3 checks passed
@DetweilerRyan
DetweilerRyan deleted the docs/stop-cataloguing-code branch November 30, 2026 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants