Skip to content

fix(app-shell): client-evaluated condition mounts declare the roots their host binds (objectui#9856) - #10032

Merged
os-tesla merged 1 commit into
mainfrom
claude/issue-9856-client-mount-roots
Sep 19, 2026
Merged

os-tesla merged 1 commit into
mainfrom
claude/issue-9856-client-mount-roots

Conversation

@os-tesla

Copy link
Copy Markdown
Collaborator

Fixes #9856

The declared cost of objectui#9645, paid where it was measured. That change made a
scope="record" mount advertise RECORD_CONDITION_ROOTS — the set EVERY host of a
record-scoped condition binds — and said on its own face that a mount whose host binds
more would lose offers until it declared them. An action's visible / disabled is
evaluated in the browser, where the shell's buildExpressionScope publishes the
identity roots and the feature flags, so the two action mounts had been advertising two
roots while their evaluator answered six.

取数时刻 for every reading below: 2026-09-19T15:06Z – 15:30Z, worktree off
origin/main 5e5d6b245.

The mount enumeration — every non-test ConditionBuilder mount, its tier, its evidence

Seven mounts, found by the JSX tag across packages/ (six files; the action inspector
mounts two).

Mount Tier Evidence Action taken
ActionDefaultInspector — "Visible when" client CONDITION_HOST_BY_METADATA_TYPE rules action: 'client'; the browser path is useCondition over usePredicateRecordContext plus the ambient buildExpressionScope bag declares CLIENT_CONDITION_ROOTS
ActionDefaultInspector — "Disabled when" client same declares CLIENT_CONDITION_ROOTS
widgets.tsx — the schema-driven ConditionWidget polymorphic serves every metadata type by name convention; its tier is whatever CONDITION_HOST_BY_METADATA_TYPE rules for the type on screen takes a per-type list through the new WidgetContext.conditionRoots, derived by conditionRootsForMetadataType
HookDefaultInspector — "Run only when (optional CEL)" server table rules hook: 'server'; wrapDeclarativeHook evaluates against two bindings and throws otherwise unchanged — the default is already right
ObjectValidationsPanel — a rule's guard server table rules validation: 'server'; the rule validator evaluates against two bindings, fail-CLOSED unchanged (and outside this card's declared file surface)
PageBlockInspector — a block's visibleWhen NOT ESTABLISHED the table has no page row, and the mount deliberately passes no scope at all — so objectui#9645 never narrowed it and it still inherits the engine's own advertisement unchanged, reported rather than guessed
FlowNodeConfigField — a node's entry condition NOT ESTABLISHED no flow row in the host table; the mount passes no scope, so it too was never narrowed unchanged, reported rather than guessed

The 回翻条款 bites on the last two and it cost nothing to obey: neither was narrowed in
the first place, because offeredRoots only falls back to the record list when a mount
declares scope="record". Both are byte-for-byte unchanged.

How roots and subjects.context relate — and why they are not one prop

They read the SAME ruled table and take OPPOSITE arms of it, which is the finding this
PR reports rather than acts on unilaterally.

  • subjects.context is the row builder's only subject control. Its default carries
    user.*, so the tier that needs a declaration is the server one —
    conditionSubjectsForMetadataType narrows server and answers undefined elsewhere.
  • roots feeds the raw editor's autocomplete. Its default at scope="record" is already
    narrowed, so the tier that needs a declaration is the client one —
    conditionRootsForMetadataType widens client and answers undefined elsewhere.

Recommendation: do NOT unify them, and the asymmetry is why. Dropping an entry from
the subject list removes the author's ability to BUILD that row at all; dropping one from
roots removes a suggestion and never a spelling, because the accept set stays the
engine's own. The two controls therefore fail in different directions and deserve
different defaults. What could reasonably be unified is the derivation site, not the
props: the three conditionXForMetadataType functions now sit side by side reading one
table, which is where a future consolidation belongs. That is a judgement for the seat,
not an edit made here.

The one root this takes AWAY, deliberately

previous is no longer offered at the client mounts. No browser host binds it: the row
arrives alone through usePredicateRecordContext and the ambient scope publishes no
previous. Offering it there is the objectui#8155 shape — an editor advertising a root
nothing answers — so the predicate an author built from it could only fault. Server
mounts keep it. This half is pinned at the mount, not only in a docblock, because it is
the half a reader is most likely to take for an oversight.

