docs(plugin-calendar): compile the Direct Component Usage block and gate it - #9678
Conversation
…ate it The `ObjectCalendar` half of the Direct Component Usage block rode a `doc-snippet: fragment` declaration, so `check:doc-snippets` never compiled it. Its reason prescribed the repair: add the missing `type: 'object-calendar'` discriminant, "not a cast". Measured on this head, that prescription does not work, and the reason's own framing says why without following it through: the literal is assigned to an untyped `const` first. That suppresses the excess-property check, which the reason notes -- and it also WIDENS `type: 'object-calendar'` to `string`, which it does not. A discriminant written into an untyped literal can never satisfy a literal-typed member. Measured with `node scripts/check-doc-snippet-types.mjs` against the built closure, one edit at a time: marker retired, no discriminant exit 1 TS2741 x1 TS2322 x0 + type: 'object-calendar' exit 1 TS2741 x0 TS2322 x1 + const schema: ObjectCalendarSchema, import widened exit 0 0 0 So the block is annotated rather than left inferring. That is not a new style on this page: nine consts here carry the `object-calendar` discriminant and the other eight were already annotated `: ObjectCalendarSchema`. This one was the lone straggler. The fragment declaration is retired with no replacement, which moves the block from exempt to gated -- covered blocks to compile 670 -> 671, declared fragments 157 -> 156, and the gate reports 671 of 671 judged, 0 failed. The false prescription sentence leaves with it and is not carried into any new prose. `CalendarView`'s half of the block is untouched, as are `packages/plugin-calendar/src/**` and `packages/types/**`. No cast, no new fragment reason, no `UNGATED_DOCS` entry. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012EpHzwH4wTy5sd7ibkD2yq
|
changeset-claim-re-read
|
Part of #7311
The
ObjectCalendarhalf of this page's Direct Component Usage block rode adoc-snippet: fragmentdeclaration, socheck:doc-snippetsnever compiled it. Thatdeclaration named its own repair: add the missing
type: 'object-calendar'discriminant, "not a cast".
Measured on this head, that prescription does not work — and the reason's own
framing says why without following it through. The literal is assigned to an
untyped
constfirst. The reason notes one consequence of that (theexcess-property check does not fire, which is why the
calendarmember does noterror). There is a second it does not name: an untyped
constalso widenstype: 'object-calendar'tostring, so a discriminant written there can neversatisfy a literal-typed member.
Measurements — mine, one edit at a time
node scripts/check-doc-snippet-types.mjs(=pnpm check:doc-snippets) against thebuilt
--build-filterclosure (35/35 turbo tasks successful). Exit codes capturedwith redirect-then-capture, never read through a pipe.
type: 'object-calendar'const schema: ObjectCalendarSchema+ the block's type-only import widenedRun 2 reproduces the fragment reason's own numbers (TS2741 x1 / TS2322 x0) on this
head, so the reason's figures are live and correct. Run 3 is what this PR's
first premise predicted would be enough and is not — verbatim:
Run 4 is what this PR ships. Re-measured end to end on the pushed tree, not
reused from the probe:
Covered-blocks-to-compile 670 -> 671 and declared fragments 157 -> 156 is the
block moving from exempt to gated, which is the point of this change. The gate's
own controls held on that run: resolution landed on
packages/types/dist/index.d.ts, the sentinel produced its TS2305, the positivecontrol produced none.
Why annotate rather than leave it inferring
Not a new style for this page. Nine consts here carry the
object-calendardiscriminant, and the other eight were already annotated
: ObjectCalendarSchema(
fieldMappedCalendar,objectProviderCalendar,valueProviderCalendar,eventClickCalendar,dateClickCalendar,appointmentCalendar,eventCalendar,taskCalendar). The Direct Component Usage literal was the lone straggler; it nowjoins them.
The fragment declaration is retired with no replacement prose, so the sentence
that is false at this head leaves with it. Verified absent from the committed file:
a search for
not a castovergit show HEAD:content/docs/plugins/plugin-calendar.mdxreturns 0.
Scope
CalendarView's half of the block is untouched.packages/plugin-calendar/src/**and
packages/types/**are untouched. No cast, no newfragmentreason, no newUNGATED_DOCSentry — this is a narrowing in both directions.Clause-②: no. One file changed, under
content/docs/. No exported symbol movesand no key is added to any published payload.
Other gates and pins, run on this tree
check:doc-snippetscheck:changeset-presencecheck:control-bytescheck:doc-fencescheck:doc-example-idscheck:new-line-citationscheck-governed-queue-guard --testcontent/docs(16 files)That last row is the full set
scripts/markdown-test-inputs.mjsdeclares as readingthis page or walking
content/docs/**, run from the repo root with root-relativepaths.
packages/types/src/__tests__/object-calendar-record-source-7313.test.tsasserts"No bare
object-calendarliteral is left unannotated on the page". It was greenbefore this change and it is green after, and that is not evidence this change
landed: its regex is anchored at column 0, so it never could see a literal indented
inside a function, and it also requires the discriminant to be the literal's first
member. Filed as #9676 and ⛔ deliberately not touched here.
What did change is the claim underneath it. Measured on the new page: nine consts
carry the discriminant and all nine are annotated — so the pin's stated claim is
true for the first time, while the instrument that states it remains just as blind.
🤖 Generated with Claude Code
https://claude.ai/code/session_012EpHzwH4wTy5sd7ibkD2yq
Generated by Claude Code