Skip to content

Retire the "declared divergence" note on the two metadata writers' reference.trim() !== '' guard — the spec now refuses a whitespace-only reference upstream (objectstack#16920) #8621

Description

@os-zhuang

Terminal state (one sentence)

@object-ui/app-shell's MetadataService.saveFields / saveObject and @object-ui/plugin-designer's MetadataFieldsPage keep their typeof reference === 'string' && reference.trim() !== '' guard, and the docblocks (and any changeset prose still describing it) call it contract-following, not a deliberate divergence.

Background

objectui#7685 (part of objectui#7122) declared, in both writers' docblocks and in its changeset, that refusing a whitespace-only reference was a deliberate divergence from @objectstack/spec, which at 17.3.0 accepted ' ' (objectstack#16126). objectstack PR #16920 (fix(spec): refuse a whitespace-only reference on lookup / master_detail, contract review PASS at ab4d4a284, objectstack-ai/objectstack#16920 (comment)) trims before the emptiness test, so the spec now refuses the same shape under the same custom issue. The client guard becomes contract-following; only the note is stale.

Work

  • Rewrite the two docblocks: the guard mirrors the spec's own rule (cite the spec refinement in packages/spec/src/data/field.zod.ts), no longer a local opinion. ⛔ Do not remove the guard: it still gives the author an editor-time refusal before the publish gate does.
  • Retire any "declared divergence" sentence in a pin or test description that names it (grep divergence / stricter than the contract under packages/app-shell/src and packages/plugin-designer/src).
  • No behaviour change; Clause-②: no (nothing accepted or refused differently on this side).

Gate

Do this after objectstack#16920 is MERGED and the pinned @objectstack/spec in this repo carries the trimmed refinement (check node_modules/@objectstack/spec or the lockfile's pin; if the pin predates the fix, the docblock must say "matches the spec from <version>" rather than "matches the installed spec"). Re-check command: git grep -n "divergence" -- packages/app-shell/src packages/plugin-designer/src → 0 hits when done (positive control: git grep -c "reference.trim()" -- packages/app-shell/src ≥ 1).

Related

objectstack#16126 · objectstack PR #16920 · objectui#7685 · objectui#7122.

Filed by the director seat after the contract review of objectstack PR #16920 (review finding F4 / triage boundary ②).

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:specobjectui spec stream: fix lands on packages/types, schema corpus or spec pin coupling — spec lanepm:queuepriority:p3

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions