Skip to content

fix(runner): render AppAction.items from its declared type — delete the two retired-key as any reads and make the onClick refusal true again - #7720

Merged
os-justin merged 2 commits into
mainfrom
claude/issue-6854-layout-renderer-retired-onclick
Sep 5, 2026
Merged

fix(runner): render AppAction.items from its declared type — delete the two retired-key as any reads and make the onClick refusal true again#7720
os-justin merged 2 commits into
mainfrom
claude/issue-6854-layout-renderer-retired-onclick

Conversation

@os-justin

Copy link
Copy Markdown
Collaborator

Fixes #6854

Executes the maintainer ruling recorded at #6854 comment 5548581017 (director seat, decision batch #40, maintainer verbatim 「同意」): option B2 — the runner stops reading a retired key through as any, AppAction.items is not re-typed, and the shortcut-as-authorable question goes to its own card (filed: #7719).

Verified at HEAD 96fcb35 (origin/main merged in at f96a781).


Zone 2 first — the census the ruling gated the deletion on

Zone 2 first: measure whether any host feeds onClick on AppAction.items by bypassing the validator (TS / props); if one exists in-repo, stop and report before deleting (the cast would then be load-bearing).

Result: empty. No such host exists in this repository, and none can. Four legs, each with a positive control:

Leg Method Population Result
1. Who reads AppComponentSchema.actions[] at all? grep for .actions across packages/layout, packages/app-shell, packages/runner, apps/console, then classify all in-repo readers exactly one: packages/runner/src/LayoutRenderer.tsx. layout's AppSchemaRenderer.tsx contains zero occurrences of actions; app-shell's useNavigationSync.ts likewise; every other hit is objectDef.actions or an action:bar node — a different contract
2. What can reach that reader? trace the prop LayoutRenderer has one call site, App.tsx:204 its app comes from MetadataLoader, whose two implementations return an import.meta.glob'd .json module or res.json()a JSON document, never a hand-built object. @object-ui/runner publishes no library entry (files: ["dist"] from a Vite app; no main, module or exports), so nothing can import the component and hand it one either
3. Does any JSON author the keys? structural walk for any object with an items array whose members carry onClick or shortcut 594 JSON files under packages / apps / examples / content / docs / e2e 0 hits. Control: the same walker on a synthetic app.json carrying exactly that shape → CONTROL HIT … .actions[0].items[0], INSTRUMENT LIVE
4. Does any TypeScript author them? multiline scan for an items: array literal containing onClick or shortcut packages / apps / examples, .ts + .tsx 2 files, neither an AppActioncomponents/src/__tests__/menu-item-onclick-handler.test.tsx and examples/schema-catalog/test/component-fixture-declared-keys.test.ts, both the overlay MenuItem path (dropdown-menu / context-menu / menubar). Control: same pattern on a synthetic host file → matched, INSTRUMENT LIVE

Legs 3 and 4 are the ones that could have gone quiet, so both carry a control that fired. The shortcut read in particular deleted no reachable behaviour: leg 3 found nobody writing the key, and MenuItemSchema strips it from anything that is validated.

The diff

packages/runner/src/LayoutRenderer.tsx — the two as any reads deleted, the block re-verified at the line numbers the ruling named (:307, :312-313 on 4ce14f1):

⚠️ Notation: this repository has measured that GitHub's body sanitizer deletes tag-shaped fragments on save — inside fenced code blocks and backticks too — which is how a before/after listing silently collapses into "nothing changed". So the JSX below is written with the angle brackets spelled out as OPEN/CLOSE markers instead of typed literally. Read the real bytes in the diff of this PR.

  OPEN DropdownMenuItem key={idx}                       ← kept (was: … plus an onSelect prop)
-   REMOVED   onSelect={() => { if ((item as any).onClick) { /* Handle click logic */ } }}
    {item.label}                                        ← kept, declared on AppMenuItem
-   REMOVED   {(item as any).shortcut && ( OPEN DropdownMenuShortcut … CLOSE )}
  CLOSE DropdownMenuItem

The type === 'separator' branch and the item.label read are legal against AppMenuItem and stay. The DropdownMenuShortcut import goes with its only use. Casts in the file: 3 → 0 (the one as any grep still finds is the word inside the new explanatory comment).

packages/types — comment-only on published source. Machine-checkable: of the 29 changed lines in app.ts + app.zod.ts, grep -vE '^[+-][[:space:]]*(\*|/\*|//|\*/)' returns nothing. No accepted key moves, no exported symbol moves, no shape changes — clause ② stays no.

The retirement message: made true, not restated

The ruling's body offers two branches — "the retirement message is made true again (or restated to say the renderer no longer reads it)". This PR takes the first, and that is a deliberate reading worth reviewing.

