Repository navigation
Commit c0eecb1
docs(skills): objectstack-data teaches the paired .custom package's whole arrangement (fieldGroups, relatedLists) (#36568)
<!-- claude-projects-attribution: {"github_login":"os-steve"} -->
_Requested by **Steve** · [project
thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi91tYCagMT6JaQ6YA5YqnWwi)_
Fixes #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 #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; #35129 and #36559 merge
cleanly (#36559 edits case 3 of the same eval file); draft #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>1 parent 1a2a8a9 commit c0eecb1
4 files changed
Lines changed: 44 additions & 12 deletions
File tree
- .changeset
- skills/objectstack-data
- evals
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
72 | | - | |
| 71 | + | |
73 | 72 | | |
74 | 73 | | |
75 | 74 | | |
| |||
91 | 90 | | |
92 | 91 | | |
93 | 92 | | |
94 | | - | |
| 93 | + | |
95 | 94 | | |
96 | 95 | | |
97 | 96 | | |
| |||
317 | 316 | | |
318 | 317 | | |
319 | 318 | | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | | - | |
324 | 319 | | |
325 | 320 | | |
326 | 321 | | |
| |||
335 | 330 | | |
336 | 331 | | |
337 | 332 | | |
338 | | - | |
339 | | - | |
| 333 | + | |
340 | 334 | | |
341 | 335 | | |
342 | 336 | | |
| |||
389 | 383 | | |
390 | 384 | | |
391 | 385 | | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
392 | 391 | | |
393 | 392 | | |
394 | 393 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
451 | 451 | | |
452 | 452 | | |
453 | 453 | | |
454 | | - | |
| 454 | + | |
455 | 455 | | |
456 | 456 | | |
457 | 457 | | |
| |||
466 | 466 | | |
467 | 467 | | |
468 | 468 | | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
469 | 489 | | |
470 | 490 | | |
471 | 491 | | |
0 commit comments