Repository navigation
Commit 236c804
feat(spec)!: retire the boolean arm of a relationship field's inlineEdit, which read as absent once a parent field group decides the placement (#36802)
repo:objectstack#7 · os-alice · session_011y7As5bdhV5T4N9vpjmZzH
Fixes #35926
Clause-②: no (narrowing)
Metadata-protocol: narrowed
Skills-docs: follow-up #37042
## 维护者速读
- 用户能看到什么变化:写元数据的人(包括 AI
搭建)在主从或查找字段上写「内联编辑」为真或假时,校验直接报错并写出改法;已经存下来的旧定义在启动和迁移时自动去掉这个值,页面表现不变。字段设计器里多了一个「表格
/ 表单」下拉框来选子表的编辑方式。
-
为什么做:维护者裁定「一律只看分组」之后,子表进不进父表单只由父对象的字段分组决定,这两个真假值读起来和不写完全一样,属于写了没用的键(记录页重做专题的收尾)。
- 出错会怎样:最坏是有人在源码里写了真假值,升级后校验被拒并看到改法;已存数据走自动转换,不会坏页面。撤回即还原本改动。
- 要你做什么:无。
## What changes
Per the maintainer's field-group ruling on #35889 (record 7046311205,
「一律只看分组」), a field group of the parent decides whether the parent's form
inlines a child, so a relationship field's `inlineEdit` only picks the
form factor of a placed child. Measured on `origin/main` e343ab7, every
reader passes anything but `'grid'` / `'form'` as absent:
- `ui/packages/app-shell/src/providers/MetadataProvider.tsx`
(`attachInlineSubforms`): `d.inlineEdit === 'grid' || d.inlineEdit ===
'form' ? d.inlineEdit : undefined`;
- `ui/packages/plugin-form/src/deriveMasterDetail.ts`
`resolveInlineMode`: `true` / `false` / `undefined` all take the smart
default;
- `packages/lint/src/validate-field-consumers.ts` `formFactorOf`:
`undefined` for anything else;
- the lint rules R5 / R6 (`data-model-rules.ts`) no longer read the
value at all.
So `false` reads exactly as absent too, and the whole boolean arm is
retired, not only `true`. One non-runtime reader treats `true`
differently, the scenario scorer; see Acceptance notes.
- **`@objectstack/spec`**: `FieldSchema.inlineEdit` narrows from
`boolean | 'grid' | 'form'` to `z.enum(['grid', 'form'])`, and the
enum's own error map answers a boolean with the prescription
(`INLINE_EDIT_BOOLEAN_RETIRED`, house five-part shape and `os migrate
meta --from 17` sentence). `tsc` refuses a boolean at every typed site.
The route is a value narrowing like `indexes[].unique: true` (the same
refusal-by-error-map precedent): `enumWithRetiredValues` takes string
members only, so it cannot name a boolean arm.
- **ADR-0087**: D2 conversion `field-inline-edit-boolean-removed`
(lossless delete of a boolean on `objects[]` / `objectExtensions[]`
field maps, `retiredFromLoadPath: true`, `retiredAfter: '18.6.0'`), in
`MAJOR_18_CONVERSIONS` at order 84; D3 semantic entry
`field-inline-edit-boolean-retired`; a step-18 rationale fragment; a
JOIN row in `retired-key-removal-version.pin.test.ts`. No
`RETIRED_KEYS_BY_MAJOR` row: the key is not tombstoned.
- **Liveness**: `field.json` `inlineEdit` stays `live` for the two
surviving values, now with `verifiedAt`, in-repo evidence and the
narrowing in its note. State counts unchanged.
- **Field form**: with the union gone, a select spells every value, so
the omit row "no registered widget spells this union" no longer holds.
The field form offers `inlineEdit` as a Grid / Form select on `lookup` /
`master_detail`; the reconciliation ledger drops the row and the ruled
class drops `field.inlineEdit`, as that test's own header prescribes for
"a ruled key that a form offers later". i18n bundles regenerated
(`check-i18n-bundles.mjs --write`), zh-CN / ja-JP / es-ES translated by
hand; the echo-decisions count pin carries one more row label (824 after
the second main merge: main's 823 plus this PR's one label).
- **`relatedList` prose** kept true: it no longer calls itself "the
read-side mirror of inlineEdit" but "the record-page side; inlineEdit
picks the form factor on the form side".
- **Authored values**: the CLI golden metadata-eval corpus places its
line items with a parent field group (`fieldGroups[].relatedList`)
instead of `inlineEdit: true`, since each prompt asks for lines entered
with the parent; test fixtures in spec, cli and app-shell are respelled
to `'grid'` or the key is dropped. Docs (`field-types.mdx`,
`fields.mdx`, `common-patterns.mdx`, `flows.mdx`) teach `'grid' |
'form'`. Stale comments in `project.view.ts`, `deriveRelatedLists.ts`,
`validate-field-consumers.ts`, `score.ts` fixed.
- Changeset `.changeset/35926-field-inline-edit-boolean-retired.md`
(spec minor, cli patch, platform-objects patch, lint patch: the lint
edit is comment text on unexported functions) with FROM → TO table and
ADR-0087 disposition.
File-surface notes: the claim listed
`examples/app-showcase/src/ui/views/task.view.ts` and
`packages/lint/src/showcase-shape.fixtures.ts`; both carry the
VIEW-level `inlineEdit` (a different, live key) and are untouched.
Producer-side files outside the listed surface, each a direct
consequence of the narrowing: `field.form.ts`,
`metadata-form-zod-reconciliation.test.ts`, the platform-objects
translation bundles and their count pin, cli `score.ts` comment and four
cli tests, the app-shell inspector test.
## Tests
- New `packages/spec/src/data/field-inline-edit-boolean.pin.test.ts`
(14): `true` / `false` refused at `inlineEdit` with `invalid_value` and
the prescription; `'grid'`, `'form'`, absent parse; an unknown string
keeps zod's own message; `@ts-expect-error` on a typed boolean; the
conversion deletes a boolean on both collections and leaves `'grid'` /
`'form'`; step-18 wiring.
- No tree-scoped absence pin: the view-level `inlineEdit` is a live
boolean key of the same name, so a text scan cannot tell the retired
spelling from the live one. The sweep is the input type and the parse.
<details><summary>Package runs on earlier head 5874e77 (after the
first main merge at 57445a6; the second merge changed only the count
pin and the changeset)</summary>
- `@objectstack/spec` test: Test Files 890 passed (890), Tests 28186
passed, 1 todo; typecheck exit 0.
- `@objectstack/lint` test: Test Files 231 passed (231), Tests 9567
passed; typecheck exit 0.
- `@objectstack/cli` unit tier: Test Files 443 passed (443), Tests 6325
passed; typecheck exit 0. Integration tier declared to CI (no
integration-tier file or spawn entry in the diff).
- `@objectstack/platform-objects` test: Test Files 125 passed (125),
Tests 2138 passed; typecheck exit 0.
- `@object-ui/app-shell`
`ObjectFieldInspector.relatedList-27054.test.tsx` (run from the `ui/`
root): 8 passed.
- `@objectstack/example-showcase` typecheck exit 0.
- `test:repo` (vitest `repo` project) not run locally: the diff edits
none of its tests and the derived list does not name it; CI's `Test
Core` carries it.
</details>
## Acceptance notes
- Run history: the first dev ran on os-dev agent defaults (no model or
effort passed explicitly, before the seat's tier/effort convention); its
work up to `214ce2d72c` is carried. This head was produced by a
seat-owned resume on the default tier (opus), effort high: a fresh
worktree, `origin/main` merged (a merge, not a rebase) through
`scripts/pm/os-regen-merge.sh`, the one deferred artifact
(`content/docs/references/data/object.mdx`) regenerated from the merged
tree, then every spec artifact gate re-run.
- `packages/qa/scenarios/src/score/scenario-tags.ts`
(`records-forms.master-detail-inline-edit`) credits `inlineEdit ===
true` as "edited inline". Since #35889 `inlineEdit` alone inlines
nothing, and since this PR a boolean is refused at parse, so that branch
can only see an unparsed stack. Not changed here; carried by #37127.
- `docs/adr/0035-config-driven-master-detail.md` still shows
`inlineEdit: true` as history; governed surface, not edited.
- `skills/objectstack-data/rules/relationships.md` still teaches
`inlineEdit: true` as "auto"; skills are out of this PR's surface;
carried by #37042 (release-coupled: lands before the release that ships
this narrowing). `check:skill-examples` is green (the block is
unmarked).
- Seven non-hand-translated locales (ar, de, fr, ko, pt-BR, ru, zh-Hant)
carry the new form label filled with the source text;
`check:i18n-coverage` reports none new.
- Sister repos (hotcrm, cloud) not measured from this container: any
stored or authored boolean there meets the conversion at rest and the
prescription at authoring.
- `pnpm check:platform-checklist` reads red on `origin/main` itself
(57445a6 and a73edb3):
`docs/qa/platform-checklist/areas/access-security.json` anchors
`anonymousFormExplicitWithdrawals` in
`packages/metadata-core/src/anonymous-form-intake.ts`, which no longer
declares it. This diff touches neither file; the gate is outside per-PR
CI and its nightly watchdog carries it.
## Verification
First read (by risk):
1. `packages/spec/src/data/field.zod.ts` — the narrowed enum and
`INLINE_EDIT_BOOLEAN_RETIRED`.
2.
`packages/spec/src/conversions/entries/18/field-inline-edit-boolean-removed.ts`
— the lossless delete and its fixture.
3. `packages/spec/src/data/field.form.ts` +
`metadata-form-zod-reconciliation.test.ts` — the new form row and the
ledger change.
Two-minute check: `pnpm --filter @objectstack/spec exec vitest run
src/data/field-inline-edit-boolean.pin.test.ts` — expect 14 passed, the
refusal message starting with `` `field.inlineEdit: true` and
`field.inlineEdit: false` were removed in @objectstack/spec 18.7.0 ``.
<details><summary>Readings on head ca353cc (second main merge at
bfd1049, merge commit f671e98)</summary>
- Count pin `object-lifecycle-panel-echo-decisions.test.ts`: 35 passed,
pinned at 824. i18n bundles regenerated with zero byte change;
`check:generated`: all 14 artifacts up to date.
- `pnpm --dir ui exec vitest run scripts/`: 172 files passed, 2 skipped.
cli `migrate-meta-engine-guidance.test.ts`: 3 passed. Full build (`turbo
run build --filter=!@objectstack/docs`): `VERDICT command-exit 0` after
the post-merge `pnpm install --frozen-lockfile`.
- `dispatch-gates --commands` derived 128 families; `--ran`: 128
accounted for, 127 run, 1 NOT-MEASURED: `check:type-check-debt` (its
closure build never got a turn on the shared verify lock; CI's `Type
Check · debt ledger` is success).
- Full dogfood battery (`pnpm --filter @objectstack/dogfood test`, no
shard, no path): `DOGFOOD_EXIT=0`, Test Files 487 passed, 3 skipped
(490), Tests 4128 passed, 68 skipped (4196), 0 failed. Caveat: it ran in
a locked batch whose last leg read an earlier failed build attempt
(service-knowledge, outside the dogfood closure), so the lock line reads
`batch-last-exit 1`, not the battery's own verdict; the seat review
7144293247 accepted it as head-pinned evidence.
- PR check-runs on ca353cc: 61 success, 9 skipped, 0 failed, 0
pending; all eleven required contexts success, Check Changeset success.
</details>
<details><summary>Gates (local, earlier head 5874e77)</summary>
- `check:generated` (after `gen:schema && gen:docs` over the merge, spec
rebuilt from the merged tree): all 14 generated artifacts up to date.
- `dispatch-gates --commands` derived 128 families; all 128 run with
exit codes recorded; `--ran` reconciliation: 128 derived, 128 run, 0
NOT-MEASURED, 0 UNRUN (a derived zero). Exit 0 for 127, including
`check:dual-build-cjs-loads` and `pnpm --dir ui exec vitest run
scripts/` (172 files passed, 2 skipped), both NOT MEASURED on the
previous head. Exit 1: `check:platform-checklist`, the main-side anchor
named in Acceptance notes.
- `check:type-check-debt` under the lock: OK, 129/132 type-checked, 0
above ledger.
- Local-only state gates: `check:dev-prereqs` 0,
`check:skill-frame-freshness` 0.
- Full dogfood battery on this head (`pnpm --filter @objectstack/dogfood
test` under the lock, no shard, no path, every package built from the
merged tree): `VERDICT command-exit 0`, Test Files 487 passed, 3 skipped
(490), Tests 4127 passed, 68 skipped (4195), no failure.
- PR check-runs on 5874e77: 70 runs, 61 success, 9 skipped, none
failed or pending; the eleven required contexts (Lint & Repo Gates,
TypeScript Type Check, Test Core, Build Core, Governed Surface Queue
Guard, Lint UI, Type Check UI, Test UI, Build & E2E UI, Live E2E UI,
Dogfood Regression Gate) all success, Check Changeset success.
</details>
---
_Generated by [Claude
Code](https://claude.ai/code/session_011y7As5bdhV5T4N9vpjmZzH)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 32c197e commit 236c804
49 files changed
Lines changed: 526 additions & 70 deletions
File tree
- .changeset
- content/docs
- automation
- data-modeling
- getting-started
- references
- data
- system
- examples/app-showcase/src/ui/views
- packages
- cli
- src/lint
- test
- lint/src
- platform-objects/src/apps/translations
- spec
- liveness
- src
- conversions
- entries/18
- data
- migrations
- entries/semantic
- system
- ui/packages/app-shell/src
- utils
- views/metadata-admin/inspectors
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1033 | 1033 | | |
1034 | 1034 | | |
1035 | 1035 | | |
1036 | | - | |
| 1036 | + | |
1037 | 1037 | | |
1038 | 1038 | | |
1039 | 1039 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
564 | 564 | | |
565 | 565 | | |
566 | 566 | | |
567 | | - | |
| 567 | + | |
568 | 568 | | |
569 | 569 | | |
570 | 570 | | |
| |||
574 | 574 | | |
575 | 575 | | |
576 | 576 | | |
577 | | - | |
| 577 | + | |
578 | 578 | | |
579 | 579 | | |
580 | 580 | | |
| |||
594 | 594 | | |
595 | 595 | | |
596 | 596 | | |
597 | | - | |
| 597 | + | |
598 | 598 | | |
599 | 599 | | |
600 | 600 | | |
| |||
622 | 622 | | |
623 | 623 | | |
624 | 624 | | |
625 | | - | |
| 625 | + | |
626 | 626 | | |
627 | 627 | | |
628 | 628 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
241 | | - | |
| 241 | + | |
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
| |||
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
253 | | - | |
| 253 | + | |
254 | 254 | | |
255 | 255 | | |
256 | 256 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
140 | | - | |
| 140 | + | |
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
| 85 | + | |
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
| 89 | + | |
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| |||
0 commit comments