Skip to content
This repository was archived by the owner on Nov 4, 2026. It is now read-only.

test(app-shell): pin the target-required degrade set equal across app-shell and plugin-grid - #7576

Merged
os-project-manager merged 2 commits into
mainfrom
claude/issue-5880-degrade-set-pin
Sep 4, 2026
Merged

os-project-manager merged 2 commits into
mainfrom
claude/issue-5880-degrade-set-pin

Conversation

@os-project-manager

Copy link
Copy Markdown
Collaborator

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/main at ac8abb0f5 before writing anything. The premise holds:

what the card asserts measured
two statements, one per package yes — git grep LOOKUP_WIDGET_TYPES finds exactly two declarations
still {lookup, master_detail} yes — both still exactly two members
no third site none — see the lit controls below
neither already repaired neither; nothing mechanical ties them

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 at paramToField.ts:54 as 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:

  • Set-literal shape — new Set([...]) containing 'lookup': 7 hits, of which only the two under test have exactly two members. Control: the same query with 'boolean' returns SELECT_TYPES, USER_FILTER_TYPES, FILTERABLE_FIELD_TYPES — the shape matches.
  • Array-const shape — the shape a Set-only query would miss (this is the COMPONENTS_LEAK_GROUPS trap: a readonly LedgerGroup[] reads as "not found" against an object-literal query). const NAME = [...] containing 'lookup': zero. Control: the identical query with no member filter returns ENV_ROWS, ROW_ACTION_DEFS, EXCLUDED_META_TYPES and more — the shape matches, so the zero is a measurement.
  • Multi-line array shape — same query spanning lines: returns INVENTORY, DESIGNER_FIELD_TYPES, UNRULED_LIVE_TYPES, none of which is this rule. Control: the same query on 'currency' returns TABLE_COLUMN_TYPES.
  • The predicate shape — the rule can be restated with no named set at all, so the decisive query was for the degrade predicate itself (a targetless picker falling back to text). It returns exactly two production sites: paramToField.ts:84 and bulkParamToField.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_TYPES is exported, and neither should become exported just to be testable. app-shell is read through its exported paramDegradesWithoutTarget; plugin-grid has no predicate to export, so degradation is observed as the difference a declared target makes — the widget collapses to text without one and does not collapse with one. Both halves are needed: a param that resolves to text anyway yields text on 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_TYPES from @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:

  1. A shared constant would share only the member half. The two predicates read different fields on different types (ActionParamDef.referenceTo vs BulkActionParam.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.
  2. It costs a new exported symbol on a published package, permanently, for a two-member internal heuristic. That is Clause-②: yes and a contract review, bought for no additional coverage per (1). This file exports nothing.
  3. finding(app-shell): paramToField is 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, because user is 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 devDependencies and peerDependencies, while plugin-grid does not depend on app-shell. The cross-package source import is the shape already established by packages/app-shell/src/layout/__tests__/activityItemType-6730.test.ts and packages/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_TYPES was touched. git diff shows 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 spec FieldType vocabulary), and it turned up a fourth degrading row: tree. tree is a spec field type that is not a widget-map key, so resolveFormWidgetType sends it through packages/fields/src/field-type-alias.ts (tree: 'field:lookup') and it arrives as lookup.

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 TERM with absolute paths, restoring via git checkout HEAD -- ABSOLUTE_PATH. Run against the final HEAD, with the implementation already committed so the restore leg had a real reference point.

leg mutation result which assertion fired
A plugin-grid: add 'user' to its set RED the pin, naming packages/plugin-grid/.../bulkParamToField.ts
B app-shell: drop 'master_detail' RED the lit control, naming packages/app-shell/.../paramToField.ts

Each 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":

RESTORED-OK packages/plugin-grid/src/components/bulkParamToField.ts
  disk=c7b6e1db1d5739ef6f8e46849067f2a000d8f597 == HEAD=c7b6e1db1d5739ef6f8e46849067f2a000d8f597 ; git diff HEAD empty
RESTORED-OK packages/app-shell/src/utils/paramToField.ts
  disk=1800efd21993e5546d6d495eb39388c69a04fc71 == HEAD=1800efd21993e5546d6d495eb39388c69a04fc71 ; git diff HEAD empty

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 stale dist.

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.

