chore(ci): check spec surface drift - #332
Open
Ivan Logutov (VanishJr) wants to merge 2 commits into
Open
Conversation
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Ivan Logutov (VanishJr)
requested review from
Olga Lavrichenko (OLavrik),
Rustam Sadykov (SBOne-Kenobi),
danyaberezun and
Rinat S (rsolmano)
as code owners
August 27, 2026 20:46
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.
Compare the public surface a module's
SPEC.mddeclares against what its barrel actually exports, so drift between the two is caught instead of found by hand.The check
bun run check:spec-surfacereads the names a spec lists underPublic surface, resolves the barrel's real exports through the TypeScript AST (star re-exports followed), and diffs the two sets. No model, no new metadata.It is narrow on purpose: a surface written in prose is skipped rather than guessed at, so a module opts in by writing its surface as a bare list of identifiers. Of 67 specs, 16 qualify today. Every skip is counted, and
--list-skippednames each one.What it found
Nine specs list fewer names than their barrel exports.
Scope
In CI, not in the pre-commit hook.
scripts/sits outsideturbo run typecheck, as it did before this change.Rinat S (@rsolmano) I understand there are ongoing spec-linter experiments aimed at the same problem. This is a much smaller slice and may fold into it or be closed once that lands. The nine corrections stand either way.
Verifying
bun run check:spec-surface
bun run check:spec-surface -- --list-skipped
Revert any one of the nine spec edits and the run names that file and exits 1.
Checklist
,bun run test`scripts/,package.json, the CI workflow and markdown