The union declared a value nothing enforced: the registered calendar-view
renderer's `view` input declares enum ['month','week','day'],
resolveAuthoredView resolves 'agenda' to undefined (the component's 'month'
default), and CalendarView renders no agenda view. Zero measured authors of
view: 'agenda' (in-repo, examples, catalog, and the objectstack tree).
Narrowing the accept set is the substance: `view` is a declared key, and
declared keys are validated even under .passthrough(), so view: 'agenda' is
now an invalid_value error on the `view` path where it previously parsed
green. Undeclared keys still pass through. Runtime resolver unchanged.
Value-level residue of objectui#5667's key-level ruling (the renderer is
authoritative; converge the declaration on the measured read set), ADR-0049
enforce-or-remove.
Fixes#5740
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E7snar5mwF7qoXJazqKhys
Fixes#5740
Direction
Option A — narrow the value union — inherited from the maintainer's 2026-08-22 ruling on #5667 ("the renderer is authoritative;
CalendarViewSchemaconverges on the measured read set"), of which this card is the value-level residue on the same renderer. Recorded in the claim comment on #5740 as a veto window; both stop conditions were re-measured and hold (below). Not a fresh adjudication.What changed
CalendarViewMode(packages/types/src/complex.ts) is now'month' | 'week' | 'day';CalendarViewModeSchema(packages/types/src/zod/complex.zod.ts) is nowz.enum(['month', 'week', 'day']).describeonview, and theCalendarViewSchematable row incontent/docs/api/schema-reference.mdno longer teach an'agenda'fallback.packages/types/src/__tests__/calendar-view-mode-agenda-retired.test.ts(modeled onowner-retired-contract-twins.test.ts) — refusal envelope (invalid_valueon theviewpath, offered vocabulary asserted), full-green survivors, passthrough control,@ts-expect-errorTS twin (enforced viatsconfig.test.jsonchained fromtype-check).minorfor@object-ui/types(majors track@objectstack), body states the breaking semantics.resolveAuthoredViewand the registry input (enum: ['month','week','day']already declared) — the runtime boundary still resolves any off-union value in raw metadata to the'month'default, andcalendar-view-renderer.propsContract.test.tsx's off-enum fixture still pins that branch (it authorsview: 'agenda'through anas nevercast; after this change that value is simply another off-enum spelling, which is exactly what the fixture represents).Unlike #5667's key retirements (no new rejections under
.passthrough()),viewis a declared key and declared keys are validated even under.passthrough(). Measured on this tree before the change:CalendarViewSchema.safeParse({type:'calendar-view', view:'agenda'})→success: true. After:success: false, exactly oneinvalid_valueissue on theviewpath offeringmonth/week/day. Undeclared keys still pass (pinned by the passthrough control test). Clause-② dispatch at tier per the claim comment; no compensating label exists in this repo.Measurements (stop conditions and reachability)
view: 'agenda': swept objectui (all file types, includingexamples/, catalog, docs) and the full objectstack tree — the only occurrences are the declarations themselves and the props-contract fixture that pins the off-enum drop branch. Stop condition 1 holds.['month','week','day'](calendar-view-renderer.tsx:451),resolveAuthoredViewdrops off-enum values (:115),CalendarView's own prop and switcher are three-valued,ObjectCalendarreadsdefaultViewas three-valued. Stop condition 2 holds.CalendarViewModereachability: consumers areCalendarViewSchema.viewand the HOST-ONLYonViewChangeparameter — both on this same renderer contract; no other package imports the symbol (narrowing a callback parameter is contravariance-safe for hosts).CalendarViewModeSchema's only consumer is theviewkey. ThedefaultViewenums inobjectql.ts/objectql.zod.tsare textually independent inline unions, not consumers — same defect class on a different declaration, filed separately rather than smuggled in here.File surface note
The claim's file surface was
packages/types/src/complex.ts,packages/types/src/zod/complex.zod.ts,packages/plugin-calendar/**, changeset. This PR additionally touches one row ofcontent/docs/api/schema-reference.md(line ~1079) — the docs-table copy of the fallback the dispatch explicitly required reconciling ("a retired value still described as 'falls back to month' is a new contradiction"). Declared here as the dispatch-mandated increment; nopackages/plugin-calendarsource needed changing (registry side already correct).Verification (union re-run at
e168a0a43, the PR head)pnpm --filter @object-ui/types type-check&&pnpm --filter @object-ui/plugin-calendar type-check— green (scripts echoed).pnpm exec vitest run packages/types/ packages/plugin-calendar/from repo root —Test Files 56 passed (56),Tests 590 passed (590).origin/main(mutation anchored on disk — enum-line grep 0→1), reran the new pin —Tests 3 failed | 3 passed (6), exactly the predicted split (rejection legs red, survivors/passthrough green); trap-restored, restore confirmed by grep (1→0) and cleangit status..d.tsreverse verification: tsc probe againstpackages/types/dist—error TS2322: Type '"agenda"' is not assignable to type 'CalendarViewMode'; the'week'control compiles clean.check:control-bytes✅,check:spec-symbols✅,check:doc-types✅ ("Every documented component type is registered."),check-changeset-presence✅,check-changeset-no-major✅,check-changeset-fixed✅,check:esm-specifiers✅,@object-ui/typeslint 0 errors.check:doc-snippetswas not concluded locally — its preflight red is the known unbuilt-closure gauge ("The snippet program was NOT run"; it kept naming more unbuilt packages after one bounded build round). The edited docs line is a prose table row, not a snippet; CI's built run is the verdict.Overlap scan
packages/typesis serialised: #5494 (ReferenceRailEntry) is queued behind this card and not dispatched; this PR does not touch that surface. #5494 remains open and is not addressed here.Generated by Claude Code
Generated by Claude Code