Skip to content

Commit d2fc055

Browse files
docs(skills): seeds.md says a seeded roll-up value is never stored, not stored as written (#36800)
Fixes #36122 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:用数据技能写演示数据的 AI 作者,读到的说明从「写进汇总字段的数会原样存下」改成「不会存、加载时提醒一次、由子记录算出」。 - 为什么做:平台行为已在上周改掉(种子数据不再存汇总值),技能里的理由成了错话,这次让文字跟上已发布的行为。 - 出错会怎样:只改一句说明和一条评测期望;写错了作者会学到错的模型,撤回这次合并即可恢复原文。 - 要你做什么:无 ## What changes - `skills/objectstack-data/references/seeds.md` (the validation-rules paragraph): the rule "Never seed the roll-up" and the record-order point stay. Only the consequence changes, from "a seeded `amount_paid` is stored as written, and a cap on payments refuses those it counts" to "a seeded `amount_paid` is never stored (a warning per dataset); the child rows compute it." - `skills/objectstack-data/evals/hooks-security-seeds-datasources.json`, case id 32: `expected_output` now says the seed loader never stores a supplied `amount_paid` and logs one warning per dataset naming the fields. It adds a "does not say a seeded `amount_paid` is stored or makes the rule refuse the payments" line. `prompt`, `must_contain` and `must_not_contain` (`amount_paid: 4800`, `amount_paid: 2000`) are unchanged, so the case still requires invoice rows with no roll-up value. - `.changeset/36122-seeds-rollup-never-stored.md`: `patch` on `@objectstack/skills`, as earlier skills-text changes carry. Shipped behaviour the sentence states, read at `packages/metadata-protocol/src/seed-loader.ts` on `origin/main` bbc7e03: - lines 794-801 (`summaryFieldNames`): only fields with `type === 'summary'` are taken out, every aggregate, `readonly` or not. Formula and autonumber fields have no such path in the loader. - lines 2304-2311: the value is deleted from the record copy before the replay compare and before the engine write, so no validation rule ever sees it. - lines 3268-3277: one `logger.warn` per dataset, naming the object, the fields and the count of values not written. Read first: the one changed sentence in `seeds.md`, then eval case 32. Two-minute check: `node scripts/check-skills-token-ratchet.mjs` prints `skills/objectstack-data/references/seeds.md is 1898 tokens (ceiling 1898; headroom 0)` and exits 0. ## Skill size readings Head a2b90f7 against `origin/main` bbc7e03. | Reading | Before | After | |:---|---:|---:| | `seeds.md` lines | 190 | 190 | | `seeds.md` bytes | 7590 | 7589 | | `seeds.md` tokens (ceiling 1898) | 1898 | 1898 | | eval file lines | 361 | 361 | | all `SKILL.md` lines, whole catalog | 4947 | 4947 | | ratcheted authored tokens, whole catalog (ceiling 202541) | 197570 | 197570 | No ceiling moves and `scripts/check-skills-token-ratchet.mjs` is not edited. ## Tests Text only: no code or tested behaviour changes, so there is no package test to run and no ablation. The eval file parses as JSON. ## Acceptance notes - Other evals in the data skill that mention seeding a roll-up: none. A search of `skills/objectstack-data/evals/` for seed cases naming a roll-up, a summary field or `amount_paid` hits case 32 only. The two `task_count` summary cases in the same file (ids near lines 257 and 267) are about read access, not seeding. - The first wording was one byte over the old sentence; the second commit trims it to one byte under. - The branch carries one merge of `origin/main` (22 commits, none touching these files). ## Verification Local run of the 49 commands `node scripts/pm/dispatch-gates.mjs --commands` derives for this diff, on head a2b90f7: 44 exit 0, 5 exit 3. `--ran` reconciliation: 49 derived, 49 run, 0 unrun. Exit 0 on the families that read these files: `check-skills-token-ratchet` (and its self-test), spec `check:skill-refs`, spec `check:skill-served-sections`, `check:skill-links`, `check:skill-identifier-liveness`, `check:skill-compatibility`, `check:skill-frame-sync`, `check:doc-authoring`, `check:nul-bytes`, `check:pm-skill-id-lint`, `check:published-files`, `check-empty-changeset`, `check-changeset-no-major`, `check-adr-0087-registration`. NOT MEASURED locally (exit 3, each asks for a build this text-only diff does not owe; CI runs them): lint `check:doc-formula-expressions`, `check:dts-closure`, `check:dual-build-cjs-loads`, `check:lean-entry-closure`, `check:sourcemap-no-sources-content`. `node scripts/pm/overlap-check.mjs`: `VERDICT clean exit 0` against `origin/main` bbc7e03. --- _Generated by [Claude Code](https://claude.ai/code/session_011y7As6FyXmJyGyHNKXUkV7)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent f115a66 commit d2fc055

3 files changed

Lines changed: 12 additions & 2 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/skills': patch
3+
---
4+
5+
docs(skills): the data skill's seeds reference says a seeded roll-up value is never stored, not stored as written
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
objectstack-data's `references/seeds.md` kept the rule "never seed the roll-up" but gave a reason that stopped being true: it said a seeded `amount_paid` is stored as written and a cap on payments then refuses the payments it counts. The seed loader takes a value written for a `summary` field out of the record before the write, logs one warning per dataset naming the fields, and the child rows compute the roll-up. The sentence now says that. The record-order point stays: a rule reading a parent roll-up sees the total earlier rows left. The matching eval case in `evals/hooks-security-seeds-datasources.json` expects the same model. Text only; the sentence pays for its new wording in its own bytes.

‎skills/objectstack-data/evals/hooks-security-seeds-datasources.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@
334334
{
335335
"id": 32,
336336
"prompt": "`payment` has a validation rule that refuses a payment above the invoice's open balance (`record.amount > record.invoice.amount - record.invoice.amount_paid`); `invoice.amount_paid` is a `sum` roll-up of its payments. Seed demo data: invoice `INV-1` for 4800, fully paid in two payments, and `INV-2` for 5000 with 2000 paid.",
337-
"expected_output": "Two `defineSeed` sets. The invoice rows carry `number` and `amount` and no roll-up value: a seed write stores a supplied `amount_paid` as written, the rule then reads a balance already spent, and both payments on the fully paid `INV-1` are refused (the 2000 on `INV-2` still fits its 3000 open balance). The payments name their invoice by natural key (`invoice: 'INV-1'`) and each fits what the rows before it left: two that sum to 4800 on `INV-1`, one of 2000 on `INV-2`; the roll-up then computes the paid totals. Does not say seed rows skip validation rules (only `state_machine` is skipped) and does not weaken the rule to make the seed load; `os verify` fails on a dropped seed row.",
337+
"expected_output": "Two `defineSeed` sets. The invoice rows carry `number` and `amount` and no roll-up value: the seed loader never stores a supplied `amount_paid` (it leaves the value out of the write and logs one warning per dataset naming the fields), so the rows state nothing the payments do not compute. The payments name their invoice by natural key (`invoice: 'INV-1'`) and each fits what the rows before it left: two that sum to 4800 on `INV-1`, one of 2000 on `INV-2`; the roll-up then computes the paid totals. Does not say a seeded `amount_paid` is stored or makes the rule refuse the payments. Does not say seed rows skip validation rules (only `state_machine` is skipped) and does not weaken the rule to make the seed load; `os verify` fails on a dropped seed row.",
338338
"files": [],
339339
"assertions": {
340340
"must_contain": [

‎skills/objectstack-data/references/seeds.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ refused row never lands. `os validate` does not run them on seed rows;
144144
`os verify` fails on each dropped row. A rule reading a parent roll-up
145145
(`record.invoice.amount_paid`) sees the total earlier rows left, so children
146146
must fit in record order. ⛔ Never seed the roll-up: a seeded `amount_paid` is
147-
stored as written, and a cap on payments refuses those it counts.
147+
never stored (a warning per dataset); the child rows compute it.
148148

149149
### Dynamic values (CEL)
150150

0 commit comments

Comments
 (0)