This repository was archived by the owner on Nov 4, 2026. It is now read-only.
Repository navigation
test(app-shell): pin the target-required degrade set equal across app-shell and plugin-grid - #7576
Merged
Merged
Conversation
…-shell and plugin-grid The rule "this picker cannot query without a DECLARED target, so degrade it to a plain text input" has exactly two production statements, both spelled `new Set(['lookup', 'master_detail'])`, and nothing mechanical held them together: no shared object, no pin, no gate that could report a split. Derives each package's EFFECTIVE set through its own adapter over one shared probe vocabulary and asserts the CONTENTS equal — cardinality would pass against two sets that disagree. Adds no dependency edge (app-shell already devDepends on plugin-grid) and exports no new symbol. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EMrWaQw3XS5DxTHxp4yRyC
Empty frontmatter: the change adds one test file, exports no new symbol and moves no published behaviour. The presence gate names this shape as the explicit exemption, not a workaround. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EMrWaQw3XS5DxTHxp4yRyC
Contributor
✅ 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
|
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 #5880
Clause-②: no — two added files, zero new exported symbols, no source file touched, and the changeset declares the change as releasing nothing. Determined from the diff itself:
git diff BASE..HEAD | grep '^+.*\bexport\b'returns nothing.Premise re-verified first (the card is from 2026-08-24)
Measured on
origin/mainatac8abb0f5before writing anything. The premise holds:git grep LOOKUP_WIDGET_TYPESfinds exactly two declarations{lookup, master_detail}One drift, and it is the card's only error: the plugin-grid site is at
bulkParamToField.ts:41, not:40. The app-shell site is atparamToField.ts:54as stated.Lit controls, because three of these answers are zeros
A zero from an unlit instrument is not a reading, so every zero-answering query was run in the same shape against a population known to be non-empty:
new Set([...])containing'lookup': 7 hits, of which only the two under test have exactly two members. Control: the same query with'boolean'returnsSELECT_TYPES,USER_FILTER_TYPES,FILTERABLE_FIELD_TYPES— the shape matches.COMPONENTS_LEAK_GROUPStrap: areadonly LedgerGroup[]reads as "not found" against an object-literal query).const NAME = [...]containing'lookup': zero. Control: the identical query with no member filter returnsENV_ROWS,ROW_ACTION_DEFS,EXCLUDED_META_TYPESand more — the shape matches, so the zero is a measurement.INVENTORY,DESIGNER_FIELD_TYPES,UNRULED_LIVE_TYPES, none of which is this rule. Control: the same query on'currency'returnsTABLE_COLUMN_TYPES.paramToField.ts:84andbulkParamToField.ts:134. Every other hit is a widget-internal "do I have a datasource" check, not the param-degrade rule.What this adds
One test file. It derives each package's effective degrade set through that package's own adapter, over one shared probe vocabulary, and asserts the contents equal.
Contents, not cardinality — deliberately. "Both sets have two members" passes against two sets that disagree; swap a member on one side and the count is untouched.
The sets are derived rather than read because neither
LOOKUP_WIDGET_TYPESis exported, and neither should become exported just to be testable. app-shell is read through its exportedparamDegradesWithoutTarget; plugin-grid has no predicate to export, so degradation is observed as the difference a declared target makes — the widget collapses totextwithout one and does not collapse with one. Both halves are needed: a param that resolves totextanyway yieldstexton both passes and is correctly not counted.Why the pin, and not the shared constant
Triage recommended the pin and left explicit latitude: "If a shared home both packages already depend on exists (e.g.
@object-ui/types) the dev may choose the shared-constant shape instead — say which and why in the PR."I took the pin. A shared home does exist — both packages already import
EXPANDABLE_FIELD_TYPESfrom@object-ui/core, so triage's stated cost (a new dependency edge) is actually not what the shared constant would cost here. That argument is weaker than triage assumed, and I am saying so rather than quietly leaning on it. The pin still wins on three measured grounds:ActionParamDef.referenceTovsBulkActionParam.object), so each surface keeps its own "has a target?" half either way. Both shapes therefore catch exactly membership drift — the shared constant buys no coverage this pin does not already have.Clause-②: yesand a contract review, bought for no additional coverage per (1). This file exports nothing.paramToFieldis now the LAST private copy of the reference-bearing rule — and its "moves in lockstep with plugin-grid" comment stopped being true #5312 ruled the deliberate separation for the sibling rule in these same two files, becauseuseris reference-bearing but must never degrade. Converging the member set of the smaller rule re-opens a question that ruling shut.The pin lives in app-shell, not plugin-grid, because the dependency direction already runs that way: app-shell declares plugin-grid in
devDependenciesandpeerDependencies, while plugin-grid does not depend on app-shell. The cross-package source import is the shape already established bypackages/app-shell/src/layout/__tests__/activityItemType-6730.test.tsandpackages/plugin-grid/src/__tests__/rowRecordCrudVerdict.test.tsx. So this adds no dependency edge at all.For the record, the third option the card listed — "rule the duplication acceptable and say so in both files" — was not available and I did not argue for it. It is the comment #5312 measured as false for the twin rule in these very files.
The set membership was NOT changed
Neither
LOOKUP_WIDGET_TYPESwas touched.git diffshows two added files and no modified source. Which field types degrade is a behaviour question and needs its own ruling.Something the instrument caught about itself
The lit control failed on first run, and it was right to. My probe vocabulary is wider than the existing sweep in
paramToField.test.ts(it adds the specFieldTypevocabulary), and it turned up a fourth degrading row:tree.treeis a spec field type that is not a widget-map key, soresolveFormWidgetTypesends it throughpackages/fields/src/field-type-alias.ts(tree: 'field:lookup') and it arrives aslookup.Both packages degrade
tree, identically. This is not a divergence and not a defect — it is a row the narrower existing sweep never sees. The instrument was wrong, not the sets; I corrected the control's expected literal and documented the route. Recording it because a silently-corrected control is indistinguishable from a control that was never lit.Verification
The pin discriminates — ablated in both directions, each leg with the mutation proven on disk before any result was read, and each restore proven by state (not by exit code) under
trap ... EXIT INT TERMwith absolute paths, restoring viagit checkout HEAD -- ABSOLUTE_PATH. Run against the final HEAD, with the implementation already committed so the restore leg had a real reference point.'user'to its setpackages/plugin-grid/.../bulkParamToField.ts'master_detail'packages/app-shell/.../paramToField.tsEach side's movement is caught by a different assertion, and each message names the package that actually moved. Baseline before both legs: 2 passed.
Restore proof, both legs — blob identity, with an empty hash read as failure rather than as "nothing to compare":
No rebuild leg is owed: the root vitest config aliases every package specifier to its
src, and the plugin-grid import is a relative source path, so both legs read source directly and never a staledist.Gate union, all run on the final HEAD
a59038538. Exit codes captured by redirect-then-read, never through a pipe; each verdict is the gate's own line.Tests, at
a59038538:pnpm exec vitest runfrom the repo root over the pin and its four nearest neighbours (paramToField.test.ts,bulkParamToField.test.ts,expandableFamily.identity-5874.test.ts,resolveActionParams.test.ts) — Test Files 5 passed (5), Tests 79 passed (79).Type check:
pnpm --filter @object-ui/app-shell type-check— exit 0, and the script name echoed (tsc --noEmit && tsc -p tsconfig.test.json), so this is not the zero-match false green. Dependency closure built first (pnpm --workspace-concurrency=2 --filter '@object-ui/app-shell^...' build), becausetsconfig.test.jsondropspathsand resolves workspace packages through built declarations.And the type-check green actually covers the new file —
tsc -p tsconfig.test.json --listFilesconfirms both of these are in the 4545-file program, rather than silently excluded:Declared narrowings
Lint. Ran
eslint --no-inline-config --format jsonover the one changed file rather thanturbo run lintover the repo. What the full run could have caught that a single-file run cannot: a rule whose verdict on an untouched file changes because of my diff. It cannot happen here, and the reason is read from eslint's own config rather than assumed:eslint.config.jsconfigures no type-aware linting (noproject, noprojectService, notsconfigRootDir), so no rule can see across file boundaries, and my diff modifies zero existing files. File count read from the JSON output, not from prose: 1 file, 0 errors, 0 warnings.check-lint-coverage(46/46 packages) was run in full and covers the "is every package linted at all" question separately.Tests. Ran the pin plus its four nearest neighbours rather than the full suite. What the full run could catch: a module-state interaction between my new file and an unrelated suite sharing a worker. The neighbours chosen are precisely the suites that import the same two adapters and the same shared
EXPANDABLE_FIELD_TYPESobject (the one piece of cross-test shared mutable state in this area, which the neighbouring suites spy on). CI runs the full farm regardless.Gates. Ran the nine derived above rather than enumerating every workflow. Derived from the diff's actual surface: one
.test.tsunder a released package'ssrc/, plus one.changeset/file. Gates keyed on docs, i18n, skills, dist, SDUI registration, icons and spec symbols have no input in this diff.🤖 Generated with Claude Code
https://claude.ai/code/session_01EMrWaQw3XS5DxTHxp4yRyC
Generated by Claude Code