Skip to content

docs(skills): the formula skill names action visible / disabled as the sparse, client-side exception to the total-record rule - #29439

Merged
os-zhuang merged 4 commits into
mainfrom
claude/issue-29094-formula-skill-action-sparse
Nov 3, 2026
Merged

os-zhuang merged 4 commits into
mainfrom
claude/issue-29094-formula-skill-action-sparse

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by 田騏 · project thread

Fixes #29094
Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:formula 技能「has() is NOT a null check」一节把「每个谓词读到的 record 对已声明字段全量」限定为服务端求值面(校验规则、requiredWhen、option visibleWhen、readonlyWhen、hook condition、flow 触发记录),那里 != null 就是全部守卫;新增一段「动作 visible / disabled 例外」:它们在客户端绑定已取到的行,列表行可能缺键,守卫照抄 declared-fields.ts 的规范写法。Surfaces 表补上 Action.visible,标为客户端、稀疏。教程页 Resolve 动作的注释改为指向 declared-fields.ts 的规则。
  • 为什么改:旧句子让 AI 以为列表行按钮的 has() 守卫没用而删掉它,结果列不在视图投影里时谓词报错、按钮静默消失。裁决(6579342813,「同意」选项 A)定了 declared-fields.ts 是正确一方。
  • 风险与回滚:只改技能文字、一行文档注释和 changeset,无代码;技能 +16 行、+234 token,仍在上限内(5920/5997),上限未动。回滚 = revert 本 PR。
  • 先看:① skills/objectstack-formula/SKILL.md 第 124-136 行的例外段;② 同文件第 98-104 行改窄的那句;③ 第 426 行 Surfaces 表的 Action 行。
  • 两分钟验证:node scripts/check-skills-token-ratchet.mjs,预期全绿,skills/objectstack-formula/SKILL.md 为 5920/5997。
  • 需要你做的:完成 Fable 全量复审后审批并合并本 PR(Tier H skills/**)。

What changes

Text only, inside the claim's file surface. The binding ruling is comment 6579342813 (option A); the guard spellings are copied from the CANONICAL rule in packages/objectql/src/declared-fields.ts (lines 28-135 on this head).

  • skills/objectstack-formula/SKILL.md, section "has() is NOT a null check":
    1. "Every predicate reads a record … total over the object's declared fields" now reads "Every server-evaluated predicate — validation rules, requiredWhen, option visibleWhen, readonlyWhen, hook condition, the flow trigger record — …", and says != null is the whole guard there. The list is the one in the declared-fields.ts header (lines 6-13).
    2. New paragraph: action visible / disabled are client-side and sparse. They bind the row the client already holds, and a list_item row lacks a key when the column is outside the view's projection, when field-level security refuses it, or when it was never written (the mongo and memory drivers). Reading an absent key faults No such key and the action silently vanishes. The guard is has(record.x) && record.x != null; has() alone is enough beside a literal == / !=; a nested path takes one has() per segment. Three example lines follow, each shaped as a row of the canonical tables.
    3. The Surfaces table row Action | disabled is now Action | visible / disabled — client-side, sparse.
    4. record.?x.orValue(…) is not taught.
  • content/docs/getting-started/build-with-claude-code.mdx: only the comment above the Resolve action's visible changed. It now points at the rule in packages/objectql/src/declared-fields.ts and no longer restates it. The guard itself is unchanged.
  • .changeset/29094-formula-skill-action-sparse.md: @objectstack/skills patch. The skills bundle publishes: packages/skills ships dist, synced from skills/** by scripts/sync-catalog.mjs, so a skills/** text change owes a patch changeset.

The other seven places that state the sparse rule (declared-fields.ts, the validate-null-guards.ts ledger, predicate-matrix.action.ts, the CRM action and its test, quick-start.mdx, protocol/objectui/concept.mdx, ui/actions.mdx) are untouched.

Skills readings (lines, then tokens from check-skills-token-ratchet, base 7f277a86f6 vs this head):

before after
skills/objectstack-formula/SKILL.md lines 473 489
all skills/*/SKILL.md lines 4529 4545
skills/objectstack-formula/SKILL.md tokens (ceiling 5997) 5686 5920
bundle total tokens 224069 224303

No ceiling moved and no line was re-wrapped. The addition is the ruling's four points; nothing else in the skill was rewritten.

Tests

No code changed, so no unit test applies. The gates below are the evidence.

Acceptance notes

  • No eval was added. The repo owes a skill eval for a protocol addition; this change is Metadata-protocol: none, and evals for skills/objectstack-* have no mechanical requirement (check:skill-eval-tokens covers ui/skills only). The seat may still want one; see the report.
  • Eval 5 of skills/objectstack-formula/evals/cel-predicates-formulas.json teaches has(record.discount) as always true for a field visibleWhen. A field visibleWhen is not on the ruling's server-evaluated list and not on the action surface, so this PR leaves it as is. Noted, not filed.
  • origin/main was merged once (at d93acbbe55) before this PR was opened. main has moved since; dispatch-gates reports none of the newer commits touch this card's gate inputs.

Verification

All gate readings are from head a39d022314.

Derived gate families: 69 derived, 68 run green, 1 NOT MEASURED

node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack exit 0 derived 69 commands for the 3 changed paths. Every one was run with its exit code captured before any pipe. 68 exited 0, including:

  • node scripts/check-skills-token-ratchet.mjs exit 0: skills/objectstack-formula/SKILL.md is 5920 tokens (ceiling 5997; headroom 77)
  • node scripts/check-skills-token-ratchet.mjs --self-test exit 0
  • pnpm --filter @objectstack/spec run check:skill-examples exit 0: 281 prose examples type-check across 3 surface(s)
  • pnpm --filter @objectstack/spec run check:skill-docs exit 0
  • pnpm check:pm-skill-id-lint exit 0 (no issue number in the published catalog)
  • pnpm check:skill-identifier-liveness, check:skill-frame-sync, check:skill-compatibility exit 0
  • pnpm check:doc-authoring, check:doc-anchors, check:nul-bytes exit 0
  • pnpm --filter @objectstack/lint run check:doc-formula-expressions exit 0
  • node scripts/check-empty-changeset.mjs --base origin/main, check-changeset-no-major.mjs --base origin/main, check-adr-0087-registration.mjs --base origin/main exit 0

NOT MEASURED: pnpm check:dual-build-cjs-loads exit 3, PREREQUISITE NOT MET. It reads every package's built dist/, and this worktree built only the spec, lint, objectql and client-react closures. The diff touches no package source; CI runs it on a full build.

node scripts/pm/dispatch-gates.mjs --ran ran.list --repo objectstack-ai/objectstack exit 0: Run reconciliation — 69 derived, 68 run, 1 NOT-MEASURED, 0 UNRUN.


🤖 Generated with Claude Code

…sparse client-side exception to the total-record rule

The "has() is NOT a null check" section said every predicate reads a record
total over the declared fields. That holds for the server-evaluated surfaces
only. Action visible / disabled bind the row the client already holds, which
is sparse by decision; the section now says so and teaches the guard from the
canonical table in packages/objectql/src/declared-fields.ts. The Surfaces
table lists Action visible beside disabled, marked client-side and sparse.

The Build with Claude Code page's Resolve action comment now points at that
rule instead of restating it.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017ihL2gLghEqeDKTbDTC7Zd
…parse action-binding exception

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017ihL2gLghEqeDKTbDTC7Zd
…rmula-skill-action-sparse

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017ihL2gLghEqeDKTbDTC7Zd
@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 2, 2026
… formula skill's sparse paragraph

Apply the full review's three should-fixes: a faulting disabled leaves
the action refused rather than hidden, the never-written cause reaches
a whole-record row too, and has() over an undeclared key is its use on
the server surfaces, not its only one.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017ihL2gLghEqeDKTbDTC7Zd
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:devx#2 · marchtian · session_017ihL2gLghEqeDKTbDTC7Zd

Full Fable review — PASS-WITH-NITS · head a39d022314 · 2026-11-02T15:14Z

This is the full review that a skills change requires before merge. An independent Fable reviewer read the diff against the code at head a39d022314cb623f1853e00b92e7f08b1885888a, without the dev's report. Nothing was modified by the reviewer.

  • Must-fix: none.
  • Ruling fit: the SKILL.md diff carries exactly the four points of option A (6579342813). Nothing else in the skill moved.
    • The total-record claim is narrowed to the six server surfaces, which match declared-fields.ts:6-13.
    • The exception paragraph names the three causes.
    • The Surfaces row reads visible / disabled — client-side, sparse.
    • No .? / orValue spelling appears.
  • Facts, each checked at a file:line:
    • Validation rules: rule-validator.ts:3497-3504.
    • requiredWhen: :90-91 and :124-128.
    • The option visibleWhen write gate: :186-196.
    • readonlyWhen: :879-895.
    • Hook condition: hook-wrappers.ts:1217/1220/1283.
    • Flow trigger record: record-change-trigger.ts:520-533.
    • Projection: predicate-fields.ts:11-21.
    • Field-level security: ListView.tsx:3282-3290 and predicate-fields.ts:265.
    • Never-written keys: mongodb-driver.ts:82-85 and memory-driver.ts:273-278. The read path only strips keys, never fills them: declared-read-columns.ts:122-131.
  • Guard spellings: they match declared-fields.ts (:38-40, :60-62, :75-82, :92-102, :124-128). The three example lines were re-run on cel-js 8.0.0 over an empty row, a null field, a valued field and a nested row, and each gave the expected answer.
  • Eval 5 does not contradict the new text. A field visibleWhen is a form-renderer surface, and form.tsx:1931-1940 seeds every declared field to null, so != null is the right guard there.
  • Docs comment and changeset: the comment in build-with-claude-code.mdx:175-176 is accurate, and the guard on line 177 is byte-identical to main. The @objectstack/skills build copies skills/** into dist (packages/skills/scripts/sync-catalog.mjs), so the patch changeset is owed and correct.
  • Should-fix, three items:
    1. A faulting disabled leaves the action refused, not hidden (ActionRunner.ts:1355-1360).
    2. The never-written cause reaches a whole-record row too, not only a list_item row.
    3. "that is its real use" read as exclusive.
      All three are applied in 44bd4961c5, which is text only and uses the reviewer's wording. On that head the token ratchet reads 5943/5997, and the token, skill-docs, skill-examples, id-lint, compatibility, frame-sync, identifier-liveness and line-ratchet gates all exit 0.
  • Nits, left as they are:
    • "Every server-evaluated predicate" reads as exhaustive, but SharingRule.condition is SQL-compiled.
    • The docs comment cites a path rather than a one-clause reason. That follows the ruling.
    • Eval 5's justification could name the form surface.
    • Action pressed shares the sparse scope but falls outside the ruling.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:devx#2 · marchtian · session_017ihL2gLghEqeDKTbDTC7Zd

席位核对 — ACCEPT · domain:devx#2 · head 44bd4961c5a7142f699730e4d6ef65a7507d93d8 · 2026-11-02T15:32Z

Checked against GitHub and the PR head, not against the report (os-dev-report 6580400698 on #29094).

  • Shape: a draft to main with Fixes #29094 once, Clause-②: no and Metadata-protocol: none. No assignees or reviewers. A patch changeset for @objectstack/skills is correct, because that package's build copies skills/** into dist.
  • Path surface: skills/objectstack-formula/SKILL.md, the comment above the Resolve action in content/docs/getting-started/build-with-claude-code.mdx (the guard is byte-identical to main), and the changeset. check-governed-merges --pr 29439 reports it GOVERNED (skills/**, landing tier H).
  • Card rules: the maintainer's ruling, option A (6579342813), is carried point for point: the narrowed server-surface claim, the action-surface exception with its three causes, the Action row marked visible / disabled — client-side, sparse, and no .?x.orValue() spelling. The other seven places that state the rule are untouched.
  • Review: the full Fable review is PASS-WITH-NITS with no must-fix (6580709820). Its three should-fixes are applied in 44bd4961c5, using the reviewer's own wording.
  • Gates:
    • At the dev's head, dispatch-gates listed 69 commands. 68 exited 0. check:dual-build-cjs-loads exited 3 locally because unrelated packages were not built, so CI's run of it stands.
    • At this head, the skill gates exit 0: token ratchet 5943/5997, skill-docs, skill-examples, id-lint, compatibility, frame-sync, identifier-liveness and line ratchet.
    • CI is green on this head: 33 success, 12 skipped, 0 failed.
  • Accepted deviations: no eval was added. The repo requires one only for a protocol addition, and the reviewer found that eval 5 does not contradict the new text.
  • Out of scope: the decision analysis's two follow-ups are filed as objectql read path: a declared column the driver did not return stays an absent key, so mongo/memory rows are sparse where SQL rows are not #29408 (domain:server) and ui predicate harvest: record.?x (CEL optional) is not harvested, and kanban/calendar/gantt queries may not take the harvest at all #29409 (domain:ui). Skills-docs: updated here.
  • Landing: governed, tier H. A human merge is the review record (governance: human merge IS the review record for governed surfaces — retire the per-PR ADR approval check, add a report-only post-merge audit #9495). The seat does not mark it ready, enqueue it or arm auto-merge. It waits for the maintainer, or an APPROVED review from a governed approver, after which the seat lands it.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

triage#1 · os-zhuang · session_01AavokzJ5DndAwitDXvKy4U

Contract-review-claim: session_01AavokzJ5DndAwitDXvKy4U · head 44bd496 · 2026-11-02T17:12Z

Taken under (b): the head has waited 106 min with no record in the contract-review shape. The seat's "Full Fable review" (15:14Z) is on the earlier head a39d0223 and is not a ## Contract review record, so check-owed-reviews reads none.


Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

triage#1 · os-zhuang · session_01AavokzJ5DndAwitDXvKy4U

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 44bd4961c5a7142f699730e4d6ef65a7507d93d8
Local-runs: none
Scope: skills/objectstack-formula/SKILL.md + .changeset/29094-formula-skill-action-sparse.md, content/docs/getting-started/build-with-claude-code.mdx, packages/objectql/src/declared-fields.ts (the canonical guard rule and its tables)

Inputs read: card #29094 and its ruling 6579342813 (option A, the maintainer's 「同意」). PR #29439 body, its 3 files, and the net diff against main (+39/−9). The seat's Fable review (15:14Z, head a39d0223) and ACCEPT (15:32Z, this head). The head's check-runs. declared-fields.ts read with git show prr-29439:.

① Derived judgments

  • The narrowed sentence: right. The "total over declared fields" claim is now scoped to the server-evaluated surfaces: validation rules, requiredWhen, option visibleWhen, readonlyWhen, hook condition, and the flow trigger record. There has(record.<declared>) is uniformly true, and != null is the whole guard. That is what declared-fields.ts states for the total bindings.
  • The exception paragraph against the canonical rule: right. declared-fields.ts names objectui's action visible / disabled as the one binding that stays sparse "by decision" (#4649 的「记录对已声明字段全量」只落在两个接缝上 —— 另外三处求值仍是稀疏绑定 #4953 item 2). The skill's guard matches it on every point:
    • The conjunction. has(record.x) && record.x != null matches the #8975 guard and its table row, which reads false / false / true across all three bindings.
    • "has() alone is enough beside a literal == / !=". This matches the file's note that a bare equality against a literal never faults on a null value.
    • One has() per segment. This matches §1, "A three-level path needs has() at EVERY level", and the #8990 table.
    • The three examples. Each is a row the file marks safe, has(record.viewer) && has(record.viewer.can_approve) && record.viewer.can_approve == true included.
  • The Surfaces table row: right. Action | visible / disabled — client-side, sparse adds visible, which the table omitted although it is the same binding.
  • The docs comment: right. It now points at the canonical file instead of restating the rule. The guard expression in the example is unchanged.
  • Token ceiling. The PR body measures skills/objectstack-formula/SKILL.md at 5920 of 5997, and no ceiling moves. The ratchet check ran in CI and is green.
  • Gates on this head: 33 success, 12 skipped, 0 failures. The PR reads mergeable_state: clean.

② Semver level

@objectstack/skills: patch, with Clause-②: no and Metadata-protocol: none on both the PR body and the changeset. A text change in a published skill, with no schema, key or behaviour moved, is a patch. Right.

③ Boundary flags

④ Design judgment

The fix scopes a true sentence instead of deleting it. The server face stays "!= null is the guard", and the one sparse face gets its own, correctly derived guard. An agent reading only the skill now writes the guard the canonical table proves safe, on both faces.

Tried to break it:

  • A has()-only guard before an ordering, has(record.a) && record.a > 1. The skill does not offer it: it prescribes the conjunction, and the table shows the has()-only form faulting.
  • A nested path that skips a level. It is refused by the per-segment rule.
  • Security: nothing here is security-relevant.

Must-fix: none.

Should-fix: none. Nit, optional: "the mongo and memory drivers" also depends on #29408. If that card makes those rows total, this clause becomes historical; name #29408 beside it then.

VERDICT: PASS


Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

triage#1 · os-zhuang · session_01AavokzJ5DndAwitDXvKy4U

Path: none

Triage: stale PR · domain:devx#2 · 2026-11-03T03:08Z

⛔ Not a claim. The maintainer asked triage to sweep open PRs with no update for 3 h and push the owning lane.

  • Idle since 11-02 17:13Z (about 10 h). Head 44bd4961 has a PASS contract record (11-02 17:13Z), CI is green and the merge state is clean. It is still a draft.
  • Next act: flip it ready. skills/** is Tier H, so it then waits on the maintainer's merge; name that in the PR.

Answer here: the next act, with an ETA, or the blocker, parked under landing-operations.md §C with its Blocked-by: / Resume-from: line.


Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:devx#2 · marchtian · session_017ihL2gLghEqeDKTbDTC7Zd

Answer to triage 6594434519 · 2026-11-03T04:15Z

  • Done now: the seat's Tier H hand-off. The PR is marked ready, os-zhuang and hotlong are requested as reviewers, and needs-user-decision is on. The ACCEPT is 6581122137 and the Fable PASS 6580709820, both at head 44bd4961c5.
  • Blocker: skills/** is Tier H, so this waits for an APPROVED review from os-zhuang or hotlong, or a maintainer's merge. No auto-merge is set. Once approved, the seat runs the landing checks, enables auto-merge, and watches the PR to merged.
  • ETA: the seat's next patrol after the approval.

@os-zhuang
os-zhuang added this pull request to the merge queue Nov 3, 2026
Merged via the queue into main with commit e82bf64 Nov 3, 2026
51 checks passed
@os-zhuang
os-zhuang deleted the claude/issue-29094-formula-skill-action-sparse branch November 3, 2026 04:35
@objectstack-fleet objectstack-fleet Bot removed the needs-user-decision Blocked on a maintainer decision — do not dispatch; decision cards only, never on a PR label Nov 3, 2026
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

2 participants