Control reading — the new pins fail against today's behaviour and pass against this

Ablation on the committed tree: the declarations were deleted from the two action mounts
and from the widget's forwarding site (on-disk proof both ways — anchor occurrences
2 / 1 before, 0 / 0 after; restored by git checkout HEAD --, with git diff HEAD
empty and both blob hashes equal to HEAD's).

ablated (= today on origin/main)   Tests  4 failed | 9 passed (13)
    × offers every advertised root in "Visible when"
        AssertionError: "current_user" at "Visible when": expected [] to include 'current_user'
    × offers every advertised root in "Disabled when"
    × offers the roots only a browser host binds          (generic mount)
    × still withholds `previous`, which no browser host answers
        AssertionError: expected [ 'previous' ] to not include 'previous'

restored (= this branch)           Tests  13 passed (13)

The nine that stay green under ablation are the derivation and list-membership cases:
they judge the table and the list, which the ablation does not touch. The four that flip
are exactly the ones that read the real suggestion menu at a real mount.

Validation

  • pnpm exec vitest run on the two new files — 13 passed.
  • pnpm exec vitest run over the affected sibling suites (the three ConditionBuilder
    roots/subject pins, mountScope, the base and celGate suites, both ConditionWidget
    pins, ResourceEditPage.conditionScope, ActionDesigner.paramVocabulary,
    ActionDefaultInspector.celGate) — 13 files, 134 passed.
  • pnpm --filter @object-ui/app-shell type-check — exit 0, after building the dependency
    closure (pnpm --workspace-concurrency=2 --filter '@object-ui/app-shell^...' build,
    exit 0 under the shared verify lock).
  • pnpm exec eslint on the seven changed files — exit 0 (0 errors; the warnings are
    pre-existing no-explicit-any / react-refresh findings in widgets.tsx).
  • check:new-line-citations, check:control-bytes, check:test-path-roots,
    check:vi-mock-specifiers, check:vi-mock-inherit, check:vi-mock-override-shape,
    check:changeset-claims, check:pending-changeset-literals, check:unreferenced-sources,
    check:self-import, check:esm-specifiers — all exit 0.
    node scripts/check-changeset-presence.mjs — exit 0, one changeset declared.
  • check:readme-exports is NOT MEASURED locally: it exits 1 on an unbuilt tree with
    "its type entry is not on disk — run pnpm build first" for 86 self-imports across
    packages this diff does not touch. No README changed here.
  • Repo-wide pnpm lint and the full suite are CI's runs, not this branch's.

Acceptance notes

Noted, not filed — neither meets the three filing classes, and both are already carried
by an open card or by a docblock in the file a successor will open:

  • The action inspector's Conditions section hint promises predicates "over the record /
    user / ctx". Before this change that sentence disagreed with the dropdown; it now
    agrees, so there is nothing left to file. Carrier: this PR.
  • PageBlockInspector is the one mount whose tier is genuinely open, and it is open
    UPSTREAM rather than here — the engine has no page scope root, which that mount's own
    docblock records along with the objectstack-side card it waits on. Successor: none
    needed in this repo; the mount declares nothing and is unchanged.

Session reference, in prose because a footer does not reliably survive an edit:
https://claude.ai/code/session_018HrVaotisyhgmot9o2MLRq

🤖 Generated with Claude Code

https://claude.ai/code/session_018HrVaotisyhgmot9o2MLRq


Generated by Claude Code

…heir host binds

objectui#9645 narrowed a `scope="record"` `ConditionBuilder` mount to the roots
every host of a record-scoped condition binds, and named this cost on its face:
a mount whose host binds MORE loses the offers its evaluator really answers.
An action's `visible` / `disabled` is evaluated in the browser, where the
shell's expression scope publishes the identity roots and the feature flags.

The two curated action mounts and the generic schema-driven mount now declare
what their host binds. Which tier evaluates which metadata type is read from
the ruled host table rather than decided again here, through a third
derivation beside the lint scope and the subject vocabulary. `previous` is
withdrawn at those mounts in the same act, because no browser host binds it.

Server-evaluated mounts and every mount whose tier that table does not measure
are unchanged.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018HrVaotisyhgmot9o2MLRq
@github-actions

