Repository navigation
feat(spec): the paired .custom package declares an installed object's field-group and tab arrangement - #36517
Conversation
… whole arrangement (WIP) ObjectExtensionSchema gains fieldGroups and relatedLists, written only by a base's paired .custom package: the registry fold applies them last, replacing the owner's arrangement and the extensions' placements key by key, and the save, validate, build and install doors refuse any other writer, prescribing place. Work in progress: reader, docs and generated baselines follow. Claude-Session: https://claude.ai/code/session_01ADHkmRY38EZf38Yy3zthbY Co-authored-by: Claude <noreply@anthropic.com>
… tabs and shown-last rule (WIP) The tab reader and the default page synthesis read the served `_relatedListsArrangement` decoration: a list the environment hides drops its tab, and where the object's own tab list was automatic an unlisted list shows after the listed ones. With no decoration served both readers answer as before. Docs page gains the arrangement section. Claude-Session: https://claude.ai/code/session_01ADHkmRY38EZf38Yy3zthbY Co-authored-by: Claude <noreply@anthropic.com>
…ngeset, and the registry facade back under its line ceiling The getter's contract docblock moves to the registration facet so registry.ts stays within its facade line ceiling. Claude-Session: https://claude.ai/code/session_01ADHkmRY38EZf38Yy3zthbY Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 6 package(s): 75 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 20 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. What this run could not see
Coarse fallback — 189 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 78ec27d016cc83838cb53ba1c515abaa0d03c815 && git checkout 78ec27d016cc83838cb53ba1c515abaa0d03c815
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 96b7975b0587bd3268884ea44f3b3170d90187d3 7052770cd8e35f0577a027a6cf69a06dfde0dc19 && git checkout -B drift-repro 96b7975b0587bd3268884ea44f3b3170d90187d3 && git merge --no-ff 7052770cd8e35f0577a027a6cf69a06dfde0dc19
node scripts/docs-audit/affected-docs.mjs --json 96b7975b0587bd3268884ea44f3b3170d90187d3
|
…nement A `.refine()` on the `fieldGroups` array was a new position at which a rule reaches the runtime and not the published JSON Schema, so the schema build refused it against the dropped-refinements ledger. The rule moves into the extension's existing refinement, which that ledger already records; the refusal's path and message are unchanged. Claude-Session: https://claude.ai/code/session_01ADHkmRY38EZf38Yy3zthbY Co-authored-by: Claude <noreply@anthropic.com>
…ension arrangement keys The entry object's interface takes the schema's type name (ObjectExtensionRelatedListEntryObject) so its reference page keeps an import line. Regenerated: api-surface, authorable-surface, declaration-map, export-origins, json-schema.manifest, the strictness ledger counts and content/docs/references. Claude-Session: https://claude.ai/code/session_01ADHkmRY38EZf38Yy3zthbY Co-authored-by: Claude <noreply@anthropic.com>
…ngement suite Claude-Session: https://claude.ai/code/session_01ADHkmRY38EZf38Yy3zthbY Co-authored-by: Claude <noreply@anthropic.com>
…stom-package-arrangement engine-registration.ts: main moved the extension contribution into objectExtensionContribution (shared with residual entries); the two arrangement keys ride it. Claude-Session: https://claude.ai/code/session_01ADHkmRY38EZf38Yy3zthbY Co-authored-by: Claude <noreply@anthropic.com>
…with main Claude-Session: https://claude.ai/code/session_01ADHkmRY38EZf38Yy3zthbY Co-authored-by: Claude <noreply@anthropic.com>
… anchors The translation-reference rule was sized against an extension that could not declare field groups. The shared extension fold now carries `fieldGroups`, and the rule adds each group key to the target's `_sections` anchors, so a bundle key for a group the arrangement brings is not reported as an orphan. The connector redactor's decoration fixture lists the new read decoration. Claude-Session: https://claude.ai/code/session_01ADHkmRY38EZf38Yy3zthbY Co-authored-by: Claude <noreply@anthropic.com>
…ves the field A placement sets the placed field's `group` to the owner's group. Where the `.custom` arrangement replaces the groups and has no group of that key, the field kept a `group` naming nothing, and folding the served body again answered differently. The fold now takes such a `group` off a field the `.custom` extension does not declare, so the field shows after the last group and a refold is the identity. The two suites' layout helper no longer reports the trailing bucket when it holds system fields only. The changeset lists the lint package. Claude-Session: https://claude.ai/code/session_01ADHkmRY38EZf38Yy3zthbY Co-authored-by: Claude <noreply@anthropic.com>
|
l2-review#4 · os-steve · session_01ADHkmT4eA4YqtxfiPyLPih Contract-review-claim: session_01ADHkmT4eA4YqtxfiPyLPih · head f87f5e2 · 2026-11-22T19:06Z |
|
l2-review#4 · os-steve · session_01ADHkmT4eA4YqtxfiPyLPih Contract reviewServed-tier: ① Derived judgmentsCheck-runs on the head: 70 runs, 61 success, 9 skipped (opt-in and schedule-only jobs), 0 failed, 0 pending. Test Core 10 of 10, Test UI 16 of 16, the Type Check lanes, Lint and Repo Gates, Check Changeset, Spec property liveness and Governed Surface Queue Guard are success. These are the gate verdicts; nothing was re-run. Accept-set and public-surface changes the diff implies:
② Semver levelThe changeset declares Clause-②: yes (widening) — on the PR body and in the changeset, and it agrees with ①: every changed position accepts more or the same; none narrows. One sentence of the changeset overstates (evidence only, the changeset is the lane's): "was already refused at parse, and is still refused" does not hold on the three paths of N1. ③ Boundary flagsSQL push-down: no finding. The diff adds no query, no id materialisation and no in-app join; the fold and the readers work on metadata bodies already in memory. Security: no hunk changes who can read or write a record or a field. A hidden tab and a field in a hidden group are presentation: the list and the field still read over the API under the caller's permissions. The arrangement is written by whoever may write a The dev's five forks and the sixth
Other flags:
④ Design judgment
S1 (should-fix) — hiding every tab of a declared tab list reveals the lists the owner hid. Trace: the owner declares S2 (should-fix) — the choice among several S3 (should-fix) — the published recipe for hiding a base field omits what it breaks. The Implementing files, against the contract:
N1 (nit) — three paths accept a non- N2 (nit) — S1, S2 and S3 are open on this head and earn a delta review of their fixes. Forks 1 (the lone non-pair writer) and 3 go to the maintainer. Implemented-by: VERDICT: PASS |
…ab list stays a declared one; the field-hide recipe states its limits Three should-fix items of the contract review of the paired `.custom` arrangement. - Hiding every tab of a declared tab list revealed the lists the owner hid. The fold has nothing left to serve there, and an empty `relatedLists` alone reads as "none declared, every list shows". The two readers of the served tab list (the record page's tab reader and the default page synthesis) now read an empty list beside `unlisted: 'hidden'` as a declared list that names nothing. - The choice among `.custom` writers did not know the App pair. The fold now asks `pairsOf` over the installed manifests (the App's pair first, then an installed per-package pair an earlier version created) and serves only a writer in that list, chosen by its position there and never by fold order. A `.custom` package that is not the object's pair is skipped and named, alone or beside the pair. - The published recipe for keeping a base field off the page (a `.custom` group whose `visibleWhen` is false) now says it is presentation only, not access control, and that it is not for a `required` field without a default. The docs page and the changeset follow, and the changeset no longer says a non-`.custom` writer is refused on every path. Claude-Session: https://claude.ai/code/session_01ADHkmRY38EZf38Yy3zthbY Co-authored-by: Claude <noreply@anthropic.com>
|
l2-review#4 · os-steve · session_01ADHkmT4eA4YqtxfiPyLPih Contract-review-claim: session_01ADHkmT4eA4YqtxfiPyLPih · head 7052770 · 2026-11-22T20:32Z |
|
l2-review#4 · os-steve · session_01ADHkmT4eA4YqtxfiPyLPih Contract reviewServed-tier: ① Derived judgmentsCheck-runs on the head: 74 runs (70 on the push, four re-run on the PR body edit), 63 success, 11 skipped (opt-in, queue-verdict and schedule-only jobs, and the body-edit re-runs of Auto Label and Check PR Size), 0 failed, 0 pending. Test Core 10 of 10, Test UI 16 of 16, the Type Check lanes, the Lint lanes, Build Core, Check Changeset, Spec property liveness and Governed Surface Queue Guard are success. These are the gate verdicts; nothing was re-run. What the rework changes in the accept set and the public surface, against the earlier record's ①:
② Semver levelThe changeset still declares Clause-②: yes (widening) — on the PR body and in the changeset, and it agrees with ①: no input accepted on ③ Boundary flagsSQL push-down: no finding. The rework adds no query, no id materialisation and no in-app join. Security: no hunk changes who can read or write a record or a field. The field-hide recipe now says in every published place that it is not access control. The dev's open question (round 2), answered: A is consistent, B is not needed.
Where the installed manifests come from at fold time, as asked:
Flags carried, each still without a change on this head:
④ Design judgmentNo must-fix, no should-fix. S1: closed — the readers now read an empty served
S2: closed — S3: closed — the N2: closed — the docs page and the changeset follow S2 and S3, and the changeset's "still refused" sentence is corrected (②). N1: accepted deviation, follow-up (the changeset now states two of the three paths; no card number is named yet). The hits files on this head:
Implementing files the rework changes, against the contract:
N3 (nit) — the served fold now depends on the installed package records, and no install or uninstall of an enabled package drops N4 (nit) — N5 (nit) — the two key descriptions say "the paired Nits alone; the round ends here. Implemented-by: VERDICT: PASS |
|
repo:objectstack#2 · os-steve · session_01ADHkmRY38EZf38Yy3zthbY 维护者速读(席位记录 · head
|
|
repo:objectstack#2 · os-steve · session_01ADHkmRY38EZf38Yy3zthbY Hand-off for approval: L1 ACCEPT at head |
…flows.FLOW.nodes.NODE_ID.label (objectstack-ai#36383) <!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} --> _Requested by **Steedos** · [project thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9UbbYV2nRmpjdz5BmCf9psuMXA)_ Part of objectstack-ai#35979 (Asked item 2 only, as ruled in comment 7076440876; Asked item 1 is PR objectstack-ai#36335, merged) repo:objectstack#7 · zhuangjianguo · session_01QsR2jTrJZvNaijgX3NxBMc Clause-②: yes (widening: a new translation key `flows.FLOW.nodes.NODE_ID.label`; the new exports `FLOW_TECHNICAL_NODE_TYPES` and `isFlowTechnicalNodeType` from `@objectstack/spec/automation`; and `@object-ui/i18n`'s exported `FlowLabelTranslations` type gains the member `screenTitle`, and its `stepLabel` parameter accepts a `config`) Metadata-protocol: added Skills-docs: follow-up objectstack-ai#36401 ## 维护者速读 - 用户能看到什么变化:应用包现在可以给流程里每个步骤(开始、判断、通知、结束等)写各语言名称;手册里的流程图和 Studio 流程画布都按读者语言显示这些步骤名,中文下不再夹英文。已发布语言的应用在检查里会多出这些步骤的缺译提示。 - 为什么做:HotCRM 销售手册的审批流程图在中文下仍显示英文的判断和通知步骤,维护者在卡上选了「补上翻译位,可以翻译」。 - 出错会怎样:只影响显示和缺译提示,不改流程运行和任何数据;可直接撤回。 - 要你做什么:无。 ## What changes Both halves are on this branch: the key, its validation and its coverage demand, and the readers that draw it (on `main` since PR objectstack-ai#36335 merged the shared flow-label resolution into `@object-ui/i18n`). - **The key** (`packages/spec/src/system/translation.zod.ts`). `flows.FLOW.nodes.NODE_ID.label`, a strict entry with one plain-text leaf, `label`, overlaying the node's own `FlowNode.label`. It addresses every node but a `screen` (whose `screens.NODE_ID.title` covers `config.title ?? node.label`) and an `approval` (`approvals.NODE_ID.label`), so one string keeps one key. `nodes` was an unknown-key alias onto `screens`; it is now the real group (`node` aliases onto it). The `## nodes` docblock section states the rule; the convention list gains the row. - **Start and end nodes (ruling item 3).** Keyed like any other step; the viewer supplies no words of its own. Measured on `examples/app-showcase` at c448c61: of the start/end labels, 25 are `End` and 11 `Start`, but the rest name an outcome or a trigger (`Approved` x5, `Rejected` x5, `Signed Off`, `Declined`, `On Task Created` x3, `Daily at 06:00`, ...), which a generic word would erase. - **Validation** (`packages/lint/src/validate-translation-references.ts`). A `nodes` key over an unknown node is `translation-target-unknown` with the nearest node offered; over a `screen` it is pointed at `screens.NODE_ID.title`, over an `approval` at `approvals.NODE_ID.label`. The reverse slips now point at the new key: a `screens` or `approvals` key over any other node says `its label is keyed nodes.NODE_ID.label` (two existing messages gain that clause instead of "so nothing resolves"). - **The demand** (`packages/lint/src/i18n-walk.ts`, `i18n/missing-flow`). Every top-level node the docs embed draws at its default `detail: business` altitude, minus screens and approvals, which were already demanded; and, since the embed's branch list names the step each branch of a drawn decision leads to, a folded technical step a branch names (seat reading L2 S1; live case: app-todo's `check_recurring` branching to the `compute_next_due_date` script). `decisionBranchTechnicalTargets` mirrors which out-edges the viewer lists (`flow-branches.ts` `decisionBranches`). Region-nested nodes are accepted by validation but not demanded: the embed does not draw them. `packages/cli/src/utils/i18n-coverage.ts` only updates the bucket's description. - **The readers** (`ui/packages/i18n/src/flowLabels.ts`). The shared `stepLabel` now reads each step's one key by node type: `approvals.NODE_ID.label` for an approval, `screens.NODE_ID.title` for a screen with no `config.title`, `nodes.NODE_ID.label` for any other node. The docs viewer's `type: flow` embed (`metadata-viewer.tsx`, new `flowStepName`) names each drawn step and each decision-branch target by it; the Studio canvas (`FlowCanvas`, and `flow-region-view`'s `RegionNode` for nested region nodes) and the inspector heading read the same `stepLabel` unchanged, so a nested node's key, which validation accepts, has a reader. - **A titled screen (seat reading S3).** A screen with its own `config.title` shows that heading at run time, translated under `screens.NODE_ID.title`; its canvas label has no key. The docs embed names such a screen by its heading (translated where the bundle carries it), unless the heading holds a `{{ }}` hole a drawing cannot fill, in which case it keeps the authored label. `FlowLabelTranslations` gains `screenTitle` for this read. The Studio canvas keeps a titled screen's authored label, since that is the label the designer edits. - **One table for business altitude** (`packages/spec/src/automation/flow-altitude.ts`). The viewer's private `TECHNICAL_NODE_TYPES` set becomes `FLOW_TECHNICAL_NODE_TYPES` + `isFlowTechnicalNodeType` in `@objectstack/spec/automation`; the viewer folds steps by it and the walk demands by it, so they agree on which steps a reader sees. - **Examples.** `app-crm`'s lead-conversion wizard gets its three drawn steps in zh-CN (its baseline stays 0). The ratchet in `scripts/i18n-coverage-baseline.json` is raised for the new population, as the PR that first walked the validation-message family did: `app-showcase` 317 -> 425 (+108, one of them the folded `showcase_inquiry_purge.purge` a branch names), `app-todo` 106 -> 130 (+24, two of them `todo_task_completion.compute_next_due_date` in its two translated locales); the other 12 configs are unchanged (the ten bundle packages stay 0, `check:i18n` in sync). - **Ledger and pins.** `liveness/translation.json` gains `flows.nodes` (+ `label`), `live`, citing `flowLabelTranslations`, `flowStepName`, `FlowCanvas` and `RegionNode`. `flows-translation-face.test.ts`: the `node.label` row now lists `nodes.NODE.label` beside `approvals.NODE.label`. - **Generated.** `api-surface/automation.json`, `export-origins/automation.json`, `content/docs/references/system/translation.mdx`, the strictness-ledger counts and the liveness state counts, regenerated by `check:generated --fix`. ## Read first (by risk) 1. `packages/lint/src/i18n-walk.ts`, the new loop at the end of `walkScreenFlows`: what is demanded (top level, not technical, not screen/approval). 2. `ui/packages/i18n/src/flowLabels.ts` `stepLabel` and `metadata-viewer.tsx` `flowStepName`: which key each node type reads, and the titled-screen rule. 3. `packages/spec/src/system/translation.zod.ts`, the `nodes` entry and the `nodes` / `steps` alias changes. 4. `packages/lint/src/validate-translation-references.ts`, the `nodes` block and the two redirect clauses. Two-minute check: `pnpm --filter @objectstack/cli exec vitest run --project unit test/i18n-flow-node-coverage.test.ts`; expect 6 passed, including HotCRM's `opportunity_approval` shape asking for its start, decision, notify, loop and end labels and nothing for its approvals, screen or record write. ## Tests <details><summary>Pins</summary> - `packages/cli/test/i18n-flow-node-coverage.test.ts` (new family file, like the screen / approval / refusal family files beside it): the walker harvests exactly the drawn steps with no other key, seeded with the authored label; a folded step only where a drawn decision's listed branch names it, once (a conditions-free decision lists every out-edge; a `conditions` decision its default and its claimed labels; an unclaimed label and a non-decision source name nothing); nothing for any other `FLOW_TECHNICAL_NODE_TYPES` step or an id-less node; every harvested key parses and is kept by `TranslationDataSchema`; the coverage gate lists them in the flow bucket and goes quiet once translated. - `packages/lint/src/validate-translation-references.test.ts`: a new top-level describe (clean run over start / decision / loop / nested notify / end beside the other groups; `nodes` over an approval and over a screen redirected; unknown node with suggestion), the two changed redirect messages, and the one-line-verdict arm list gains the four new arms. - The screen, approval and liveness-gate family files in `packages/cli/test/` pin exact key lists of their own family; they now read every key but the `nodes` family (one predicate per file, pointing at the new file). - `ui/packages/components/src/__tests__/metadata-viewer.test.tsx`: a new top-level describe: start / decision / notify / end by `nodes`, an untitled screen by `screens` title, a titled screen by its translated heading and a holed heading by its label, a decision-branch target by `nodes`, and the business view folding exactly `FLOW_TECHNICAL_NODE_TYPES`. - `ui/packages/app-shell/src/views/metadata-admin/previews/FlowCanvas.test.tsx`: `stepLabel` reads each group by node type (and never another type's group under the same id); the canvas draws a decision's and a nested notify's translation; the inspector heading titles a decision by its `nodes` key with the authored label beside it. </details> <details><summary>Runs at cafc3fd (the spec half) unless noted</summary> - `@objectstack/lint` whole suite (before the L2 S1 widening): `Test Files 225 passed (225)`, `Tests 9431 passed (9431)` (at eabf0e6; lint unchanged since). - `@objectstack/cli` unit project, the 60 i18n / translation / lint test files: 18 failures at eabf0e6, all exact key lists in the three family files above; after the predicate, those 4 files `Tests 52 passed (52)`. - `@objectstack/spec`: `flows-translation-face.test.ts` + `translation.test.ts`, `Tests 238 passed (238)`. - `pnpm --filter @objectstack/spec check:generated`: 5 stale before regeneration, all 5 green after `--fix`. - `node scripts/check-i18n-coverage.mjs`: before the baseline edit `app-crm 0 -> 3`, `app-showcase 317 -> 424`, `app-todo 106 -> 128`; after: `OK (14 config(s), 552 baselined untranslated string(s), none new)`. `pnpm check:i18n`: all ten bundle packages in sync. `pnpm check:i18n-walk-parity`: 17 declared, 15 walked, 2 exempted. - Derived gate sweep at cafc3fd (`dispatch-gates --commands`, 127 commands): 126 exit 0, 1 NOT MEASURED (`check:dual-build-cjs-loads`, exit 3 for want of a full build; left to CI). `dispatch-gates --ran`: 127 accounted for. </details> <details><summary>Runs at bc0171d (the reader half, after merging main at dda5e74)</summary> - ui, from `ui/`: `FlowCanvas.test.tsx` + `flowNodeLabels.sites-13200.test.ts`, 64 tests passed; `metadata-viewer.test.tsx` at its final edit, `Tests 22 passed (22)` (two runs before it failed on the test's own isolation: a shared i18n instance and a locale-specific string, both fixed in the test). - `pnpm --filter @object-ui/i18n run type-check`, `@object-ui/components`, `@object-ui/app-shell`: all exit 0 (after building app-shell's dependency closure, 68 of 68 tasks). - `pnpm --filter @objectstack/spec check:generated --fix`: the 2 artifacts the merge deferred plus the liveness counts regenerated, all 3 re-checked green. - Derived gates for the files changed since the first sweep (`dispatch-gates --commands`, 96 commands): 96 exit 0. `dispatch-gates --ran`: 96 accounted for, 0 NOT MEASURED (derived from recorded exit codes). - `overlap-check.mjs`: merges cleanly with `origin/main` at 316f757. </details> <details><summary>Runs at 04d28e0 (the L1 / L2 rework)</summary> - `@objectstack/lint` whole suite: `Test Files 225 passed (225)`, `Tests 9444 passed (9444)`. - `@objectstack/cli` unit project, the 4 flow family files: `Tests 53 passed (53)` (the new folded-branch-target pin included). - `node scripts/check-i18n-coverage.mjs`: `app-showcase 424 -> 425`, `app-todo 128 -> 130` before `--update`; the new keys are `flows.showcase_inquiry_purge.nodes.purge.label` and `flows.todo_task_completion.nodes.compute_next_due_date.label`. `check:generated` green after rebuilding spec. - Derived gates for the files changed since bc0171d (`dispatch-gates --commands`, 105 commands): 105 exit 0; `--ran`: 105 accounted for, 0 NOT MEASURED. - `overlap-check.mjs`: clean against `origin/main` and the open PRs sharing files (objectstack-ai#36517, objectstack-ai#36527). </details> ## Acceptance notes - `flows.FLOW.label` is still demanded only for a flow with a screen or an approval node, although item 1's viewer draws the label of every embedded flow. Not widened here, by the seat's word: filed as objectstack-ai#36400. - HotCRM's own translations (`opportunity_approval`: 9 of 11 drawn steps) are a follow-up in that repository now that the key has a reader: objectstack-ai#36402. - The i18n skill's text for the new key is owed: objectstack-ai#36401. - A titled screen whose heading holds a `{{ }}` hole is drawn in the docs embed by its authored label, which has no key, so it stays in the authored language: carded as objectstack-ai#36530 with the L2's N2. Every other step the embed names has a key and a reader. --- _Generated by [Claude Code](https://claude.ai/code/session_01QsR2jTrJZvNaijgX3NxBMc)_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01QsR2jTrJZvNaijgX3NxBMc <!-- signed: repo:objectstack#7 · zhuangjianguo · session_01QsR2jTrJZvNaijgX3NxBMc --> --------- Co-authored-by: Claude <noreply@anthropic.com>
…hole arrangement (fieldGroups, relatedLists) (objectstack-ai#36568) <!-- claude-projects-attribution: {"github_login":"os-steve"} --> _Requested by **Steve** · [project thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi91tYCagMT6JaQ6YA5YqnWwi)_ Fixes objectstack-ai#36541 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用 AI 写配置的客户,想给已安装软件包里的对象重排记录页(换字段分组、调页签顺序、隐藏页签)时,AI 现在知道这份排布要写在该软件包配套的环境定制包里;以前技能没讲这件事,AI 要么不会用,要么写进别的扩展包后被拒收。 - 属于「记录页标签与分组」专题:环境管理员整页排布的能力上一步已经上线,这一步把它教给 AI 作者,并补一道考题。 - 如果教错,AI 会把排布写到会被拒收的位置,保存或校验时当场报错并给出改法,数据不受影响;撤回这次改动,技能文字就回到原样。 - 审批这次对外技能文字的改动(技能包属于受管范围,需要你来合入)。 ## Fix round 1 Head `90a673de67`, one commit on top of `0db54351e8`, answering the contract review of that head (record 7087999230). - **S1, the refused writer is named by what the judge tests.** The paragraph's last sentence read "In any other package both keys are refused at those doors". That is false for a `.custom` package that is not the object's pair: `judgeExtensionArrangement` returns no refusal when `isCustomizationPackage(packageId)` holds (`packages/metadata-protocol/src/protocol-extension-arrangement.ts:94`; the predicate is the id's `.custom` suffix over a valid base, `packages/spec/src/kernel/customization-package.ts:119`), and the key descriptions say such a package "is not refused at those doors: the registry merge does not apply what it writes here ... and the boot log names it" (`CUSTOM_ARRANGEMENT_WRITER`, `packages/spec/src/data/object.zod.ts:6832`). Both files read again on `main` at `abe95a950d`: unchanged since `d463c46f`. The sentence now reads "Outside a `.custom` package both keys are refused at those doors: use `place`." The changeset's first bullet carries the same words. - **Bytes.** The new wording is 7 bytes longer and the file had exactly 7 priced bytes of headroom, so nothing more is cut: 26,853 to 26,860 bytes, 6,709 to 6,710 tokens, ceiling 6,710 unchanged. - **N1, case 27 asserts `place:`.** The token `place` also matched the word "replaces", so an answer that never said what the add-on package writes could pass. It is `place:` now, the token case 26 uses; the reference answer already contains `place: [`. Regraded below. - **N2 is left as it is.** No byte remains after S1, and the review ties the clause to bytes being left. ## What changes **One paragraph in `skills/objectstack-data/SKILL.md`, § Object Extension Model** (lines 386 to 390 at head `90a673de67`), inside the paragraph about an object an installed package ships, right after the sentence that lists the doors of the `__c` rule: > Only the pair's extension may also write `fieldGroups` and `relatedLists`, shaped as on an object. A written key replaces that arrangement whole (the owner's and every `place`): an unlisted field shows after the last group, an unnamed tab still shows after the listed ones, and `{ list: 'crm_note', hidden: true }` hides a tab. Outside a `.custom` package both keys are refused at those doors: use `place`. "Those doors" are the ones the sentence before it names: save, publish and install, `os validate` and `os build`. **What it teaches is what is on `main`** (PR objectstack-ai#36517, merge commit `45ef94ef`; ADR-0146 D2, D3 and D10), read at `d463c46f`: | Sentence | Where it is on `main` | |:---|:---| | The two keys, in an object's shapes | `packages/spec/src/data/object.zod.ts:7070` (`fieldGroups`, an array of the object's group schema) and `:7082` (`relatedLists`); the key list is `CUSTOM_ARRANGEMENT_KEYS`, `packages/spec/src/data/field-customization.ts:124` | | `{ list, hidden: true }` | `packages/spec/src/data/object.zod.ts:6703`: `hidden` is a boolean on the extension's entry only; an object's own entry refuses it by name (`:1347`) | | A written key replaces whole; an unlisted field after the last group; an unnamed tab still shows after the listed ones | the two key descriptions, `packages/spec/src/data/object.zod.ts:6837` and `:6863`; the fold is `applyCustomArrangement`, `packages/objectql/src/registry-custom-arrangement.ts:144` | | Only the pair writes them; outside a `.custom` package they are refused and the writer is told to use `place` | one judge, `judgeExtensionArrangement`, `packages/metadata-protocol/src/protocol-extension-arrangement.ts:91`. Its answer is `VALIDATION_ERROR` / 400 (`:116`); the message, measured on this PR's eval shape: "`relatedLists` in the extension of object 'crm_account' in package 'acme_contracts': only the object extension of a base's paired `.custom` package declares an object's whole arrangement (ADR-0146 D10). Remove the key and place what this package brings with `place`, e.g. `place: [{ list: 'contract', after: 'opportunity' }]`." | | The doors | save `packages/metadata-protocol/src/protocol-save.ts:1390`; publish `protocol-history-and-publish.ts:1062`; restore `protocol-authoring-gate.ts:129` (all three through `objectExtensionItemRefusal`, `protocol-object-extension-item.ts:257`); `os validate` `packages/cli/src/commands/validate.ts:895`; `os build` `packages/cli/src/commands/compile.ts:948`; install `packages/cloud-connection/src/marketplace-install-local-plugin.ts:3192` (`VALIDATION_ERROR` / 422, one row per key in `details.refusals`) | **Paid for in the same file; the token ceiling is not raised.** The file had 0 tokens of headroom (6,710 of 6,710). The paragraph is 407 bytes (400 before fix round 1); five restatements are cut, 405 bytes, and the content of each stays in the bundle. The remaining 2 bytes come out of the 2 priced bytes the file had under its ceiling: | Cut from `SKILL.md` | Bytes | Where the content stays | |:---|---:|:---| | § Validation Patterns, the note that on insert an omitted optional field reads as `null` in a predicate | 240 | `rules/validation.md` lines 80 to 83 (the same note) and line 17 (a `script` rule judges the merged record: prior row plus this write) | | § Index Patterns, "`unique` defaults to `false`; omit it when that is what you mean." | 66 | `rules/indexing.md` line 11 | | Quick Reference, the lifecycle row's "append-only objects must declare one" | 42 | the `lifecycle` row of the optional-properties table in the same file ("Required for append-only, high-write-rate objects") and `rules/lifecycle.md` line 14 | | The `sharingModel` heading's "(ADR-0090 D4; legacy aliases removed)" | 38 | `references/lint-rules.md` line 23 (`security-owd-alias`: a legacy spelling is an error, ADR-0090 D4) | | The `pluralLabel` row's `(e.g., "Accounts")` | 19 | the object JSON example in the same file (`"pluralLabel": "Accounts"`) | **The two readings** (tokens in the ratchet's convention, `ceil(utf8 bytes / 4)`, the release-stamp line not priced): | | Before (`d463c46f`) | After (`90a673de67`) | |:---|:---|:---| | `skills/objectstack-data/SKILL.md` | 473 lines · 26,858 bytes · 6,710 tokens (ceiling 6,710) | 472 lines · 26,860 bytes · 6,710 tokens (ceiling 6,710, unchanged) | | All 14 `skills/*/SKILL.md` | 4,951 lines · 261,175 bytes | 4,950 lines · 261,177 bytes | | Ratcheted (authored) tokens, whole bundle | 197,573 | 197,573 | | Eval fixtures (measured, not ratcheted) | 81,141 | 81,720 | | Bundle total | 293,321 | 293,900 | **One eval case**, `skills/objectstack-data/evals/objects-fields-relationships.json` case 27: an add-on package put the tab arrangement (two tabs swapped, one hidden) on its own extension of an installed object and `os validate` refused it. The answer moves the arrangement to the object extension of the base's paired `.custom` package and names `place` as what the add-on package writes. `must_contain`: `hotcrm.custom`, `defineObjectExtension`, `extend: 'crm_account'`, `relatedLists`, `hidden: true`, `place:`. Two riders in the eval directory: - Case 26 (the `place` case) said in its reference answer that "an extension has neither key". That stopped being true when the two keys shipped, and the new paragraph says the opposite, so the parenthesis now reads: only the object extension of HotCRM's paired `hotcrm.custom` package writes those keys; here they are refused. Its prompt and assertions are unchanged, so its case hash is unchanged. - `evals/README.md` lists what the file covers and gains the new case's topic. **Changeset**: `.changeset/36541-skills-custom-arrangement.md`, `@objectstack/skills` patch. ## Tests The grader and gate readings are at head `90a673de67`, tree clean. The door suites were run at `0db54351e8`; fix round 1 touches no file they read. <details> <summary>The eval file's reference answers under its own grader</summary> `gradeAnswer` (`packages/qa/scenarios/src/skill-evals/grade.ts`) over each case's `expected_output`, cases parsed by the runner's own `parseEvalFile`. No model round was run. | Tree | Reading | |:---|:---| | `d463c46f` (control) | 26 cases parsed, 0 refusals; reference answers PASS 26/26 | | `0db54351e8` (the head reviewed before) | 27 cases parsed, 0 refusals; reference answers PASS 27/27; case 26 PASS; case 27 PASS | | `90a673de67` | 27 cases parsed, 0 refusals; reference answers PASS 27/27; case 26 PASS; case 27 PASS | Named answers for case 27, each graded under the assertions of both heads and each as expected: | Answer | At `0db54351e8` (`place`) | At `90a673de67` (`place:`) | |:---|:---|:---| | the reference answer | PASS | PASS | | a short answer: the pair, the arrangement, `place: [...]` for the add-on package | PASS | PASS | | the pair and the arrangement, "the key replaces the tab list whole", nothing about what the add-on package writes (the N1 control) | PASS | FAIL, `missing=["place:"]` | | the arrangement kept on the add-on package, the pair never named | FAIL, `missing=["hotcrm.custom"]` | FAIL, `missing=["hotcrm.custom"]` | | the pair named, the tab hidden by leaving it out (an object's own rule) | FAIL, `missing=["hidden: true"]` | FAIL, `missing=["hidden: true"]` | At `0db54351e8` two more named answers were graded as expected: the object redeclared with an `overrides` declaration (FAIL, `forbidden=["name: 'crm_account'","overrides:"]`), and the pair named with nothing said about the add-on package (FAIL, `missing=["place"]`). The reference answer's extension, `{ extend: 'crm_account', relatedLists: ['crm_opportunity', 'crm_contact', { list: 'crm_lead', hidden: true }] }`, parses under `ObjectExtensionSchema`; `judgeExtensionArrangement` answers 1 refusal for package `acme_contracts` (path `objectExtensions[0].relatedLists`) and 0 for `hotcrm.custom`. `node ui/scripts/check-skill-eval-tokens.mjs`: exit 0, "Every must_contain token is taught by its own skill bundle." </details> <details> <summary>Which doors refuse: the suites of the merged protocol, run on this head</summary> The dispatch asked which doors actually refuse a writer that is not a `.custom` package. Each door's suite was run, at `0db54351e8`, after building its dependency closure (`turbo run build --filter='@objectstack/cli^...'`, 64 tasks, exit 0), each run under the shared verification lock: | Door | Suite | Reading | |:---|:---|:---| | The judge, and the gate the save, publish and restore doors ask | `packages/metadata-protocol/src/protocol-extension-arrangement.test.ts` | exit 0, `Tests 13 passed (13)` | | Save, through the real protocol and engine | `packages/objectql/src/protocol-custom-arrangement.test.ts` | exit 0, `Tests 6 passed (6)` | | `os validate` and `os build`, both commands in process | `packages/cli/test/validate-build-extension-arrangement.test.ts`, `packages/cli/src/utils/extension-arrangement.test.ts` | exit 0, `Test Files 2 passed (2)`, `Tests 10 passed (10)` | | Install | `packages/cloud-connection/src/marketplace-install-local-extension-arrangement.test.ts` | exit 0, `Tests 5 passed (5)` | | What a written key does (replaces whole, the unlisted field, the unnamed tab, the hidden tab) | `packages/objectql/src/registry-custom-arrangement.test.ts`, `packages/spec/src/data/object-extension-arrangement.test.ts` | exit 0, `Tests 33 passed (33)` and `Tests 53 passed (53)` | The publish and restore doors are measured at the gate they call (`objectExtensionItemRefusal`); that each of them calls it is read from the call sites cited above, not from a run through the door. </details> <details> <summary>Gates</summary> `node scripts/pm/dispatch-gates.mjs --commands` at `90a673de67` derives the same 50 commands as at `0db54351e8`. All 50 were run again on this head, each exit code recorded before any pipe; `--ran` answers: "50 derived famil(ies) accounted for — 49 run, 1 NOT-MEASURED (1 DERIVED from a recorded exit 3)", exit 0. - 49 exit 0. Among them: `node scripts/check-skills-token-ratchet.mjs` ("60 authored bundle file(s) within their ceilings"; the data row reads `6710 / 6710 (+0)`), `check:skill-docs`, `check:skill-served-sections`, `check:skill-links`, `check:skill-identifier-liveness`, `check:skill-compatibility`, `check:skill-frame-sync`, `check:doc-authoring`, `check:doc-formula-expressions`, `check:role-word`, `check:nul-bytes`, `check-empty-changeset`, `check-changeset-no-major`, `check-adr-0087-registration`. - NOT MEASURED: `pnpm check:dual-build-cjs-loads`, exit 3. It reads the built output of every package and asks for a whole-workspace build; this change touches no package source, and the full build was not made for it. CI reads it. - Outside the derived list, also run on this head: `check:skill-refs` exit 0 ("10 generated files in sync"), `check:skill-examples` exit 0 ("349 prose examples type-check across 3 surface(s)"), `node ui/scripts/check-skill-eval-tokens.mjs` exit 0. - The gates that read built output (`check:dts-closure`, `check:published-files`, `check:sourcemap-no-sources-content`, `check:driver-memory-census`, `check:lean-entry-closure`) answered exit 0 on a tree where the spec, lint, objectql, metadata-protocol and client-react closures were built, not the whole workspace; their full reading is CI's. </details> ## Acceptance notes 1. **Overlap.** `node scripts/pm/overlap-check.mjs` at `90a673de67`: `origin/main` (`abe95a950d`) merges cleanly; objectstack-ai#35129 and objectstack-ai#36559 merge cleanly (objectstack-ai#36559 edits case 3 of the same eval file); draft objectstack-ai#36158 conflicts in `skills/objectstack-data/SKILL.md`. That one is known to the seat and ruled: this card does not wait, and whichever of the two lands second replays its text. 2. **`main` moved after the branch was cut**, `d463c46f` to `abe95a950d`. It merges cleanly and the branch was not merged again. 3. **Both mechanism assumptions of the dispatch hold.** The refusal fires at save, publish and install and at `os validate` / `os build`, the doors the `__c` sentence already lists, so the paragraph says "at those doors". `{ list, hidden: true }` is the schema's spelling. 4. **What the paragraph leaves to the refusal texts and the docs page** (`content/docs/data-modeling/object-extensions.mdx`, "Arranging the whole record page"), to stay inside the ratchet: a `place` entry beside the key that replaces it is refused at parse with its own prescription; a built-in tab is written as its bare name and cannot be hidden; a `.custom` package that is not the object's pair is not refused, it is skipped and named in the boot log (since fix round 1 the paragraph no longer says the opposite; it still does not teach the skip); a list the owner hid by leaving it out stays hidden until the arrangement names it; a field is kept off the page by a group whose `visibleWhen` is false. 5. **Case 27's prompt carries two of its own `must_contain` tokens** (`relatedLists`, `hidden: true`), because the colleague's refused extension is quoted in it. The tokens the prompt does not hand over are `hotcrm.custom`, `defineObjectExtension`, `extend: 'crm_account'` and `place:`. With `place:` an answer that names `place` only in prose, without an entry, does not pass; case 26 has the same property. 6. **`evals/README.md` is outside the file surface the claim lists.** It is the index of the eval file and the same-file PR before this one updated it with its case, so it is updated here too. 7. **The ceiling row is untouched at 6,710** and the file sits exactly on it, with 0 tokens of headroom, as it did on `main`. ## Verification **Read first:** 1. `skills/objectstack-data/SKILL.md` lines 386 to 390, the last sentence first (fix round 1), beside `CUSTOM_ARRANGEMENT_WRITER` and the two key descriptions in `packages/spec/src/data/object.zod.ts` (lines 6828 to 6888). The risk is a sentence that says more than the runtime does. 2. The five deletions in the same diff, each against the home named in the table above. The riskiest is the insert-null note: it leaves the always-loaded file and stays in `rules/validation.md`. 3. Case 27, and the one changed parenthesis of case 26, in `skills/objectstack-data/evals/objects-fields-relationships.json`. **Two-minute check:** `node scripts/check-skills-token-ratchet.mjs`. Expected: the data row reads `6710 / 6710 (+0)` and the last line reads "60 authored bundle file(s) within their ceilings". 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01ADHkmPTDM2MxHR8cvoMVUX <!-- signed: repo:objectstack#2 · os-steve · session_01ADHkmPTDM2MxHR8cvoMVUX --> --------- Co-authored-by: Claude <noreply@anthropic.com>
…translatable (objects.OBJECT._relatedLists.LIST.label) (objectstack-ai#36574) <!-- claude-projects-attribution: {"github_login":"os-steve"} --> _Requested by **Steve** · [project thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi98qMCtnkL9edrhDJZJffTAD)_ Fixes objectstack-ai#36528 Clause-②: yes (widening) Metadata-protocol: added Skills-docs: follow-up objectstack-ai#36575 ## 维护者速读 - 记录页上由父对象自己命名的子表页签标题,现在可以按语言翻译;切到中文等界面时显示译文,以前不论什么语言都显示原文。 - 属于「记录页的页签和字段分组改由父对象一处声明」专题,补上父对象给页签起名后无法翻译的缺口。 - 翻译写错只影响该页签标题的显示文字,数据与页签顺序不受影响;删掉这条翻译即恢复原文。 - 无 ## What changes A record page's tab title that an object-form `relatedLists` entry declares on the parent (`{ list, label, columns }`) wins over the child lookup field's `relatedListTitle`. The field's title had a translation key; the winning title did not. It now has one, on the parent, keyed by the entry's literal `list` (a dotted `object.field` is one key, indexed directly): ``` objects.OBJECT._relatedLists.LIST.label ``` | Package | Change | |:---|:---| | `@objectstack/spec` | `ObjectTranslationDataSchema._relatedLists`: a record of closed leaves whose one key is `label` (aliases `name` / `title` / `heading` / `text` onto `label`, like `_tabs`), plus the un-prefixed alias `relatedLists` onto `_relatedLists`. `translateObject` overlays it onto the served object's labelled object-form entries (`translateObjectRelatedLists`), along the locale chain, under the ADR-0029 D9.2a / ADR-0146 D2 catalog rule every other slot follows (a label that diverged from the packaged entry of the same `list` reads only the pair's catalog). | | `@objectstack/lint` | The extractor walk emits the key for each labelled entry; the orphan rule (`translation-target-unknown`) flags a key naming no labelled entry, with a distinct verdict when the object names the list but gives it no `label`. The shared extension fold now carries an extension's `relatedLists` (the `.custom` arrangement, ADR-0146 D10) and `place` record entries, so a key over a labelled tab an extension brings resolves. | | `@objectstack/metadata-protocol` | The save door's translated-echo restore puts a translated entry `label` back to its source text (matched by `list`), with the existing `info` advisory, so a Studio save of an object read in another language does not store the translation as the title. | | `@objectstack/objectql` | `getPackagedObjectBase` (the packaged base the `/meta` read and the form route hand `translateObject`, and the echo restore translates with) carries the tabs a code extender's `place` splices into the owner's `relatedLists`, by the fold's own pass (`applyExtensionPlacements`, so only where the owner declares `relatedLists`), as it already carries the fields such an extender adds. A placed title therefore compares equal to its packaged text and reads the deployment catalog. The `.custom` arrangement stays the customization layer, never part of the base. | Precedence is unchanged (entry `label`, then the child FK's `relatedListTitle`, then the child's plural label). Only an AUTHORED entry `label` is translated: an entry with no label, a bare name and a built-in tab gain nothing from the key, the rule the field-level `inlineTitle` / `relatedListTitle` docblocks state. **Where the record page reads the title.** The tab title comes from `deriveRelatedLists` (`ui/packages/app-shell/src/utils/deriveRelatedLists.ts`, `title: entry.label`), handed to `buildDefaultPageSchema` as `options.related` (`label: rel.title ?? rel.objectName`). Its `objectDef` is `useMetadata().objects`, the `GET /meta/object` list read, which the REST read exit translates per request (`translateMetadataDocument('object', …)` → `translateObject`), outside the ADR-0156 D3 cached part. So no `ui/` change is made. **Extension-brought titles.** The registry fold splices a list placement (`place`) and the paired `.custom` arrangement (`relatedLists`) into the parent's served `relatedLists`. A placed title is translated from the deployment catalog because the packaged base now carries the placed entry (round 2, see Acceptance notes); a `.custom` title diverges from the base and reads the pair's own translations (ADR-0146 D2). Pinned through the read's real options (`packagedBase` from `ObjectStackProtocolImplementation#getPackagedObjectBase`, the accessor the REST read's `packagedObjectBaseOf` asks) in `packages/objectql/src/registry-related-lists-label-translation-36528.test.ts`. Also: `content/docs/protocol/kernel/i18n-standard.mdx` (example and the key-resolution table), the regenerated `content/docs/references/system/translation.mdx`, `authorable-surface/system.json` and the strictness-ledger count, the liveness ledger evidence for `objects`, and `.changeset/36528-related-list-label-translation.md` (minor on spec, lint, metadata-protocol, objectql). ## Tests | Suite | What it pins | |:---|:---| | `packages/spec/src/system/i18n-related-lists-label-36528.test.ts` | schema accepts the key (dotted list included), refuses an unknown leaf key with the strict-object message, names `title` → `label` and `relatedLists` → `_relatedLists`; overlay on a plain and a dotted entry through the type dispatch, the served object still parses; label-less, bare and built-in entries untouched; same array back when nothing matched; locale ladder and fallback chain; catalog loses to a tenant rewrite; pair translation for a changed label | | `packages/lint/src/i18n-related-lists-label-36528.test.ts` | walk emits only labelled entries; orphan rule resolves labelled keys, flags a ghost / an unlabelled / a bare entry, resolves labelled entries a `.custom` arrangement or a `place` brings (with the unlabelled control); a key over a built-in tab and over a `hidden` `.custom` entry each get their own reason; a dotted list is bracketed in the finding path; verdict and hint each at most 200 characters | | `packages/metadata-protocol/src/protocol-translated-echo.related-lists-36528.test.ts` | a translated echo restored (dotted list included) with its advisory path; an author's own title kept; a title on an entry the source leaves untitled kept | | `packages/objectql/src/registry-related-lists-label-translation-36528.test.ts` | through the read's real options (an `ObjectQL` engine's registry, `packagedBase` from `ObjectStackProtocolImplementation#getPackagedObjectBase`): the packaged base carries a code extender's placed tab and its title reads the catalog; a tenant's rename of that title keeps its text; a `.custom` arrangement's title is not in the base and reads the pair's translations | | `validate-translation-references.test.ts`, `validate-security-posture.test.ts` | the schema-coverage table gains `_relatedLists`; the extension receiver's key-read table gains `place` and `relatedLists` | <details> <summary>Package suites and typecheck (round 2, at `6fd5bb85`, after a full `pnpm build --concurrency=2`: 120 tasks, exit 0)</summary> - `pnpm --filter @objectstack/objectql test`: `Test Files 633 passed (633)`, `Tests 14345 passed (14345)`. This full suite holds every in-package reader of the packaged base (`protocol-packaged-object-base`, `protocol-meta-effective-schema`, `engine-validation-tenant-rewrite`, `registry-field-patch-bases`, `registry-validation-rule-by-name`). - `pnpm --filter @objectstack/lint test`: `Test Files 227 passed (227)`, `Tests 9461 passed (9461)`. - Scoped: `src/system/i18n-related-lists-label-36528.test.ts` (spec) `Tests 10 passed (10)`; `src/protocol-translated-echo.related-lists-36528.test.ts` (metadata-protocol) `Tests 3 passed (3)`. The spec and metadata-protocol sources are unchanged in round 2; their full suites were green in round 1 (`dcab40cb`, `4249fe4b`) and are declared to CI here, as is `@objectstack/rest` (it reads the base; its source is unchanged). - `typecheck` on objectql and lint: exit 0. </details> <details> <summary>Ablation: each changed behaviour broken once, the suite turns red, the file restored</summary> Each leg via `node scripts/ablation-replace.mjs` (anchor hits once, blob before/after printed, restored blob equals `HEAD`, `git diff HEAD` empty). Every mutated file is imported from source by the suite that runs, so no rebuild is in a leg. - Round 2, at `8e2ca2b7`: the `relatedLists` spread of the placed entries removed from `PlatformGlobalFacet.getPackagedObjectBase` (blob `31877522` to `4549c158`): the objectql pin `Tests 1 failed | 2 passed (3)`, `expected [ 'Tasks', 'crm_note' ] to deeply equal [ 'Tasks', 'Audit trail', 'crm_note' ]`; restored blob `31877522` equals `HEAD`, `git diff HEAD` empty. - Round 1: resolver overlay wiring removed from `translateObject`: `Tests 4 failed | 6 passed (10)`. - Round 1: walk call `pushRelatedListLabels` removed: `Tests 1 failed | 4 passed (5)`. - Round 1: orphan rule's labelled-entry `continue` removed: `Tests 1 failed | 4 passed (5)`. - Round 1: echo restore's `restored.push` for an entry removed: `Tests 1 failed | 2 passed (3)`. - Round 1: extension fold's labelled-entry add removed (at `f0d2db85`): `Tests 1 failed | 5 passed (6)`. </details> <details> <summary>Gates</summary> - `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` at `6fd5bb85`: 122 commands, each run with stdin closed after the full build, all 122 `exit 0` (among them `check:facade-delegation-only`, `check:i18n-walk-parity`, `check:dual-build-cjs-loads`, `check-plugin-teardown-shape --self-test`). - `--ran`: `Run reconciliation — 122 derived, 122 run, 0 NOT-MEASURED, 0 UNRUN.` - `node scripts/pm/overlap-check.mjs --branch=HEAD` before every push: `VERDICT clean exit 0`. - CI on `8e2ca2b7`: `Lint · repo & tooling gates` failed on this PR's own change (`check-facade-delegation-only --self-test` N6: `packages/objectql/src/registry.ts` at 6438 lines, over its 6426 ceiling; the same lane is green on main at `06c3e5ac`). Fixed in `6fd5bb85` (net zero lines in the facade, the paragraph moved to the facet). The `Lint & Repo Gates`, `TypeScript Type Check` and `Test UI` aggregates on `8e2ca2b7` read that failure plus lanes `cancelled` when the push of `6fd5bb85` superseded the run; no other lane failed. </details> ## Acceptance notes - **Merged main once** (`65ce7983`, which carries PR objectstack-ai#36517's `.custom` arrangement). The orphan rule's extension fold accepts `_relatedLists` keys for labelled entries a `.custom` arrangement or a `place` list placement brings; its docblock that said `relatedLists` is not translatable through an extension is corrected. - **The extractor walk does not read `objectExtensions`** (for fields neither): a labelled tab an extension brings is not scaffolded by `os i18n extract` and not counted by coverage. The resolver translates it and the orphan rule accepts its key; scaffolding extension surfaces is a separate, pre-existing gap of the walk. - **A `place` entry's label applies only where the extended object declares `relatedLists`** (the registry's rule, and the packaged base follows it). The orphan rule accepts its key regardless, the permissive direction: its fold does not read whether the target declares the list (the target may be another package's object the stack does not carry). - **Sibling gap, not changed here:** the save door's echo restore does not restore `listViews` copy or `validations[].message`, which `translateObject` also translates. - No in-repo object declares a labelled `relatedLists` entry today, so no shipped bundle and no coverage ratchet moves. ### Round 2 (contract review 7088121343) - **M1, route (a).** `getPackagedObjectBase` now carries the list entries a code extender's `place` splices into the owner's `relatedLists`, computed by the fold's own pass (`applyExtensionPlacements` over the enabled code extenders, same child-package rule), as it carries their added fields; only the lists are read off. A placed title therefore compares equal to its packaged base on the `/meta` read and the deployment catalog applies; a tenant's rename still diverges and keeps its text. Every reader of the packaged base was measured: the REST `/meta` list and item reads and the form route (through `translateObject`, where `translateObjectRelatedLists`, new in this PR, is the only code that reads the base's `relatedLists`), the save door's echo restore (its `relatedLists` slot is this PR's, and it now restores exactly what the read translates), the share-link label (translates `{ name, label }` only), the validation-message reader (reads `validations` only) and `getPackagedFieldPatchBases` (its bases are read for `fields` only). No reader outside this card's slot changes its verdict; Studio, the `.custom` arrangement fold and the customization-diff and divergence checks do not read this base. Pinned through the protocol accessor the REST read asks, with one ablation (red without the carry). The `@objectstack/objectql` changeset entry is `minor`, as the kind takes, with a sentence true of the head. - **N1.** A key over a built-in tab (`sys_activity`, `sys_attachment`, `sys_approval_request`) gets its own reason and hint, naming neither `{ list, label }` nor `relatedListTitle`. - **N2.** A `.custom` entry with `hidden: true` no longer counts as labelled; its key is flagged with its own reason. - **N3.** A dotted list is bracketed in the finding path (`_relatedLists["event.owner_id"]`). - **Facade ceiling.** `registry.ts` is a facade at its 6426-line ceiling; its docblock stays net zero there and the why-paragraph lives on the facet's `packagedPlacedRelatedLists`. ## Verification Read first, by risk: 1. `packages/spec/src/system/i18n-resolver.ts`, `translateObjectRelatedLists`: which entries are translated (labelled object-form only) and which catalog a label reads (`valueOverridesPackagedBase` against the packaged entry of the same `list`). 2. `packages/metadata-protocol/src/protocol-translated-echo.ts`, the `relatedLists` block in `restoreTranslatedEchoes`: a save's entry label is put back only when a read of the source translates to exactly it. 3. `packages/lint/src/validate-translation-references.ts`, the `_relatedLists` leg and the extension-fold addition. Two-minute check, one command: ``` pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2 src/system/i18n-related-lists-label-36528.test.ts ``` Expected: 10 tests pass, among them the zh-CN title served on the parent's `contact` and `event.related_to` entries. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01ADHkmRdKNUzzADvuRJx6UT <!-- signed: repo:objectstack#2 · os-steve · session_01ADHkmRdKNUzzADvuRJx6UT --> --------- Co-authored-by: Claude <noreply@anthropic.com>
Requested by Steve · project thread
Fixes #36498
Clause-②: yes (widening)
Metadata-protocol: added
Skills-docs: follow-up #36541
维护者速读
What changes
The record page is arranged in three layers. The package that owns an object declares
fieldGroupsandrelatedLists; a package that extends it places what it brings withplace; this PR adds the third: the object extension of the paired.custompackage may declare the whole arrangement, over both.Spec keys touched (
packages/spec/src/data/object.zod.ts,related-list-entry.ts,field-customization.ts,kernel/metadata-read-decorations.ts):ObjectExtensionSchema.fieldGroupsObjectFieldGroupSchema, the shape an object'sfieldGroupstakes; keys unique. Was refused at parse with a prescription namingplace.ObjectExtensionSchema.relatedListsObjectExtensionRelatedListEntrySchema: a bare name (a child, a relationship, or one of the three built-in tab names) or{ list, label?, columns?, hidden? }. Was refused at parse the same way.ObjectExtensionRelatedListEntryObjectSchema.hiddenRelatedListEntryObjectSchema(an object's own entry) still refuseshidden, now with a sentence saying where it belongs.METADATA_READ_DECORATIONS_relatedListsArrangementadded: derived on read, stripped on write, never authorable.BASE_FIELD_DISPLAY_WHITELISThidden, below).New exports:
CUSTOM_ARRANGEMENT_KEYS,extensionArrangementKeys,relatedListEntryHidden,relatedListNameCovers,RELATED_LISTS_ARRANGEMENT_DECORATION,RelatedListsArrangement,readRelatedListsArrangement, the two entry schemas and their types.Who may write them. The schema admits the keys on any extension, because a parse does not know the writing package. The writer is judged where the package is known, by one judge (
judgeExtensionArrangement,packages/metadata-protocol/src/protocol-extension-arrangement.ts) on the__cprecedent's predicate (isCustomizationPackage), at the same doors as the__creservation:object_extensionitem (objectExtensionItemRefusal):VALIDATION_ERROR/ 400, one issue per key;os validateandos build(findExtensionArrangementRefusals, in the validate/build parity roster);marketplace-install-local-plugin.ts):VALIDATION_ERROR/ 422 withdetails.refusals.Each refusal names the key, the object and the package and prescribes
placewith an example entry. An extension that reaches the registry past those doors is skipped by the fold and named in the boot log.Which
.custompackage is served. The doors judge by the suffix; the fold decides by role. It serves only the object's own pair: the.custompackage of the App the object belongs to, asked ofpairsOfover the installed manifests (packages/metadata-core/src/customization-pair-lookup.ts, the listisPairOftests against). That list is the App's pair first and then, while one is installed, a per-package pair an earlier version created. A.customwriter outside the list is skipped and named in the boot log, alone or beside the pair. Where both listed pairs write one key, the App's pair is served and the other is named. Fold order decides nothing (ADR-0146 D2).The merge (
packages/objectql/src/registry-custom-arrangement.ts, wired intofoldExtendersOntoDefinitionafterapplyExtensionPlacements): the owner's arrangement, then every extension'splace, then the.customkey replaces the result, whole. A key the extension does not write keeps the result of the first two steps. Nothing is merged entry by entry.fieldsshows exactly its list, so a field of the owner or of another extension that no list names loses agroupnaming such a group, and a listed field's owngroupfollows the group that lists it. The served object still passes an object parse.relatedListsis the arrangement's shown entries, then the entries of the list it replaced that it does not name (before a trailing approvals / activity-stream run).{ list, hidden: true }hides that list, whichever package brings it. What a servedrelatedListscannot say travels in the_relatedListsArrangementread decoration ({ packageId, hidden, unlisted }), stamped on the served by-name read and the served object list, not on the execution face. Where the arrangement hides every tab of a declared list, the served list is empty andunlisted: 'hidden'beside it says it is still a declared list..custompackage, serves the first two steps again. Nothing is stored in the base or in another package.The record page (
ui/packages/app-shell/src/utils/deriveRelatedLists.ts,ui/packages/plugin-detail/src/synth/buildDefaultPageSchema.ts): both readers read the decoration throughreadRelatedListsArrangement. A list the environment hides is not derived; where the arrangement replaced the automatic tab list, a list no entry names still shows after the listed ones, and so does the attachments tab. An empty served list besideunlisted: 'hidden'is read as a declared list that names nothing, so a list the owner hid by leaving it out stays hidden. With no decoration served, both answer exactly as before; each reader's suite ends with a block that pins that against literal values.hiddenon a field did not enterBASE_FIELD_DISPLAY_WHITELIST. The whitelist's admission test is "display only: never changes what is stored, validated or computed".FieldSchema.hiddenfails it on three counts: a hidden field is left out of the search companion column (the stored value changes), a form's required check skips it (required && hidden !== true, the validation verdict changes), and default search and export columns drop it. So the whitelist is not widened. The explicit arrangement form is a.customfield group whosevisibleWhenis false:{ key: 'off_page', label: 'Not shown', fields: ['fax'], visibleWhen: 'false' }keeps a vendor field off the record page and the forms. Two limits, now stated in the key's description, the whitelist's doc comment, the docs page and the changeset:requiredfield that has no default: the create form no longer shows the field while the save still requires it, so the form cannot be submitted.The per-user tab order still layers on top. The console keeps each reader's tab order and hidden tabs as a diff over the host's default order (
ui/packages/plugin-detail/src/synth/relatedArrangement.ts), and the default order isderiveRelatedListsover the served object. The environment layer is in the served object, so the reader's order is laid over it unchanged. A list the environment hides is not derived, so a reader's saved arrangement cannot bring it back.Docs and changeset:
content/docs/data-modeling/object-extensions.mdxgains "Arranging the whole record page";.changeset/36498-custom-package-arrangement.md(minoron the eight packages moved). The changeset no longer says a non-.customwriter is refused on every path: where no door judges it, the key is not applied and the boot log names it.Tests
The acceptance bullets of the card are reproduced over a base + extension package +
.customfixture (com.vendor.crm,com.acme.tax,com.vendor.crm.custom, objectcrm_lead), and the App pair over two installed packages in the HotCRM shape (an Appcom.hotcrmand a module of it,com.hotcrm.sales, that owns the object); HotCRM itself is not edited.packages/objectql/src/registry-custom-arrangement.test.tsunlisted: 'hidden'; onlyrelatedListswritten keeps the groups of the first two steps; removing both keys, uninstalling and disabling the pair each restore; a non-.customwriter is skipped with a boot-log line namingplace; a.custompackage that is not the object's pair is skipped and named, beside the pair and alone; an object a module owns with two.customwriters, in both fold orders: the App's pair is served and the other named; an installed per-package pair is read, and comes second to the App's pair; re-fold idempotence. The layout is asserted throughderiveFieldGroupLayout, the derivation the record page, the forms and the preview share.packages/objectql/src/protocol-custom-arrangement.test.ts.custompackage's save is refused once (VALIDATION_ERROR/ 400,placenamed), nothing stored; re-saving without the keys and disabling the pair restore.packages/metadata-protocol/src/protocol-extension-arrangement.test.ts.customcontrol.packages/cli/test/validate-build-extension-arrangement.test.ts,packages/cli/src/utils/extension-arrangement.test.tsos validateandos buildeach refuse once and nameplace; the.customcontrol passes; the parity roster row.packages/cloud-connection/src/marketplace-install-local-extension-arrangement.test.tsdetails.refusals), nothing installed; the.customcontrol installs.packages/spec/src/data/object-extension-arrangement.test.ts,object-extension-place.test.tshiddenaccepted on the extension entry only, the contradiction andplace-beside-arrangement refusals, the whitelist unchanged.ui/packages/app-shell/src/utils/__tests__/deriveRelatedLists.customArrangement-36498.test.ts,ui/packages/plugin-detail/src/synth/__tests__/buildDefaultPageSchema.customArrangement-36498.test.tsunlisted: 'hidden'(the list the owner left out stays hidden; without the decoration the empty list reads as before), and the pin that nothing moves with no decoration served.Readings at head
7052770cd, this round (the review's three should-fix items). The first round's readings are in the firstos-dev-reportcomment on the card.Scoped suites
At head
7052770cd, tree clean, each run outside the shared verification lock, one at a time.pnpm --filter @objectstack/objectql exec vitest run --maxWorkers=2 src/registry-custom-arrangement.test.ts src/protocol-custom-arrangement.test.ts src/registry-extension-placement.test.ts: exit 0,Test Files 3 passed (3),Tests 73 passed (73). The fold suite alone:Tests 33 passed (33).pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2 src/data/object-extension-arrangement.test.ts src/data/field-customization.test.ts src/data/related-list-entry.test.ts: exit 0,Test Files 3 passed (3),Tests 158 passed (158).pnpm --filter @object-ui/app-shell exec vitest run --root ../.. --maxWorkers=2 packages/app-shell/src/utils/__tests__/deriveRelatedLists.customArrangement-36498.test.ts: exit 0,Tests 21 passed (21).pnpm --filter @object-ui/plugin-detail exec vitest run --root ../.. --maxWorkers=2 packages/plugin-detail/src/synth/__tests__/buildDefaultPageSchema.customArrangement-36498.test.ts: exit 0,Tests 10 passed (10).pnpm --dir ui exec vitest run --maxWorkers=2 scripts/: exit 0,Test Files 172 passed | 2 skipped (174),Tests 5127 passed | 2 skipped (5129).pnpm --filter @objectstack/spec run check:generated --fixrebuilt the spec and regeneratedcontent/docs/references/data/object.mdx(the two descriptions), exit 0; the objectql dependency closure and objectql were built, exit 0.Ablation: each changed behaviour broken once, the suite turns red, the file restored
Each leg goes through
node scripts/ablation-replace.mjs: the anchor must hit once, the tool prints the blob before and after, the suite runs, the file is restored. After each leg the file's blob equals the one atHEADandgit diff HEADis empty. All six ran at7052770cd. No build step is in a leg: each suite imports the mutated file from source.if (writers.size === 0)to>= 0):Tests 27 failed | 6 passed (33).if (!pairs.includes(packageId))to a condition that never holds):Tests 4 failed | 29 passed (33). The four: the.custompackage that is not the pair, the module-owned object in both fold orders, and the.customid named after the module.readRelatedListsArrangement(objectDef)to(undefined)):Tests 11 failed | 10 passed (21).unlisted === 'hidden'to a value never served):Tests 2 failed | 19 passed (21). The two are the new empty-list cases.Tests 3 failed | 7 passed (10).entries.length === 0 && unlistedTabs !== 'hidden'toentries.length === 0):Tests 1 failed | 9 passed (10). The one is the new empty-list case.Gates
node scripts/pm/dispatch-gates.mjs --commandsat7052770cd: 131 commands derived from the branch's 46 changed paths.pnpm check:facade-delegation-only(registry.tsstays at its line ceiling: the one host line added is paid for by folding a doc line into a trailing comment),pnpm check:registry-log-declared,pnpm check:test-source-alias,pnpm check:nul-bytes, and the spec family (check:generated,check:docs,check:api-surface,check:authorable-surface,check:export-origins,check:liveness).check:skill-examples,check:dual-build-cjs-loads,check:i18n,check:i18n-coverage,check:i18n-walk-parity, reason: each answered exit 3, PREREQUISITE NOT MET. The worktree was rebuilt for this round with the spec and the objectql closure only, and these read the built output of the CLI and of other packages. The check-runs on this head are their reading.pnpm --dir ui exec vitest run scripts/; it was run with--maxWorkers=2added (the bare spelling was killed for memory in the first round) and is counted under the scoped suites.node scripts/pm/dispatch-gates.mjs --ran:Run reconciliation — 131 derived, 125 run, 5 NOT-MEASURED, 1 UNRUN; the one is the UI scripts suite under its derived spelling.node scripts/check-platform-checklist.mjs --changed-from origin/main: exit 0,7 anchored file(s) in the change set, 54 anchor(s) judged, 0 lost.7052770cd: 70 runs, 61 success, 9 skipped (opt-in, queue and schedule-only jobs), 0 failed. Test Core 10 of 10, Test UI 16 of 16, the Lint lanes, the Type Check lanes, Build Core, Check Changeset, Spec property liveness and Governed Surface Queue Guard are success.Acceptance notes
unlisted: 'hidden'beside it now reads as a declared list that names nothing. This was the smaller change: the decoration's shape and the fold's output are as they were, and the documented rule (a list the owner hides by leaving it out stays hidden until the arrangement names it) now holds in the empty case too. Pinned in the fold suite and in both reader suites..customwriters did not know the App pair. The fold now askspairsOf, neverisCustomizationPairOf; the arm that served the writer folded last is gone. One call made here: an installed per-package pair of an earlier version is admitted, second to the App's pair, because the lookup module prescribesisPairOf/pairsOffor every read that serves a package's customizations.docs/adr/**; the sentences this change puts out of step and their replacement wording are in the report.hiddenis for relationship entries, and an unlisted built-in tab shows. A separate finding, which the seat files..customwriter's key is only skipped with a boot-log line, wheremainrefused it at parse: a code-defined stack that boots withoutos validateoros build; a stack that names no package id, whichos validatepasses; and package duplicate and orphan adoption. Nothing is applied on any of them. A follow-up, not a change on this head..customwriter that is not the object's pair: they can read the installed manifests, which the CLI door cannot. As built they judge by the suffix, and the fold skips such a writer with a boot-log line. A follow-up.relatedListsstays hidden until the arrangement names it; "unlisted shows last" applies to the tabs the first two steps showed.placeentry beside the arrangement key that replaces it, in one extension, is refused at parse..customarrangement that the object does not have (a field in a group's list, a tab entry) is not judged atdefineStack,os validateor install. The layout derivation and the tab reader skip a name nothing answers to, as they do for an object's own arrangement, so a vendor upgrade that removes a field does not make the environment's next save fail.packages/spec/src/data/object.zod.ts(field history defaults); the later lander merges main.Verification
Read first, by risk:
packages/objectql/src/registry-custom-arrangement.ts, two hunks.servedWriter: a writer is admitted when its package is a.custompackage and is inpairsOfof the object's owner, and the served one is chosen by its position in that list; this decides whose arrangement an installed object shows. The field hunk under// ── fieldGroups: it rewrites or removes a field's owngroupon the served copy (never on a stored body) so that a listing group shows exactly its list; this decides where an unlisted field lands.packages/spec/src/data/object.zod.ts, theObjectExtensionSchemahunk: the twoguidancerefusals are removed and the keys are admitted on every extension; the writer is refused at the doors instead. Check that every door a package's extension passes is listed above, and the two key descriptions against what the fold does.ui/packages/app-shell/src/utils/deriveRelatedLists.ts, thenamingline and the final loop: an empty served list besideunlisted: 'hidden'becomes an empty naming map, so the loop takes the declared arm and shows only what is named or brought by another package.hiddenByArrangementruns before the!namingearly exit. All of it is inert whenreadRelatedListsArrangementanswersundefined.Two-minute check, one command:
Expected: 33 cases pass; the case titles read as the card's acceptance bullets and the review's three items.
🤖 Generated with Claude Code
https://claude.ai/code/session_01ADHkmRY38EZf38Yy3zthbY