Repository navigation
docs(skills): roll-up guidance resolves security-rollup-source-unreadable before finishing - #33954
Conversation
…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>
|
domain:skills#2 · os-steve · session_01ADHkmRxXmVQ41fqnaTPGAv Contract reviewServed-tier: 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 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):
① Derived judgmentsEvery taught-behaviour change in the diff, against the rule's code on
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 O1 (outside the diff, not a finding on it): one observation outside the diff is with the owner seat. ② Semver level
③ 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 (b) Ratchet row 4127 → 4232 — ANSWERED, holds on the standing ruling's path. The script's header assigns the two checks to this record:
(c) (d) No pointer in (e) Example not marked Other deviations in the report: ④ Design judgment
Findings: S1 (should-fix) — case 20 N1 (nit) — the eval forbids N2 (nit) — the worked example is unmarked, so N3 (nit) — No must-fix. One should-fix (S1). Implemented-by: VERDICT: PASS |
… writes Claude-Session: https://claude.ai/code/session_01ADHkmRN27hsvWWTzGXixkW Co-authored-by: Claude <noreply@anthropic.com>
|
domain:skills#2 · os-steve · session_01ADHkmRxXmVQ41fqnaTPGAv Contract reviewServed-tier: DELTA record. It follows my record 6896463758 on head Inputs read: the commit diff 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. Gate verdicts on this head (check-runs; conclusions are the verdicts, none re-run here): 45 runs, ALL COMPLETED, NONE STILL RUNNING, none failed.
① Derived judgmentsNo taught behaviour changed in this delta: The delta changes only what case 20 refuses:
② Semver levelUnchanged: ③ 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 ④ Design judgment
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 N2 (nit) — stands: the worked example is unmarked, so N3 (nit) — stands: N4 (nit) — case 20 has no string assertion against an answer that masks and also grants View All / Modify All on No must-fix, no should-fix. Implemented-by: VERDICT: PASS |
|
domain:skills#2 · os-steve · session_01ADHkmRxXmVQ41fqnaTPGAv 维护者速读
席位核对Verdict: ACCEPT, held for the maintainer · head
|
…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>
Requested by Steve · project thread
Fixes #33819
Clause-②: no
Metadata-protocol: none
维护者速读
security-rollup-source-unreadable警告,必须处理掉再收尾——该权限集应看子记录就授予读取,不应看就在该集上屏蔽父对象的汇总字段。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、全部通过。What changes
skills/objectstack-data/rules/relationships.md§ Roll-up Summaries: a new paragraph "Never finish withsecurity-rollup-source-unreadablestanding." 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'sfiltertests), 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 workeddefinePermissionSetfragment (client_viewer,projectread,'project.task_count': { readable: false }).procurement_receipt/received_amountfiltered-sum example (the section's code block showsfunction: 'sum'besidefilter: { 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 — aclient_viewerset that readsprojectbut must never readtask, aproject.task_countcount roll-up.must_containthe count and the mask spelling;must_not_containonly thetaskread grant (task: { allowRead: true }), the one shape a correct answer never writes (review round 1: "safe to ignore" andviewAllRecords: truewere dropped, since a correct answer can contain either while naming what to avoid).scripts/check-skills-token-ratchet.mjs: therelationships.mdrow 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.rules/security.mdandrules/field-types.mduntouched.Tests
The worked example was run through the real rule (
runAuthoringRules('build', …)frompackages/lint/src/authoring-rules.ts, on a stack built withObjectSchema.create/definePermissionSet/defineStack; the example body passed todefinePermissionSetexactly 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
The same boundary held with
modifyAllRecords: trueonproject(1 warning) in the seat-side measurement onorigin/main895783a.Acceptance notes
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.rules/relationships.md(read at roll-up time). No pointer inrules/security.md(zero token headroom there); open question in the report.check:skill-examplesdoes not compile it; its correctness evidence is the proof run above.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):rules/relationships.mdskills/*/SKILL.mdskills/bundle (ratchet)Local gate union re-run in full at head
099fa84, the review round 1 fix; the first run at02b5f1cread the same (node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack, every listed command run, exit captured before any pipe):pnpm check:dual-build-cjs-loadsexit 3, PREREQUISITE NOT MET (reads every package'sdist/; this worktree built only the lint and client closures). Declared narrowing; CI carries it.--ranreconciliation (exit codes recorded): "63 derived famil(ies) accounted for — 62 run, 1 NOT-MEASURED (1 DERIVED from a recorded exit 3)".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