docs(plugin-calendar): rewrite the two object-calendar examples onto declared keys, and annotate them - #8470
Conversation
…declared keys Both `object-calendar` blocks in this README taught keys that `ObjectCalendarSchema` does not declare and the renderer does not read: `object`, `startField`, `endField`, `dataSource` and a `fields` container. Measured on the renderer, with `schema.objectName` (19 occurrences) as the non-vacuity control in the same run: `schema.object`, `schema.startField`, `schema.fields` and `schema.dataSource` each have 0 read sites. The wrong start-date key was not a partial failure. `getCalendarConfig` gates the entire flat-property branch on the start-date spelling, so the first block's correctly spelled `titleField` was never read either and the node rendered the "Calendar configuration required" refusal screen. Both blocks are now annotated `ObjectCalendarSchema`, which puts them inside `check:doc-snippets` instead of leaving them as bare literals compiled against nothing. The annotation's real reach is stated in the file rather than implied: it type-checks the VALUES of declared keys, and it does NOT check key names, because this interface extends `BaseSchema` and its `[key: string]: any` admits any spelling. Claude-Session: https://claude.ai/code/session_01FhBNJcLRZLe8M87VcUgpKr
✅ 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
|
|
LANDED —
⇒ The corrected keys satisfy the gate that was silently refusing the old ones, and the gate itself was not touched — the alias question stays with #8355.
⭐ What the PR leaves behind is the part worth keeping: the README now states in the file that the annotation type-checks values and not key names, because
Generated by Claude Code |
Fixes #7925
Both halves of the triage ruling ship here: the six wrong keys are replaced with the keys
ObjectCalendarSchemadeclares, and both blocks are annotated socheck:doc-snippetsjudges them instead of compiling bare literals against nothing.The card was measured at
db2c20d08; this branch is based on868e82501. Every coordinate was re-derived before a byte was touched. The defect is entirely real and unrepaired, but four numbers were stale, and one figure the card and its own triage comment disagreed about is now settled:868e82501packages/types/src/objectql.ts:2672:2698getCalendarConfigatObjectCalendar.tsx:119, gate at:131:155, gate at:162schema.objectNameread at 26 sitesAlso corrected: the brief predicted
UNGATED_DOCShad reached{}. It holds 4 entries.packages/plugin-calendar/README.mdis not among them — it is covered, so no entry was added and none was needed.The measurement, with its non-vacuity control
A zero read-site count means nothing without a term known to be present. Both halves come from the same run over
packages/plugin-calendar/src/ObjectCalendar.tsx:The control is non-zero in the same run, so the four zeros are readings rather than a broken matcher.
The part of the card worth preserving: one wrong key silently disabled three correct ones
This is not six independent typos.
getCalendarConfiggates the entire flat-property branch on the start-date spelling:Block 1 supplied
startField. The gate was therefore false,getCalendarConfigreturnednull, and the block's correctly spelledtitleFieldwas never read either — the node rendered the "Calendar configuration required. Please specify startDateField and titleField." refusal screen (ObjectCalendar.tsx:833, pinned byObjectCalendar.unconfiguredRefusal-7029.test.tsx). The prose now states that consequence, because it is the reason the key list is not a matter of taste.The card's own explanation of why three gates stayed green predicted that annotating would not have caught the key names either, because
ObjectCalendarSchema extends BaseSchemaandBaseSchemaends with an[key: string]: anyindex signature (packages/types/src/base.ts:467). That prediction was tested rather than assumed — a throwaway probe compiled against the builtdist/*.d.ts:objectandstartFielddefaultView: 'agenda'(a retired value)titleField: 42So the annotation is live (two positive controls prove it is not vacuously
any) but its reach is values, not key names. A reader who sees an annotation and assumes the key set is now guarded would be worse off than one who sees a bare literal, so the block says so in a comment rather than leaving the impression uncorrected.Ablation — proving the gate now actually judges these blocks
check:doc-snippetswas green before and after, with identical block counts (632 compiled, 0 failed). That pair of greens on its own proves nothing about this change, since both blocks already compiled as bare literals. So the annotation was ablated from the committed state:defaultView: 'month'changed to'agenda'fcc26a3d…moved todc3a8961…, and the marker count fordefaultView: 'month'fell from 2 to 11 failed:The gate named this README, this line, and this annotation. Restored under an
EXIT INT TERMtrap with absolute paths, and the restore proven by state rather than by exit code:git diff HEADempty, blob hash back tofcc26a3d…,git statusclean.Verification
check:doc-snippetsbefore632 of 632 block(s) judged, 0 failedcheck:doc-snippetsaftercheck:doc-snippetsablated1 failed, naming this filecheck-doc-linksLinks are valid across 17 scan rootscheck-doc-component-typescheck:readme-exportscheck:doc-fencescheck:control-bytescheck:doc-example-readerscheck-changeset-presence0 of them published source of a package the release covers, so none owed; run, not guessedcheck-governed-queue-guard --testNOT GOVERNED— 1 path, none of the 5 governed surfaces matchedExit codes were captured before any pipe, and each verdict line above is the gate's own printed text.
四轴分析
object-calendar在本包 README 里仅有的两个 ObjectQL 示例,而它们教的六个键渲染器一个都不读(上面的对照读数)。照抄 block 1 的读者拿到的不是"部分生效",是一整块拒绝渲染的屏幕。需求是真实的:文档是这个键集唯一的对外教学面。startField/object/fields一律直接改成出厂拼写,不留双拼写、不加别名说明。别名去留是 objectui#8355 的题,triage 明确裁定两卡不得重叠,本 PR 不碰ObjectCalendar.tsx,也不把别名问题写进 README 当搭车。check:doc-snippets每次提交重判一次值,消融已证明它能红。UNGATED_DOCS。顺路量到的两个问题都按无 assignee 立单交 triage,⛔ 没有搭车修:objectui#8466(colorField/allDayField被读却未声明)、objectui#8468(另外三个 README 仍把 adapter 写成 schema 键,与已关闭的 objectui#5098 同一类)。colorField因此从 block 1 的示例里去掉而不是保留 —— 保留它等于在一个刚刚说明"键名不受检"的块里,示范一个未声明的键。Scope
⛔ Untouched, by triage's explicit fence:
packages/plugin-calendar/src/ObjectCalendar.tsxand its alias ladder. That question is objectui#8355 and is not addressed here.Related findings filed while working this card, both unassigned and bare: objectui#8466, objectui#8468.
Drafted by an automated development seat; session reference
https://claude.ai/code/session_01FhBNJcLRZLe8M87VcUgpKr. Left as a draft for the PM seat to flip.Generated by Claude Code