Repository navigation
fix(sdui-parser): the base-prop list is declared once, and the renderer's visibleWhen / hiddenOn / testId join it (objectui#11044) - #11072
Conversation
…degen `validateTree`'s `BASE_PROPS` and `generateDts`'s `SduiBaseProps` were two hand-kept copies and had drifted: the validator accepted `bind` / `hidden` while the generated JSX types refused both. Both now read the exported `SDUI_BASE_PROPS`. - `visibleWhen`, `hiddenOn` and `testId` join as `every-node` members. - `name`, `label`, `description`, `placeholder`, `data` and `ariaLabel` join as `where-undeclared` members: a declared input of that name wins, type check included, and the generated interface `Omit`s it from the base. - Consumer controls that used `name` / `description` as the undeclared key now use a near-miss; the page-header `description` silence is pinned as the named cost. Claude-Session: https://claude.ai/code/session_011p7ikEivgXefNDaE5S5Uec Co-authored-by: Claude <noreply@anthropic.com>
|
changeset-claim-re-read
|
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
Contract reviewServed-tier: Inputs: card #11044 (body; triage Check-runs on the head, read 2026-09-29T09:11Z with ① Derived judgmentsJudged member by member against triage
② Semver level
③ Boundary flags
Findings
Remedy, prose-only and frontmatter untouched: correct each body to record that Implemented-by: VERDICT: FAIL Generated by Claude Code |
…se-props-one-list Claude-Session: https://claude.ai/code/session_011p7ikEivgXefNDaE5S5Uec Co-authored-by: Claude <noreply@anthropic.com>
…prop move `11008-bind-base-prop`, `9529-detail-section-declares-icon` and `10485-detail-section-declares-hideempty` each carried a sentence this branch makes false: `placeholder` is no longer outside the base props, and `name` on `detail-section` no longer draws `unknown-prop`. Each sentence is scoped to its own change and followed by a dated objectui#11044 note. Front matter is byte-identical. Claude-Session: https://claude.ai/code/session_011p7ikEivgXefNDaE5S5Uec Co-authored-by: Claude <noreply@anthropic.com>
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
Contract reviewServed-tier: Re-review after record Check-runs on the head, read 2026-09-29T09:31Z with ① Derived judgments
② Semver level
③ Boundary flags
Implemented-by: VERDICT: PASS Generated by Claude Code |
Fixes #11044
Clause-②: yes
Seat
domain:ui#2, PM sessionhttps://claude.ai/code/session_011p7ikEivgXefNDaE5S5Uec, branchclaude/issue-11044-base-props-one-list(PM claim5885808433). Direction per triage5883977635: one list, members 1 to 3, with member 2 as triage ruled it.What this changes
validateTreekept aBASE_PROPSset, andgenerateDtskept a separate hand-writtenSduiBasePropsinterface. They were two lists of the same thing, and they had drifted. The validator had 11 entries and the interface had 8. The interface lackedtype(on purpose, because the tag name carries it), plushiddenandbind. So after PR objectui#11042 the validator acceptedbindandhiddenon every node, while the generated JSX types still refused both.packages/sdui-parser/src/validate.ts: a new exportedSDUI_BASE_PROPSis the one list. Each entry gives aBaseSchemamember, a scope and the attribute's TypeScript type.BASE_PROPS(theevery-nodemembers) and a newWHERE_UNDECLARED_BASE_PROPSare derived from it. The nameBASE_PROPSis kept because prose in other packages cites it.visibleWhen,hiddenOnandtestIdjoin asevery-nodemembers.name,label,description,placeholder,dataandariaLabeljoin aswhere-undeclaredmembers. The loop skips one of them only when the type declares no input of that name. Where one is declared, the declared input's lookup runs,type-mismatchincluded.packages/sdui-parser/src/codegen.ts, member 3. TheSduiBasePropsinterface is emitted fromSDUI_BASE_PROPS(every entry excepttype). A component that declares awhere-undeclaredmember extends anOmitofSduiBasePropsover the keys it declares, so its declared type wins, as it does in the validator. Without theOmit, a declared type the base type does not admit is a TS2430 on the generated file. Reverse-verification leg D below measures this.packages/sdui-parser/src/index.ts: exportsSDUI_BASE_PROPS, plus theSduiBasePropandSduiBasePropScopetypes.packages/sdui-parser/scripts/gen-manifest.tsis not edited. It callsgenerateDts, so it follows. The generated files are not committed:buildArtifactshas no caller in this repo, andscripts/is not in the package'sfiles. What ships isgenerateDtsitself, which is what thetscpin compiles..changeset/11044-base-props-one-list.md:minorfor@object-ui/sdui-parser(an accept set widens, and there are new exports).Values of existing entries are unchanged. The
every-nodemembers that some registrations do declare (className,disabled,id,visible) still skip their declared lookup, as before. See the acceptance notes.Pins
packages/sdui-parser/src/__tests__/base-props-one-list-11044.test.ts(54 tests), against a synthetic manifest:SduiBasePropsblock equals the list, entry for entry;testid,visibleIf,hiddenWhen,aria-label) still draw oneunknown-prop, which is the lit control;424242withtype-mismatch, and a type that does not declare it draws nothing;tscprogram over the generated.d.tsplus a page, mapped one statement per line. The.d.tsitself has zero diagnostics. Alistelement acceptsbind,hidden,visibleWhen,hiddenOn,testIdand an undeclaredlabel, and refusesbindTo. Afieldelement that declaresdataas an array refuses an objectdata(the declared type wins), whilelistaccepts it (the base type isunknown).packages/components/src/renderers/__tests__/base-props-one-list-11044.test.tsx(4 tests), against the live registry of that package:BaseSchemazod shape, andbodyis the one member left out;visibleWhen,hiddenOnortestId, and none of the three draws a diagnostic naming it on any registered type;where-undeclaredkey, every declaring registration keeps its type check and every other registration draws nothing naming the key.packages/sdui-parser/src/__tests__/base-props-bind-hidden-11008.test.ts: theplaceholderrow's prose said the key "stayed OUT of the set". It now saysplaceholderis awhere-undeclaredmember, and that the row goes red if the key is madeevery-node. The assertions are unchanged.Fixture triage: consumer controls this change falsified
The consumer radius (every test importing
@object-ui/sdui-parser, plus every test namingunknown-prop,generateDtsorSduiBaseProps) had four red rows. Each one pinned exactly the branch member 2 moves:examples/schema-catalog/test/pageheader-with-actions.test.tsx: the lit control addeddescriptionto apage-header. That key is the retired alias ofsubtitle(objectui#3226, and the renderer stopped reading it in objectui#3789). The control now uses the near-misssubTitle. A new row pins thatdescriptionnow draws nothing there. This is the named cost of the ruling, so restoring the warning later has to be a deliberate change.packages/plugin-detail/src/__tests__/detailSectionAuthoredHideEmpty-10485.test.tsxanddetailSectionAuthoredIcon-9529.test.tsx: the lit control wasname, aDetailViewSectionmember the block neither declares nor reads. It is nowhideIfEmptyandiconNamerespectively. NoDetailViewSectionmember can serve any more: the block leaves out onlynameandvisible, and both are base props now.packages/plugin-dashboard/src/__tests__/dashboardAuthoredInputs.test.tsx:dashboarddeclareslabelanddescription, so its interface now extends theOmitover those two keys. The regex reads that. Every per-key assertion is unchanged.Measurements
Census through a temporary vitest probe, deleted after use and never committed. It loaded
@object-ui/components,@object-ui/fieldsand all 19plugin-*packages,plugin-treeby source path, so the registry held 519 known types. The card's probe loaded fewer plugin packages and read 488. The probe built the manifest withmanifestFromConfigsand ranvalidateTreeonce per key per type, first with a well-typed value and then with424242. Before is480de81fd(the base). After is this branch.424242: before, aftervisibleWhenunknown-prop, then 0unknown-prop, then 0hiddenOntestIdplaceholderunknown-prop, then 0unknown-prop+ 25type-mismatch, then 25type-mismatchnametype-mismatchlabeltype-mismatchdescriptiontype-mismatchdataunknown-prop+ 11type-mismatch, then 11type-mismatchtype-mismatchariaLabeltype-mismatchEvery declared
type-mismatchsurvives, and no existing member's row moved. The 11datarows after the change are declarations ofobjectorcode, which answer the probe's array value with a mismatch, as a declared input should.tscprobes (strict, noskipLibCheck):generateDtsover alistwithtitleanditems, then a page). Before:bind,hidden,visibleWhen,hiddenOn,testIdandlabeleach give TS2322, and the declared control compiles. After: all of them compile. An addedbindTogives TS2322 with the hint "Did you mean 'bind'?".generateDtsover the real published manifest (getPublicConfigs()over the console's registration graph, 107 types). Before: one error, TS2430 onRecordAlertProps(see the acceptance notes). After: the same one error and no new one. 15 interfaces now extend theOmit. The file diff is 41 lines: 11 newSduiBasePropsmembers, and 15 changedextendslines.Tests and gates
The union ran after the final commit, at HEAD
5b0996905:pnpm exec vitest run packages/sdui-parser/(20 files) plus the consumer radius (73 files: every test importing@object-ui/sdui-parser, every test namingunknown-prop/generateDts/SduiBaseProps, and the new components pin): 93 files, 1593 tests passed.scripts/__tests__(check-changeset-*,changeset-polarity-census,check-pending-changeset-literals,check-control-bytes): 8 files, 330 tests passed.check-changeset-presence,check-control-bytes,check-changeset-no-major,check-pending-changeset-literals,check-new-cross-file-line-citations(0 new).check-governed-queue-guard --testover the 11 paths answers NOT GOVERNED.pnpm exec eslint --no-inline-config --format jsonover the 10 changed code files gives 10 files, 0 errors, 0 warnings, and none ignored.eslint.config.jssets no type-aware parser options, so this diff cannot move the verdict on an untouched file.type-checkexits 0 forsdui-parserandcomponents(afterpnpm --filter '@object-ui/components^...' build), and forplugin-detail,plugin-dashboardandexample-schema-catalog(after their dependency closures were built).tsc --listFilesOnlyconfirms that each package's test program holds the new or edited test files.check:phantom-deps,check:self-import,check:esm-specifiers,check:test-path-roots,check:unreferenced-sources,check-changeset-claims(report-only; the three pending bodies it names describemanifestFromConfigsinindex.ts, which this change does not touch).check:readme-exports. It needs every package built, and on this tree it reports that its population collapsed.@object-ui/sdui-parserhas no README.Declared narrowing: the full
pnpm test, the repo-widepnpm lintand the full type-check farm are CI's.Reverse verification
Each leg is one-off and committed-first. It uses objectstack's
scripts/ablation-replace.mjs(the anchor must hit, and the blob change is checked), inside a script whoseEXIT INT TERMtrap restores the file. After each leg the file's blob equals HEAD andgit diff HEADis empty. The root vitest alias maps@object-ui/sdui-parserto itssrc, so each mutation reached the tests without a build. Each leg ran five files: both new pins, the 11008 sdui-parser pin, the dashboard pin and the schema-catalog pin.visibleWhenentry. Anchor count 1 to 0, blob7cc3d76d4634tod2f4a57962a7. Result: 6 failed, 103 passed. Red rows: the list-coverage row, thevisibleWhenaccept row, the member-1 row, thetscrow, and in components theBaseSchemarow and the all-registrations row.placeholderevery-node. Blob tof1d3a62400f0. Result: 3 failed, 104 passed. Red rows: the "six members" row, the.d.tscompile row (theFieldPropsOmitstring lostplaceholder), and the 11008placeholdertype-check row. The member-2it.eachrows did not go red, because their population is derived from the list and shrank with it. The rows that pin the population caught the change.where-undeclaredskip line. Blob toaebc57218748. Result: 14 failed, 95 passed. Red rows: all six undeclared-case rows in both describe blocks, the components row, and the schema-catalogdescriptionrow. The declared-case rows stayed green.Omit. Blobac39892e6250to36fc417b089d. Result: 2 failed, 107 passed. The.d.tscompile row received "Interface 'FieldProps' incorrectly extends interface 'SduiBaseProps'. Types of property 'label' are incompatible". The dashboard regex row went red too.bindfrom its emission. This is a second list in effect. Blob toc4e5d1eab555. Result: 2 failed, 107 passed. Red rows: theSduiBasePropsequality row, and thetscrow forbind.'where-undeclared'was changed to'where-undeclard', andtsc -p tsconfig.test.jsonran forcomponentsagainst the rebuiltsdui-parserdist. Result:TS2367 … the types 'SduiBasePropScope' and '"where-undeclard"' have no overlap, exit 2. The test program reads the rebuilt.d.ts. A first attempt at F quoted the lock command wrongly, and the wrapper refused it as a usage error before running anything. That was a no-op, not a measurement, and it was restored at once.The direction was red in every leg, as predicted before each run.
For the objectstack save-gate port (objectstack-ai/objectstack#20578)
The port carries three things:
SDUI_BASE_PROPS, thewhere-undeclaredskip line invalidateTree, and the list-drivenSduiBaseProps/Omitemission incodegen.ts. No diagnostic code is added or removed.acceptsChildren,CHILD_LIST_KEYand the containmentifare untouched, so the lockstep record's containment-predicate closure does not move.Acceptance notes
descriptiononpage-header, a retired alias that no renderer reads, used to drawunknown-propand now draws nothing. How many undeclaring types actually read each key is NOT MEASURED (no census of read sites)..d.tsover the published manifest already failstscbefore this change, and still does.record:alertdeclaresvisibleas boolean, string or object, whileSduiBaseProps.visibleisboolean, which gives TS2430 onRecordAlertProps.visibleis anevery-nodemember, so this change does notOmitit. Fixing it needs a decision about declaredevery-nodemembers (below), so it is not fixed here.every-nodemembers keep their silenced type check, as before. In the 519-type census,classNameis declared by 227 types,disabledby 24,idby 12 andvisibleby 1. Applying member 2's lookup to them would not be mechanical.disabledis declaredbooleanby those 24, whileSchemaRendererevaluates a predicatedisabledfor every node, so a declared-first check there would flag values the renderer honours. This is left as it was.visible,disabledandhiddenasboolean, whileBaseSchemaalso admits a predicate.hiddenfollows its two siblings, and each has a string predicate partner in the list (visibleWhen/visibleOn,hiddenOn,disabledOn).visibleOnagainst the canonicalvisibleWhen.@object-ui/sdui-parserhas no README, so none was edited.Generated by Claude Code