Skip to content

Name the type that exists, and guard the prose that names types - #356

Merged
blove merged 1 commit into
mainfrom
blove/bench-grouping-2-3878ef
Aug 13, 2026
Merged

blove merged 1 commit into
mainfrom
blove/bench-grouping-2-3878ef

Conversation

@blove

@blove blove commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

First pass of the #321 fallout audit, plus the one live defect it turned up.

The defect

grid/keyboard.mdx told readers: "renderSnapshot.rowMetrics is public and fully typed, but its interface is not exported under a name — take it as PretableRenderSnapshot["rowMetrics"] if you need to write the type down."

#321 renamed that type to PretableIndexedRenderSnapshot. Anyone following that sentence got a compile error, and had been for a release.

Everything the existing guard covers behaved perfectly through the rename: reports regenerated, every bound member table moved with them, the import check passed. The sentence is prose — and prose is exactly where escape hatches live. "Not exported under a name, take it as X" is a claim about the API that no table can express.

The guard

Every Pretable* identifier named anywhere in the docs must be a real export of some reported package.

Run across the whole corpus it found exactly one violation — this one — so it lands fail-closed with no allowlist, which is the shape a guard should have. Mutation-checked: restoring the old sentence fails it with grid/keyboard.mdx: PretableRenderSnapshot. It also carries the same non-empty assertion the neighbouring checks use, so a corpus it can no longer read fails loudly instead of passing clean.

It reads the whole page rather than prose only: a name is a name wherever it's written, and the narrower version would need the fence-tracking machinery this one doesn't.

Also from the audit

heroGrid/selection.ts still documented its inputs as grid.getColumns() and grid.getSnapshot().visibleRows. Both were removed by #321; the code moved to columnLayout and range(0, visibleRowCount) in #336 and the comment didn't. A comment naming a removed API is a wrong instruction to the next reader — which is how this class propagates.

What the audit checked and found clean

Verification

pnpm test (full monorepo; the one multi-sort-surface failure is the known load flake — the package passes 829/829 on its own), lint, typecheck, format all clean. Rebased onto #353 and re-verified, since that renamed public types: the new guard passes, which is itself a small piece of evidence for it.

🤖 Generated with Claude Code

…types

Auditing what #321 left behind, one live defect in the published docs:
`grid/keyboard.mdx` told readers to write `PretableRenderSnapshot["rowMetrics"]`
if they needed the type down on paper. #321 renamed that type to
`PretableIndexedRenderSnapshot`. Anyone following the sentence got a compile
error, and had been for a release.

Everything the existing guard covers behaved perfectly through that rename: the
reports were regenerated, every bound member table moved with them, the import
check passed. The sentence is prose, and prose is exactly where escape hatches
like this one live — "not exported under a name, take it as X" is a claim about
the API that no table can express.

So the sweep the miss argues for: every `Pretable*` identifier NAMED anywhere in
the docs must be a real export of some reported package. Run across the whole
corpus it found exactly one violation — this one — so it lands fail-closed with
no allowlist, which is the shape a guard should have. It fails with
`grid/keyboard.mdx: PretableRenderSnapshot` against the sentence as it was.

It reads the whole page rather than only prose. A name is a name wherever it is
written, and the narrower version would need the fence-tracking machinery this
one does not.

Also from the same audit: `heroGrid/selection.ts` still documented its inputs as
`grid.getColumns()` and `grid.getSnapshot().visibleRows`. Both were removed by
#321; the code moved to `columnLayout` and `range(0, visibleRowCount)` in #336
and the comment did not. A comment naming a removed API is a wrong instruction
to the next reader, which is how this class of bug propagates.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Aug 13, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
pretable Ready Ready Preview Aug 13, 2026 2:40pm

@github-actions

Copy link
Copy Markdown
Contributor

Vercel preview ready

Preview: https://pretable-7ba7q9o0o-cacheplane.vercel.app
Commit: 4d6d7944022bce16b9561dfc4d58f42a77a44241

Updated automatically by the deploy-preview job.

@blove
blove merged commit 9684385 into main Aug 13, 2026
17 checks passed
@blove
blove deleted the blove/bench-grouping-2-3878ef branch August 13, 2026 14:53
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.

1 participant