You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 6e47e16
Browse filesBrowse the repository at this point in the historyBrowse files
refactor(spec): share the form object-name resolver with lint (#25979)
_Requested by **Steedos** · [project
thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9UbbTHQmGisuNMkvo5hbWyoWo5)_Fixes#25756
Clause-②: yes (widening)
Metadata-protocol: none
## What
The rung order that resolves the object an open anonymous form submits
into (the form's `data.object`, else the view's `list.data.object`,
`form.data.object`, `object`) was typed twice: as
`anonymousFormObjectName` in `@objectstack/metadata-core` and as
`candidateObjectName` in the lint rule
`validate-public-form-file-fields`. It now lives once, in
`@objectstack/spec/ui` beside `anonymousFormIntakeCandidates`.
- `packages/spec/src/ui/anonymous-form-intake.ts`: declares and exports
`anonymousFormObjectName`; the docblock no longer says it stays in
metadata-core.
- `packages/metadata-core/src/anonymous-form-intake.ts`: re-exports the
spec function. The consumers (rest `form-routes.ts`, `rest-server.ts`,
metadata-protocol `runtime-authoring-gate.ts`) import from metadata-core
unchanged.
- `packages/lint/src/validate-public-form-file-fields.ts`: imports it
from `@objectstack/spec/ui`; `candidateObjectName` is gone.
- Pins: the metadata-core identity test now also holds
`anonymousFormObjectName` to be the spec binding itself (module and
barrel); a lint test pins that the rule imports it from
`@objectstack/spec/ui` and keeps no retyped copy.
- Generated: `api-surface/ui.json` and `export-origins/ui.json` (one
added export); one changeset.
## Behaviour effect (stated, as ordered)
Lint's old helper went through `viewObjectName` (view-walk.ts), which
also reads `objectName` on a raw input and skips non-string or empty
values. The shared function is the doors' own raw read and does neither,
so lint now judges exactly the object the doors resolve. A form that
sets `objectName` (not a spec key) or an empty or non-string `object` no
longer binds an object in this rule; the doors never honoured those
either, so the rule no longer judges a form the doors cannot reach. No
producer in the repo was found relying on the old reading.
## Measurements
- `git grep candidateObjectName -- packages`: 0 hits after the change.
- `git grep "v.list?.data?.object" -- packages` still hits
lint-view-refs.ts:185, an unrelated candidate list (the card's own
correction).
- Landing point as expected; no other producer package found.
## Acceptance notes
Gate and test readings are in the os-dev report comment on #25756.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01NRNx6Ah37J9r3zaMuuC4fs)_
---------
Co-authored-by: Claude <noreply@anthropic.com>
`@objectstack/spec/ui` now exports `anonymousFormObjectName`, the object an open anonymous form candidate submits into (the form's `data.object`, else the view's `list.data.object`, `form.data.object`, `object`). `@objectstack/metadata-core` re-exports the same function, and the public-form file-field lint rule in `@objectstack/lint` resolves the object through it instead of a retyped copy, so the doors and the lint cannot disagree.
0 commit comments