Repository navigation
test(floors, ui): one shared floor per ui package population, one catalog entry floor, all at about two thirds - #26576
Conversation
… entry floor in one place, all at about two thirds The ui published-package count was spelled in about eight places, each floor sitting at or just under today's measured value, so one package retirement edited a floor in every file. The floors now live in ui/scripts/__tests__/helpers/ui-package-population.mjs at about two thirds of the values measured on 6a7c0fe, read by both gate scripts' MIN_PACKAGES and by every test site; the schema-catalog entry floor lives in one helper read by all eight call sites. ui/QUICK_REFERENCE.md drops its hand-written count and its test now refuses one. Claude-Session: https://claude.ai/code/session_01ADHkmTNh6kDC6Lu2Yr7s5v Co-authored-by: Claude <noreply@anthropic.com>
…package floor Claude-Session: https://claude.ai/code/session_01ADHkmTNh6kDC6Lu2Yr7s5v Co-authored-by: Claude <noreply@anthropic.com>
席位核对 · ACCEPT · seat
|
| Population | Measured | Floor |
|---|---|---|
| Published | 36 | 24 |
| Workspace members | 43 | 28 |
sideEffects: false |
11 | 7 |
sideEffects arrays |
17 | 11 |
| tsc-built | 11 | 7 |
| Catalog entries | 432 | 288 |
The catalog-entry floor is written once, in ui/examples/schema-catalog/test/catalog-entry-floor.ts, replacing 8 call sites (the 4 the card listed and 4 more above 400). The QUICK_REFERENCE.md prose count is deleted, and its test now refuses one.
Not weakened. On an emptied population, all 31 floor assertions go red. Deleting one ui package or one catalog entry reds none.
Seat rulings on the open questions.
- One module with per-population floors: yes.
- Placement under
__tests__/helpers/: kept. The two gate scripts import it at run time under plainnode, and the docblock says why. A new top-levelui/scripts/*.mjswould join the gate-script population, so it would be a new script for the script census rather than a helper.
Surface deviations (in the report). check-node-esm-load.test.ts was forced, because it pinned MIN_PACKAGES >= 30. component-fixture-declared-keys.test.ts had a per-type census at exactly the measured value; it moved to ⅔ in place, the same class of fix.
Governed surface. scripts/pm/check-governed-merges.mjs --pr 26576: not governed.
Checks pinned to the head. All check runs completed: 0 failing, 0 pending. The seat's landing script checked this before posting.
Evidence (dev). ui scripts/: 178 files green. Gates: 20/20.
Serial constraints. refactor(ui)!: retire @object-ui/plugin-ai and its three node types #26365 (plugin-ai retirement, held) also edits these floors and QUICK_REFERENCE.md. If this PR lands first, refactor(ui)!: retire @object-ui/plugin-ai and its three node types #26365 merges main and reads the constant.
Landing: ready + auto-merge through the relay. devx seat 2 is told on merge.
Requested by Steve · project thread
Fixes #26521
Clause-②: no
Metadata-protocol: none
The ui half of #26444 (the parent stays open for its CLI and baseline halves). No changeset: every edit is to a test, a test helper, a repo-internal gate script under
ui/scripts/orui/QUICK_REFERENCE.md, none of which any package ships; the PR carriesskip-changeset.维护者速读
ui/scripts/__tests__/helpers/ui-package-population.mjs写一次,取实测值约三分之二,两个门禁脚本的MIN_PACKAGES和全部测试点都读它;schema-catalog 的条目底线收成catalog-entry-floor.ts一处(原来 8 处三个值)。ui/QUICK_REFERENCE.md删掉手写的「35 published packages」,测试改为拒绝手写数字。ui/scripts/__tests__/helpers/ui-package-population.mjs(实测表与五个底线)、ui/examples/schema-catalog/test/catalog-entry-floor.ts、ui/scripts/__tests__/quick-reference-commands-4149.test.ts(改写的那条测试)。cd ui && pnpm exec vitest run scripts/__tests__/package-files-exist.test.ts scripts/__tests__/quick-reference-commands-4149.test.ts,预期两文件全绿。Why
#26444's rule: an anti-vacuity floor refuses an empty scan; it is not a census. Floors set at today's measured value red on every legitimate deletion, and #26343 edited five floors to delete one ui package. Each floor now sits at about two thirds of its measurement and is written once per population.
What changes
One floor per ui package population, written once. New
ui/scripts/__tests__/helpers/ui-package-population.mjsholds the anti-vacuity floors with the table they were measured from. It is an.mjsmodule rather than a.tshelper like its neighbours because the two gate scripts import it under plainnode. Each floor is about two thirds of the value measured onorigin/main6a7c0fe3(right after #26483 made@object-ui/app-shellprivate), thevite-dts-wiring-ratchetprecedent:UI_PUBLISHED_PACKAGE_FLOORUI_WORKSPACE_MEMBER_FLOORpackages/*,apps/*,examples/*UI_SIDE_EFFECTS_FALSE_FLOORsideEffects: falseUI_SIDE_EFFECTS_ARRAY_FLOORsideEffectsarrayUI_TSC_BUILT_PACKAGE_FLOORThe card asked for one shared constant; the published-package floor is that constant and every site whose population is the published set or a superset of it reads it. Four sites count genuinely smaller or larger populations (the two
sideEffectsgroups, the tsc-built packages, all workspace members); a 24 there would either red today (11, 17) or sit far under two thirds (43), so each of those has its own floor in the same module, still written once. See open question 1 in the report.Every site, its measured value and its margin:
check-node-esm-load.mjsMIN_PACKAGEScheck-published-dist-tooling.mjsMIN_PACKAGESpackage-files-existpackages declaringfilespackage-files-existfilesentriespackage-files-existpackages owing license textpackage-files-existpackages declaringexportspackage-files-existexportstargetsside-effects-declaration-consistencydeclaringside-effects-declaration-consistencyfalseside-effects-declaration-consistencyarraycheck-dist-completenesstsc-built packageszero-test-member-exclusion-9106memberszero-test-member-exclusion-9106members with a test script and filescheck-doc-linksexamplesREADMEscheck-doc-linkspackages/*/README.mdquick-reference-commands-4149published underpackages/The two entry-count floors (
filesentries,exportstargets) and the example-README floor count entries, not packages, so they stay local at two thirds of their own measurement.ui/QUICK_REFERENCE.mddrops its hand-written count. Thepackages/*row now reads "The published@object-ui/*packages, plus the private ..." and still names the four private packages. Its test no longer requires the row to stateN published; it refuses anyN published/N packagesfigure in the row, keeps the anti-vacuity floor under the derived population, and keeps the private-package check (its failure text reworded for a row without a number).One schema-catalog entry floor, in one place. New
ui/examples/schema-catalog/test/catalog-entry-floor.tsexportsCATALOG_ENTRY_FLOOR = 288(432 entries measured, margin 144). It replaces the card's four sites (431 ×3, 423 ×1) and four more spellings of the same population the card did not list (component-fixture-declared-keys.test.ts,allExamples().length > 400×3 andentries.length > 400×1). The helper lives in the catalog package's owntest/because a test there importing fromui/scripts/would read outside its package.Per-type catalog floors in the same four files, fixed in place. The same tests pin per-type censuses at exactly today's count, so deleting one badge or card demo would red them. Same defect class, same files, mechanical two-thirds edit, so they moved in place:
catalog-authored-key-6805-6806scroll-areanodes (minNodes)catalog-authored-key-6805-6806badgenodes (minNodes)card-demo-content-6788cardscard-demo-content-6788card categoriesbadge-demo-label-6829badgesbadge-demo-label-6829badge categoriescomponent-fixture-declared-keysselect optionscomponent-fixture-declared-keysoption categoriescatalog-gallery-renderplugin categoriesThe plugin-category floor counts ui plugin packages with catalog entries, so retiring one plugin package would have redded it.
Forced test edits
ui/scripts/__tests__/check-node-esm-load.test.ts"keeps a floor under both legs": it pinnedMIN_PACKAGES >= 30, a ninth spelling of the population. It now pinsMIN_PACKAGESto the shared floor and keeps> 0.ui/scripts/__tests__/quick-reference-commands-4149.test.ts: rewritten as described above, because the card deletes the prose number it asserted.Tests
At head
0c64d31a, all underscripts/pm/os-verify-lock.sh:ui/scripts/__tests__sites,check-node-esm-load,check-published-dist-tooling,check-published-tsconfig-tooling-exclude, and the five schema-catalog files): Test Files 14 passed (14), Tests 1143 passed (1143). VERDICT command-exit 0.pnpm --dir ui exec vitest run scripts/ --maxWorkers=2: Test Files 178 passed, 2 skipped (180); Tests 5057 passed, 2 skipped. VERDICT command-exit 0.pnpm --dir ui type-check:scripts(the program holding the new.mjsand everyui/scriptstest): VERDICT command-exit 0.Emptied population: every floor still goes red (31 assertions)
A one-shot mutation, restored from
HEADby a trap and confirmed by an emptygit diff HEADafterwards: at each of the 30 floor sites in the eleven test files the measured population was replaced by0(expect.soft(0, "EMPTIED ...")), so every floor is read against an empty population in one run. Result: Test Files 11 failed (11), and 31 assertions red, one per floor (theminNodesloop yields two). Examples from the log:EMPTIED packagesWithFiles.length: expected 0 to be greater than or equal to 24EMPTIED members.length: expected 0 to be greater than or equal to 28EMPTIED published.length: expected 0 to be greater than or equal to 24(QUICK_REFERENCE)EMPTIED entries.length: expected 0 to be greater than or equal to 288(×5) andEMPTIED allExamples().length: ... 288(×3)no plugin categories were derived, so this case would be vacuous: expected 0 to be greater than or equal to 9The two gate scripts' own collapse refusal (fewer than
MIN_PACKAGESpublished packages found) is covered by the existingcheck-published-tsconfig-tooling-excludecase that pads a fixture belowMIN_PACKAGESand asserts thescan-collapsedfinding naming the number; it is green at the new value.Measurement method
The measured values were read on
6a7c0fe3by a throwaway mutation that turned each floor intoexpect.soft(population).toBe(-1)and read the actual values from the failures, restored fromHEADafterwards.MIN_PACKAGES' population was read by calling each script's own discovery (discoverPackages(...).filter(not private)anddiscoverPublishedPackages): 36 each.Acceptance notes
layout-props-conversion.test.tsx: layout nodes 430 (447 measured) has a margin;withClassName175 (182 measured) says in its own comment it is deliberately tighter after a ruled sweep; the 153 stack-node count is the census of a ruledspacing→gaprename, a transcription pin rather than an anti-vacuity floor (the class ci(gates): retire the transcription pins — tests and gates that hold a hand-typed count or table equal to the tree and red on every unrelated move (parent of eight) #26431 owns).badge-demo-label-6829CONTAINER_CHILDREN_FLOOR600 (660 measured) andcatalog-authored-key-6805-6806text-content 600 (659 measured) have margins. ExacttoHaveLengthpins on fixed demos are not floors.#26365(plugin-ai retirement) edits the QUICK_REFERENCE count andpackage-files-existfloors too; whichever lands second merges main. After this PR it needs to touch neither.ui/scripts/__tests__/helpers/as the claim's file surface names; the two gate scripts importing from there is the one oddity, and the alternative (a sibling ofworkspace-root.mjsinui/scripts/) is open question 2 in the report.Verification
dispatch-gates: 20 derived, 20 run, 0 NOT MEASURED
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackat0c64d31aderived 20 families; each was run after the last commit with its exit code captured before any pipe:check-closing-keyword-parity(and--self-test),check-comment-mask-corpus(18349 files, 0 disagree),check:cross-package-test-inputs,check:dispatcher-error-vocabulary,check:driver-memory-census,check:engine-double-contract,check:gitlink-declared,check:nul-bytes,check:published-files,check:query-options-erasure,check:refd-timer-probe,check:test-source-alias,check:tier-file-adoption,check:type-check-coverage,check:type-check-debt,check:undeclared-dep-imports,check:watch-hint-literal,check:where-matcher, andpnpm --dir ui exec vitest run scripts/(above).--ran:20 derived famil(ies) accounted for — 20 run, 0 NOT-MEASURED (a DERIVED zero — all 20 recorded an exit code and none of them is 3).@object-ui/example-schema-catalogtype-checkon built dependencies. A localtsc -p tsconfig.test.jsonwithout the@object-ui/*builds prints 171 errors, all unresolved-module noise from unbuilt packages (81 TS2307, 62 TS2882 and their implicit-any fallout); none namescatalog-entry-floor.tsor an edited line. CIType Check UIis the reading.Human Minimum
packages/specholds no runtime logic. (not touched)pnpm lintpasses. (lint is CI's run)main, one pull request.skip-changeset)packages/spectouched: n/a.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01ADHkmTNh6kDC6Lu2Yr7s5v
Generated by Claude Code