Skip to content

fix(lint): field/embedded-sub-fields fix names the field group that inlines the child - #36307

Merged
objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/issue-36281-embedded-sub-fields-hint
Nov 22, 2026
Merged

objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/issue-36281-embedded-sub-fields-hint

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Leehom · project thread
Fixes #36281
Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:作者给「组合/重复」字段声明了子字段时,检查工具打印的修复建议以前说「建子对象并设成表格内联编辑」就能在父表单里编辑明细;现在改成「建子对象,并在父对象的字段分组里点名它」,同时说明内联方式只决定怎么编辑行。
  • 为什么做:属于「检查工具的建议要和平台真实规则一致」这条线,替照着建议改元数据的作者和 AI 解决「照做之后父表单里没有明细行、子对象只是一个标签页」的问题。
  • 出错会怎样:只改一句提示文字和两处测试,规则何时触发、级别和位置都不变;写错的话作者看到的仍是一句不准的建议,直接回退这个 PR 即可。
  • 要你做什么:无。

What changes

State at head bc156e739 (one commit).

  • packages/lint/src/data-model-rules.ts: the field/embedded-sub-fields fix line. It said the child object plus "inlineEdit: 'grid' edits it inline". Since the parent-field-group rule (主从子表默认只是页签,不再自动放进概览和表单;只有字段分组指定时才放进去 #35889, with feat(spec, ui): a master_detail child is a tab by default; a field group puts it in the overview and the form #35921), a child is inlined in the parent's form only when a field group of the parent names it in relatedList; the FK's inlineEdit only picks grid or form. The line now reads: "Make the typed list a child object whose master_detail field points back here, name it in a fieldGroups[].relatedList here (inlineEdit only picks how rows are edited), and remove the key." (193 characters, under the 200 cap.) This follows the spec text EMBEDDED_JSON_TYPED_LIST and the rule's os explain paragraph, which already name the field group.
  • Message text only: the rule id, severity, path and when it fires are unchanged.
  • packages/lint/src/data-model-rules.fix-lines.test.ts: the exact-text pin of this fix line is updated to the new text (it asserts the hint text, nothing else).
  • packages/lint/src/data-model-rules.embedded-sub-fields.test.ts: new top-level describe in the rule's existing harness file: the fix names master_detail, fieldGroups[].relatedList and "inlineEdit only picks how rows are edited", and no longer carries inlineEdit: 'grid'.
  • .changeset/36281-embedded-sub-fields-hint.md: @objectstack/lint patch.

Read first: packages/lint/src/data-model-rules.ts (the one changed string, R14), then the new describe at the end of data-model-rules.embedded-sub-fields.test.ts.

Two-minute check: pnpm --filter @objectstack/lint exec vitest run src/data-model-rules.embedded-sub-fields.test.ts src/data-model-rules.fix-lines.test.ts shows 2 files, 26 tests passed.

Tests

All readings at head bc156e739.

Targeted tests, typecheck, whole lint package
  • pnpm --filter @objectstack/lint exec vitest run --maxWorkers=2 src/data-model-rules.embedded-sub-fields.test.ts src/data-model-rules.fix-lines.test.ts: Test Files 2 passed (2), Tests 26 passed (26).
  • pnpm --filter @objectstack/lint typecheck: exit 0 (tsc --noEmit, then check:test-typecheck OK).
  • pnpm --filter @objectstack/lint exec vitest run --maxWorkers=2: Test Files 224 passed (224), Tests 9409 passed, 5 skipped (9414).
Ablation (one-time, not kept)

node scripts/ablation-replace.mjs swapped the new second half of the fix back to "inlineEdit: 'grid' edits it inline": anchor 1 to 0, blob f16e42de7f96 to 1f785d0f961a. Both pins went red: "routes to fieldGroups[].relatedList and gives inlineEdit only the form factor" and "field/embedded-sub-fields: one line, whatever the type, the keys or the names" (2 failed, 24 passed). Restored: blob equals HEAD (f16e42de7f96), git diff HEAD empty. Vitest reads src/ through the relative import, so no rebuild was needed.

Gates run locally

node scripts/pm/dispatch-gates.mjs --commands derived 63 commands for this diff. 61 exit 0 (check:docs-transcript-drift and check:lean-entry-closure after building lint and objectql; first run exit 3, prerequisite). 2 NOT MEASURED, exit 3 prerequisite: check:dual-build-cjs-loads (needs a full pnpm build; CI runs it) and check-plugin-teardown-shape.mjs --self-test (checker health only; needs an unshallowed clone). --ran reconciliation: 63 derived, 61 run, 2 NOT-MEASURED, 0 UNRUN, exit 0.

Acceptance notes

  • Other inlineEdit hits in packages/lint/src (non-test), left as they are: data-model-rules.ts doc comments near the bulk rule, the group map and R5 already say the field group, not inlineEdit, inlines the child; validate-field-consumers.ts reads inlineEdit only as the form factor (grid or form); showcase-shape.fixtures.ts sets inlineEdit: true on a list view, a different key.
  • Outside packages/lint, content/docs/data-modeling/field-types.mdx says "inlineEdit: 'grid' edits the rows as an inline grid on the parent's form (where a field group of the parent names the child)". It states the group condition, so it is not wrong, only ordered the old way. Not changed here (not on this card's file surface).
  • The pin went into the rule's existing harness file as a top-level describe, not a new card-named file (AGENTS.md: a new pin for a component with a shared harness goes into that file).

Verification

Local only; CI runs the full farm. Net added lines: +28 / -4 (net +24) against merge base 76cb366.


Generated by Claude Code

…nlines the child

The fix line taught `inlineEdit: 'grid'` as what inlines a child; a parent
field group's `relatedList` places it, and `inlineEdit` only picks the form
factor. Pins the hint in the shared harness and updates the exact-text pin.

Claude-Session: https://claude.ai/code/session_01FEkQ5kDGa1ViantgrfH797
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/s documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

1 anchor(s) derived from 1 changed package(s); no hand-written page names any of them, so this run has nothing to list — not a clean bill of health. This check sees only pages that NAME a derived anchor: one that documents this change in prose, or enumerates it in an authoring dialect, names none and stays invisible to it on every run.

What this run could not see
  • the SDK route bridge reached 67 of 249 client-bound route-ledger rows — the other 182 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 182: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 123 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 4 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 4ab1218901d7c3c757217c099f06d377e04ae452 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 1d68b5939b773f7a31d7754adda6b982015c8666 — the merge of head bc156e73996c44f371ccb100c99db291befea100 into base 4ab1218901d7c3c757217c099f06d377e04ae452, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 1d68b5939b773f7a31d7754adda6b982015c8666 && git checkout 1d68b5939b773f7a31d7754adda6b982015c8666
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 4ab1218901d7c3c757217c099f06d377e04ae452 bc156e73996c44f371ccb100c99db291befea100 && git checkout -B drift-repro 4ab1218901d7c3c757217c099f06d377e04ae452 && git merge --no-ff bc156e73996c44f371ccb100c99db291befea100

node scripts/docs-audit/affected-docs.mjs --json 4ab1218901d7c3c757217c099f06d377e04ae452

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-project-manager · session_01FEkQ5kDGa1ViantgrfH797

Final green head · area a4-I · 2026-11-22T05:44Z
Head: bc156e7399 — 57 check-runs success, 11 expected skips, 0 failed, 0 pending; mergeable_state clean (pr-state.mjs); overlap-check clean.
Carries #36281: the field/embedded-sub-fields fix string now routes to a master_detail child named by fieldGroups[].relatedList, with inlineEdit only as the form factor. The exact-text pin was updated and one ablated pin added to the rule's existing harness file.
Next: L1-b reads this head. Not governed (packages/lint/**): the area lands after ACCEPT.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-project-manager · session_01FEkQ5oVqoTJkrRZcyZS4xd
L1-b · 2026-11-22T05:47Z

席位核对 — ACCEPT · head bc156e7

  • Shape: l1-face.mjs --pr 36307 is clean at bc156e7, with 57 success, 11 expected skip, 0 failed and mergeable_state clean.
    • Fixes #36281 is right: every Done-when line is met.
    • The declarations are Clause-②: no · Metadata-protocol: none, and the changeset is a patch on @objectstack/lint. Nothing is governed, so the area lands it.
  • The fix line is true and follows the spec.
    • It now reads: "Make the typed list a child object whose master_detail field points back here, name it in a fieldGroups[].relatedList here (inlineEdit only picks how rows are edited), and remove the key." That is 193 characters, under the one-line cap.
    • It agrees with the spec's EMBEDDED_JSON_TYPED_LIST (packages/spec/src/data/authoring-key-lint.ts: "a field group on this object whose relatedList names that child edits its rows as an inline grid on this object's form").
    • It agrees with MetadataProvider's attachInlineSubforms, read for docs(skills): line items in the parent's form are taught as a parent field group naming the child #36250: a child is inlined only when a parent field group places it, and inlineEdit picks grid or form.
    • The rule's id, severity and path are unchanged.
  • Pins:
    • The fix-lines exact-text pin moves to the new line.
    • A new describe in the rule's own harness asserts master_detail, fieldGroups[].relatedList and "inlineEdit only picks how rows are edited" are present, and inlineEdit: 'grid' is absent.
    • The ablation (the old second half restored) turns both red, 2 failed and 24 passed. The restore was proven against HEAD.
  • The card's grep line: git grep inlineEdit packages/lint/src at this head finds no other hint that teaches inlineEdit as the switch.
    • The data-model-rules.ts comments already name the field group.
    • validate-field-consumers.ts reads inlineEdit only as grid or form.
    • The fixture's inlineEdit: true is a list-view key.
    • The body names each. field-types.mdx states the group condition, so it is not false, and it is off this card's surface.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-project-manager · session_01FEkQ5kDGa1ViantgrfH797

Landing (area a4-I, non-governed self-land) at head bc156e73996c44f371ccb100c99db291befea100, 2026-11-22T05:51Z.

Probe Reading
check-governed-merges.mjs --pr 36307 NOT governed; 32 changed lines ≤ 3000
landing-k.mjs --pr 36307 OK: K = 5 < 15

L1-b ACCEPT 7074982572 is at this head, and there is no spec or contract face. State: ready for review and auto-merge armed; #36281 closes on merge (Fixes).

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 22, 2026 05:57
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 22, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-project-manager · session_01FEkQ5kDGa1ViantgrfH797

Landing (area a4-I, non-governed self-land) at head bc156e73996c44f371ccb100c99db291befea100, 2026-11-22T05:56Z.

Probe Reading
check-governed-merges.mjs --pr 36307 NOT governed; 32 changed lines ≤ 3000
landing-k.mjs --pr 36307 OK: K = 5 < 15

L1-b ACCEPT 7074982572 is at this head, and there is no spec or contract face. State: ready for review and auto-merge armed; #36281 closes on merge (Fixes).

Merged via the queue into main with commit a61b8ab Nov 22, 2026
69 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-36281-embedded-sub-fields-hint branch November 22, 2026 06:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/s tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

2 participants