Skip to content

feat(types): restate AppComponentSchema.hidden as the spec's app-catalogue boolean (objectui#7542) - #7782

Merged
os-justin merged 2 commits into
mainfrom
claude/issue-7542-app-hidden-catalogue-flag
Sep 5, 2026
Merged

feat(types): restate AppComponentSchema.hidden as the spec's app-catalogue boolean (objectui#7542)#7782
os-justin merged 2 commits into
mainfrom
claude/issue-7542-app-hidden-catalogue-flag

Conversation

@os-justin

Copy link
Copy Markdown
Collaborator

Fixes #7542

What moves

AppComponentSchema.hidden on the TypeScript face is restated as boolean — the spec's app-catalogue flag — instead of the boolean | ExpressionWire hide predicate every other node inherits from BaseSchema. Direction 1 of the card, dispatched by the domain:spec seat under a declared veto window (the claim comment on the card); no maintainer ruling exists on the card, and direction 2 (renaming the catalogue flag upstream in @objectstack/spec) stays open as the alternative.

Tier CONTRACT_REVIEW_TIER, Clause-② yes: a published TS face narrows on one node. The validator's accept set does not move.

The collision, measured

On the app node two keys share one name and mean different things:

  • BaseSchema.hidden — the renderer's hide predicate (boolean | ExpressionWire; objectui#7455 widened it to the string, objectui#7530 to the CEL envelope), evaluated by SchemaRenderer's shouldHide chain.
  • @objectstack/spec/ui AppSchema.hidden — the app-catalogue flag, described by the spec as "Hide from the App Switcher; the shell surfaces hidden apps via the avatar menu instead (navigation only — never an access gate)".

packages/types/src/zod/app.zod.ts builds the mirror as BaseSchema.extend(SpecAppFields.shape).extend(...), and SpecAppFields = specFieldsExcept(SpecAppSchema.shape, ['name', 'label', 'description', 'navigation', 'areas', 'contextSelectors']) does not exclude hidden, so the spec's boolean lands after the base's key and overrides it. packages/types/src/app.ts restated nothing and inherited the base's union: the published declaration invited a spelling the published validator refused.

Spec side, through the installed pin (@objectstack/spec@17.2.0, ui entry, resolved from packages/types/node_modules): AppSchema.shape has 30 keys; hidden is present as optional(boolean); visible and disabled are ABSENT (the strict schema refuses them as unrecognized_keys); control keys label and active present. AppSchema.safeParse with hidden: true / false → OK; with the predicate string → invalid_type at hidden, "expected boolean, received string"; with the CEL envelope object → invalid_type at hidden, "expected boolean, received object".

Both entry paths, BEFORE editing (source via tsx, origin/main 669d71b), document { type: 'app', name: 'crm', label: 'CRM', hidden: VALUE }:

value AppComponentSchema.safeParse safeValidateSchema
true / false OK OK
predicate string REFUSED — invalid_type at path hidden, expected boolean REFUSED — root invalid_union; the app arm carries the same hidden issue
CEL envelope object REFUSED — invalid_type at path hidden, expected boolean, received object REFUSED — root invalid_union, same arm issue

Controls, same run: BaseSchema and ButtonSchema accept the string and the envelope on hidden; safeValidateSchema accepts a button with the string. The refusal is the app arm's, not the union's.

AFTER (runtime): identical — the validator did not move. What moved is the declaration: AppComponentSchema['hidden'] now reads boolean | undefined, and a predicate string on a typed app document is a compile error.

The in-repo reader agrees with the boolean. filterActiveApps (packages/app-shell/src/utils/appRoute.ts) keeps an app out of the launcher on a?.hidden !== true and never evaluates the value; UnifiedSidebar.tsx filters the switcher the same way. A predicate string on this node would have read as "not hidden" without a sound. No source in packages/app-shell, packages/layout or apps/console authors hidden on an app-typed document (the only AppComponentSchema consumer, useNavigationSync.ts, spreads navigation and writes no hidden).