handlerKeyRefusal(key, 'retired', …) generates, from a template in zod/tombstone.zod.ts shared by 22 other retired handler keys:

onClick is RETIRED (objectui#6124, ADR-0049): JSON has no function value, and no renderer reads this key, so nothing could ever run it.

Before this PR that sentence was falseLayoutRenderer read the key. After the deletion it is true, so the text is unchanged and is instead pinned, on both sides. Softening it (say, to "no renderer is intended to read this key") would have bought nothing and cost the property that makes it worth having: it is falsifiable, and a gate can hold it. It would also have rewritten 22 other keys' published messages and their pins to fix one key's claim.

What is corrected in packages/types is a different sentence, one the deletion does not make true. Both rationale comments on this key said:

Nothing reads AppComponentSchema.actions[], so no value here could ever run.

That is false in the other direction: LayoutRenderer renders both the 'button' and the 'user' arm of actions[]. They now say what was measured — actions[] is read, onClick is not, on the action or on items[].

Pins, and the ablation that shows they can fail

Both were run mutation-then-restore, from the committed tree; each restore is proven by blob hash and an empty git diff HEAD, not by an exit code, and both scripts carry a trap … EXIT INT TERM. No build is involved: the root vitest config aliases @object-ui/* to src, so dist is not on the resolution path for either.

A — packages/runner/src/__tests__/LayoutRenderer.appActionItems-6854.test.tsx drives a real user menu with both undeclared keys authored, exactly as a validator-bypassing host would, and requires neither to be read.

Re-inject the two reads → blob 7e45da19 → 3b99c550, and:

     × never invokes an authored `onClick` — the key the refusal message says no renderer reads
     × never puts an authored `shortcut` into the DOM
 Tests  2 failed | 2 passed (4)

Only the two negatives fail; the two positive controls in the same file (the declared label renders, the declared type: 'separator' still renders a separator) stay green — so the pin discriminates rather than just detecting a broken render. Restored: blob back to 7e45da19, git diff HEAD empty, 4 passed (4).

B — packages/types/src/__tests__/app-action-onclick-refusal-6854.test.ts asserts the measured clause survives, that the refusal is addressed to onClick with code: 'custom', and that the parse message and the .describe() metadata are still one string. It also pins the premise: the legacy mirror strips onClick and shortcut from an item rather than refusing them, which is why no author could ever have fed the cast.

Soften the shared clause in tombstone.zod.tsblob 8eaed046 → 4ff4ba1f, and:

pin under the mutation
the new pin Tests 2 failed | 4 passed (6)red
handler-keys-json-refusal-6124.test.ts (pre-existing) Tests 272 passed (272)green

That second row is the point: the clause this card measured had no guard at all before this PR. Restored: blob back to 8eaed046, git diff HEAD empty, both pins 278 passed (278).

Gates

Exit codes captured before any pipe (cmd > log 2>&1; EXIT=$?), all at HEAD 96fcb35, heavy runs through the container's shared verify lock (VERDICT command-exit read, never a bare $?).

Command Exit Evidence
pnpm exec vitest run packages/types/ 0 Test Files 112 passed (112) · Tests 1931 passed (1931)
pnpm exec vitest run packages/runner/ 0 Test Files 4 passed (4) · Tests 17 passed (17)
pnpm --filter @object-ui/types type-check 0 echoed tsc --noEmit && tsc -p tsconfig.examples.json && tsc -p tsconfig.test.json
pnpm --filter @object-ui/runner type-check 0 echoed tsc --noEmit && tsc -p tsconfig.test.json
pnpm --filter @object-ui/types build 0 rebuilt before every judgement, so no stale .d.ts was read
node scripts/check-changeset-presence.mjs 0 ✅ 5 source file(s) of 2 released package(s) changed, and this change declares 1 changeset(s)
node scripts/check-changeset-fixed.mjs 0 ✅ All workspace packages are in the changeset fixed group.
node scripts/check-changeset-no-major.mjs 0 ✅ No changeset declares a major bump.
node scripts/check-control-bytes.mjs 0 ✅ check-control-bytes: OK (scanned 6294 tracked text file(s); skipped 85 binary)
node scripts/check-vi-mock-specifiers.mjs · check-vi-mock-inherit.mjs · check-unreferenced-sources.mjs 0 derived from the diff (two new test files)
pnpm exec eslint . --format json 0 not narrowed — the whole repo ran: 4284 files, 0 errors. The five changed files carry 0 errors; the 7 warnings on them are pre-existing (NavItem's any props, two set-state-in-effect, MenuItemSchema typed as ZodType-of-ANY), and the deletion removed three no-explicit-any warnings rather than adding any

Both new test files were confirmed to be inside their package's type-check project by tsc -p tsconfig.test.json --listFiles, rather than assumed to be.

@object-ui/types is a dependency of all 43 workspace packages, so turbo ls --affected lists every one of them. Their suites were not run locally and are left to CI; the narrowing is declared, and the ground for it is the comment-only proof above — no behaviour, type shape or zod shape moved in packages/types, so no consumer's verdict can move.

Deviations, declared

  1. The shared handlerKeyRefusal template is unedited. The ruling's title asks for the message to be corrected "so it no longer claims no renderer reads this key"; its body and the dispatch both allow the other branch — make the claim true — which is what deleting the cast does. Reviewer's call if the title was meant literally; ablation B shows the sentence is now guarded either way.
  2. The message pin is a new file, not a row in handler-keys-json-refusal-6124.test.ts. That census is scoped to the nine #6124 mirror files and app.zod.ts is not one of them; adding AppActionSchema.onClick would move its asserted 22 retired / 66 total counts, which belong to that card. The pre-existing file is re-run here unchanged and stays green.
  3. Two packages/types doc comments were corrected beyond the literal instruction, because they carried a claim the deletion does not make true (above). Comment-only; no shape moves.

Out of scope, filed and reported

Drafted by the domain:spec @ objectui dev dispatch, session https://claude.ai/code/session_01BAZFhALsQsGqxui8sNqM8s — recorded here in prose as well, because a markdown-link footer is not measured to survive an edit of this body.


🤖 Generated with Claude Code

https://claude.ai/code/session_01BAZFhALsQsGqxui8sNqM8s


Generated by Claude Code

…he two `as any` reads

`LayoutRenderer` mapped a `type: 'user'` action's `items` and reached
`(item as any).onClick` and `(item as any).shortcut` — past the declared element
type, which is `AppMenuItem` and has neither key. The zod mirror parses the same
array with the legacy eight-member `MenuItemSchema`, which strips both in
silence, so no validated document could ever have supplied either.

Deleting the two reads is what makes `AppActionSchema.onClick`'s retirement
message true again: it tells an author "no renderer reads this key, so nothing
could ever run it", and one did. The shared `handlerKeyRefusal` template is left
alone — 22 other retired keys carry the same sentence, and the ruling asked for
the claim to be made true, not softened.

The rationale comments on `AppAction.onClick` and `AppActionSchema.onClick` said
"nothing reads `AppComponentSchema.actions[]`". That was false in the other
direction — the runner renders both the `'button'` and the `'user'` arm — so they
now say what was measured: `actions[]` is read, `onClick` is not.

Two pins, one per side of the claim: the runner drives a real menu with both
undeclared keys authored and requires neither to be read; `packages/types`
asserts the refusal message still carries the measured sentence.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BAZFhALsQsGqxui8sNqM8s
@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

✅ Console Performance Budget

Metric Value Budget
Eager closure (gzip, 50 chunks) 3186.1 KB 3191.4 KB
Main entry chunk (gzip) 143.2 KB 350 KB
Entry file index-DWqx4_Ic.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) 510.70KB 116.21KB
core (index.js) 6.96KB 2.79KB
create-plugin (index.js) 10.08KB 3.26KB
data-objectstack (index.js) 180.00KB 50.20KB
fields (index.js) 242.27KB 61.22KB
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.99KB 0.87KB
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 (useSpecGesture.js) 4.39KB 1.66KB
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) 47.87KB 13.31KB
plugin-charts (index.js) 70.92KB 19.75KB
plugin-chatbot (index.js) 196.37KB 46.41KB
plugin-dashboard (index.js) 132.87KB 34.68KB
plugin-designer (index.js) 212.86KB 43.19KB
plugin-detail (index.js) 250.55KB 64.06KB
plugin-editor (index.js) 2.46KB 1.10KB
plugin-form (index.js) 132.87KB 32.66KB
plugin-gantt (index.js) 167.26KB 41.00KB
plugin-grid (index.js) 209.29KB 56.78KB
plugin-kanban (index.js) 52.71KB 14.55KB
plugin-list (index.js) 113.28KB 27.59KB
plugin-map (index.js) 20.44KB 6.78KB
plugin-markdown (index.js) 13.93KB 4.81KB
plugin-report (index.js) 43.59KB 11.97KB
plugin-timeline (index.js) 30.84KB 8.85KB
plugin-tree (index.js) 9.20KB 3.19KB
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.73KB 2.28KB
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-justin
os-justin marked this pull request as ready for review September 5, 2026 11:49
@os-justin
os-justin added this pull request to the merge queue Sep 5, 2026
Merged via the queue into main with commit adb2a86 Sep 5, 2026
34 of 35 checks passed
@os-justin
os-justin deleted the claude/issue-6854-layout-renderer-retired-onclick branch September 5, 2026 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

contract: should AppAction.items be re-typed to the overlay MenuItem? — the runner reads two overlay fields through as any today

2 participants