ci(spec): signature-level snapshot for defineX factories — catch narrowing (#2035)#2100
Merged
Merged
Conversation
…owing (#2035) The api-surface snapshot (#2092) catches add/remove/rename but not NARROWING — a `.default()` that flips an input field to required, or a `string` tightened to an enum, keeps the same `name (kind)`. The downstream-contract fixtures catch narrowing only for the fields they happen to set. Adds api-surface-signatures.json: a stable hash of each defineX factory's resolved signature (27 factories). The factory signature embeds the full accepted authoring shape, so any narrowing of what a domain accepts flips its hash. Scoped to the factories — the authoring contract — to stay low-noise: the breadth file (4251 exports) is unchanged, and full per-export signatures would churn on every internal type tweak. Rides the existing check:api-surface CI step (one command checks both). Verified: check clean, deterministic across regens (code-unit/structural, no locale), breadth snapshot byte-identical to main, and a flipped hash is reported as a breaking "signature changed" with exit 1. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
📓 Docs Drift CheckThis PR changes 1 package(s): 89 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
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.
Follow-up #4 from the #2035 discussion. The name+kind snapshot (#2092) catches add/remove/rename of exports, but not narrowing — a
.default()that flips an input field to required, or astringtightened to an enum, keeps the samename (kind). The downstream-contract fixtures (#2089/#2095) catch narrowing only for the fields they happen to set.What
Adds
packages/spec/api-surface-signatures.json: a stable, compact hash of eachdefineXfactory's resolved signature (27 factories). A factory's signature embeds the full accepted authoring shape (config: { ... }), so any narrowing of what a domain accepts flips its hash.Deliberately scoped to the factories — the authoring contract — to stay low-noise (this was my one hesitation when I recommended it). The breadth file (4251 exports) is untouched; full per-export signatures would churn on every internal type tweak and wouldn't be worth the noise.
Rides the existing
check:api-surfaceCI step — one command now checks both the breadth snapshot and the signatures.Verification (local)
check:api-surface→ clean (surface + factory signatures unchanged ✓)typeToString, no locale; same pinned TS as CI, which already proved macOS↔Linux parity for the breadth file in ci(spec): public API-surface snapshot gate to catch silent export drift (#2035) #2092)signature changed: defineAction+ breaking-change guidance, exit 1This completes the four follow-ups (#2095 depth coverage, #2097 guard→apps, #2098 ADR-0059, and this).
🤖 Generated with Claude Code