Skip to content

ADR-0089 D3a: flip .strict() on view/page schemas so mis-layered visibility keys are loud errors #2902

Description

@os-zhuang

Follow-up to #2642 / #2900 (ADR-0089). D1 (canonical visibleWhen) + D2 (deprecated visibleOn/visibility aliases normalized at parse) have landed. This tracks D3a.

Goal

Per ADR-0049 (enforce-or-remove) and ADR-0078 (no-silently-inert), a mis-layered or stale visibility key must be a loud parse error, not a silent strip. Tighten the relevant object schemas with .strict() so e.g. a raw visibleOn surviving past the deprecation window, or a visibleWhen on a schema with no visibility semantics, fails validation.

Why it's staged separately

.strict() on FormFieldSchema / FormSectionSchema / PageComponentSchema rejects every unknown key, not just visibility ones — a large blast radius. The ADR requires sweeping the monorepo + example apps first, then flipping strict. That sweep is bigger than the alias mechanism and risky to land alongside it under parallel-agent development.

Tasks

  • Sweep packages/ + examples/ (and platform metadata) for any keys these schemas currently strip silently; fix or file them.
  • Add .strict() (or a targeted unknown-key guard with UNKNOWN_KEY_GUIDANCE tombstones) to the view form + page component schemas.
  • Confirm the deprecated visibleOn/visibility aliases still parse (they are declared keys, so strict must keep accepting them until removal).
  • Ensure the rejection message points authors at visibleWhen.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority:p3Low: nice-to-have, backlog

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions