Skip to content

docs(skills): roll-up guidance resolves security-rollup-source-unreadable before finishing - #33954

Merged
os-zhuang merged 2 commits into
mainfrom
claude/project-thread-vldcg4
Nov 15, 2026
Merged

os-zhuang merged 2 commits into
mainfrom
claude/project-thread-vldcg4

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

Requested by Steve · project thread
Fixes #33819

Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:数据技能的「汇总字段」一节新增一段教学 + 一个示例 + 一条评测用例:搭建时若出现 security-rollup-source-unreadable 警告,必须处理掉再收尾——该权限集应看子记录就授予读取,不应看就在该集上屏蔽父对象的汇总字段。
  • 为什么改:按裁决「改为搭建侧处理」;评测发现 15 次 project+task 搭建全部带着这条警告收尾,不该看任务的客户仍能从项目上的任务数看到汇总。
  • 风险与回滚:仅文档与评测,不改运行时;回滚即 revert 本 PR。relationships.md 的 token 天花板 4127→4232(先削两处重复,余额按实测提高)。
  • 先看:skills/objectstack-data/rules/relationships.md(新增段落与示例)→ scripts/check-skills-token-ratchet.mjs(天花板行与算式)→ 评测 JSON 第 20 条。
  • 两分钟验证:node scripts/check-skills-token-ratchet.mjs,预期 relationships.md 显示 4232 / 4232、全部通过。
  • 需要你做的:批准本 PR

What changes

  • skills/objectstack-data/rules/relationships.md § Roll-up Summaries: a new paragraph "Never finish with security-rollup-source-unreadable standing." It says when the warning fires (a set reads the summary but not the child object, the aggregated field, or a field the roll-up's filter tests), and the per-set decision: should see the children ⇒ grant the read; should not ⇒ mask the summary on that set (fields["PARENT.SUMMARY"]: { readable: false }), after removing any View All / Modify All the set holds on the parent, since either overrides the mask (measured below, control leg C). One worked definePermissionSet fragment (client_viewer, project read, 'project.task_count': { readable: false }).
  • Paid down first in the same section (239 bytes), each rule keeping a home: the procurement_receipt / received_amount filtered-sum example (the section's code block shows function: 'sum' beside filter: { status: 'received' }; the three-counts sentence carries "one child, several totals"), and the "a child moving in or out of the predicate recomputes the parent" sentence (the section's opening already says the parent recomputes on every child insert/update/delete).
  • skills/objectstack-data/evals/hooks-security-seeds-datasources.json: case 20 — a client_viewer set that reads project but must never read task, a project.task_count count roll-up. must_contain the count and the mask spelling; must_not_contain only the task read grant (task: { allowRead: true }), the one shape a correct answer never writes (review round 1: "safe to ignore" and viewAllRecords: true were dropped, since a correct answer can contain either while naming what to avoid).
  • scripts/check-skills-token-ratchet.mjs: the relationships.md row 4127 → 4232, pinned at the measurement (arithmetic in the row comment). Raise path is the standing ruling, verbatim: 「A:先削重复,余额按实测提高」 (ruling record 6513306068).
  • .changeset/33819-rollup-source-unreadable-skill.md: '@objectstack/skills': patch.
  • No forced test edits. rules/security.md and rules/field-types.md untouched.

Tests

The worked example was run through the real rule (runAuthoringRules('build', …) from packages/lint/src/authoring-rules.ts, on a stack built with ObjectSchema.create / definePermissionSet / defineStack; the example body passed to definePermissionSet exactly as shipped). Command: cd packages/lint && npx tsx proof-shipped.mts (scratch script, not committed), exit 0.

Proof output — before: 1 warning · after: 0 · grant alternative: 0 · View All control: 1
--- BEFORE shipped example without the fields line => 1 finding(s)
   warning security-rollup-source-unreadable | permission set "client_viewer" · summary field "project.task_count" | "project.task_count" counts "task" records, and permission set "client_viewer" cannot read object "task"; a roll-up aggregates the whole child collection and follows only the parent field's own permissions
--- AFTER shipped example verbatim => 0 finding(s)
--- ALT grant instead of mask => 0 finding(s)
--- CONTROL mask + viewAllRecords on project => 1 finding(s)
   warning security-rollup-source-unreadable | permission set "client_viewer" · summary field "project.task_count" | ... | hint: If its value should not be visible to this set, first remove View All and Modify All on "project" from it, since fields["project.task_count"]: { readable: false } does not hide a field from a set holding either, then set ...

The same boundary held with modifyAllRecords: true on project (1 warning) in the seat-side measurement on origin/main 895783a.

Acceptance notes

  • Seat hypothesis ① (View All / Modify All on the parent defeats the mask) is CONFIRMED by measurement and taught ("after removing any View All / Modify All it holds on the parent").
  • Hypothesis ② — the sibling security-rollup-source-row-scoped (info) is NOT taught: advisory, the pairing is often intended, and the card's "Done when" names only the warning. Left as an open question in the report.
  • Hypothesis ③ — one home, rules/relationships.md (read at roll-up time). No pointer in rules/security.md (zero token headroom there); open question in the report.
  • The example is an unmarked fragment, so check:skill-examples does not compile it; its correctness evidence is the proof run above.
  • Authoring arrangement: this thread is served below the card's mandated tier, so the skills/** text was authored by an at-tier (CONTRACT_REVIEW_TIER) subagent in the same worktree and branch; gates, relay writes and the report stay with the thread.

Verification

Token counts, ceil(utf8 bytes / 4):

Scope Before (895783a) After
rules/relationships.md 401 lines · 16444 B · 4111 tok (ceiling 4127) 414 lines · 16925 B · 4232 tok (ceiling 4232, headroom 0)
rules files, net lines — +13 (budget +14)
all skills/*/SKILL.md 4590 lines · 236373 B 4590 lines · 236373 B (unchanged)
whole shipped skills/ bundle (ratchet) 245523 tok 245923 tok (+400: +121 authored, +279 eval fixture)

Local gate union re-run in full at head 099fa84, the review round 1 fix; the first run at 02b5f1c read the same (node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack, every listed command run, exit captured before any pipe):

  • 63 derived · 62 exit 0 · 1 NOT MEASURED: pnpm check:dual-build-cjs-loads exit 3, PREREQUISITE NOT MET (reads every package's dist/; this worktree built only the lint and client closures). Declared narrowing; CI carries it.
  • --ran reconciliation (exit codes recorded): "63 derived famil(ies) accounted for — 62 run, 1 NOT-MEASURED (1 DERIVED from a recorded exit 3)".
  • Acceptance gates, each exit 0 at 099fa84: pnpm --filter @objectstack/spec check:skill-docs ("Skill docs in sync"), check:skill-refs ("9 generated files in sync"), check:skill-examples ("346 prose examples type-check across 3 surface(s)", after building the client closures it reads), node scripts/check-skills-token-ratchet.mjs (and --self-test), pnpm check:nul-bytes, git diff --check.

Generated by Claude Code

…able before finishing

The data skill's Roll-up Summaries section tells the builder to grant the
child read or mask the parent summary on the permission set, with one worked
example proven against the lint rule, an eval case and the measured ceiling.

Claude-Session: https://claude.ai/code/session_01ADHkmRN27hsvWWTzGXixkW
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 15, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:skills#2 · os-steve · session_01ADHkmRxXmVQ41fqnaTPGAv

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 02b5f1cb0b3f38f499e1e34a989da3c10cde6d6a
Local-runs: none
Scope: skills/objectstack-data/rules/relationships.md, skills/objectstack-data/evals/hooks-security-seeds-datasources.json + scripts/check-skills-token-ratchet.mjs

Inputs read: card #33819 (body and all three comments: triage audit 6893644309, claim 6895851062, os-dev-report 6896378351), PR #33954 (body, 4-file list, net diff against main 895783a), the check-runs on this head. Read outside the diff, never reviewed: packages/lint/src/validate-rollup-source-visibility.ts, holdsSuperuserBypass in packages/lint/src/validate-security-posture.ts, packages/spec/src/security/permission.zod.ts, content/docs/data-modeling/fields.mdx, skills/objectstack-data/rules/security.md, the ratchet script's header. .changeset/33819-rollup-source-unreadable-skill.md is the lane seat's ACCEPT.

Security: the hits teach permission behaviour (hiding a roll-up from a permission set, and when a field mask does not hide it). Judged as such in ① and ④.

Gate verdicts on this head (check-runs, read 2026-11-15; conclusions are the verdicts, none re-run here):

  • success: Build Core, Check Changeset, Check PR Size, Dogfood Regression Gate, Governed Surface Queue Guard, PR-body guards, Lint · ESLint, Lint · PM dispatch-gates, Type Check · workspace / source gates / consumer gates / debt ledger, TypeScript Type Check, Test UI, Live E2E UI, Plan Test Core shards, Test Core (3/8), Auto Label, filter.
  • STILL RUNNING at the time of this record: Lint · repo & tooling gates, Lint · docs & code guards, Lint · CI, release & engine gates, Lint · scoped · query-options erasure, Lint · scoped · slot lookup & corpus, Lint · scoped · tooling self-tests, Test Core (1/8), Test Core (2/8). The skills gates this diff moves (token ratchet, skill docs / refs / examples) sit in the running Lint jobs, so this head is NOT gate-green yet; this record is the contract verdict only.
  • none failed; the rest are skipped (opt-in or not selected).

① Derived judgments

Every taught-behaviour change in the diff, against the rule's code on main:

  1. "os build warns for each permission set that reads the summary but not the child object, the aggregated field, or a field filter tests" — RIGHT. Those are the rule's three security-rollup-source-unreadable arms, in that order, judged only when the set reads the parent object and the summary column.
  2. "The total covers every child row and answers only to the parent field's own access" — RIGHT. It is the rule's stated semantics (system-elevated recompute over the whole child collection, the column answering only to the parent field's own field-level security) and agrees with content/docs/data-modeling/fields.mdx.
  3. "it should see the children → grant the read" — RIGHT. With the child object, the aggregated field and every filter field readable, no unreadable finding is raised.
  4. "it should not → mask the summary on that set" with fields: { 'project.task_count': { readable: false } } — RIGHT. fieldHidden reads fields["OBJECT.FIELD"] with readable === false; a set that cannot read the column is skipped before any arm. Key spelling, readable, and the definePermissionSet shape (name, objects required; fields optional; readable default true) match permission.zod.ts, and the single-quoted 'OBJECT.FIELD' key is the dialect rules/security.md already uses.
  5. "after removing any View All / Modify All it holds on the parent (either overrides the mask)" — RIGHT, and it closes the one leak path the mask has on its own set. fieldHidden returns false when holdsSuperuserBypass(set, parent, 'view') holds, which is viewAllRecords OR modifyAllRecords, on the set's own entry for the parent or, absent one, its '*' entry. The rule then keeps warning with the remove-first hint, so "never finish with it standing" also catches the wildcard case the prose does not spell.
  6. The worked example's two comments ("no task read: warned", "the mask: resolved") — RIGHT by trace: without the fields line grantFor finds no task grant, so arm 1 fires; with it the column is hidden and the pair is skipped.
  7. The two cuts change no taught behaviour (see ③ b).

Leak paths checked. View All / Modify All on the parent: taught. A filter field: the mask hides the column whichever arm fired, and the grant arm is named for it. Co-held sets: only a co-held set that declares readable: true for the column, or holds View All / Modify All on the parent, restores it; each set is judged on its own, and the skill does not claim otherwise. The row-scoped sibling: see ③ c.

O1 (outside the diff, not a finding on it): one observation outside the diff is with the owner seat.

② Semver level

'@objectstack/skills': patch holds: the diff publishes skill prose and one eval fixture, with no schema, runtime or CLI change. Clause-②: no holds: nothing is narrowed or removed for a consumer, and both declaration lines (Clause-②: no, Metadata-protocol: none) are in the PR body and the changeset body. Check Changeset: success.

③ Boundary flags

(a) Authoring by an at-tier subagent inside a thread served below the mandated tier — ANSWERED, not blocking. The claim mandates the tier for skills/**; the PR body and the report both record the arrangement, and the tree was written on the claimed branch. Which model served the subagent cannot be read from this review's inputs, so that evidence stays with the seat. The text itself is judged on this head at CONTRACT_REVIEW_TIER, which is the check the tier rule exists to guarantee.

(b) Ratchet row 4127 → 4232 — ANSWERED, holds on the standing ruling's path. The script's header assigns the two checks to this record:

  • Deletion of restatement in the same file is shown and is genuine. Measured on the two blobs: main 16444 B (4111 tokens), head 16925 B; the rewritten paragraph is 743 B → 504 B (−239), the new block is +720 B, net +481, ceil(16925 / 4) = 4232. The row is pinned AT the measurement, headroom 0, and the row comment's arithmetic is correct.
  • Both cuts keep a home a reader reaches in the same section. The procurement_receipt / received_amount example: the section's code block shows function: 'sum' beside filter: { status: 'received' }, the paragraph still says any qualified "count or sum" carries its condition in filter, and the three-counts sentence still carries "one child feeds several totals". The predicate-recompute sentence: the section opens with the recompute on every child insert/update/delete, and "The recompute runs only on a child write" follows it. No rule lost its only statement; no eval on the head references the cut names.
  • The ruling 「A:先削重复,余额按实测提高」 is quoted verbatim and untranslated in the PR body with record 6513306068, as the header requires.

(c) security-rollup-source-row-scoped left untaught — ANSWERED: leave (option A). The card's Done-when names only the warning; the sibling is an info note the rule itself calls often intended. Residual, stated plainly: the "grant the read" arm can land a set on that note when a row policy narrows its child reads, and the total still covers every row. If builds are later seen finishing with that note on sets meant to be narrowed, it is a new card.

(d) No pointer in rules/security.md — ANSWERED: none in this PR (option A). The Done-when asks for the skill's roll-up guidance; SKILL.md routes both rules files, the build output names the warning id the new paragraph is keyed on, and security.md already teaches the 'OBJECT.FIELD': { readable, editable } entry. Note for the lane seat: eval case 20's own scenario arrives at permission-set time, so a one-line pointer paid by a cut in security.md is a reasonable follow-up, not a condition of this head.

(e) Example not marked os:check — ANSWERED: acceptable (option A). The marker type-checks the fragment's shape, not the lint behaviour the card asks to be checked, and the shape was confirmed here against permission.zod.ts. Unmarked, a later rename of readable or the fields key would not red this example; recorded as N2.

Other deviations in the report: check:dual-build-cjs-loads NOT MEASURED locally (declared, CI carries it); changeset title line before the declaration lines (Check Changeset: success); no reviewer request and the comment signature order are relay-process matters with no effect on the tree.

④ Design judgment

skills/objectstack-data/rules/relationships.md — holds against the card's Done-when and the rule on main. It tells the builder to resolve the warning before finishing ("Never finish with ... standing"), gives the per-set decision both ways (grant the read; mask the parent summary with the fields entry the card names), never leaves it standing, and carries one worked example in the skill's own dialect. "Checked against the lint rule": the dev's proof run is the dev's account; independently, the trace in ① 6 shows the unmasked set is warned and the shipped example raises nothing. The View All / Modify All precondition goes beyond the card and is correct and necessary.

skills/objectstack-data/evals/hooks-security-seeds-datasources.json case 20 — self-consistent on the mechanical cross-check: both must_contain strings (function: 'count', 'project.task_count': { readable: false }) are in expected_output verbatim; none of the three must_not_contain strings is (project: { allowRead: true } does not contain the task grant string). The prompt forbids the grant arm, so the mask is the one right answer, and the expected output matches the skill text.

scripts/check-skills-token-ratchet.mjs — the row and its comment agree with the measured tree (③ b).

Findings:

S1 (should-fix) — case 20 must_not_contain holds two strings a correct answer can contain while naming the form to avoid. "safe to ignore" is prose, and "this warning is not safe to ignore" is a natural correct sentence that fails the case; "viewAllRecords: true" fails an answer that restates the skill's own new warning in key dialect ("do not put viewAllRecords: true on project, it overrides the mask"). The lane's own precedent (the fourteen-case must_not_contain repair recorded in packages/skills/CHANGELOG.md) is that an entry is the shape only a wrong answer writes. Drop "safe to ignore"; drop or narrow the View All entry. "task: { allowRead: true }" is the wrong answer's shape and can stay.

N1 (nit) — the eval forbids viewAllRecords: true but not modifyAllRecords: true, though the skill names both as defeating the mask.

N2 (nit) — the worked example is unmarked, so check:skill-examples does not guard its key spelling against a later schema rename (③ e).

N3 (nit) — function: 'count' as a must_contain literal is spelled in the data skill only as function: 'sum' with 'count' in a comment; an existing case in objects-fields-relationships.json already asserts the same literal, so this follows the file's convention.

No must-fix. One should-fix (S1).

Implemented-by: claude/project-thread-vldcg4
Reviewed-by: session_01ADHkmRxXmVQ41fqnaTPGAv

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:skills#2 · os-steve · session_01ADHkmRxXmVQ41fqnaTPGAv

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 099fa848ce3664252db8fc40f49b612fba7f65a0
Local-runs: none
Scope: skills/objectstack-data/rules/relationships.md, skills/objectstack-data/evals/hooks-security-seeds-datasources.json + scripts/check-skills-token-ratchet.mjs

DELTA record. It follows my record 6896463758 on head 02b5f1cb0b3f38f499e1e34a989da3c10cde6d6a (PASS, one should-fix S1) and re-judges this head after one commit, 099fa848 "docs(skills): roll-up eval case forbids only the shape a wrong answer writes". Everything in that record not restated here stands unchanged on this head.

Inputs read: the commit diff 02b5f1cb..099fa848, the net diff against main, PR #33954 (body, head), the check-runs on this head. Not the dev's account of the change: the tree.

Security: the hits teach permission behaviour (hiding a roll-up from a permission set, and when a field mask does not hide it). The taught text did not move in this delta.

What moved: one line in one file. skills/objectstack-data/evals/hooks-security-seeds-datasources.json case 20 must_not_contain went from three entries to one, task: { allowRead: true }. relationships.md (16925 B, 4232 tokens, at its ceiling), the ratchet row, the changeset, case 20's prompt, expected_output and must_contain are byte-identical to 02b5f1cb. main has moved 895783a → 68e726d since the first record without touching skills/objectstack-data/**, the ratchet script, the lint rule or permission.zod.ts; the PR's merge base is still 895783a.

Gate verdicts on this head (check-runs; conclusions are the verdicts, none re-run here): 45 runs, ALL COMPLETED, NONE STILL RUNNING, none failed.

  • success: Build Core, Check Changeset, Check PR Size, Dogfood Regression Gate, Governed Surface Queue Guard, PR-body guards, Lint & Repo Gates, Lint · ESLint, Lint · PM dispatch-gates, Lint · repo & tooling gates, Lint · docs & code guards, Lint · CI, release & engine gates, Lint · scoped · query-options erasure, Lint · scoped · slot lookup & corpus, Lint · scoped · tooling self-tests, Type Check · workspace / source gates / consumer gates / debt ledger, TypeScript Type Check, Test Core, Test Core (1/8) (2/8) (3/8), Plan Test Core shards, Test UI, Live E2E UI, Auto Label, filter.
  • the rest are skipped (opt-in or not selected). The Lint jobs that were running on the previous head have all concluded success on this one.

① Derived judgments

No taught behaviour changed in this delta: relationships.md is untouched. The seven judgments of record 6896463758 stand as written. O1 stays withheld; a security item is with the owner seat.

The delta changes only what case 20 refuses:

  1. "safe to ignore" dropped — RIGHT. It was prose that a correct "not safe to ignore" contains.
  2. "viewAllRecords: true" dropped — RIGHT on the false-fail side: a correct answer restating the skill's View All caveat in key dialect contains it. Its cost is stated in ④.
  3. "task: { allowRead: true }" kept — RIGHT. It occurs nowhere in relationships.md on this head (0 matches) and not in case 20's expected_output, which writes project: { allowRead: true } and names the forbidden grant only in prose.

② Semver level

Unchanged: '@objectstack/skills': patch, Clause-②: no. The changeset file did not move; Check Changeset: success on this head.

③ Boundary flags

(a) to (e) as answered in record 6896463758; none is reopened by this delta. (b) re-checked: the measured file and the row are unchanged, 4232 at 4232.

New in this round: the PR body on GitHub still describes 02b5f1cb (it lists the three old must_not_contain entries and the gate run at 02b5f1c). The tree is what is judged here; the body is the seat's to patch before the PR leaves draft, since the body is what the maintainer reads.

④ Design judgment

skills/objectstack-data/evals/hooks-security-seeds-datasources.json case 20, on this head:

  • Self-consistent: both must_contain strings are in expected_output verbatim; the one must_not_contain string is not.
  • Does the remaining entry still catch the wrong answer the case targets? Yes, for the two wrong answers the card is about. Leaving the warning standing (no mask) fails must_contain 'project.task_count': { readable: false }. Silencing the warning by granting the task read fails must_not_contain in the inline spelling the skill and the prompt's dialect use. It is a string check, so it catches that spelling only: a multi-line entry, added keys (task: { allowRead: true, ...) or a '*' grant pass it. That is the reach every must_not_contain in this file has, and an answer that grants and masks nothing still fails must_contain.
  • Does dropping viewAllRecords leave the case unable to fail an answer that grants View All? Yes, by string assertion it now cannot: an answer that masks the summary and also puts View All or Modify All on project contains both must_contain strings and passes, although the mask does not bind. Only a grader reading expected_output ("with no View All / Modify All on project") catches it. I judge this acceptable and grade it a nit (N4): the prompt gives clients plain read and no reason to grant View All, the skill text itself carries the caveat, and every string that would forbid it false-fails a correct answer naming the caveat, which was S1.

skills/objectstack-data/rules/relationships.md and scripts/check-skills-token-ratchet.mjs — unchanged; the judgments of record 6896463758 hold.

Findings:

S1: closed. Both strings a correct answer could contain are gone; the kept entry is the shape only a wrong answer writes.

N1: moot (the viewAllRecords entry it compared against is gone).

N2 (nit) — stands: the worked example is unmarked, so check:skill-examples does not guard its key spelling.

N3 (nit) — stands: function: 'count' follows the file's existing convention.

N4 (nit) — case 20 has no string assertion against an answer that masks and also grants View All / Modify All on project. If the lane wants one later, the wrong answer's full inline shape (the project entry carrying viewAllRecords: true beside allowRead: true) is narrower than the bare key and far less likely to appear in a correct sentence.

No must-fix, no should-fix.

Implemented-by: claude/project-thread-vldcg4
Reviewed-by: session_01ADHkmRxXmVQ41fqnaTPGAv

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:skills#2 · os-steve · session_01ADHkmRxXmVQ41fqnaTPGAv

维护者速读

  • 改了什么:skills/objectstack-data/rules/relationships.md 的「汇总字段」一节新增:os build 报 security-rollup-source-unreadable 时,完工前必须处理,不能放着;该权限集应看到子记录就补读权,不应看到就在该集上遮住父汇总字段(fields['父对象.汇总字段']: { readable: false },并先去掉它在父对象上的 View All / Modify All,否则遮不住),附一个例子。评测新增第 20 条;技能 token 上限一行按实测上调;@objectstack/skills patch changeset。
  • 为什么改:卡 skills(data): tell the builder to resolve security-rollup-source-unreadable by masking the parent summary on a set that may not read the child #33819(p2),你的裁决「改为搭建侧处理」:不改规则,教 AI 在搭建时处理这条警告。
  • 风险与回滚:只改技能文字、一条评测和上限表一行,不动运行时。回滚即还原本 PR。
  • 先看:relationships.md 汇总字段一节新增的那段和例子(View All / Modify All 要先去掉那句)。
  • 两分钟验证:node scripts/check-skills-token-ratchet.mjs,预期 relationships.md 4232 / 4232 通过。
  • 需要你做的:受管面 Tier H(skills/**)。达档(CONTRACT_REVIEW_TIER)复审:首轮 6896463758(PASS,S1 should-fix),delta 6896780326 在本 head PASS、S1 已关。请批准或直接合并。
  • 席位意见:可以合。

席位核对

Verdict: ACCEPT, held for the maintainer · head 099fa848ce3664252db8fc40f49b612fba7f65a0 · card #33819 · report 6896378351 · at-tier contract review 6896463758 (round 1) + delta 6896780326 (PASS on this head, S1: closed) · read 2026-11-15T15:22Z.

  • Shape: draft → main, Fixes #33819. skills/objectstack-data/rules/relationships.md, skills/objectstack-data/evals/hooks-security-seeds-datasources.json, the relationships.md row in scripts/check-skills-token-ratchet.mjs, one changeset (@objectstack/skills patch). GOVERNED, Tier H (skills/**). Clause-②: no; Metadata-protocol: none.
  • Premise measured: no skills/** file named security-rollup-source-unreadable on main; the taught steps match the rule's three arms and its View All / Modify All handling, as the review judged against packages/lint/src/validate-rollup-source-visibility.ts.
  • Gates: check-runs on this head: 45, all completed, none failing. Dev: 63 derived, 62 exit 0, 1 NOT-MEASURED (check:dual-build-cjs-loads, prerequisite; CI carries it); skill docs / refs / examples and the token ratchet exit 0.
  • Changeset (read against the diff): the grant-or-mask choice, the mask key spelling, and the remove-View-All-first condition each match the diff and the rule on main.
  • Accepted deviations: authoring by a subagent pinned to CONTRACT_REVIEW_TIER inside a default-tier card thread (recorded in the body); ratchet ceiling 4127 → 4232 at the measurement after 239 B paid down, under the standing ruling 「A:先削重复,余额按实测提高」; the row-scoped sibling stays untaught; no pointer in rules/security.md. Review nits N2–N4 accepted (example unmarked for the example check; function: 'count' follows the file; case 20 has no string assertion against an answer that masks and also grants View All, since every such string false-fails a correct answer).
  • Out of scope: none filed.
  • Landing: Tier H. The seat does not flip this PR ready or enqueue it. It needs the maintainer's merge, or an authorised APPROVED review after which the seat lands it.

@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 15, 2026
@os-zhuang
os-zhuang marked this pull request as ready for review November 15, 2026 16:12
@os-zhuang
os-zhuang enabled auto-merge November 15, 2026 16:12
@os-zhuang
os-zhuang added this pull request to the merge queue Nov 15, 2026
Merged via the queue into main with commit 81af309 Nov 15, 2026
55 checks passed
@os-zhuang
os-zhuang deleted the claude/project-thread-vldcg4 branch November 15, 2026 16:31
scbdzhwl pushed a commit to scbdzhwl/objectstack-analysis that referenced this pull request Nov 16, 2026
…ts a current_user default (objectstack-ai#34019)

<!-- claude-projects-attribution: {"github_login":"os-steve"} -->
_Requested by **Steve** · [project
thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9Ty2ru1KHBywrksCX6GQE13)_
Fixes objectstack-ai#33978

Clause-②: no
Metadata-protocol: none

## 维护者速读

- 改了什么:两条搭建教学。① 界面技能
actions.md:「给父记录加明细行」的动作必须设置单价(从产品读价,或在角色可定价时设为必填参数),附一个可类型检查的示例;② 数据技能
security.md:插入策略的 `check` 绑定当前用户的字段时,给该字段设 `defaultValue:
'current_user'`,用户只说「加一个任务」也能建成。各配一条评测用例。
- 为什么改:评测里聊天写数据失败,6 次明细行金额写成空(加行动作没有价格),14 次建任务
403(策略要求用户没说的负责人)。维护者原话「聊天里改数据 出问题的关键还是我们的skills需要优化吧?」。
- 风险与回滚:仅技能文档、评测与 token 天花板,不改运行时;回滚即 revert。actions.md 天花板
2453→2808、security.md 3959→4041、objectstack-ui SKILL.md
3814→3833(先删重复,余额按实测提高)。
- 先看:`skills/objectstack-ui/rules/actions.md`(新段落与示例)→
`skills/objectstack-data/rules/security.md`(`own_tasks` 策略与四行说明)→
`scripts/check-skills-token-ratchet.mjs`(两行天花板与算式)。
- 两分钟验证:`node scripts/check-skills-token-ratchet.mjs`,预期 actions.md 显示
2808 / 2808、security.md 4041 / 4041,全部通过。
- 需要你做的:批准本 PR

## What changes

- `skills/objectstack-ui/rules/actions.md` § Action Parameter Patterns:
**An action that adds a child line sets its price.** `lookupAutofill`
fills only the form and the grid, and a stored `expression` reads only
its own row, so a body inserting `invoice`, `product` and `quantity`
alone stores no `amount`. Read the price from the source the build
declares, or take it as a `required` param where the persona sets
prices. One `os:check` example (`crm_add_invoice_line`, `type:
'script'`, params `product` and `quantity` borrowed with
`objectOverride: 'invoice_line'`, a body with `api.read` + `api.write`
that reads `product.list_price`, throws when the product is not found,
and inserts the line; `refreshAfter: true`, since the invoice's roll-up
total moves). Lines also written past the action (API, an agent, an
import — one with automations off skips hooks) get the price from a
`beforeInsert` hook on the line, `runAs: 'system'` when the writer
cannot read it.
- `skills/objectstack-ui/SKILL.md` § line-item grid behaviors: one
clause scoping its "never add an 'Add line' button" to the grid,
pointing a record-header action that inserts a priced line to
rules/actions.md, so the two do not read as contradicting each other.
- `skills/objectstack-data/rules/security.md` § Row-Level Security: the
example's second policy becomes the insert-only `own_tasks` (`check:
'assignee == current_user.id'`, field `task.assignee: { type: 'user',
defaultValue: 'current_user' }`), followed by four lines: a `check` over
a field the request never names refuses a plain create; `defaultValue:
'current_user'` fills an omitted `user` field before `check` is judged.
- Homes, chosen by where a builder reads it: rule 1 where the add-line
action and its params are written; rule 2 directly under the policy
example, beside `check`. `relationships.md` and `field-types.md`
untouched.
- Paid down first (standing ruling 「A:先削重复,余额按实测提高」, record 6513306068),
each cut keeping a home:
- actions.md, 85 bytes: "`locations` is an array of surfaces:" (the H2
names `locations`, the table header says Surface); the `opensInNewTab`
H3 tail "— async / computed redirect" (its paragraph opens "A redirect
URL computed after a fetch"); ", holes in either" on the `helpText`
bullet (the bullet above lists `description` and a param's `helpText`
among the `{{ }}` copy holes).
- security.md, 137 bytes: the `org_isolation` example policy. A
select-only `using` policy is still shown twice in § Membership keys;
`current_user.organization_id` keeps its placeholder-table row; the
tenant predicate is the Layer 0 wall in § Platform-global objects.
- Evals: `skills/objectstack-ui/evals/views-apps-actions-pages.json`
case 18 (the add-line action);
`skills/objectstack-data/evals/hooks-security-seeds-datasources.json`
case 21 (the self-tied create; it follows case 20, which objectstack-ai#33954 landed,
byte-identical after the merge of main). Every `must_contain` appears
verbatim in its `expected_output`; both `must_not_contain` lists are
empty.
- `scripts/check-skills-token-ratchet.mjs`: three rows moved to the
measurement (actions.md, security.md, objectstack-ui SKILL.md),
arithmetic in the row comments. The review-round additions (35 + 24
tokens) had no true duplicate to cut, so they rest on the ruling's
second half.
- `.changeset/33978-line-price-and-self-tied-create.md`:
`'@objectstack/skills': patch`.
- No forced test edits.

## Tests

Measured on `origin/main` before writing (b8ac0e2):

- `defaultValue: 'current_user'` is a runtime token on a `user` field
(`packages/spec/src/data/field.zod.ts`, the `defaultValue` describe),
resolved per request in
`packages/objectql/src/engine-defaults-and-autonumbers.ts`.
- On insert the engine applies field defaults, then `beforeInsert`
hooks, and the RLS `check` judges that post-hook row
(`postHookWriteImageCheck`; pinned by
`packages/plugins/plugin-security/src/insert-check-post-image.test.ts`).
- A CEL `defaultValue` envelope and a stored `expression` read only the
row being written, so neither can read the product's price;
`lookupAutofill` is client-side only.
- Action bodies run elevated
(`packages/runtime/src/action-execution.ts`, `isSystem: true`); hooks
run as the operator unless `runAs: 'system'`
(`packages/objectql/src/hook-run-as.ts`).

<details><summary>Scratch proof (uncommitted vitest file on the
insert-check-post-image harness, deleted after) — 5/5 passed</summary>

```text
assignee: { type: 'user', defaultValue: 'current_user' } + insert check 'assignee == current_user.id'
  create naming no assignee            -> admitted, stored assignee = the caller
  control: same field, no default      -> PERMISSION_DENIED 403 "the insert would violate a row-level CHECK"
  with the default, naming another user -> still 403
  the taught field parses through ObjectSchema.create
invoice_line amount = record.quantity * record.unit_price
  quantity 3, no unit_price            -> amount null (not 0)
  quantity 3, unit_price 20            -> amount 60
Lock VERDICT command-exit 0 · Test Files 1 passed · Tests 5 passed
```
</details>

## Acceptance notes

- Not taught: the card's alternative for rule 2, "say in the field
description that an agent sets it". On main the agent's object
description (`describeServedObject`,
`packages/runtime/src/domains/mcp.ts`) serves name, type, label,
required, readonly, system, options and `defaultValue` per field, and no
`description`, so that route has no measured agent consumer. It does
serve `defaultValue` and tells the agent to omit the field to get it,
which is the taught path.
- The rule 1 example computes the price and takes no price param: the
body runs elevated, so an optional override param would let a persona
write a price their field grant denies. The param route stays prose ("a
`required` param where the persona sets prices").
- NOT MEASURED: the example action run through the action runtime (it is
type-checked; its mechanics follow the file's existing script example);
a hook stamping `unit_price` for a persona whose field grant denies
editing it (the text makes no claim about it).
- `field-types.md`'s `lookupAutofill` paragraph still ends at
"Client-side only" with no pointer to the new rule; left out to keep to
two rule files.
- Review round (seat at-tier review PASS at 31a2d6d, record
6897741755): N2, N3, N4 applied in one commit; N1 and N5 left as they
are.
- Authoring arrangement: this thread is served below the card's mandated
tier, so the `skills/**` text was authored and committed by an at-tier
(`CONTRACT_REVIEW_TIER`) subagent in the same worktree and branch; push,
gates, relay writes and the report stay with the thread.

## Verification

Token counts, `ceil(utf8 bytes / 4)`:

| Scope | Before | After |
|---|---|---|
| `rules/actions.md` | 185 lines · 9807 B · 2452 tok (ceiling 2453) |
224 lines · 11231 B · 2808 tok (ceiling 2808, headroom 0) |
| `rules/security.md` | 329 lines · 15834 B · 3959 tok (ceiling 3959) |
334 lines · 16164 B · 4041 tok (ceiling 4041, headroom 0) |
| `objectstack-ui/SKILL.md` (priced bytes, stamp line excluded) | 15233
B · 3809 tok (ceiling 3814) | 15329 B · 3833 tok (ceiling 3833, headroom
0) |
| all `skills/*/SKILL.md` (240e9ab vs head) | 4596 lines · 237075 B |
4597 lines · 237171 B (+1 line, +96 B) |
| whole shipped `skills/` bundle (ratchet, 240e9ab vs head) | 246388
tok (authored 187806, eval 46787) | 247470 tok (authored 188268, eval
47407): +462 authored, +620 eval fixture |

Local gate union at head `0d221b0` (`origin/main` 240e9ab merged in;
`node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack`, every listed command run, exit captured
before any pipe):

- 65 derived · 64 exit 0 · 1 NOT MEASURED: `pnpm
check:dual-build-cjs-loads` exit 3, PREREQUISITE NOT MET (reads every
package's `dist/`; this worktree built only the spec, client,
client-react and plugin-security closures). Declared narrowing; CI
carries it.
- `--ran` reconciliation: "65 derived famil(ies) accounted for — 64 run,
1 NOT-MEASURED (1 DERIVED from a recorded exit 3)". The union at the
previous heads read the same (63 derived, 62 run, 1 NOT MEASURED at both
`18e323b` and `31a2d6d`).
- Acceptance gates at `0d221b0`, each exit 0: `pnpm --filter
@objectstack/spec check:skill-docs` ("Skill docs in sync"),
`check:skill-refs` ("9 generated files in sync with packages/spec"),
`check:skill-examples` ("347 prose examples type-check across 3
surface(s)", after a spec rebuild), `node
scripts/check-skills-token-ratchet.mjs` ("57 authored bundle file(s)
within their ceilings") and `--self-test` ("104 cases pass"), `pnpm
check:nul-bytes`, `git diff --check`.
- Not run locally: `test:repo` (CI's `Test Core`); the diff touches no
test.

<!-- signed: domain:skills#2 · os-steve ·
session_01ADHkmQ2cXsNaBaNbjBDxsA -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
@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 17, 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 security 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.

skills(data): tell the builder to resolve security-rollup-source-unreadable by masking the parent summary on a set that may not read the child

3 participants