check-changeset-presence     EXIT=0  1 source file(s) of 1 released package(s) changed, and this change declares 1 changeset(s)
                                     Every one of them has an EMPTY frontmatter — declared as releasing nothing
check-changeset-no-major     EXIT=0  No changeset declares a `major` bump.
check-control-bytes          EXIT=0  OK (scanned 6240 tracked text file(s); skipped 85 binary)
check-package-self-import    EXIT=0  No package names itself inside its own src/.
check-phantom-dependencies   EXIT=0  Every in-scope import is declared by the package that publishes it.
check-vi-mock-specifiers     EXIT=0  OK
check-vi-mock-inherit        EXIT=0  OK
check-lint-coverage          EXIT=0  46/46 packages linted, 0 with outstanding errors
check-type-check-coverage    EXIT=0  45/46 via `type-check`, 0 known-broken

Tests, at a59038538: pnpm exec vitest run from 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), because tsconfig.test.json drops paths and resolves workspace packages through built declarations.

And the type-check green actually covers the new file — tsc -p tsconfig.test.json --listFiles confirms both of these are in the 4545-file program, rather than silently excluded:

/home/user/objectui-5880/packages/plugin-grid/src/components/bulkParamToField.ts
/home/user/objectui-5880/packages/app-shell/src/utils/degradeSetTwin-5880.test.ts

Declared narrowings

