Uh oh!
There was an error while loading. Please reload this page.
alias-integrity: fail an alias row a guidanceSet already consumes - #7952
Merged
Conversation
…consumes `strictUnknownKeyError` consults `guidance`, then `guidanceSets`, and only then the `aliases` rename fallback — a guidanceSets match `continue`s past the alias lookup entirely. An alias row whose written key also matches a guidanceSet on the same strict-options table is therefore dead on arrival, and nothing checked that until now. Extends alias-integrity.test.ts with `unreachableAliasRows`, which reads only `options.aliases` / `options.guidanceSets` (never `.shape`) and flags any alias key a guidanceSet already matches. Two tests: the live-table verdict (also pinning that the one existing view-family alias, `disabled -> readonly` on FormFieldSchema, stays reachable outside VISIBILITY_KEY_PATTERN), and a self-test proving the check can go red on a planted synthetic dead row without touching any live schema. Fixes#7889 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WocN37om5bw81JDoEEMA2e
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Contributor
📓 Docs Drift CheckNo hand-written docs reference the 0 changed package(s). ✅ |
os-zhuang
marked this pull request as ready for review
August 12, 2026 09:10
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Aug 12, 2026
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 freeto 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.
Fixes#7889
What
strictUnknownKeyError(packages/spec/src/shared/suggestions.zod.ts) consults three channels for each unrecognized key, in order: exactguidance, thenguidanceSets, and only then thealiasesrename fallback. AguidanceSetsmatchcontinues past the alias lookup entirely (confirmed by reading the actual control flow, not assumed from the issue body):So an alias row whose written key also matches a
guidanceSetdeclared on the samestrictObjecttable is dead on arrival — the set answers first, every time — and nothing checked for that before this PR. PR #7884 had to place its one view-family alias (disabled → readonlyonFormFieldSchema) outsideVISIBILITY_KEY_PATTERN's reach by hand; a futurevisible: 'visibleWhen'row on the same shared table would have shipped exactly as dead, with every existing gate green.Change
Extends
packages/spec/src/shared/alias-integrity.test.ts(test-only, no other files touched) with:unreachableAliasRows(surfaces)— reads onlyoptions.aliasesandoptions.guidanceSets(never.shape), and flags any alias key aguidanceSeton the same table already matches viakeySetMatches(the same function the real error map calls).unreachableAliasRows(SURFACES)must be empty, plus an explicit pin that the one existing view-family alias (disabled → readonlyonFormFieldSchema,ui/view.zod.ts:1775) exists and sits on a table carryingVISIBILITY_KEY_PATTERN— so the empty-array assertion is judging a real, non-trivial table rather than passing vacuously.guidanceSetsarray.No acceptance-behavior change anywhere — publish/parse behavior of every schema is byte-identical before and after. No
*.zod.tsfiles touched.Tests
This is a test/gate-only change with no reader-visible behavior — no changeset;
skip-changesetlabel requested.Generated by Claude Code