Skip to content

finding(fields): LocationField.optionalKeys.test.tsx pins LocationValueSchema as NOT strict — flips red the day objectui takes the @objectstack/spec release carrying objectstack#13802 #7267

Description

@claude

Summary

packages/fields/src/__tests__/LocationField.optionalKeys.test.tsx pins, by name, that @objectstack/spec's LocationValueSchema is not strict ("pins WHY those assertions read keys and not safeParse: the schema is not strict" — LOCATION_SCHEMA.safeParse(polluted).success === true for { lat, lng, latitude, longitude }), and packages/fields/src/widgets/LocationField.tsx carries the matching comment ("LocationValueSchema is a plain, NON-STRICT z.object, so it ACCEPTS a polluted object and merely strips the unknown keys"). Measured at the pin d8ec8d6d4f011b11c8eb1e6dbd364ef206711391 (objectstack .objectui-sha), lines 217–224 of the test and ~125 of the widget.

objectstack#13802 (maintainer ruling 2026-09-01, option A) makes LocationValueSchema and AddressSchema strict: an undeclared key is refused by name (unrecognized_keys, with a rename latitudelat, longitudelng, postal_code / zipCodepostalCode). The day this repo takes a @objectstack/spec release carrying that change (it ships as a minor under the launch-window convention, protocol major 18, D3 entry address-location-value-unknown-keys-refused), that pin goes red — correctly — and the comment becomes false.

What does NOT move

Measured at the pin: LocationField.tsx's two runtime safeParse sites (isSpecAcceptedLocation, refusedRangeMessage) only ever parse a widget-built { lat, lng, altitude?, accuracy? } candidate (a key-by-key pick, deliberately not a spread), so their verdicts do not change under the strict schema. AddressField parses nothing at runtime; its AddressField.postalCode.test.tsx parses only the widget's own output, which never carries zipCode. The READ guard isLocationValue is hand-written and unaffected — legacy values still render.

Expected fix (when the spec bump lands)

  1. Repin LocationField.optionalKeys.test.tsx's last test to the strict contract: safeParse(polluted).success === false with the unrecognized_keys issue naming latitude / longitude — the reason the widget reads emitted keys rather than safeParse is now the OPPOSITE one (the spec IS the guard), so the test's prose flips with the assertion.
  2. Update the carryOptionalKeys comment in LocationField.tsx accordingly (the key-by-key pick stays — it is still the right shape; only the "the spec cannot be that guard" sentence is stale).

⛔ No consumer-side alias for postal_code / zipCode / latitude follows from this (AGENTS.md #0.1; objectstack#13802's ruling item 5) — the widget's existing read-time LegacyAddressValue display compatibility is untouched by the spec change and is not what this issue is about.

Blocked-by: objectstack-ai/objectstack#13802 (its PR must land and a @objectstack/spec release carrying it must be taken here first).

Related: objectstack#13388, objectstack#5143, objectui#6812, objectui#6664.

Generated by Claude Code


Generated by Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    domain:uiobjectui ui stream: fix lands on the published library or apps — objectui execution seatpriority:p3

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions