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

fix(core): narrow validateSchema's published parameter to unknown - #8880

Merged
huangyiirene merged 1 commit into
mainfrom
claude/issue-8416-validate-schema-unknown-param
Sep 10, 2026
Merged

huangyiirene merged 1 commit into
mainfrom
claude/issue-8416-validate-schema-unknown-param

Conversation

@claude

@claude claude Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Fixes #8416

validateSchema in @object-ui/core took schema: any — a bare any on a published
parameter. This narrows it to unknown and makes the implementation narrow the value
before it reads a key off it.

The card's premise, measured before relying on it

The card graded this cheap on one argument: for a parameter, any to unknown is
caller-compatible, so the cost lands inside the implementation. It supplied its own
falsifier — if the return type or generics thread the parameter's any outward, it stops
being caller-compatible
. Measured, not inherited:

reading result
generics on validateSchema none — the function is not generic
return type the concrete SchemaNodeValidationResult, which names no parameter type
published declaration delta one token: validateSchema(schema: any, path?: string) becomes validateSchema(schema: unknown, path?: string)
new exported symbols none — SchemaNodeUnderValidation and isSchemaNodeShape are module-private and appear in no published .d.ts (grepped across every packages/*/dist)
call sites outside packages/core one: packages/react/src/SchemaRenderer.tsx:84, which passes a value already typed any. It needed no change — @object-ui/react type-check and its two SchemaRenderer suites (49 tests) pass untouched

The falsifier does not fire, and the re-grade trigger was not hit. No call site outside
this package moved.

The half that is not a type annotation

validateSchema calls four rules unconditionally and only one of them ever checked it
had an object. validateBaseSchema refused a non-object and returned; validateRetiredNodeType
used optional chaining; but validateFormSchema read schema.type and validateChildren
read schema.children straight through. So, measured on 256c709e2 before the change:

validateSchema(null)       ->  TypeError: Cannot read properties of null (reading 'type')
validateSchema(undefined)  ->  TypeError: Cannot read properties of undefined (reading 'type')
isValidSchema(null)        ->  the same TypeError, from a function documented "@returns True if the value is a valid schema"
assertValidSchema(null)    ->  the same TypeError, in place of its own `Schema validation failed:` refusal

SchemaRenderer wraps its call in a try/catch commented "Validator itself failed —
surface but don't crash render"
. That catch is where the crash was landing in the one
shipped consumer.

The guard now runs once, in validateSchema, before any rule reads a key; the four
rules take a narrowed node type whose keys are all unknown. The same defect one level
down goes with it: a null entry inside a form's fields array threw the same way.

Accept-set delta — 29 cases, diffed before and after

Both matrices were produced from a real build: the pre-change one by restoring the base
file, rebuilding @object-ui/core, confirming the mutation reached dist/ (dist declared
validateSchema(schema: any), then probing.

25 of 29 identical. The four that moved:

case before after
null THREW TypeError INVALID_SCHEMA at schema
undefined THREW TypeError INVALID_SCHEMA at schema
{ type: 'form', fields: [null] } THREW TypeError MISSING_FIELD_NAME at schema.fields[0]
{ type: 'form', fields: [namedFunction] } valid: true MISSING_FIELD_NAME at schema.fields[0]

The first three are a crash becoming the documented refusal. The fourth is a genuine
refusal-set widening
and it is why this is declared Clause-②: yes below: a named
function satisfied field.name through Function.prototype.name. It is a corner JSON
cannot express, and function values on this family's mirrors are already refused
(objectui#6124) — but that changeset names @object-ui/types' zod validateSchema, not
this structural one, so there is no published contract text that already covers it.

Everything else holds: an array node keeps MISSING_REQUIRED (typeof [] is 'object',
and the replaced guard let it through too), primitives keep their single INVALID_SCHEMA,
null holes inside children are still skipped, the body dialect still resolves, nested
retired types are still refused by path, and no new error code is emitted.

Verification

Every command was run from the repo root. Readings are quoted from each tool's own verdict
line, and the union below was run at f5cb148f5, the final commit.

Ablation — from the committed tree, mutation proved on disk first. The mutation is
git checkout 256c709e2 -- packages/core/src/validation/schema-validator.ts, i.e. reverting
the narrowing wholesale.

  • on-disk proof: marker isSchemaNodeShape 7 to 0, schema: unknown 1 to 0; blob hash
    3802177 to e27f547, equal to the base blob and different from the head blob.
  • the vitest leg resolves ../schema-validator.js to package source, not dist — no
    build sits between the mutation and the run.
  • 6 tests go red, by name:
    • takes every value UNCAST, which is what makes the narrowing caller-compatible
    • `validateSchema(null)` returns INVALID_SCHEMA instead of throwing a raw TypeError
    • `validateSchema(undefined)` returns INVALID_SCHEMA instead of throwing a raw TypeError
    • `isValidSchema(null)` answers `false`, which is the boolean its docblock promises
    • `assertValidSchema(null)` throws the validator's OWN refusal, not a TypeError
    • a `null` entry inside `fields` is REPORTED, not thrown on
  • control: 138 tests stay green, including all 64 pre-existing tests in
    schema-validator.test.ts, predicate-valued-gate-rules.test.ts and
    form-field-widget-namespace.test.ts, plus this file's own five behaviour-preservation
    cases. The mutation is surgical; the harness is live.
  • restored by state: git diff HEAD empty and the blob back at 3802177.

The type-level half fires under tsc, not vitest, and is shown doing it. The pin is a
compile-time refusal (the mechanism objectui#3181 established for this package), and
tsc -p tsconfig.test.json --listFiles confirms the file is in that program (1 hit of 234).
Under the same mutation:

src/validation/__tests__/unknown-schema-param-8416.test.ts(74,11): error TS2322: Type 'true' is not assignable to type 'never'.

Gate enumeration, on both axes. Asked which tests read this file or path, and
separately what lines did my change move.

  • Content axis. scripts/__tests__/body-dialect-census.test.ts:198 asserts this file still
    contains the literal schema.children || schema.body. It does — the narrowing kept that
    expression byte-identical. Green.
  • Position axis. scripts/check-doc-example-types.mjs keys its ledger by path:line symbol,
    and two rows point into this file. My diff moved both JSDoc blocks down, so the rows were
    re-derived from the file: 490 to 550 (assertValidSchema) and 515 to 575
    (isValidSchema). Verdicts and codes unchanged. Same precedent as the objectui#8738 row
    already in that file.
    Control that moves when the change is wrong: reverting just the 550 row back to 490
    makes check:doc-examples exit 1 with STALE LEDGER ROW ...:490 assertValidSchema and
    UNDECLARED FAILURE ...:550 assertValidSchema. The row edit is load-bearing, not cosmetic.

Runs.

command verdict
turbo run build $(node scripts/check-doc-snippet-types.mjs --build-filter) --concurrency=2 35 successful, 35 total
pnpm --filter @object-ui/core run type-check exit 0 (tsc --noEmit && tsc -p tsconfig.test.json)
pnpm --filter @object-ui/react run type-check exit 0
pnpm exec vitest run packages/core/src/validation/ Test Files 8 passed · Tests 144 passed
pnpm exec vitest run on the two SchemaRenderer gate-diagnostic suites Tests 49 passed
pnpm exec vitest run scripts/__tests__/body-dialect-census.test.ts scripts/__tests__/check-doc-example-types.test.ts scripts/__tests__/check-doc-example-shared-reader.test.ts Test Files 3 passed · Tests 87 passed
node scripts/check-doc-example-types.mjs exit 0 — "Every covered @example compiles, or fails exactly as its ledger row declares."
node scripts/check-control-bytes.mjs exit 0 — scanned 7072 tracked text file(s)

Lint — the complete units, not a narrowing. CI's lint job runs pnpm lint (turbo, per
package) plus lint:root. My diff lives in exactly two of those units and both were run
whole: @object-ui/core (234 files, 0 errors) and the root scope (305 files, 0
errors, and scripts/check-doc-example-types.mjs confirmed present in the population).
File counts are read from eslint's own --format json output. Type-aware linting is not
enabled anywhere in eslint.config.js (zero occurrences of project), so this diff cannot
move the verdict of any file it does not itself contain — the other package units are
provably unaffected rather than merely unrun. The five surviving
@typescript-eslint/no-explicit-any warnings in this file are all pre-existing and on lines
this diff does not touch; the file's bare : any count drops 13 to 5.

Ratchets: none moved, measured. KNOWN_BARE_ANY_EXAMPLES in
scripts/check-skill-examples.mjs is an empty set whose SCAN_ROOTS are skills and
.claude/skills — it cannot see packages/**. A repo-wide grep for BARE_ANY / bare-any
finds that script and its own test and nothing else, so there is no other bare-any ratchet
to move. No baseline was edited.

Governed surface: none touched. node scripts/check-governed-queue-guard.mjs --test on
all four changed paths answers NOT GOVERNED — 4 path(s) checked against 5 governed surface(s); none matched.

Clause-②: yes

Judged here, not inherited. The mechanical floor is clear: no new exported symbol and
no new key on a published payload (both grepped, above). What tips it is the fourth row
of the accept-set matrix — one input that validated before and is refused now. A no would
have to cite published contract text that already declares that refusal; objectui#6124 is
the closest and it names a different symbol in a different package. Genuinely unsure, so:
yes. The needs:contract-review label is on this PR and on the card.

⚠️ The Clause-②: line could not be added to the claim comment — the dispatching seat has
no comment-edit tool (objectstack#17213) — so this section and the report are where the
declaration lives. A second claim comment was deliberately not posted.

⚠️ node scripts/pm/check-widening-tells.mjs was not used as evidence. Its bare CLI has
no repo flag and always judges as objectstack (objectstack#17217), and using the exported
judge with repo set correctly does not rescue it here: the control fires as expected
(packages/types/src/zod/form.zod.ts is covered as objectui, not covered as objectstack),
and under that same correct repo none of this diff's four files is covered by any
surface row. The tool has nothing to say about these paths in either direction.

验收备注

Observations found while reading the file. None is filed, and none is in this PR.


🤖 Generated with Claude Code

https://claude.ai/code/session_01611D6ZaRaMmwTNQmSbk8MH


Generated by Claude Code

…jectui#8416)

`validateSchema(schema: any)` was a bare `any` on a published parameter. The
declaration moves by one token to `schema: unknown`, and every value is still
assignable, so no call site outside `@object-ui/core` had to move: the function
is not generic and returns the concrete `SchemaNodeValidationResult`, which
names no parameter type.

The half with teeth is the implementation. `validateSchema` calls four rules
unconditionally and only `validateBaseSchema` ever checked that it had an
object, so `validateFormSchema` (`schema.type`) and `validateChildren`
(`schema.children`) read straight through and `validateSchema(null)` threw a raw
`TypeError` instead of returning the `INVALID_SCHEMA` result its own contract
promises. The single guard now runs once, in `validateSchema`, before any rule
reads a key; the four rules take a narrowed `SchemaNodeUnderValidation` whose
keys are `unknown`. A `null` entry inside a form's `fields` array threw the same
way and is now reported as `MISSING_FIELD_NAME`.

No verdict that already existed changes: the guard's accept set is the one it
replaces, spelled the same way, and a 29-case matrix diffed before and after
shows every difference is a value that used to throw.

`scripts/check-doc-example-types.mjs`: the two `schema-validator.ts` ledger rows
are re-derived (490 -> 550, 515 -> 575) because their keys carry a line number
and this diff moved those JSDoc blocks. Verdicts unchanged.

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

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

✅ Console Performance Budget

Metric Value Budget
Eager closure (gzip, 50 chunks) 3487.0 KB 3512.7 KB
Main entry chunk (gzip) 144.1 KB 350 KB
Entry file index-CIUgdv-0.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) 500.23KB 114.67KB
core (index.js) 7.48KB 2.96KB
create-plugin (index.js) 26.68KB 8.94KB
data-objectstack (index.js) 198.39KB 55.29KB
fields (index.js) 246.94KB 62.28KB
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) 6.57KB 2.76KB
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.84KB 10.94KB
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) 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) 49.03KB 13.93KB
plugin-charts (index.js) 71.39KB 19.92KB
plugin-chatbot (index.js) 194.54KB 46.34KB
plugin-dashboard (index.js) 131.50KB 34.45KB
plugin-designer (index.js) 215.51KB 44.29KB
plugin-detail (index.js) 252.45KB 65.33KB
plugin-editor (index.js) 2.23KB 1.05KB
plugin-form (index.js) 136.26KB 34.13KB
plugin-gantt (index.js) 166.96KB 40.93KB
plugin-grid (index.js) 210.86KB 57.28KB
plugin-kanban (index.js) 57.53KB 16.46KB
plugin-list (index.js) 112.73KB 27.69KB
plugin-map (index.js) 20.49KB 6.83KB
plugin-markdown (index.js) 13.88KB 4.80KB
plugin-report (index.js) 43.42KB 11.92KB
plugin-timeline (index.js) 30.10KB 8.74KB
plugin-tree (index.js) 9.55KB 3.32KB
plugin-view (index.js) 84.54KB 20.84KB
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) 6.58KB 2.74KB
sdui-parser (dashboard-widget-options.js) 3.08KB 1.30KB
sdui-parser (index.js) 5.55KB 2.45KB
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) 13.64KB 4.59KB
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.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.27KB 5.47KB
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

Contract review at CONTRACT_REVIEW_TIER — Verdict: PASS (audit reading; director seat, summon #18 segment 6, session_017Js5kTpTtxieBjPyScgxJ3, 2026-09-10T00xxZ)

PR objectui#8880 · head f5cb148f5003d1a62c805ea0e9cee118c9e200db (re-read at posting 00:18:22Z; unchanged since 18:41Z) · card objectui#8416.

  • Reviewed-by: isolated claude-fable-5-1 subagent, transcript-verified (82 harness model stamps, all claude-fable-5-1, zero residue; positive control 70 assistant / 48 user role tokens), adopted verbatim below.
  • Implemented-by: session_01611D6ZaRaMmwTNQmSbk8MH · branch claude/issue-8416-validate-schema-unknown-param (newest Claim: 5606527326, PM-dispatched under os-zhuang). Distinct sessions ⇒ not a self-review.
  • Reading for the seat: PASS, no rework; one optional runtime pin (F4, the named-function-in-fields accept→refuse row). Landing pre-checks satisfied by this verdict + --pair 0 + green head. ⛔ This seat cleared no carrier and touched no PR state at posting.

Verdict

PASS — contract review at the Clause-②: yes tier. Published-face delta is exactly one parameter token, input-compatible; runtime delta is four crash→documented-refusal rows plus one JSON-inexpressible corner, all disclosed; tests pin the parameter at type level and the non-object runtime path. No REWORK items; one optional test pin noted (F4).

Head reviewed

f5cb148f5003d1a62c805ea0e9cee118c9e200db (prefix f5cb148f50 — head did not move). Single commit on base 256c709e2. origin/main is 11 commits ahead; git merge-tree clean; the only main-side drift on a touched file is an unrelated useExpression.ts:163→165 ledger row in scripts/check-doc-example-types.mjs (no overlap with the PR's two rows).

Clause-② reading · claim match · --pair

  • My reading: yes. Mechanical floor clear (no new exported symbol — SchemaNodeUnderValidation :157 and isSchemaNodeShape :178 carry no export; no new key or error code). What tips it: one input moves accept→refuse (named function as a fields entry, F2), and no published contract text already declares that refusal (objectui#6124 covers the zod mirrors in @object-ui/types, a different symbol/package) — so no Contract-text: could license no.
  • Claim: PR body ## Clause-②: yes; card claim comment 5606527326 carries Clause-②: yes (appended by the dev under the PM's on-record authorisation — disclosed in report 5607018063 carrier_resolution; no second claim). Match.
  • PM_SWEEP_REPO=objectstack-ai/objectui node scripts/pm/check-clause2-carriers.mjs --pair 8880 → exit 0 ("declaration readable in the fixed spelling and both carriers agree"). needs:contract-review present on both PR and card.

Governed surface

node scripts/check-governed-queue-guard.mjs --test <4 paths> → NOT GOVERNED — 4 path(s) checked against 5 governed surface(s); none matched, exit 0. Normal review/queue route.

CI on head

33 check-runs, all head_sha = f5cb148f50: 30 success, 3 skipped (dependabot, Test (coverage), Test (coverage shard …) — conditional legs), 0 failed. Lint ✓, Type Check ✓, Test shards 1–4 ✓, Build & E2E ✓, Doc Snippet Type Check ✓, Changeset Declaration/Bump Policy/Fixed Group ✓, Governed Surface Queue Guard ✓. Not red ⇒ no causation needed.

Findings

F1 — Published-face delta (verified). packages/core/src/validation/schema-validator.ts:506-509 (PR): export function validateSchema(schema: unknown, path: string = 'schema'): SchemaNodeValidationResult vs main :458-461 schema: any. Reaches the published .d.ts through packages/core/src/validation/index.ts:19 export * from './schema-validator.js' (@object-ui/core private: false, types: ./dist/index.d.ts). Return type is the concrete SchemaNodeValidationResult (:51-55, unchanged); no generics, no overloads. assertValidSchema(schema: any) :560 and isValidSchema(value: any) :582 untouched (outside card scope; dev noted → #7493). Callers: typeof validateSchema / Parameters<typeof validateSchema> appear nowhere in-tree except the new test; the one out-of-package caller packages/react/src/SchemaRenderer.tsx:84 passes an any behind its own !schema || typeof schema !== 'object' guard (:73). (s: unknown) => R is assignable wherever (s: X) => R was expected. No caller shape stops compiling.

F2 — Runtime before/after (independently measured, not inherited). Ran merge-base vs PR source under Node 22 type-stripping across 28 inputs: 24 identical, 4 differ — null, undefined: TypeError → INVALID_SCHEMA@schema; {type:'form',fields:[null,…]}: TypeError → MISSING_FIELD_NAME@schema.fields[0]; {type:'form',fields:[namedFn]}: valid:true → MISSING_FIELD_NAME. isValidSchema(null|undefined): TypeError → false; assertValidSchema(null|undefined): TypeError → Error: Schema validation failed:. Unchanged: all primitives (INVALID_SCHEMA), []/{}/Date (MISSING_REQUIRED), root functions/Symbol (INVALID_SCHEMA), children null holes skipped, children: 42/fields: 'x' silently accepted, nested RETIRED_TYPE path, duplicate warnings, predicate-gate INVALID_TYPE. Reachability: for non-object roots the three formerly-unguarded rules are now skipped rather than executed; before, they either threw (null/undefined) or contributed nothing ((42).type → undefined). Nothing that returned before now throws. schema.children || schema.body literal kept byte-identical (:467), so body-dialect-census.test.ts:198 holds. Matches the dev's 25/4 matrix.

F3 — Clause-② substance. The single accept→refuse row is a function value (JSON cannot express it; reachable only programmatically) and it lands on the existing MISSING_FIELD_NAME code already emitted for fields: [42]. Disclosed in changeset and PR body. Declaring yes was the right conservative call; agree.

F4 — Tests pin the contract. Type-level: __tests__/unknown-schema-param-8416.test.ts:74 IsAny<Parameters<typeof validateSchema>[0]> extends false ? true : never. Reproduced with global tsc 6.0.2: main's any → TS2322: Type 'true' is not assignable to type 'never'; PR → exit 0. Together with the uncast const probes: unknown[] loop (:85-88) the pair pins exactly unknown (IsAny excludes any; the unknown probe excludes anything narrower). File is inside tsconfig.test.json include, chained from type-check, which the green Type Check job runs. Runtime: null/undefined root, fields:[null], isValidSchema/assertValidSchema(null) with .not.toThrow(TypeError) + /Schema validation failed:/, plus five preservation pins. I re-ran the file's runtime assertions with node:assert against the PR source: all pass. Optional gap: the one accept→refuse row (named function in fields) — the very row that triggers Clause-② — has no runtime pin; worth one it so it cannot silently revert. Not a REWORK condition.

F5 — Scope. 4 files, all card-related. Ledger rows in scripts/check-doc-example-types.mjs 490→550 / 515→575 verified: keys are the @example tag line (:382 getLineAndCharacterOfPosition(tag.getStart(sf)).line + 1); main @example at 490/515, PR at 550/575. No content/docs/releases/, no governed paths, no ratchet/baseline edits (KNOWN_BARE_ANY_EXAMPLES roots are skills/.claude/skills; check-lint-coverage.mjs counts nothing). Card boundaries (defaultValue, item ③) untouched.

F6 — Changeset. .changeset/8416-validate-schema-unknown-param.md → '@object-ui/core': patch. Required (published dist/**/*.d.ts moves; core is private: false, in the fixed group) and present. Patch is the right level: input-compatible parameter, runtime delta is crash→documented refusal plus one non-JSON corner; not breaking, so objectui's "breaking ⇒ minor" rule does not apply; no major. Body is accurate against F2.

