Skip to content

docs(skills): objectstack-automation teaches that a clearable state lists '' among its targets - #36559

Merged
os-zhuang merged 2 commits into
mainfrom
claude/issue-36161-clearable-state-skill
Nov 23, 2026
Merged

os-zhuang merged 2 commits into
mainfrom
claude/issue-36161-clearable-state-skill

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Warren · project thread

Fixes #36161

Clause-②: no
Metadata-protocol: none
Ride-along: the employee lifecycle eval in skills/objectstack-data/evals/objects-fields-relationships.json now declares initialStates (declared by the seat; source: a finding in the thread of card 36534, the same state-machine teaching theme).

维护者速读

  • 用户能看到什么变化:用 AI 搭应用的人,照自动化技能写状态机时,会被告知「想让某个状态可以清空,就要在它的去向里写上空值」;此前技能没提,照着写出来的应用会拒绝用户清空状态字段。
  • 为什么做:平台已经把「清空状态」当成一次状态流转来判定,技能文字落后于已上线的规则,这是补上那句教学。
  • 出错会怎样:只改教学文字,不改任何运行行为;写错了最多是 AI 少写或多写一个空值去向,撤回这个改动即可恢复原文。
  • 要你做什么:无。

What changes

skills/objectstack-automation/references/state-machines-and-approvals.md, state-machine notes, one new entry:

Clearing the field is a transition to ''. An update to null or '' is judged from the stored state: a clearable state lists '' in its targets, e.g. paused: ['open', '']; from any other listed state it is refused (invalid_transition, constraint.to: '').

Quoted from the merged code, not from the card. checkStateMachine in packages/objectql/src/validation/rule-validator.ts (main d463c46) reads the stored state, maps an empty target (undefined, null or the empty string) to the key '', and answers fallback('invalid_transition', { from: fromKey, to: toKey }, …) when the stored state's list does not include it. Two points where the skill text is narrower than the card's sentence, both on purpose:

  • The card writes to: ''. In the code that pair is the refusal's constraint ({ from, to: '' }), so the skill says constraint.to: ''.
  • The card writes "a clear from any other state is refused". The code returns no error when the stored state is not a key of transitions (the existing "unlisted from state is not guarded" note), so the skill says "any other listed state".

The new entry is paid for by shortening the section intro and six neighbouring notes in the same file; each keeps its fact. The token ceiling row is untouched.

Ride-along, second commit: in skills/objectstack-data/evals/objects-fields-relationships.json, the employee lifecycle case's expected answer declared a state_machine with transitions only, which publish refuses for a machine that runs on insert (state-machine-no-initial-states). It now declares initialStates: ['draft'] with the one-clause reason its sibling order case uses, and must_contain requires initialStates. The seeds eval in hooks-security-seeds-datasources.json that mentions state_machine only says seed rows skip that rule; it teaches no machine and is unchanged.

Tests

No code path changes, so there is no test to add or ablate. The one os:check block in the section is byte-identical.

Acceptance notes

  • Scope-out, the ui lane's: the card notes that the Studio validations panel parses targets with a filter that drops empty strings, so it cannot write '' and loses an existing one on edit. Not touched here; no file under ui/ is in this diff.
  • Commit trailer: the commit carries the model-free trailer pair AGENTS.md prescribes. The dispatch order asked for a trailer naming a model; AGENTS.md outranks it.
  • Changeset: skills/ ships as @objectstack/skills, so this takes a patch changeset (.changeset/36161-automation-skill-clearable-state.md), not skip-changeset.

Verification

Readings at head dd527b9 against main d463c46.

Reading Before After
The edited file, lines 385 386
The edited file, bytes 23726 23734
The edited file, tokens (ceiling 5936) 5932 5934
All SKILL.md files, lines 4951 4951
Ratcheted authored catalog, tokens 197573 197575
The eval file (measured, not ratcheted), tokens 7984 8032
Whole shipped bundle, tokens 293321 293371

