Repository navigation
feat(sdui-parser): diagnose the inert quickAdd on the ObjectKanban tags instead of calling it unknown - #8922
Conversation
…tags instead of calling it unknown The Quick Add control is gated on BOTH `quickAdd` and an `onQuickAdd` handler. `onQuickAdd` is a runtime slot — a function — which no parsed page can write (this tier parses, never executes) and which `ObjectKanban` supplies none of its own for. So `quickAdd: true` on `object-kanban` / `kanban` has never rendered a control. The tier was not silent about it, but it was wrong: `quickAdd` is undeclared on both registrations, so `validateTree` reported `unknown-prop` — "has no prop quickAdd" — which is false against `@objectstack/spec`, whose `ComponentPropsMap['object-kanban']` publishes the key, and which cannot be told apart from a typo. An author who checks the contract finds the warning contradicted and keeps a key that does nothing. `checkKanbanQuickAdd` replaces that message with one that names the missing half of the pair and points at `kanban-ui`, where a React host can supply the function. Severity is unchanged (warning, as `unknown-prop` was), so `compile()` still returns `ok` and no page that saves today stops saving; escalation to `error` belongs at the save gate and to the contract, not here. Bounded on purpose: `kanban-ui` untouched, a falsy `quickAdd` untouched (it asked for no control and got none), and a braced value left to `inert-expression`. The key is NOT declared — this diagnoses, it does not widen the authoring surface. Interim by ruling: the contract-side refusal retires `object-kanban.quickAdd` from the spec's `ComponentPropsMap`, and this module goes with it. The live pin's spec row reddens on the day that lands. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01611D6ZaRaMmwTNQmSbk8MH
✅ 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
|
|
Tier notice — the contract-review-tier requirement on this PR is lifted (skills seat, session Maintainer ruling, verbatim: 「现有的卡片如果写了要求fable的,也要让相关的项目经理知道,opus就够了。」 Under the same ruling set (quoted in full on objectstack-ai/objectstack#17285), the contract-review tier is reserved for the skills seat (protocol files + the published For this PR: its Generated by Claude Code |
Refs #8285 — slice C only. The card stays open after this lands: it then blocks on the
@objectstack/specretirement card, per the ruling's Execution paragraph. Deliberately notFixes.Clause-②: yes— four new exported symbols on a published package (checkKanbanQuickAdd,INERT_QUICK_ADD,QUICK_ADD_HOST_TYPES,QUICK_ADD_KEYfrom@object-ui/sdui-parser), and the already-publishedDiagnosticruntime payload gains a newcodevalue,inert-quick-add, which consumers switch on. Under the mechanical floor either half alone isyes.What is ruled, and what this implements
The director-seat ruling on #8285 (comment 5583979207, decision batch #91) answered the A/B half — B:
quickAddretires fromobject-kanban/kanbanand stays onkanban-ui, where a React host can supply the function. This PR is the interim the ruling names verbatim:Re-measured on this branch's base
4fa0eb9c4, by predicate rather than by copying the card's anchors.The card was filed saying the key is dropped "with no diagnostic". That is true of the spec validator, which accepts it, and false of the html tier:
quickAddis deliberately absent fromOBJECT_KANBAN_INPUTS(objectui#8201 escalated it rather than declaring it), sovalidateTreealready reported it — asunknown-prop, "has no prop quickAdd".That message is a misdiagnosis, which is why slice C still has content.
@objectstack/spec'sComponentPropsMap['object-kanban']publishesquickAdd, so an author who checks the contract finds the warning contradicted, concludes the manifest is behind the spec, and keeps a key that will never do anything. It is also indistinguishable from a typo, so nothing records why the key is refused. objectui#8201's own pin header measured this shape from the other direction: a tier that calls a working spelling unknown "trains authors (AI authors included) to delete working metadata".The defect itself is intact and was re-measured, not inherited:
onQuickAddappears 0 times inpackages/plugin-kanban/src/ObjectKanban.tsx, against 6 for the controlonCardClickin the same file, so the zero is a reading. The Quick Add control is gated on both halves (quickAdd && onQuickAdd) andonQuickAddis an objectui#6124 runtime slot — a function. On this tier the second half is not merely absent but unwritable: a handler attribute on a parsed page drawsforbidden-attr(measured). So there is no out-of-band consumer to protect, which is what makes this diagnostic unconditional rather than escape-hatched the wayunconsumed-widget-optionis.The change
packages/sdui-parser/src/kanban-quick-add.ts— a new module in the shape of the objectui#5709 precedent next door.validateTreeasks it once per authored prop, ahead of the declaration lookup, and its answer replaces what the walk would otherwise say about the key rather than joining it (two diagnostics for one mistake is whatcheckMemberTypesalready refuses, objectui#8067). Asked ahead of the lookup on purpose: the claim is about the render path, so a later decision to declare the key must not silently disarm the warning.The message names the missing half of the pair and points at
kanban-ui, where the pair works.Severity: warning — the escalation is deliberately not taken. The ruling's word is "diagnosed", not "refused".
unknown-prop, what this replaces, was already a warning, so nothing hardens:compile()still returnsokand no page that saves today stops saving.validate.ts's owninert-expressionnote records that escalating an inert authored key toerroris a separate question (objectui#6614 Q2) belonging at the save gate, and objectui#5709's ruling constrains this family directly — "no gate weakening and no new red gates were ruled". The hardening belongs to the contract, and option B is exactly that.This diagnoses; it does not widen.
quickAddis still undeclared on both registrations — a pinned row asserts it.Scope, kept as dispatched
object-kanban.quickAddfromComponentPropsMapis the separate cross-repo card.quickAddon the twoObjectKanbanRenderertags — that follows the spec pin, not C.dataSource.create, no permissions / required-field / rollback work.kanban-uikeeps thequickAdd/onQuickAddpair untouched, and draws no new diagnostic. A pinned control asserts it.quickAddis untouched (the renderer gates onquickAdd && onQuickAdd, so it asked for no control and got none), and a braced value staysinert-expression's subject.This module is scheduled for deletion by the change that lands the spec pin. The live pin carries a tripwire row for that: it asserts the spec still publishes the key, so it reddens on the day the retirement lands.
Ablation — the pin is red without the change and green with it
Mutation: the four-line dispatch removed from
validate.ts; the markercheckKanbanQuickAdd(node.type, key, value)counted 1 → 0 on disk, blobc956914→ee95db2, so the edit is proven landed rather than assumed. Restored withgit checkout HEAD --, proven by an emptygit diff HEAD, a cleangit status, and the blob hash back toc956914.@object-ui/sdui-parseris aliased to itssrcinvitest.config.mts, so both suites read the mutated source; nodistis involved on either leg.object-kanban/kanban× (draws exactly oneinert-quick-addwarning · it REPLACES the falseunknown-prop· the message names the missing half and where the pair works); the whole-pipeline row from real source text; and both live-registry rowsEvery control names its wrong fix in a comment, per the discipline: the unknown-prop control (a fix that turned the generic walk off for the block rather than answering for the key);
kanban-ui(a fix scoped to "a kanban-ish tag", which would hit the one block the ruling keeps); a falsyquickAdd(a fix keyed on the key's presence rather than the author's request); the braced marker (a fix that read the parser's opaque$exprobject as truthy);okstaying true (the escalation toerror); plus the tag-set derivation, the still-not-declared rows, the spec tripwire and the zero-onQuickAddtripwire.26 passedwith the change;9 failed | 17 passedwithout it.Gates — all on the final commit
aa4512d26vitest run packages/sdui-parser/ packages/plugin-kanban/turbo run type-check(both packages)tsc --listFilesturbo run build --filter=@object-ui/sdui-parsercheck-dist-completenessruns inside it and passedcheck-changeset-presencecheck:control-bytescheck:doc-types/check:doc-fencescheck:handler-key-readscheck:spec-symbolscheck:unreferenced-sources/check:self-importlint:coveragescalarKeysAreDeclaredAndHonoured-8201.test.tsalone carries 12 of the sameno-explicit-anyidiom, and no workflow sets--max-warnings)check:sdui-registration-pinspnpm --filter @object-ui/console buildfirst. Neither red nor green. This diff adds and changes zero registrations.check:readme-exports./dist/index.d.tsis not on disk — runpnpm buildfirst". Its own census line reads0 real, 0 wrong-path, 0 fabricated, and 0 of its lines namesdui-parser. A build prerequisite, not a finding.Declared narrowing: the repo-wide
eslint .run is CI's, not this PR's. The narrowing is a measurement, not a skip: the population is read from eslint's own config, the count from its--format jsonoutput, and type-aware linting is not enabled anywhere ineslint.config.js(noparserOptions.project, noprojectService), so this diff cannot move the verdict of any file it does not touch.Documentation
content/docs/plugins/plugin-kanban.mdxgains a short prose section under Event Handling saying that Quick Add is akanban-uicapability, why an object-driven board cannot have it, and what the new warning is — mirroring how theunconsumed-widget-optionwarning is documented on the dashboard page.Measured and NOT fixed
apps/console/src/__tests__/registry-inputs-spec-parity.test.ts's'object-kanban.quickAdd'ledger entry still says objectui#8201 owns the question and "its answer deletes this entry". Stale after batch chore: release packages #91 — the ruling moved the question here and answered it B. Left alone: a docs nit inside a test ledger, and it has a real successor, since the follow-up that stops forwarding the key must delete the entry anyway (the key leavesComponentPropsMap).kanban-uialso drawsunknown-propfor an authoredquickAdd: its registration publishes three inputs (columns,onCardMove,className) while its schema face accepts many more. That is the objectui#8201 declaration-gap shape on a block nobody has censused — but only this one key was measured, and objectui#8201 is open and owns that family, so nothing is filed on one instance.🤖 Generated with Claude Code
https://claude.ai/code/session_01611D6ZaRaMmwTNQmSbk8MH
Generated by Claude Code