fix(lint): named listViews/formViews entries keyed by the runtime identity, single spelling (#6422) - #6800
Draft
os-project-manager wants to merge 1 commit into
Draft
Conversation
…ntity, single spelling (#6422) collectViewRecord accepted two spellings for a named view entry — the map key and the entry's inner name — while the composer constructs the runtime identity from the map key alone. Per the #5164 ruling (canonical = the runtime identity's bare key), the named branches now read their keys from the composer via namedViewKeys, defaultListViewKey's sibling: a diverging inner name stops being legal, and a collision-renamed entry becomes legal under the renamed key — the one spelling the runtime resolves. Measured over the 12 ratchet-covered configs: os lint verdicts are byte-identical before/after (added: 0 / removed: 0). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01F8q5J1MQyocgtNspb15fSn
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Contributor
📓 Docs Drift CheckThis PR changes 1 package(s): 3 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.
Fixes #6422
What
validateTranslationReferences'scollectViewRecord()accepted two spellings for every namedlistViews.<key>/formViews.<key>entry — the map key and the entry's innername— while the composer (expandViewContainerWithDiagnosticsinpackages/spec/src/ui/view.zod.ts) constructs each named entry's runtime identity from the map key alone and ignoresv.nameentirely.Per the #5164 ruling (2026-08-06: canonical = the runtime identity's bare key), restated for this card in the PM claim on #6422, the named branches now read their
_viewskeys from the composer, exactly as the defaultlistalready does viadefaultListViewKey(#6038):namediverging from its map key stops being a legal bundle key — the runtime never resolves it;{ list: {...}, formViews: { default: {...} } }registerscrm_lead.default(the list) andcrm_lead.default_2(the form). The rule previously accepteddefaultfor the form (a key that resolves the OTHER view) and reporteddefault_2— the one spelling that actually resolves the form — as an orphan.New helper
namedViewKeys()isdefaultListViewKey's sibling: a thin reader of the composer, never a re-derivation. Positional alignment rests on two documented facts of the composer (named entries expand first per family, one item per object-typed map value, in authoring order).The assembler is untouched (teaching it to honour inner
nameis the direction #5164 rejected).validate-null-guards.tsis untouched (claimed in parallel under #6458).Stop conditions, re-measured
os lint --jsonover all 12 ratchet-covered configs (the exact set inscripts/i18n-coverage-baseline.json), before vs after, diffed on(rule, path, message)triples:added: 0 / removed: 0on every config — verdicts are byte-identical. No baseline entry was added anywhere.listViews/formViews; a brace-walking scan found zero entries whose innernamediverges from its map key, and objectui authors nostack.translationsbundles of its own. The HotCRM corpus itself (source of the "authors write either" comment) is not in this repo or in objectui, and I could not reach it — its blast radius is unmeasured, not zero. If a HotCRM-family corpus is linted downstream, bundles keyed by a diverging innernamewill newly warn (warning severity — the rule's findings are never errors).Tests
Four new pins in
validate-translation-references.test.ts, each "legal" assertion paired with a planted bad key on the same fixture so a green run is never an empty run:namediverging from map key → flagged (listViews branch, formViews branch);defaultanddefault_2both legal (each resolves a real registry entry), planteddefault_3flagged. Dormant in shipped configs only becauselint-view-refs.tsmakes collisions a hard error — dormancy that depends on another rule staying strict is pinned, not trusted;namematching its map key stays legal (the ubiquitous authored shape — the narrowing removes a spelling, not a view).Reverse verification (direction predicted first)
namelimb (addView(binding, strName(sub.name))). Predicted: exactly the two diverging-inner-name tests go red, collision + matching-name pins stay green. Measured:2 failed | 38 passed, both failures the named tests.1 failed | 39 passed, the failure being that named test.Verification
pnpm --filter @objectstack/lint test: 65 files, 1656 passed (1652 baseline + 4 new)pnpm --filter @objectstack/lint typecheck: cleanpnpm exec eslint --no-inline-config packages/lint: exit 0node scripts/check-nul-bytes.mjs: OK.changeset/view-record-map-key-only.md(@objectstack/lintpatch — published lint verdicts change)Note: the Docs Drift Check advisory on this PR fired on package paths, not semantics — none of the three listed docs documents the named-view-key spelling surface, so it is not actionable here (and
content/docs/releases/**is never edited in a code PR; the changeset is the release-notes input).🤖 Generated with Claude Code
https://claude.ai/code/session_01F8q5J1MQyocgtNspb15fSn