Repository navigation
docs(skills): objectstack-automation teaches that a clearable state lists '' among its targets - #36559
Conversation
…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>
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>
|
repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj Contract reviewServed-tier: 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 Check-runs at 2026-11-22T23:34:06Z: 48 runs, 30 success, 18 skipped, 0 red, 0 in progress ( 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 ( The rule-change line above reads none: the file list holds no ① Derived judgments
② Semver level
③ Boundary flagsDev flags, from the report naming this head (comment 7087555372):
Out-of-scope finding carried by the dev as "noted, not filed": the Studio validations panel drops 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 ④ Design judgment
New entry, clause by clause:
Acceptance scenario: the card's re-check, Attempts to break it:
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;
No must-fix, no should-fix.
Implemented-by: VERDICT: PASS |
|
repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj 维护者速读自动化技能补了一句:状态字段要允许「清空」,得在那个状态的可去目标里写上空值;其它状态下清空会被拒绝。这是 #36127 落地后的行为,技能原来没教,AI 照旧写出的应用会拒掉清空状态的用户。 席位核对 — ACCEPT (L1) · repo:objectstack#1 · head
|
|
repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj 维护者速读自动化技能补教「状态字段要允许清空,就把空值写进该状态的可去目标」,顺带修一道数据技能评测的参考答案(状态机补起始状态)。两层审核通过,CI 全绿,64 行。涉及写入锁的教法,按规则要人工批准。 Tier H approval request · 2026-11-22T23:39Z · @os-zhuang, PR #36559 (#36161) is ready for your review on head Why it needs a human. Governed |
…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>
Requested by Warren · project thread
Fixes #36161
Clause-②: no
Metadata-protocol: none
Ride-along: the
employeelifecycle eval inskills/objectstack-data/evals/objects-fields-relationships.jsonnow declaresinitialStates(declared by the seat; source: a finding in the thread of card 36534, the same state-machine teaching theme).维护者速读
What changes
skills/objectstack-automation/references/state-machines-and-approvals.md, state-machine notes, one new entry:Quoted from the merged code, not from the card.
checkStateMachineinpackages/objectql/src/validation/rule-validator.ts(main d463c46) reads the stored state, maps an empty target (undefined,nullor the empty string) to the key'', and answersfallback('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:to: ''. In the code that pair is the refusal'sconstraint({ from, to: '' }), so the skill saysconstraint.to: ''.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, theemployeelifecycle case's expected answer declared astate_machinewithtransitionsonly, which publish refuses for a machine that runs on insert (state-machine-no-initial-states). It now declaresinitialStates: ['draft']with the one-clause reason its siblingordercase uses, andmust_containrequiresinitialStates. The seeds eval inhooks-security-seeds-datasources.jsonthat mentionsstate_machineonly 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:checkblock in the section is byte-identical.Acceptance notes
''and loses an existing one on edit. Not touched here; no file underui/is in this diff.skills/ships as@objectstack/skills, so this takes apatchchangeset (.changeset/36161-automation-skill-clearable-state.md), notskip-changeset.Verification
Readings at head dd527b9 against main d463c46.
SKILL.mdfiles, linesNet
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.mjsexits 0 and printsstate-machines-and-approvals.md is 5934 tokens (ceiling 5936; headroom 2);git grep -n "''" -- skills/objectstack-automation/references/state-machines-and-approvals.mdshows 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 builtdist/and this diff touches no package, so no build closure was made.Generated by Claude Code