Net skills/** lines: +2 (25 added, 23 removed): +1 in the reference, +1 in the eval file.

Read first: the "Notes" list of the state-machine section in the diff — the new entry, then the six shortened notes beside it (check that none lost a fact).

Two-minute check: node scripts/check-skills-token-ratchet.mjs exits 0 and prints state-machines-and-approvals.md is 5934 tokens (ceiling 5936; headroom 2); git grep -n "''" -- skills/objectstack-automation/references/state-machines-and-approvals.md shows the clearable-state entry.

Local gate subset (derived by dispatch-gates, 49 families)

44 exited 0 at dd527b9, among them check-skills-token-ratchet (scan and self-test), check:skill-refs, check:skill-served-sections, check:skill-links, check:skill-identifier-liveness, check:skill-compatibility, check:skill-frame-sync, check:role-word, check:doc-authoring, check:nul-bytes, check:published-files, check-empty-changeset, check-changeset-no-major, check-adr-0087-registration, check-closing-keyword-parity.

NOT MEASURED locally, left to CI:

  • check:dts-closure, check:dual-build-cjs-loads, check:lean-entry-closure, check:sourcemap-no-sources-content, check:doc-formula-expressions — each exited 3, prerequisite not met: they read built dist/ and this diff touches no package, so no build closure was made.

Generated by Claude Code

…ists '' among its targets

A clear of a state-machine field (null or '') is judged from the stored
state as a transition to ''. The reference says how to make a state
clearable and that a clear from any other listed state is refused with
invalid_transition, the constraint carrying to: ''. Paid for by shortening
neighbouring notes in the same file; the token ceiling is unchanged.

Claude-Session: https://claude.ai/code/session_01JQwxbZeHNsF3RWcWpj7rGj
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/s documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 22, 2026
Ride-along on the state-machine teaching: the objectstack-data eval's
expected answer declared a state_machine with transitions only, which
publish refuses for a machine that runs on insert
(state-machine-no-initial-states). It now declares initialStates: ['draft']
with the reason, and must_contain requires initialStates.

Claude-Session: https://claude.ai/code/session_01JQwxbZeHNsF3RWcWpj7rGj
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: dd527b97cb8d2e717fa3c1d70bc18331f43c21f0
Local-runs: none
Scope: skills/objectstack-automation/references/state-machines-and-approvals.md, skills/objectstack-data/evals/objects-fields-relationships.json + none
Security-touching: yes
Rule-change-verified: none

Inputs read: card #36161 (body, its 5 comments, its label timeline), PR #36559 (body, 3-file list, net diff), the check-runs on this head, and the cited code on main at ad50d611. Merge-base is d463c46f; neither hits file, the changeset path, rule-validator.ts, validate-inert-object-declarations.ts nor validation.zod.ts changed between the two, so the PR diff is the net diff against main.

Check-runs at 2026-11-22T23:34:06Z: 48 runs, 30 success, 18 skipped, 0 red, 0 in progress (Test Core (1/10) was still running at the first read and completed green at 23:33:19Z; the Test Core roll-up followed). Read green, among them: Check Changeset (both runs), PR-body guards (both runs, the second after the body edit of 23:25Z), Governed Surface Queue Guard, Type Check · source gates (token ratchet, skill-refs, served-sections, frame-sync, compatibility, links), Lint · docs & code guards (role-word, identifier-liveness), Build Core, Type Check · consumer gates, Test Core (1/10), Test Core (2/10), Test Core, and the other Lint and Type Check jobs.

The security line above reads yes, and yes is meant. The path name shows a workflow reference; the changed hunks teach where a server-side write-path lock does and does not refuse a write: the new entry tells an author how to open an exit from a state ('' in its targets), and the reworded entry beside it restates that an unlisted stored state is not guarded. The lock binds an elevated caller too (engine-state-machine-stored-state.test.ts, "an elevated caller is judged the same way"), the rule this teaches was narrowed by the security seat (PR #36127), and the card says decisions on the same machine are pending with that seat. That is enforcement behaviour, so the low-risk arm does not apply. The card has never carried the security label (timeline read); the adopting seat adds it.

The rule-change line above reads none: the file list holds no .claude/** path (one changeset, two skills/** files), and no hunk alters what an agent may do, the order of work, or what goes to the maintainer.

① Derived judgments

  • Accept-set: unchanged, right. No schema or code file is in the diff. StateMachineValidationSchema.transitions is z.record(z.string(), z.array(z.string())) (packages/spec/src/data/validation.zod.ts:196), so the taught paused: ['open', ''] already parses and type-checks against StateMachineValidation; no lint rule judges a target against the field's options (validate-inert-object-declarations.ts and validate-seed-state-machine.ts read).
  • Public surface, @objectstack/skills reference text: one added note, the section intro and six notes reworded. Right. No heading or anchor changes, the os:check block sits outside every hunk, the file is 23734 bytes (23726 on the merge-base), under the untouched ceiling row 5936 at scripts/check-skills-token-ratchet.mjs:1808.
  • Eval grading set, case objectstack-data/objects-fields-relationships#3: must_contain gains initialStates. This narrows what the grader passes (grade.ts: a literal, case-sensitive substring), right: publish refuses a machine that runs on insert without it at severity error (validate-inert-object-declarations.ts:57-66), the data skill teaches the token (skills/objectstack-data/SKILL.md:327, rules/validation.md:103-113), and the sibling order case already requires initialStates: ['draft'].
  • Eval case hash: hashCase covers the prompt and both token lists (cases.ts), so case 3's hash moves and --regrade refuses earlier run records of this case as changed since the turn ran (run.ts:372-388). Right, and the designed reading; expected_output is neither sent nor graded.

② Semver level

.changeset/36161-automation-skill-clearable-state.md declares '@objectstack/skills': patch, Clause-②: no, Metadata-protocol: none; the PR body carries the same two lines. The diff publishes skill prose and one eval fixture: no accept-set, export, type or runtime behaviour moves, so patch and Clause-②: no match what is published, and Metadata-protocol: none holds (no protocol file in the list). @objectstack/skills is in the fixed group and takes a changeset, not skip-changeset; the sibling .changeset/36285-relationships-predicate-floor.md on main has the same shape. Check Changeset is green on both runs.

③ Boundary flags

Dev flags, from the report naming this head (comment 7087555372):

  1. Commit trailer without a model name: answered. Both commits carry Claude-Session: and Co-authored-by: Claude, the pair AGENTS.md:451 prescribes.
  2. Skill wording narrower than the card (constraint.to: '', "any other listed state"): answered, and the narrower wording is the correct one. See ④.
  3. Five build-dependent gates not measured locally: answered by CI. check:dts-closure, check:dual-build-cjs-loads, check:sourcemap-no-sources-content and check:lean-entry-closure run in Build Core, check:doc-formula-expressions in Type Check · consumer gates; both green.
  4. Two tokens of headroom spent, ceiling row untouched: answered. The ratchet file is not in the file list and the ratchet step is green in Type Check · source gates.
  5. PR body footer form: prose face; PR-body guards green.
  6. File surface: the eval file is outside the claim's declared surface (claim comment 7087169995 names one file and says stop on breach). Answered for this record: the PR body carries a Ride-along: line, PR-body guards (single-writer path) is green after that edit, the file is a hits path and is reviewed in full below, and PR fix(qa): travel_expense verified build declares initialStates so install-local accepts it #36560 from the source card travel_expense scenario fixture cannot be installed on main: install-local answers 422 state-machine-no-initial-states #36534 does not touch it. Left to the adopting seat: the claim comment still names one file; say so in the ACCEPT.
  7. PR body not patched by the dev: answered. The body read at 23:25:48Z names head dd527b97 and carries the ride-along paragraph.
  8. No merge of main: answered above; the net diff is the PR diff.

open_questions: empty.

Out-of-scope finding carried by the dev as "noted, not filed": the Studio validations panel drops ''. Confirmed on main: ui/packages/app-shell/src/views/studio-design/ObjectValidationsPanel.tsx:597 ends the target parse with .filter(Boolean), so a row edit removes a listed '' and the clear is refused again. An issue search found no card for it, and Fixes #36161 closes the only card that carries the note. Escalated to the adopting seat: route it to the ui lane through the filing gate before this lands, or name the card that already holds it.

Reviewer flag: one item goes to the security seat through the private channel; it is not held against this head and the skill text does not widen it.

SQL push-down: no query, id materialisation or join in the diff.

PR author is objectstack-fleet[bot].

④ Design judgment

skills/objectstack-automation/references/state-machines-and-approvals.md, against checkStateMachine on main (packages/objectql/src/validation/rule-validator.ts:4166-4264) and the card's owed sentence.

New entry, clause by clause:

  • "Clearing the field is a transition to ''": lines 4243 and 4251, cleared = isEmptyStateValue(to), toKey = cleared ? '' : String(to). Holds.
  • "An update to null or '' is judged from the stored state": from = previous[rule.field] (4236); isEmptyStateValue takes undefined, null and '' (4267). Holds.
  • "a clearable state lists '' in its targets, e.g. paused: ['open', '']": allowed.includes('') (4252). The example is the fixture of engine-state-machine-stored-state.test.ts:59 and of content/docs/protocol/objectql/state-machine.mdx:110. Holds.
  • "from any other listed state it is refused (invalid_transition, constraint.to: '')": line 4255 answers fallback('invalid_transition', { from: fromKey, to: toKey }, …), and both arms of fallback put that pair under constraint, with or without an authored message. "listed" is required: line 4249 returns null when the stored state is not a key. The card's "any other state" and bare to: '' would both have been wrong; the diff's wording is right.

Acceptance scenario: the card's re-check, git grep -n "''" on the file, now answers the entry; the triage ruling's case (an app built from the skill refuses a user who clears the state field) is answered by the taught target.

Attempts to break it:

  • An already-empty state written empty again: from === to returns first (4242) and the test's control covers it. The entry speaks of listed states and stays true.
  • A non-blocking machine: the entry, like every note in the section, describes the default severity: 'error' rule. Unchanged premise.
  • The first client of a '' target: ui/packages/core/src/validation/validators/state-machine-next-values.ts builds a string set from the targets and treats an empty current value as unconstrained; a '' member is inert there. Holds.
  • The seed lint adds each target to its state set as a string (validate-seed-state-machine.ts:74-78); a '' target is not refused there.

Reworded passages, each checked for a lost fact: the intro and the "enforced on the write path" sentence (same claim, 4252-4255); one rule per field; initialStates gating insert, the publish refusal and the update-only exemption (validation.zod.ts:197, validate-inert-object-declarations.ts:42-66); guards as sibling script / conditional rules and reactions as a record_change flow under ADR-0019; the introspection route with next: null and "always pass from"; the unguarded unlisted from state (4249); the record. scope of sibling predicates. Every fact is still stated. What went is rationale only ("instead of hard-coding it", "rather than relying on an implicit any → any") and the label "record-triggered Flow", whose identifier record_change stays.

skills/objectstack-data/evals/objects-fields-relationships.json, case 3, against the lint rule and the data skill on main.

  • initialStates: ['draft'] for a draft → active → terminated machine with default events: the rule refuses the old expected answer (rule.type === 'state_machine', runsOnInsert(undefined) is true, no initialStates, severity error), so the old expected_output modelled a shape publish refuses. The new one is right, and draft is the entry state the prompt names.
  • "transitions governs only UPDATE … (state-machine-no-initial-states)": matches validation.zod.ts:197 and rule-explanations.ts:6519-6530.
  • must_contain + initialStates: attainable from the skill under test (SKILL.md:327), and looser than the sibling's initialStates: ['draft'], so an answer that quotes the list with other quote marks still passes.
  • The file parses and every must_contain token of case 3 is present in its expected_output.

No must-fix, no should-fix.

  • N1 (nit) — eval case 3, "publish refuses a machine that runs on insert without it": the nearest nouns before "it" are message and transitions; initialStates is meant. The rule id in the parenthesis settles the reading and expected_output is neither sent nor graded. Accepted deviation.
  • N2 (nit) — the entry's example state paused is not one of the five states of the os:check block above it. It is marked "e.g." and mirrors the docs page and the engine test. Accepted deviation.

Implemented-by: claude/issue-36161-clearable-state-skill
Reviewed-by: session_01JQwxbZeHNsF3RWcWpj7rGj

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj

维护者速读

自动化技能补了一句:状态字段要允许「清空」,得在那个状态的可去目标里写上空值;其它状态下清空会被拒绝。这是 #36127 落地后的行为,技能原来没教,AI 照旧写出的应用会拒掉清空状态的用户。
顺带修了数据技能的一道评测参考答案:它示范的状态机没写起始状态,按现在的规则发布会被拒。
两层审核都通过,CI 全绿,改动 64 行。因为契约审核判它涉及写入锁的教法(Security-touching: yes),走人工批准。
要你做的:os-zhuang 批准即可(契约审核 PASS 7087685411,Head-sha dd527b97)。

席位核对 — ACCEPT (L1) · repo:objectstack#1 · head dd527b97 · 2026-11-22T23:38Z

  • Shape: Fixes #36161; files skills/objectstack-automation/references/state-machines-and-approvals.md, skills/objectstack-data/evals/objects-fields-relationships.json, .changeset/36161-automation-skill-clearable-state.md (+41/−23). Tier H by check-governed-merges --pr 36559: governed skills/**, and the low-risk skills arm does not apply because the record reads Security-touching: yes.
  • Premise measured: zero hits for the clearable-state sentence on main before this PR; PR fix(objectql): a state machine judges every write from the stored state, a clear included #36127 merged. Every clause of the new entry holds against checkStateMachine (packages/objectql/src/validation/rule-validator.ts); the diff's narrower wording ("any other listed state", constraint.to: '') is the code's, not the card's, and is right.
  • Gates: 30 success · 18 skipped · 0 red on dd527b97; mergeable clean. Token ratchet green with the ceiling row untouched.
  • Accepted deviations: the claim's file surface named one file; the eval ride-along was declared by this seat (source: the travel_expense scenario fixture cannot be installed on main: install-local answers 422 state-machine-no-initial-states #36534 card thread's finding) and is named on the PR body's Ride-along: line. Nits N1, N2 of the contract review are accepted. Commit trailers follow AGENTS.md's model-free pair.
  • Out of scope, routed: the Studio validations panel drops a '' target → filed Studio validations panel cannot author a clearable state: it drops the '' target of a state_machine row #36567 (finding, area:ux, for triage). One reviewer flag went to the security seat through the private channel. Skills-docs: n/a (this PR is the skills text).
  • Landing: Tier H — waits on os-zhuang's approval; the seat then readies and queues it. Contract review PASS 7087685411 on this head.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj

维护者速读

自动化技能补教「状态字段要允许清空,就把空值写进该状态的可去目标」,顺带修一道数据技能评测的参考答案(状态机补起始状态)。两层审核通过,CI 全绿,64 行。涉及写入锁的教法,按规则要人工批准。
要你做的:批准 PR #36559(契约审核 PASS 7087685411,Head-sha dd527b97)。

Tier H approval request · 2026-11-22T23:39Z · @os-zhuang, PR #36559 (#36161) is ready for your review on head dd527b97cb.

Why it needs a human. Governed skills/** (two files); the low-risk skills arm does not apply because the contract review reads Security-touching: yes (the text teaches where the state-machine write lock refuses a clear).
Reviews. Seat ACCEPT 7087726113 on this head; contract review (CONTRACT_REVIEW_TIER) PASS 7087685411 on this head, No must-fix, no should-fix., nits N1/N2 accepted.
Gates. 30 success · 18 skipped · 0 red on dd527b97; mergeable clean; +41/−23.

@objectstack-fleet objectstack-fleet Bot added the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Nov 22, 2026
@os-zhuang
os-zhuang marked this pull request as ready for review November 23, 2026 00:30
@os-zhuang
os-zhuang added this pull request to the merge queue Nov 23, 2026
Merged via the queue into main with commit 934ac07 Nov 23, 2026
54 checks passed
@os-zhuang
os-zhuang deleted the claude/issue-36161-clearable-state-skill branch November 23, 2026 00:50
@objectstack-fleet objectstack-fleet Bot removed the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Nov 23, 2026
247257110 pushed a commit to 247257110/objectstack that referenced this pull request Nov 23, 2026
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

objectstack-automation state-machine reference teaches that a clearable state lists '' among its targets

3 participants