Repository navigation
fix(types): refuse onNavigate / onAddComment by name on the detail-view arm (objectui#9447) - #9698
Conversation
…view` (objectui#9447) The `detail` arm has refused both keys by name since objectui#7804. The `detail-view` arm, which reaches the same `DetailView` component, declared neither — and `BaseSchemaCore` is `.passthrough()`, so an authored value was kept rather than refused and then handed to a call site expecting a function. Both keys stay DECLARED and unwritable, the `onBack` / `related` precedent on this same arm: under `.passthrough()` a deletion leaves the silent accept in place and discards the diagnostic with it. The TypeScript face is unchanged. The read path is measured rather than assumed: `detail-view` registers `DetailViewRenderer`, whose data-source gate hands `DetailView` either the node unchanged or a shallow spread that overwrites only binding keys, so the authored value arrives by identity and is called. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UanLVj6xvbS6puBCewLr8L
…47 transfer The ledger move is a pure transfer between two EXISTING entries for the same pair, so the two key totals move by two in opposite directions while neither entry count moves. Both header figures are corrected to the derived values and each carries the cumulative history sentence the bullet keeps for every move. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UanLVj6xvbS6puBCewLr8L
|
changeset-claim-re-read
|
✅ Console Performance Budget
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
Size Limits
|
Fixes #9447
Mirrors the objectui#7804 by-name refusal of
onNavigateandonAddCommentonto thedetail-viewarm, so the same two keys stop having two different fates decided only bywhich
typeliteral an author wrote. Both keys stay declared and unwritable — theonBack(objectui#7344 / the objectui#6182 ruling) andrelated(objectui#7997,ADR-0049) precedent on this same arm — because
BaseSchemaCoreends.passthrough()and a deletion there leaves the silent accept exactly as it was.
Clause-②: no— re-derived here, not inheritedThe dispatching seat declared
no; I re-derived it and agree.The
detail-viewzod arm declared neither key. I measured that on my own head(
bbe57fdd5):onNavigate0 andonAddComment0 inviews.zod.ts, beside alit control
onBack3 andhandlerKeyRefusal2 in the same file, and anabsent-token control 0. So today's acceptance is an accident of
.passthrough(),⛔ not a declaration — the member list already implied the refusal and the arm simply
never said it. Writing it down is 「拉回已声明契约」 and brings the arm into line with
its own twin.
Three checks for the STOP the order attached to this, all negative:
could have widened — the nested
recordNavigation.onNavigate— is explicitly pinnedas still parsing green.
DetailViewSchemais already exportedfrom
@object-ui/types/zod; the diff adds two MEMBERS to an existing exported objectand no new export anywhere.
packages/types/src/views.tsis not in thediff, which is the
onBackprecedent exactly: keep the callable declaration, refuseonly on the JSON face.
One row per file in the diff
packages/types/src/zod/views.zod.tsDetailViewSchema:onNavigateandonAddComment, eachhandlerKeyRefusal(..., 'runtime-slot', ...), with the read-path derivation in their docblockspackages/types/src/__tests__/zod-mirror-parity.test.tsRuntimeOnlyDeclaredtoKnownDrift; both header key totals corrected to the derived values with their cumulative history sentencespackages/plugin-detail/src/__tests__/detail-view-handler-slots-9447.test.tsxSchemaRenderer, the zod face in both directions, and the boundary this card did not cross.changeset/9447-detail-view-handler-key-refusal.md@object-ui/types: minor, breaking semantics and migration spelled outThe census, refined to node level — the gating measurement
The seat's first cut was file-level and it explicitly was not an answer. A hit only
counts if the key sits on a
detail-viewnode.Step 1 — whole tracked tree at
bbe57fdd5, enumeration and reading both from thesame ref (
git grep ... HEAD), so the worktree is never the population:onNavigateonAddCommentonBackdetail-viewThe absent-token control reads 0 and exits 1 while every lit control reads non-zero on
the same instrument, so the zeros below are negative, not void.
Step 2 — intersection. A file that does not contain the token
detail-viewcannotauthor either key on a
detail-viewnode. 57 ∩ 99 = 9 files, and note what isabsent from that list:
examples/contributes zero.Step 3 — node level, all 9 classified:
content/docs/api/schema-reference.mdDetailSchemaheading — prose about thedetailarm's own refusal. Thedetail-viewnode under theDetailViewSchemaheading carries neither key, in the JSON example or the member table. Not a break.ROADMAP.mdonNavigatehit is a React prop in console /useNavigationOverlayTypeScript, not a node key; thedetail-viewhit is about registration inputs. Not a break.docs/audits/2026-07-objectview-detailview-schema.mdpackages/plugin-detail/src/__tests__/DetailView.test.tsxonNavigatekeys, all nested underrecordNavigation(indentation 8 against node keys at 6); different key, different path, different signature. ZeroonAddComment. Renders the component directly, never parses. Not a break.packages/types/src/__tests__/handler-keys-string-any-mirrors-7344.test.tsdetail-viewfixture authorsonBackonly. Not a break.packages/types/src/__tests__/zod-mirror-parity.test.tspackages/types/src/views.tspackages/types/src/zod/crud.zod.tsdetail-view. Not a break.scripts/check-handler-key-read-sites.mjsStep 4 — zero pull, the axis the
relatedretirement was carried on. Neitherfirst-party producer of a
detail-viewnode writes either key:detail-viewonNavigateonAddCommentobjectName/sectionsrenderers/record-details.tsxRecordDetailDrawer.tsx⇒ zero authored
detail-viewnodes carry either key as a member. The STOP did notfire, and the repair proceeded.
The read path, re-derived — the card said outright it had not measured this
It decides the repair, and it turns out to confirm the card's conclusion by a route the
card did not state.
'detail'registersDetailViewraw.'detail-view'registersDetailViewRenderer, so there is a wrapper — the card was right that the tworegistrations are not the same shape.
DetailViewRendererdestructures{ schema, dataSource, ...props }and rendersElementDataSourceGate, whoserender-prop child is
DetailView schema={bound}.boundcomes fromuseElementDataSourceSchema, which has exactly two branches:it returns
schemaunchanged when there is no composed binding, and otherwisereturns
{ ...base }— a shallow spread whose only overwrites are the binding keys(
objectName,columns,filter,sort,limit,viewType). A handler keysurvives both branches.
DetailViewreadsschema.onNavigateand calls it in its own body —handleBack,handleEdit, the post-delete redirect — and readsschema.onAddCommentand forwards it as a prop into
RecordComments, whose submit handler awaits it.⇒ the authored value arrives by identity, exactly as under the raw registration.
The repair is therefore "mirror the refusal", not something narrower. Suite 1 of the new
pin drives both keys to their call sites rather than asserting this.
On the gate.
pnpm check:handler-key-readsis green on both keys and always was.That is measured, not assumed: it exits 0 on the base tree,
views.zod.tsdeclaredneither key there, and
KNOWN_UNDECLARED_READScarries nodetail-view::row at all(only
detail::DetailSchema.onTabChange) — an undeclared read it could see would havebeen a finding. Its counters are byte-identical before and after this change (105 arms,
212 registrations, 60 reachable reads, 60 judged, 14 exempted). The mechanism — that its
transitive hop stops at the cross-package render-prop boundary — is my reading of its
source, flagged as such; the fact that it does not judge these reads is the measurement.
Gate exit codes
Derived from objectui's own
package.jsonand workflows, becausescripts/pm/dispatch-gates.mjslives in the sibling repository and refuses objectuipaths by design.
pnpm --filter @object-ui/types run lintpnpm --filter @object-ui/types run type-check(all three tsc legs)pnpm exec vitest run packages/types/pnpm changeset:checknode scripts/check-changeset-presence.mjspnpm check:changeset-claimspnpm check:pending-changeset-literalspnpm check:control-bytespnpm check:new-line-citationspnpm check:test-path-rootspnpm check:self-importpnpm check:esm-specifiersnode scripts/check-changeset-no-major.mjspnpm check:handler-key-reads(not owed; run because it is the gate the card names)node scripts/check-governed-queue-guard.mjs --test(the 4 diff paths)pnpm --filter @object-ui/plugin-detail run lintI also ran a control-byte self-scan over the four diff files beyond the gate, with a
firing positive control: no control bytes, and the same expression fires on a planted
one.
Suites — this package and the consumer package
A refusal in
packages/typescan flip a fixture's assertion elsewhere, and this diffalso adds a file under
packages/plugin-detail/src, so that package's own readings areowed too. Both were run from the repo root through the shared verify lock.
pnpm exec vitest run packages/types/pnpm exec vitest run packages/plugin-detail/pnpm --filter @object-ui/plugin-detail run type-check(both tsc legs)smoothed.
plugin-detail's type-check first came back exit 2 withCannot find module '@object-ui/types'and six siblings — in files this diff nevertouches. That is an unbuilt workspace
dist, not a regression: the package type-checksagainst its dependencies' emitted declarations, and a fresh worktree has none. After
pnpm --filter "@object-ui/plugin-detail^..." build(exit 0) the same command exits0 with zero
error TS. ⛔ The first reading is reported as a prerequisite notmet, never as a failure and never as a pass.
packages/typesrun failed one test — the runtime pin that re-derives the parityheader's key totals from the ledgers. Moving two keys between two ledgers changed two
figures the header had written down, and the pin named both sides and printed the
derived values. Corrected in the header, never in a key set, and each figure carries the
cumulative history sentence the file's convention requires. ⭐ The entry counts did
not move, and the pin that guards those stayed green — the asymmetry is real
information: both entries survive the transfer, because
KnownDriftalready heldonBackandRuntimeOnlyDeclaredkeepsonTabChange.Reverse verification
Every mutation's direction was predicted in writing before it ran. Each ran under a
trap … EXIT INT TERM, mutated through an anchor whose occurrence count was checkedbefore and after so a no-op mutation could not be read as a passing run, and each
restore is judged by blob hash against HEAD, never by an exit code.
onNavigatemember from the armonNavigatelegs;onAddCommentand lit controlonBackgreen; suites 1 and 3 green; type-check RED naming the pair twiceviews.zod.ts#DetailViewSchemac5275b5f…== HEAD,git diff HEADemptyonAddCommentmemberonNavigateandonBackgreen; type-check REDc5275b5f…== HEAD,git diff HEADemptyonNavigatedispositionruntime-slottoretiredc5275b5f…== HEAD,git diff HEADemptyMutation C is the informative one and its prediction was deliberate: it shows the two
pins are not redundant. The type-level ledger sees a key's presence, the probe sees
its disposition, and only the probe can fail on C. After the last restore the whole
tree reads
git status --porcelainempty and the probe is 13/13 green again, so therestores returned behaviour and not merely bytes.
than an omission: the root vitest config aliases
@object-ui/types/zodtopackages/types/src/zod/index.zod.ts, so the probe reads source, notdist. Astale-
distfalse green is not reachable here. I verified the alias rather than assumingit.
Acceptance notes
onTabChangeis deliberately untouched. It is the fourth handler key this arm'srenderer reads, it is still undeclared, and it is read through an
(schema as any)cast. It already has a named carrier — objectui#7804 — and it is still ledgered in
both
RuntimeOnlyDeclaredhere andKNOWN_UNDECLARED_READSin the gate. Suite 3 ofthe new pin records that it still parses green, so this card cannot be mistaken for a
sweep of the arm's handler keys.
check-handler-key-read-sites.mjs, reported, notrepaired.
detail-viewis an instance of a general shape: a registration that goesthrough a wrapper puts its component's reads out of that gate's reach. I did not
enumerate other wrapper-registered arms — that is the sibling sweep the order put out
of scope. Needs a named carrier from the dispatching seat.
RuntimeOnlyDeclareddocblock I rewrotecarried a stale parenthetical describing
onBackas mirrored "asz.string()"; ithas been a named refusal since objectui#7344. Corrected in passing because I was
rewriting that block anyway.
first-party call sites emit a
detail-viewnode, namingRecordDetailDrawer.tsxasone. That file contains zero occurrences of the token today. The audit is a dated
historical reading, so it is evidence about its own moment and editing it would
destroy the signal. Observation only. 承接者:无。
entries survive:
KnownDriftalready heldonBack, andRuntimeOnlyDeclaredkeepsonTabChange. Only the two key totals moved, by two, in opposite directions. Theruntime pin that derives the header figures caught the stale digits and named both
sides; I corrected the header, never a key set.
维护者速读(草稿)
改了什么。 给
detail-view这个 JSON 编写面补上onNavigate、onAddComment两个键的具名拒收,和它的孪生
detail完全一致。两个键保持「已声明但不可写」,不是删掉 —— 因为底座是.passthrough(),删掉等于把静默接受原样留下,还顺手扔掉了诊断信息。TypeScript 那一面一个字没动。为什么改。 同样两个键,过去取决于作者写的是
detail还是detail-view,一个被指名拒收、另一个被静默保留然后交给一个期待函数的调用点。卡片没测的那条读取链路我重新推导了:
detail-view确实多包了一层 wrapper,但那层 wrapper 不剥键 —— 它要么原样返回节点,要么做一次只覆盖绑定键的
浅拷贝,所以作者写的值按引用原封不动地到达同一个组件并被调用。
风险与代价(含回滚)。 这是一次收窄,属于破坏性语义,已在 changeset 里写明并按本仓约定标
minor。风险已测量:全仓节点级普查(含文档、示例、全部*.json/*.mdx、两个第一方生产者)命中 零 个真正在
detail-view节点上写了这两个键的地方,所以现存语料无需迁移。若宿主应用自己写了,改为以 React prop 传给组件,或改写成节点类型。嵌套的
recordNavigation.onNavigate是另一个键,不受影响,并已单独钉住。回滚成本低:四个文件,回退
views.zod.ts的两个成员即可,台账与头部数字随之回退。
席位意见。 (留空,交席位定稿)
你要做的。 确认这次收窄可以接受;其余无需动作。⛔ 我没有 enqueue、没有翻 ready、没有挂
auto-merge。另外有一条越界发现需要席位指定承接人:
check-handler-key-read-sites.mjs看不见任何经 wrapper 注册的组件的读取,
detail-view只是其中一例,我按令未做同类普查。Pending-changeset re-read — all 11, by paragraph, with the probe for each
changeset-claim-re-readflagged 11 pending declarations that name a file this diffedits. Their bodies publish verbatim into the CHANGELOG, so each was re-read by
paragraph against this diff, asking only: does this diff make any sentence false?
Verdict: all 11 still true. Zero corrections, so no pending body is touched by this
PR and no frontmatter question arises.
First, the scope of what this diff can even reach inside the parity file — one pair key
and nothing else:
KnownDriftRuntimeOnlyDeclaredUnmirroredDeclaredEXCLUSIONS·WiderThanDeclared·EXPECTED_MIRROR_PAIRS·SPEC_DERIVED_PAIRSThe only pair key appearing anywhere in my changed lines is
views.zod.ts#DetailViewSchema.7344-handler-string-any-mirrors.mdviews.zod.tsz.string()keys that are event NAMES are untouchedonViewChange3 at base, 3 at head;onChange6 and 6; all three still readz.string().optional()at head. This diff adds two members and alters no existing one.6150-undeclared-but-consumed-keys.mdRuntimeOnlyDeclaredis a SUBSET ofUnmirroredDeclared, and the union equalsUnmirroredDeclaredRuntimeOnlyDeclared's three entries are identical at base and head; entries outsideUnmirroredDeclared= 0; union = 14 =UnmirroredDeclared's 14. No ENTRY moved — only keys, inside one surviving entry.7804-tree-view-handler-slot.mdTreeViewSchemaappears in 0 of my changed lines.6175-column-state-persistence.mdonColumnReorderstays declared and unwired, asRuntimeOnlyDeclaredrecordsdata-display.zod.ts#DataTableSchemaentry is byte-identical at base and head,onColumnReorderincluded.6639-objectgrid-title-mirrored.mdUnmirroredDeclaredrecordsObjectGridSchema.titleworked off; the seed decompositionUnmirroredDeclaredinterface body hashes753747d3…at base and head.7654-floating-chatbot-trigger-icon-tombstone.mdfloatingConfigsits inUnmirroredDeclaredundercomplex.zod.ts#ChatbotSchemaobject-view-unmirrored-keys-7779.mdUnmirroredDeclared14 entries / 96 keys to 14 / 87,ObjectViewSchemare-derived into the spec-derived halfSPEC_DERIVED_PAIRShas 0 changed lines. The header's cumulative chain shows a LATER card (objectui#7762) took it on to 86 — that is the chain working, not a stale claim.5928-classname-style-props-rename.mdEXCLUSIONSkeys its entry toClassNameStylePropsSchemaEXCLUSIONSdeclaration block hashesc0f1107b…at base and head, and the key is still present.8338-retire-toast-action.mdKnownDrift42 / 64 to 41 / 63, plusWiderThanDeclaredfigurestoastappears in 0 of my changed lines andWiderThanDeclaredin 0.8572-chatbot-body-retired.mdChatbotSchemabodyrow and the two inverted pinschatbotappears in 0 of my changed lines, against a firing control of 8 forDetailViewSchema.7735-zod-mirrors-stop-authoring-defaults.md.default()call sites removed,views.zod.tscontributing 2.default(inviews.zod.tsreads 1 at base and 1 at head, and that one occurrence is inside a comment quoting the spec, not a call site; acrosspackages/types/src/zod/the count is 23 at base and 23 at head. This diff adds no.default()—handlerKeyRefusalreturns an optional custom, never a defaulted one.quietly fixed. My first
EXCLUSIONSprobe was a crude "400 lines after the firstmention" window, which spans regions this diff really does edit, and it reported two
different hashes — a false positive. Extracting the actual
const EXCLUSIONSblockinstead gives byte-identical hashes, and the same extractor fires on
KnownDrift(twodifferent hashes), so the instrument is lit rather than merely silent. ⛔ The first
reading is reported, not deleted.
8338,object-view-unmirrored-keys-7779) state ledger counts astransitions at their own card, not as live figures, and this diff does move
KnownDriftto 46 / 85. Under this file's own cumulative-chain convention that does notfalsify them — the chain in the header is where the current figure lives, and this PR
extends it with the required history sentence. ⛔ I did not edit either body: correcting
a historical reading to today's tree would make it describe a tree it was never written
about.
Angle-bracket scan: no pending body needed replacement prose, so there is none to scan.
I did scan my own new changeset and this PR body — zero angle-bracket-shaped
fragments in either.
Session for this run, in prose so it survives an edit:
https://claude.ai/code/session_01UanLVj6xvbS6puBCewLr8LGenerated by Claude Code