Lint. Ran eslint --no-inline-config --format json over the one changed file rather than turbo run lint over 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.js configures no type-aware linting (no project, no projectService, no tsconfigRootDir), 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_TYPES object (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.ts under a released package's src/, 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

…-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
@github-actions github-actions Bot added the tests label Sep 3, 2026
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

✅ Console Performance Budget

Metric Value Budget
Eager closure (gzip, 50 chunks) 3182.7 KB 3191.4 KB
Main entry chunk (gzip) 143.2 KB 350 KB
Entry file index-BISou9x1.js —
Status PASS —

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

Package Size Gzipped
app-shell (consoleActionDispatch.js) 0.20KB 0.19KB
app-shell (index.js) 15.67KB 5.75KB
app-shell (runtime-config.js) 20.68KB 7.36KB
app-shell (types.js) 0.01KB 0.04KB
app-shell (urlParams.js) 10.06KB 3.86KB
auth (ActiveOrganizationStorage.js) 25.05KB 9.16KB
auth (AuthContext.js) 0.31KB 0.24KB
auth (AuthGuard.js) 2.07KB 1.00KB
auth (AuthProvider.js) 40.18KB 10.59KB
auth (AuthShell.js) 3.49KB 1.40KB
auth (ForgotPasswordForm.js) 12.21KB 3.45KB
auth (LoginForm.js) 18.15KB 5.39KB
auth (PreviewBanner.js) 0.90KB 0.50KB
auth (RegisterForm.js) 6.65KB 2.22KB
auth (SocialSignInButtons.js) 9.61KB 3.89KB
auth (UserMenu.js) 3.41KB 1.23KB
auth (auth-gate-events.js) 1.29KB 0.66KB
auth (authStyles.js) 5.04KB 1.72KB
auth (createAuthClient.js) 40.21KB 10.80KB
auth (createAuthenticatedFetch.js) 8.46KB 3.43KB
auth (index.js) 3.19KB 1.44KB
auth (invitation-status.js) 1.22KB 0.70KB
auth (org-roles.js) 6.66KB 2.78KB
auth (phone-identifier.js) 1.11KB 0.66KB
auth (types.js) 0.59KB 0.35KB
auth (useAuth.js) 5.30KB 1.02KB
auth (useWorkspaceAdminStatus.js) 5.13KB 2.35KB
collaboration (CommentThread.js) 26.08KB 7.56KB
collaboration (LiveCursors.js) 3.17KB 1.27KB
collaboration (PresenceAvatars.js) 6.49KB 2.64KB
collaboration (PresenceProvider.js) 2.79KB 1.13KB
collaboration (index.js) 1.68KB 0.73KB
collaboration (useCollaborationTranslation.js) 6.05KB 2.52KB
collaboration (useCommentSearch.js) 1.98KB 0.88KB
collaboration (useConflictResolution.js) 7.75KB 1.86KB
collaboration (useMentionNotifications.js) 1.81KB 0.68KB
collaboration (usePresence.js) 6.33KB 1.84KB
collaboration (useRealtimeSubscription.js) 7.91KB 2.01KB
components (index.js) 516.21KB 117.82KB
core (index.js) 6.12KB 2.42KB
create-plugin (index.js) 10.08KB 3.26KB
data-objectstack (index.js) 180.00KB 50.20KB
fields (index.js) 242.40KB 61.26KB
i18n (LocalizationContext.js) 1.76KB 0.96KB
i18n (builtinAggregateLabels.js) 0.86KB 0.49KB
i18n (currency.js) 1.22KB 0.64KB
i18n (fallbackInterpolation.js) 6.25KB 2.77KB
i18n (i18n.js) 4.28KB 1.75KB
i18n (index.js) 3.65KB 1.47KB
i18n (pickLocalized.js) 7.62KB 3.26KB
i18n (provider.js) 26.89KB 9.04KB
i18n (useDisplayLocale.js) 2.85KB 1.45KB
i18n (useObjectLabel.js) 34.34KB 9.17KB
i18n (useSafeTranslation.js) 5.60KB 2.33KB
layout (index.js) 38.98KB 10.98KB
mobile (MobileProvider.js) 0.92KB 0.49KB
mobile (ResponsiveContainer.js) 0.94KB 0.38KB
mobile (breakpoints.js) 1.51KB 0.70KB
mobile (createOfflineDataSource.js) 5.61KB 1.75KB
mobile (index.js) 1.55KB 0.62KB
mobile (offlineQueue.js) 3.91KB 1.35KB
mobile (pwa.js) 0.97KB 0.49KB
mobile (serviceWorker.js) 1.48KB 0.62KB
mobile (serviceWorkerSource.js) 3.41KB 1.48KB
mobile (useBreakpoint.js) 1.54KB 0.65KB
mobile (useGesture.js) 6.96KB 1.98KB
mobile (useOfflineSync.js) 1.99KB 0.72KB
mobile (usePullToRefresh.js) 2.53KB 0.85KB
mobile (useResponsive.js) 0.72KB 0.42KB
mobile (useResponsiveConfig.js) 1.37KB 0.63KB
mobile (useSpecGesture.js) 4.32KB 1.64KB
mobile (useTouchTarget.js) 1.01KB 0.54KB
permissions (MePermissionsProvider.js) 11.71KB 4.29KB
permissions (PermissionContext.js) 0.31KB 0.25KB
permissions (PermissionGuard.js) 0.89KB 0.45KB
permissions (PermissionProvider.js) 6.24KB 2.16KB
permissions (discardProofCache.js) 1.04KB 0.55KB
permissions (evaluator.js) 5.12KB 1.74KB
permissions (index.js) 0.93KB 0.41KB
permissions (store.js) 0.91KB 0.42KB
permissions (useFieldPermissions.js) 1.28KB 0.53KB
permissions (usePermissions.js) 4.83KB 2.27KB
plugin-ai (index.js) 15.75KB 3.80KB
plugin-calendar (index.js) 48.15KB 13.35KB
plugin-charts (index.js) 70.92KB 19.75KB
plugin-chatbot (index.js) 196.19KB 46.43KB
plugin-dashboard (index.js) 132.89KB 34.68KB
plugin-designer (index.js) 212.87KB 43.19KB
plugin-detail (index.js) 250.93KB 64.09KB
plugin-editor (index.js) 2.46KB 1.10KB
plugin-form (index.js) 132.87KB 32.66KB
plugin-gantt (index.js) 167.44KB 41.05KB
plugin-grid (index.js) 209.25KB 56.71KB
plugin-kanban (index.js) 52.71KB 14.55KB
plugin-list (index.js) 113.28KB 27.59KB
plugin-map (index.js) 20.55KB 6.80KB
plugin-markdown (index.js) 13.72KB 4.69KB
plugin-report (index.js) 43.57KB 11.96KB
plugin-timeline (index.js) 30.84KB 8.85KB
plugin-tree (index.js) 9.38KB 3.22KB
plugin-view (index.js) 85.24KB 20.94KB
providers (DataSourceProvider.js) 0.75KB 0.39KB
providers (MetadataProvider.js) 1.37KB 0.59KB
providers (ThemeProvider.js) 1.90KB 0.85KB
providers (UploadProvider.js) 11.66KB 3.50KB
providers (index.js) 0.45KB 0.23KB
providers (types.js) 0.01KB 0.04KB
react-runtime (index.js) 5.62KB 2.34KB
react (LazyPluginLoader.js) 4.47KB 1.63KB
react (SchemaRenderer.js) 81.07KB 26.86KB
react (data-invalidation.js) 5.05KB 2.08KB
react (index.js) 4.63KB 2.18KB
react (schema-input.js) 2.32KB 1.24KB
react (spec-input.js) 0.20KB 0.18KB
sdui-parser (codegen.js) 5.41KB 2.34KB
sdui-parser (dashboard-widget-options.js) 3.08KB 1.30KB
sdui-parser (index.js) 4.93KB 2.24KB
sdui-parser (input-type.js) 2.84KB 1.40KB
sdui-parser (parse.js) 20.57KB 5.88KB
sdui-parser (provenance.js) 3.66KB 1.82KB
sdui-parser (types.js) 0.28KB 0.23KB
sdui-parser (validate.js) 10.35KB 3.60KB
types (ai.js) 0.20KB 0.17KB
types (api-types.js) 0.20KB 0.18KB
types (app.js) 2.87KB 1.00KB
types (base.js) 0.20KB 0.18KB
types (blocks.js) 0.20KB 0.18KB
types (complex.js) 2.74KB 1.41KB
types (crud.js) 0.20KB 0.18KB
types (dashboard-filter-alias.js) 6.23KB 2.74KB
types (data-display.js) 3.75KB 1.85KB
types (data-protocol.js) 0.20KB 0.19KB
types (data.js) 0.20KB 0.18KB
types (designer.js) 1.85KB 0.85KB
types (disclosure.js) 0.20KB 0.18KB
types (error-code.js) 1.54KB 0.88KB
types (feedback.js) 0.20KB 0.18KB
types (field-types.js) 0.20KB 0.18KB
types (form.js) 0.20KB 0.18KB
types (http-inflight.js) 8.87KB 3.73KB
types (http-retry.js) 4.32KB 2.02KB
types (icon-key-migration.js) 4.26KB 1.63KB
types (index.js) 4.74KB 2.25KB
types (layout.js) 0.20KB 0.18KB
types (managed-by.js) 0.19KB 0.18KB
types (mobile.js) 4.58KB 2.23KB
types (navigation.js) 0.20KB 0.18KB
types (objectql.js) 0.20KB 0.18KB
types (overlay.js) 0.20KB 0.18KB
types (permissions.js) 0.20KB 0.18KB
types (plugin-scope.js) 0.20KB 0.18KB
types (record-components.js) 0.20KB 0.19KB
types (record-semantics.js) 1.28KB 0.67KB
types (registry.js) 0.20KB 0.18KB
types (reports.js) 0.20KB 0.18KB
types (select-option.js) 0.20KB 0.19KB
types (spec-report.js) 5.05KB 1.93KB
types (spec-ui-namespace.js) 0.20KB 0.19KB
types (system-fields.js) 3.33KB 1.54KB
types (theme.js) 6.28KB 2.87KB
types (ui-action.js) 8.11KB 3.32KB
types (views.js) 0.20KB 0.18KB
types (widget.js) 0.20KB 0.18KB

Size Limits

  • ✅ Core packages should be < 50KB gzipped
  • ✅ Component packages should be < 100KB gzipped
  • ⚠️ Plugin packages should be < 150KB gzipped

@os-project-manager
os-project-manager marked this pull request as ready for review September 4, 2026 00:14
@os-project-manager
os-project-manager added this pull request to the merge queue Sep 4, 2026
Merged via the queue into main with commit ccb3ad7 Sep 4, 2026
33 checks passed
@os-project-manager
os-project-manager deleted the claude/issue-5880-degrade-set-pin branch September 4, 2026 00:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

finding(app-shell/plugin-grid): the target-required degrade set {lookup, master_detail} is stated once per package, with nothing tying the two

2 participants