New fact for the next author (triage's requirement): an app node cannot use the predicate spelling every other node accepts. That is not a bug in this PR; it is the spec's key winning on this node on both faces. The renderer's hidden predicate on every other node is unchanged, and BaseSchema.hidden is untouched.

Files

  • packages/types/src/app.ts — the AppComponentSchema block only: hidden?: boolean; with the docblock naming the collision, the spec reading, both refusals, the in-repo reader, direction 1 and direction 2, and the pin. Every other member kept.
  • packages/types/src/__tests__/zod-mirror-parity.test.ts — the one KnownDrift row 'app.zod.ts#AppComponentSchema': 'hidden' (with its docblock) deleted, because the drift is gone: both faces read boolean. Header counts 42 / 6341 / 62 with a history sentence ADDED in the cumulative style (the ledger's first shrink on a SPEC-DERIVED pair, and the first by moving the declared face toward the mirror); the pointer "see that entry" in the objectui#7455 history line now reads "the entry objectui#7542 removed, above". Nothing else in the file. ⛔ The row went only because the face moved — leg B of the ablation below proves the ledger would have refused the deletion alone.
  • packages/types/src/__tests__/app-hidden-catalogue-flag-7542.test.ts — new pin (8 tests): invariant Equal of AppComponentSchema['hidden'] with boolean | undefined, controls that BaseSchema['hidden'] is still boolean | ExpressionWire | undefined and ButtonSchema['hidden'] equals it; a @ts-expect-error on a predicate string authored on a typed app document; the mirror accepting true / false and refusing the string and the envelope AT PATH hidden on both entry paths (union arm errors flattened); controls on BaseSchema, ButtonSchema and the union path with a button; the spec reading live through the pin with control key active; the KnownDrift row absent, read off disk, beside a control that the reader sees the ledger (CalendarViewSchema row) and that the pair is still registered in MIRRORS.
  • .changeset/app-hidden-catalogue-flag-7542.md@object-ui/types: minor, naming the collision, the ruling direction, the TS-only breaking edge, and that authored JSON metadata and every other node are unaffected.
  • app.zod.ts untouched (direction 3 forbidden); BaseSchema untouched on both faces; docs — measured, no row exists: the three hidden hits in content/docs/core/app-schema.mdx are all AppMenuItem.hidden (navigation items), and app-shell.mdx / schema-reference.md list no hidden on the app node, so no docs row moved.

Gates (exit codes captured before any pipe; heavy runs under the shared verify lock; final union at 1d3074f8, the merged head)

gate exit verdict
pnpm --filter '@object-ui/types^...' build (dependency closure) 1 ERR_PNPM_RECURSIVE_RUN_NO_SCRIPT — the closure is @object-ui/test-support, which has no build script; nothing to build, not a red
pnpm --filter @object-ui/types build 0 dist completeness: 1 package(s) complete (124 emitted files verified)
pnpm --filter @object-ui/types type-check (three tsc projects incl. tsconfig.test.json) 0 clean
pnpm exec vitest run --maxWorkers=2 packages/types/ 0 Test Files 126 passed (126) · Tests 2233 passed (2233)
pnpm --filter @object-ui/types lint 0 0 errors; the 270 pre-existing no-explicit-any warnings name none of the four touched files
node scripts/check-changeset-presence.mjs 0 3 source file(s) of 1 released package(s) changed, and this change declares 1 changeset(s)
check-changeset-fixed / -no-major / -overwrite 0 / 0 / 0 green
node scripts/check-control-bytes.mjs 0 OK (scanned 6342 tracked text file(s))
pnpm check:spec-symbols / check:doc-types / check:doc-fences 0 / 0 / 0 green
governed-surface predicate (check-governed-merges.mjs --test, objectstack d701e65, on the final four paths) 0 0 of 4 path(s) hit the register — NOT governed
pnpm --filter @object-ui/app-shell type-check (read-only, the app node's consumer) 2 NOT MEASURED — 934 TS2307 Cannot find module '@object-ui/components' … errors: app-shell resolves its 29 sibling packages through their dist declarations, which a fresh worktree does not have, and the closure build does not fit the foreground cap. Zero of the 934 errors mention hidden or AppComponentSchema. Declared narrowing: the grep sweep above stands in (no consumer authors hidden on an app-typed document), and CI's type-check farm measures it

node scripts/check-doc-links.mjs not run: no docs row moved.

Ablation — red-first, both directions, blob-hash proof (under the lock, at 6bd44196, trap-restored, absolute paths)

  • Leg A — app.ts reverted to the base blob (git checkout 669d71bf -- packages/types/src/app.ts; on disk git hash-object = 14d12b7c… = the base blob, hidden?: boolean; count 0): tsc -p tsconfig.test.json exit 2 with exactly three errors — app-hidden-catalogue-flag-7542.test.ts(99,3) TS2344 Type 'false' does not satisfy the constraint 'true' (the Equal leg), (186,5) TS2578 Unused '@ts-expect-error' directive, and zod-mirror-parity.test.ts(1849,14) TS2322 Type '"app.zod.ts#AppComponentSchema"' is not assignable to type 'never' — the parity file naming the pair. vitest on the two files stayed green (26/26): the mutation is on the TS face and the runtime legs measure the mirror, which is the expected direction, reported as observed. Restored with git checkout HEAD -- PATH: hash = b4010c1e… = the HEAD blob, count 1, git diff HEAD empty.
  • Leg B — the KnownDrift row put back with the face narrowed (git checkout 669d71bf -- zod-mirror-parity.test.ts; hash = 6a35c73e… = the base blob, row count 1): tsc -p tsconfig.test.json exit 2 with one error — zod-mirror-parity.test.ts(1871,14) TS2322 Type '"app.zod.ts#AppComponentSchema"' is not assignable to type 'never' (recorded drift, none measured); vitest exit 1, 1 failed | 25 passed — the new pin's ledger leg. Restored: hash = 9147eee6… = the HEAD blob, row count 0, git diff HEAD empty, git status clean.
  • Resolution path: every leg imports source (../app, ../zod/app.zod, tsconfig.test.json), no dist in the loop, so the dist preflight does not apply; the on-disk proof is the blob hash and the grep counts above.

Overlap

origin/main merged before opening (1d3074f8 = this branch ∪ 1b69ca58, PR #7776 for objectui#7279, which edits other regions of zod-mirror-parity.test.ts — merge was clean, no conflict; its new describe pins the UnmirroredDeclared split figures and reads nothing from KnownDrift). The final union above ran on the merged head. objectui#7530 is not folded in (different question: the envelope object on three keys); objectui#7455 and objectui#4581 / objectui#4580 are referenced only.

Why direction 1, on the four axes (for the veto window)

  • Real business need — measured: the only in-repo readers of the app node's hidden (filterActiveApps, UnifiedSidebar) treat it as the catalogue boolean; nobody authors a predicate on an app node; the spec's producer declares a boolean. Direction 1 declares what is read and validated.
  • Long-term architecture — contract-first: the spec-derived mirror already enforces the boolean; direction 1 aligns the declaration with the contract instead of adding a local divergence (direction 3) — direction 2 is the cleaner protocol but a cross-repo spec change with its own producers, left open.
  • Harder for an AI to write wrong — the TS face stops inviting a spelling the validator refuses; the compile error lands where the metadata is authored.
  • No requirement spread at the startup stage — one restated member, one ledger row, one pin; no new capability, no transition window, reversible by one revert.

Placeholders in this body are spelled as words (PATH, VALUE) because the GitHub sanitizer strips angle-bracket shapes on save. Session: https://claude.ai/code/session_01BAZFhALsQsGqxui8sNqM8s.


🤖 Generated with Claude Code

https://claude.ai/code/session_01BAZFhALsQsGqxui8sNqM8s


Generated by Claude Code

…logue boolean (objectui#7542)

On the app node two keys share the name `hidden`: BaseSchema's renderer
hide predicate (`boolean | ExpressionWire`) and the spec AppSchema's
app-catalogue flag (`z.boolean().optional()`, "Hide from the App
Switcher"). The zod mirror takes the spec's key by reference through
SpecAppFields, which lands after the base's and overrides it, so the
validator has always refused a predicate on an app document; the TS
interface restated nothing and inherited the base's union, inviting the
spelling the validator refused. Direction 1 of the card: restate
`hidden?: boolean` on the TS face so the declaration says what the
validator enforces.

- packages/types/src/app.ts: `hidden?: boolean` with the docblock naming
  the collision, both refusals, the in-repo reader (`filterActiveApps`,
  `hidden !== true`) and direction 2 as the open alternative.
- zod-mirror-parity.test.ts: the KnownDrift row objectui#7455 seeded for
  `app.zod.ts#AppComponentSchema` is removed because the drift is gone
  (both faces read boolean); header counts 42/63 -> 41/62 with the
  history sentence added, not rewritten.
- new pin app-hidden-catalogue-flag-7542.test.ts: invariant Equal on the
  app node plus base/button controls, a ts-expect-error on a predicate
  string, both entry paths refusing string and CEL envelope at path
  `hidden`, the spec reading live through the installed pin with a
  control key, and the ledger row absent read off disk.
- changeset: @object-ui/types minor.

Measured on @objectstack/spec@17.2.0 through the installed pin:
AppSchema.shape.hidden is optional(boolean); visible/disabled absent.

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) 3187.3 KB 3191.4 KB
Main entry chunk (gzip) 143.2 KB 350 KB
Entry file index-lJGBJwwE.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.60KB 116.20KB
core (index.js) 6.96KB 2.79KB
create-plugin (index.js) 10.08KB 3.26KB
data-objectstack (index.js) 182.08KB 50.62KB
fields (index.js) 242.44KB 61.25KB
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.19KB 46.37KB
plugin-dashboard (index.js) 132.88KB 34.69KB
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 (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 (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

Copy link
Copy Markdown
Collaborator Author

needs:contract-review cleared (2026-09-05T17:51Z) — provenance: in-seat contract review at tier PASSED on head 1d3074f8, recorded on the card as objectui#7542 comment 5553667716 (carries the Implemented-by: / Reviewed-by: pair and the three-item judgment; direction 1 under the veto window declared on the claim). Cleared by the domain:spec execution seat, session session_01BAZFhALsQsGqxui8sNqM8s, via read-current → write-union-minus-target → read-back (read-back at 17:51Z: package: types, tests; the carrier absent; head 1d3074f8). The flip waits for every check run on 1d3074f8 to complete green (farm started 17:45Z; re-check armed). If this head moves, the label is re-hung and the delta re-reviewed before any flip.


Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

2 participants