Skip to content

chore(ci): check spec surface drift - #332

Open
Ivan Logutov (VanishJr) wants to merge 2 commits into
JetBrains:mainfrom
VanishJr:feat/check-spec-surface
Open

chore(ci): check spec surface drift#332
Ivan Logutov (VanishJr) wants to merge 2 commits into
JetBrains:mainfrom
VanishJr:feat/check-spec-surface

Conversation

@VanishJr

Copy link
Copy Markdown
Contributor

Compare the public surface a module's SPEC.md declares against what its barrel actually exports, so drift between the two is caught instead of found by hand.

The check

bun run check:spec-surface reads the names a spec lists under Public 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-skipped names 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 outside turbo 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

  • Fast gatesun typecheck,bun run test`
  • E2E not rud, onlyscripts/, package.json, the CI workflow and markdown
  • Relevant `dated to reflectany boundary, contract, or behavior change
  • I have rea/CONTRIBUTING.md) and agree to the Code of Conduct

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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