Copy link
Copy Markdown
Contributor

changeset-claim-re-read

⚠️ 5 pending changeset(s) describe a file this change touches

Their bodies publish verbatim into the CHANGELOG at the next release, so this is a request to re-read them against your diff — addressed here because you are the one seat that can answer it without re-deriving anything.

⛔ Nothing here blocks, and nothing here is a verdict on your change. This gate exits 0, is not a required context, and judges name resolution, never meaning: it asked whether a pending body names a file you touched. "Is this sentence still true?" is the one question it will not answer, and the one you are being asked to answer.

.changeset/6329-actionparam-one-authority.md

  • names ActionDefaultInspector.tsxpackages/app-shell/src/views/metadata-admin/inspectors/ActionDefaultInspector.tsx — edited by this change

    ActionParam has one authority again (objectui#6329). The name was declared three times, not twice as the card counted: @object-ui/types publishes it — derived from the spec's ActionParamSchema input, with its own parity suite — and ActionDefaultInspector.tsx and ActionPreview.tsx each carried a module-local interface of the same name. app-shell already read the published one elsewhere (utils/resolveActionParams.test.ts), so both locals were shadows. They are deleted, not reconciled against each other, under the 2026-08-25 family ruling 甲A1.

.changeset/7125-dashboard-empty-state-keys-retired.md

  • names widgets.tsxpackages/app-shell/src/views/metadata-admin/widgets.tsx — edited by this change

    Not touched: table.noRows ('No rows to display') and engine.form.noRows (packages/app-shell/src/views/metadata-admin/i18n.ts, read at widgets.tsx) — two different, same-named keys in different namespaces. Nor the comments in WidgetEmptyState.tsx, DatasetWidget.tsx, ObjectDataTable.tsx and PivotTable.tsx that record WHY three widgets with three strings became one shared empty state; the packs' own comment keeps that rationale and now names the retirement instead of a row that is gone.

.changeset/8218-studio-property-panel-de-developerize.md

  • names widgets.tsxpackages/app-shell/src/views/metadata-admin/widgets.tsx — edited by this change

    SchemaForm + widgets.tsx were written for an administrator editing metadata. Studio's interface panel renders the very same form for someone who has never seen a JSON Schema, so four developer habits landed inside an otherwise fully Chinese surface. Same cause, one pass:

.changeset/9952-condition-placeholder-derives-from-offered-roots.md

  • names conditionScope.tspackages/app-shell/src/views/metadata-admin/conditionScope.ts — edited by this change

    The placeholder was a string literal — record.status != 'done' && user.isAdmin — handed to CelPredicateField at every mount, scope or no scope. The same component had already narrowed a record-scoped mount's autocomplete to RECORD_CONDITION_ROOTS (objectui#9645), which carries no user, and narrowed that mount's subject dropdown the same way (objectui#9855). At such a mount user is not merely unadvertised: conditionScope.ts states that a hook condition and a validation rule's guard are evaluated with { record, previous } and only those, fail-CLOSED at the validation host, and objectstack's wrapDeclarativeHook docblock says the condition formula is evaluated against two bindings, record and previous. So the one line an author reads before typing anything taught a root the evaluator never binds, and copying it cost the author the write.

.changeset/formfieldspec-dependson-5040.md

  • names widgets.tsxpackages/app-shell/src/views/metadata-admin/widgets.tsx — edited by this change

    FormFieldSpec — the authoring type for a metadata-admin form layout, the element type of FormSectionSpec.fields[] — did not declare dependsOn. widgets.tsx held a second, inline description of the same object as WidgetProps.fieldSpec, and that one did, because two registered widgets read it as their primary configuration: field-selector resolves dependsOn || reference || 'objectName' to decide whose field catalog to offer, and dynamic-config uses it to pick a sub-schema out of WidgetContext.dynamicSchemas. One value travelling down one channel, described twice, disagreeing on the one key that decides what those widgets show — so

Read the paragraph, not the line: both false halves of the objectui#8617 claim sat in one paragraph, and correcting either alone would have left it asserting the same wrong thing.

If a claim did go false, correct the body. That is precedented and prose-only, frontmatter untouched; check-changeset-overwrite.mjs will report the correction as its own case 2 ("correcting a declaration on purpose … legitimate"), which is the intended shape — one gate asks for the read, the other records the write.

Not covered, stated so nobody reads this as more: a born-false claim that spells no line address at all (objectui#9495 coordinated one by ORDINAL — "a grep finds that member first" — and deciding that means reading what the sentence means), a claim spelled as a symbol or a package rather than a backticked file name, and a file named ambiguously.

Compared the checked-out tree with 5e5d6b245 (merge-base with origin/main): 7 file(s) changed outside .changeset/, read against 1215 pending declaration(s) that publish a body (1775 pending in total). · run

@github-actions

Copy link
Copy Markdown
Contributor

✅ Console Performance Budget

Metric Value Budget
Eager closure (gzip, 329 chunks) 3056.5 KB 3104.5 KB
Main entry chunk (gzip) 145.7 KB 350 KB
Entry file index-B2P06xsn.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) 16.69KB 6.21KB
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) 11.08KB 4.58KB
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) 545.92KB 130.72KB
core (index.js) 8.94KB 3.59KB
create-plugin (index.js) 27.94KB 9.51KB
data-objectstack (index.js) 216.90KB 60.15KB
fields (index.js) 249.62KB 63.02KB
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) 8.87KB 3.64KB
i18n (index.js) 5.22KB 2.26KB
i18n (pickLocalized.js) 9.86KB 3.95KB
i18n (provider.js) 32.15KB 10.49KB
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.83KB 10.95KB
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) 5.52KB 2.10KB
mobile (useTouchTarget.js) 1.01KB 0.54KB
permissions (MePermissionsProvider.js) 13.52KB 4.88KB
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) 8.39KB 3.10KB
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) 14.81KB 3.63KB
plugin-calendar (index.js) 50.26KB 14.36KB
plugin-charts (index.js) 71.73KB 20.08KB
plugin-chatbot (index.js) 198.20KB 47.14KB
plugin-dashboard (index.js) 132.96KB 35.17KB
plugin-designer (index.js) 215.94KB 44.33KB
plugin-detail (index.js) 255.18KB 66.49KB
plugin-editor (index.js) 2.23KB 1.05KB
plugin-form (index.js) 139.56KB 35.40KB
plugin-gantt (index.js) 167.62KB 41.26KB
plugin-grid (index.js) 213.44KB 58.21KB
plugin-kanban (index.js) 48.71KB 15.17KB
plugin-list (index.js) 113.55KB 27.99KB
plugin-map (index.js) 21.48KB 6.99KB
plugin-markdown (index.js) 13.88KB 4.80KB
plugin-report (index.js) 43.41KB 11.93KB
plugin-timeline (index.js) 30.68KB 8.95KB
plugin-tree (index.js) 10.58KB 3.72KB
plugin-view (index.js) 85.18KB 21.05KB
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) 109.04KB 36.08KB
react (data-invalidation.js) 5.05KB 2.08KB
react (index.js) 4.63KB 2.18KB
react (schema-input.js) 4.25KB 2.04KB
react (spec-input.js) 0.20KB 0.18KB
sdui-parser (body-dialect.js) 4.38KB 1.98KB
sdui-parser (codegen.js) 6.58KB 2.74KB
sdui-parser (dashboard-widget-options.js) 3.08KB 1.30KB
sdui-parser (index.js) 5.74KB 2.54KB
sdui-parser (input-type.js) 2.84KB 1.40KB
sdui-parser (kanban-quick-add.js) 3.89KB 1.87KB
sdui-parser (parse.js) 25.28KB 7.80KB
sdui-parser (provenance.js) 3.66KB 1.82KB
sdui-parser (types.js) 0.28KB 0.23KB
sdui-parser (validate.js) 15.71KB 5.30KB
types (ai.js) 4.11KB 2.06KB
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.93KB 1.49KB
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 (expression.js) 0.20KB 0.18KB
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 (strict-authoring-face.js) 14.04KB 5.36KB
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-tesla
os-tesla marked this pull request as ready for review September 19, 2026 15:48
@os-tesla
os-tesla added this pull request to the merge queue Sep 19, 2026
Merged via the queue into main with commit 030a675 Sep 19, 2026
38 checks passed
@os-tesla
os-tesla deleted the claude/issue-9856-client-mount-roots branch September 19, 2026 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

2 participants