Repository navigation
docs(skills): the data skill's Field Groups section teaches a group's visibleWhen and requiresFeature - #30890
Conversation
… visibleWhen and requiresFeature examples-objects.md names the two ways a whole field group is hidden: visibleWhen (CEL over the record; FALSE or a fault hides the group, header included) and requiresFeature (a PUBLIC_AUTH_FEATURES flag, refused when unknown, lowered at parse into the group's visibleWhen and stripped, AND-composed after an authored predicate), with sys_organization's Group Structure section as the example. Paid by deleting restatement in the same file; the token ratchet row re-locks at the landed count (1756 -> 1751). Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibxLYNwSMSVQkj55gA6
…anded count (1737) Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibxLYNwSMSVQkj55gA6
|
domain:skills#2 · os-tesla · session_01L9qibz5RLVEYDFco93jZ7u Contract reviewServed-tier: Inputs read: card #30812 (body, triage 6677319850, claim 6679873660, os-dev-report 6681485641), PR #30890 (body, 3-file list, ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgment
Every clause of the new bullet read against the cited code:
Attempts to break it:
Deletions, each checked for another home:
Should-fix (does not fail):
Must-fix: none.
Implemented-by: VERDICT: PASS |
…Field Groups bullet Contract review should-fix: the flag vocabulary is named with its module (@objectstack/spec/kernel) so a skill reader has more than a bare symbol to find. Paid in the same file by dropping the custom-Page aside, whose rule lives in the ui skill; the token row re-locks down at 1728. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibxLYNwSMSVQkj55gA6
|
domain:skills#2 · os-tesla · session_01L9qibz5RLVEYDFco93jZ7u Contract reviewServed-tier: Delta review: one commit ( ① Derived judgments
② Semver levelUnchanged by the delta: ③ Boundary flags
④ Design judgment
Must-fix: none. Should-fix: none. Implemented-by: VERDICT: PASS |
|
domain:skills#2 · os-tesla · session_01L9qibz5RLVEYDFco93jZ7u 维护者速读
席位意见:契约复审 PASS,一条建议修改(写明 席位核对ACCEPT · seat
|
Requested by Tesla · project thread
domain:skills#2 · os-tesla · session_01L9qibxLYNwSMSVQkj55gA6
Fixes #30812
Clause-②: no
Metadata-protocol: none
维护者速读
skills/objectstack-data/references/examples-objects.md的 Field Groups 一节新增一条:整个字段分组(含标题)可以用visibleWhen(对记录求值的 CEL,为 FALSE 或求值出错即隐藏)或requiresFeature(取自PUBLIC_AUTH_FEATURES的部署特性名,未知名字解析即拒绝;解析时降成该分组的visibleWhen并去掉,与作者自写的visibleWhen以 AND 合成、作者谓词在前)隐藏,两者都只管界面、字段仍可经 API 读取;示例取真实的sys_organization「集团结构」分组(requiresFeature: 'multiOrgEnabled')。requiresFeature,技能文本仍只列icon、description、collapse,读技能的 agent 写对象时不知道一个分组可以按谓词或按部署特性隐藏,会去改表单页面或者什么都不做。main上的object.zod.ts与public-auth-features.ts。回滚即 revert。skills/objectstack-data/references/examples-objects.md的 Field Groups 段(新增一条 + 四处删减);同文件 Quick-Start 的一行注释与 Metadata Protection 的一句删减;scripts/check-skills-token-ratchet.mjs的 examples-objects 行。node scripts/check-skills-token-ratchet.mjs | grep examples-objects,预期is 1737 tokens (ceiling 1737; headroom 0);再对照packages/spec/src/data/object.zod.ts中requiresFeature的 describe 文本,技能句子与之一致。skills/**(Tier H),需要受管审批人在 GitHub 上 Approve 一次;之后席位落地。What changes
skills/objectstack-data/references/examples-objects.md, section "Field Groups (MVP)": one new bullet after the per-group options, stating whatmaindoes since PR #30810 (ObjectFieldGroupSchemainpackages/spec/src/data/object.zod.ts,lowerRequiresFeatureinpackages/spec/src/kernel/public-auth-features.ts):visibleWhen(CEL overrecord.*; FALSE or a fault hides it — the slot is fail-closed) or byrequiresFeature(a deployment feature flag fromPUBLIC_AUTH_FEATURES; an unknown flag is refused at parse);requiresFeatureis lowered at parse into the group'svisibleWhenand stripped from the output, AND-combined after an authoredvisibleWhen(the author's predicate first);sys_organizationhides Parent Organization and Sort Order on a single-organization deployment with{ key: 'group_structure', label: 'Group Structure', requiresFeature: 'multiOrgEnabled' }(packages/platform-objects/src/identity/sys-organization.object.ts).Not taught, on purpose: the gate's CEL spelling (
features.X != false/== true), the four composition refusals (visibleWhen: false, a non-CEL or AST-only predicate, a blanksource), the lint's accepted-trailing-gate rule, and the console's empty-featurespre-fetch window. The skill names the two keys and the one behaviour an author must know; the rest is the schema's own docblock and refusal text.Growth paid in the same file, by deletion (no re-wrap):
Organize fields into logical groups (e.g., "Contact Information", "Billing", "System") for forms, detail pages, and editors.)collapsebullet already says groups render on forms, modals and detail pages.; group labels are human-readablelabel: 'Contact Information'lines of the example.— replaces the deprecated \defaultExpanded` flag, ADR-0085`collapseenum, not a rule; the enum's three values stay spelled out.fieldGroupsarray; editField.group); its last sentence was a roadmap note.— see abovein the Quick-StartsharingModelcommentSKILL.md, not in this file (the block was moved here verbatim).// required in practicestays.The block is \.strict()`: `reason` is required (min 1 / max 500 chars) and unknown keys are rejected.` (Metadata Protection)REQUIRED — reason … (1–500 chars); strictness is taught once inSKILL.md(ObjectSchema.create()rejects unknown keys).// src/objects/sys-user.object.ts(Metadata Protection example)os:checkblocks in this file do not carry.scripts/check-skills-token-ratchet.mjs: theexamples-objects.mdrow re-locks DOWN at the landed count, 1756 → 1737, zero headroom, with the usual comment: -5 from this PR's cut, -14 from the merged #30831 (its hook-example rename dropped the block's intro line and left the headroom unlocked)..changeset/30812-field-group-visible-when-requires-feature.md:'@objectstack/skills': patch, both declaration lines.No eval case: the
objectstack-dataevals convention (skills/objectstack-data/evals/README.md) lists the two fixtures' topic clusters and binds no taught key to a case; the card asked for one only if the convention asks. The seat may add one if it reads the convention wider.Readings (os-dev rule for
skills/**):origin/main8b9cc712)62fd849b)skills/objectstack-data/references/examples-objects.mdlinesskills/objectstack-data/references/examples-objects.mdbytes / tokens (check-skills-token-ratchet,ceil(bytes/4))skills/*/SKILL.md, linesskills/*/SKILL.md, tokens (gate formula)Why
#30812, the
Skills-docs: follow-upPR #30810 declared (card #30692, ruling 6670372892 row 4 A). The key exists onmainsince that merge; until the skill names it, an agent reading the Field Groups section learns onlyicon,descriptionandcollapse, and either leaves a feature-bound section visible everywhere or reaches for a page layout to hide it.Tests
No runtime code changes. Every word of the new bullet was read off
mainata2f523aa(unchanged at8b9cc712):ObjectFieldGroupSchema'svisibleWhen/requiresFeaturedocblocks and.describe()texts,lowerRequiresFeature('visibleWhen'slot: gate alone when no predicate is authored,(AUTHORED) && GATEotherwise),z.enum(PUBLIC_AUTH_FEATURE_NAMES)(unknown flag refused), andsys_organization.object.tsline 352 (thegroup_structureentry quoted verbatim). The pins behind them arepackages/spec/src/data/field-group-requires-feature.test.tsandpackages/platform-objects/src/identity/sys-organization-group-structure-gate.test.ts, unchanged here.pnpm --filter @objectstack/spec check:skill-examples(the threeos:checkblocks of this file among the 283 marked blocks) against freshly built@objectstack/spec,@objectstack/clientand@objectstack/client-reactdeclarations:✅ 283 prose examples type-check across 3 surface(s), exit 0 — at36152cd8and again at the head62fd849b.Acceptance notes
0e73de82while this card was open) edits this file's Lifecycle Hooks block (hook name and its intro line); this diff stays inside the Field Groups section, the Quick-Start comment and Metadata Protection.origin/main8b9cc712was merged in (909ea5ea) with no conflict; the ratchet row was then re-locked at the merged count.skills/objectstack-data/rules/field-types.md(skills: the formula row of objectstack-data field-types should say a formula is no group key either (follow-up to #30773) #30824) is untouched.# Data — object authoring examples (moved verbatim from SKILL.md)is left as is: the same convention heads four reference files, so changing one is a catalog decision, not this card's.check:skill-examplesrefuses (exit 3, PREREQUISITE NOT MET) untilpackages/clientandpackages/client-reactcarrydist/*.d.ts; a spec-only build is not enough for it.Verification
Derived with
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackagainst the three-file diff (no paths passed; the tool reads the change set off the merge base). Every line run with stdin closed, exit code landed to disk before any pipe (COMMAND :: exit CODE):36152cd8(before anyorigin/mainmerge; spec, client, client-react and lint built): 62 derived families, 62 run, 61 exit 0, 1 exit 3 (pnpm check:dual-build-cjs-loads, PREREQUISITE NOT MET: 31 packages had nodist/);--ran: 62 derived, 61 run, 1 NOT-MEASURED (derived from the recorded exit 3), 0 UNRUN.c5cc868a(after mergingorigin/main18870c92and a declarations build of every./packages/**): the same 62 families, 62 run, 62 exit 0;--ran: 62 derived, 62 run, 0 NOT-MEASURED, 0 UNRUN.62fd849b(the head:origin/main8b9cc712merged, the ratchet row re-locked at 1737): the same 62 families, 62 run, 62 exit 0;--ran: 62 derived, 62 run, 0 NOT-MEASURED, 0 UNRUN. Ran lists:skills-seat-2/out/30812-gates-ran-{36152cd8,c5cc868a,62fd849b}.listin the project files.Gate readings at 62fd849
check-skills-token-ratchet:skills/objectstack-data/references/examples-objects.md is 1737 tokens (ceiling 1737; headroom 0), exit 0;--self-test: 97 cases pass, exit 0.check:skill-identifier-liveness:Leg 1: 486 citation(s) over 71 published file(s) … Leg 2: 8 registered exhaustive section(s), 0 ledgered gap(s), exit 0.check:dual-build-cjs-loads:116 published require entry point(s) across 71 package(s) load; 2456 emitted CommonJS file(s) parse, exit 0 (declarations build of./packages/**; exit 3 without it).check-empty-changeset --base origin/main:1 declaring changeset(s) added, no merge-base changeset modified, exit 0.check-adr-0087-registration --base origin/main: no declared-breaking changeset, exit 0.check-changeset-no-major --base origin/main: exit 0.check:doc-authoring:21232 customer-facing string(s) across 1711 spec sources clean, exit 0.pnpm --filter @objectstack/spec run check:skill-refs,check:skill-compatibility,check:skill-frame-sync,check:pm-skill-id-lint,check:pm-governed-merges,check:lean-entry-closure,check:nul-bytes,check:role-word,check-comment-mask-corpus,check:pm-dispatch-gatesand the rest of the 62: exit 0.Tier:
dispatch-gates --tieron the three paths:skills/**clause ①,claude-fable-5-1mandated, no one-line exit; this thread runs on it.check-governed-merges --teston the three paths: Tier H (skills/objectstack-data/references/examples-objects.md).CI families (
Lint & Repo Gates,Test Core, the rest) are the PR's check-runs, not re-run locally. Dogfood battery: n/a (no!in the title, no narrowing arm).Human Minimum
packages/specholds no runtime logic.pnpm lintis CI's run (no source file in the diff).main, one pull request.packages/specnot touched.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01L9qibxLYNwSMSVQkj55gA6