F7 — Docs. No doc/skill restates validateSchema(schema: any) (grep over *.md/*.mdx/*.ts). skills/objectui/guides/testing.md:70-73 passes {} uncast — still valid under unknown. content/docs/api/schema-reference.md:594 describes behaviour only. @param schema JSDoc unchanged and still true. Nothing to update; the changeset is the release-notes input.

F8 — PR form. Draft ✓, base main ✓, first line Fixes #8416 ✓ — correct, the card's whole scope is validateSchema. Keyword scan of the body: only Fixes #8416; #7493 appears as Successor: #7493 (no verb). Two attribution footers (cosmetic, disclosed).

F9 — Pre-existing, not introduced. Nameless fields entries get a spurious DUPLICATE_FIELD_NAME warning (fields:[{},{}] → 2 errors + 2 warnings) — identical before/after. Belongs with #7493 or a follow-up, not this PR.

F10 — Report hygiene. Dev report evidence (ablation 6 red by name / 138 green control, ledger-row control, tsc TS2322 at (74,11)) is consistent with what I reproduced. CI in_progress at report time was honest; it has converged green on the same sha.

Acceptance notes


Generated by Claude Code

Copy link
Copy Markdown
Collaborator

Landing provenance — director seat, summon #18 segment 6 (session_017Js5kTpTtxieBjPyScgxJ3, 2026-09-10T00:21:04Z). Clearing needs:contract-review on both carriers (objectui#8880 + card objectui#8416) on the strength of the contract-review-tier PASS at #8880 (comment) (head f5cb148f50, unchanged). Landing pre-checks (contract-review.md ①②③): ① tier verdict on the card (pointer posted); ② check-clause2-carriers.mjs --pair 8880 exit 0; ③ 33 check-runs on head, 0 red / 0 in progress; governed-surface test exit 0 (not governed); mergeable_state: clean. Next: ready → auto-merge (SQUASH) → merge-queue entry, per landing-operations.md. Executed under the maintainer's 2026-09-09 13:4xZ order 「把当前的契约复审全部处理完」 precedent; the dispatching seat keeps ACCEPT/landing-window duties (MERGED confirmation + card close-out) if it is back before the queue finishes — otherwise this seat closes out.


Generated by Claude Code

@huangyiirene
huangyiirene marked this pull request as ready for review September 10, 2026 00:21
@huangyiirene
huangyiirene added this pull request to the merge queue Sep 10, 2026
Merged via the queue into main with commit 317dbce Sep 10, 2026
35 checks passed
@huangyiirene
huangyiirene deleted the claude/issue-8416-validate-schema-unknown-param branch September 10, 2026 00:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

2 participants