Repository navigation
skills(data): seed rows obey the package's own validation rules in load order; docs: seed load order comes from lookups and dependsOn - #35652
Conversation
…ad order; docs: seed load order comes from lookups and dependsOn seeds.md: a seed row is judged by the object's validation rules (all but state_machine) as it loads; a rule reading a parent roll-up sees the total earlier rows left; a seeded roll-up value is stored as written. Paid for by deleting restatement in the same file (7036 -> 7031 bytes, ceiling unmoved). One eval case. seed-data.mdx: the multi-object layout no longer says the array is exported "in dependency order". Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4d1ZJL93Kin2UHFXbFv
|
repo:objectstack#4 · os-elon-musk · session_016WV4d1ZJL93Kin2UHFXbFv Final head for review: Area a4-A asks L1 (thread L1-a) for ACCEPT. |
|
repo:objectstack#4 · os-elon-musk · session_016WV4d1H9ixhgepGZ7fawhL L1 verdict (L1-a): ACCEPT at head Gates on this head: 47 check-runs, 0 failed, 0 pending. Shape:
What I checked myself:
Notes (non-blocking):
Next: Tier H. Handed to the seat for contract review and landing. Generated by Claude Code |
|
repo:objectstack#4 · os-elon-musk · session_016WV4cxgb3PKFkt8y5FigJn Contract reviewServed-tier: Inputs read: cards #34986 and #35327 with every comment (direction 6970307554, the lane move, both claims, the os-dev-report), PR #35652 (body, four files, net diff against ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgment
S1 (should-fix) — the closing clause "a cap on payments then refuses them all" is false as a universal, and eval case 32 repeats it against its own numbers. A seeded total refuses exactly the payments that no longer fit under it: every payment on an invoice seeded as fully paid, and none on a part-paid invoice whose one payment still fits the remaining balance. The PR's own measurement says so (66 of 72 refused, the 6 on part-paid invoices landed). In case 32 the expected answer says of a seeded Nits, no effect on correctness or the contract:
The cuts otherwise remove restatement only: the
Security-touching is Implemented-by: VERDICT: PASS |
…nts, not every payment Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4d1ZJL93Kin2UHFXbFv
|
repo:objectstack#4 · os-elon-musk · session_016WV4d1ZJL93Kin2UHFXbFv Final head for delta review: One commit on top of the ACCEPTed head |
|
repo:objectstack#4 · os-elon-musk · session_016WV4cxgb3PKFkt8y5FigJn Contract reviewServed-tier: Delta record. It follows the full record on head ① Derived judgments
② Semver levelUnchanged: ③ Boundary flagsNo new flag and no new open question in the delta. No code, so nothing for the SQL push-down check. ④ Design judgmentS1: closed
No must-fix, no should-fix. The three nits of the earlier record (N1 Security-touching is Implemented-by: VERDICT: PASS |
|
repo:objectstack#4 · os-elon-musk · session_016WV4d1H9ixhgepGZ7fawhL L1 delta (L1-a): ACCEPT stands at the new head What changed since
Ratchet: Gates on this head: 51 check-runs, 0 failed, 0 pending. Next: Tier H, so the seat lands it. Generated by Claude Code |
Requested by Elon · project thread
Part of #34986
Fixes #35327
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
skills/objectstack-data/references/seeds.mdgains one paragraph, each clause measured onmain(see Acceptance notes): seed rows obey the object's validation rules, all butstate_machine; a refused row never lands;os validatedoes not run those rules on seed rows andos verifyfails on each dropped row; a rule reading a parent roll-up sees the total earlier rows left, so children must fit in record order; a roll-up value written on a seed row is stored as written and must not be seeded (a cap then refuses the payments that total already counts).skills/objectstack-data/evals/hooks-security-seeds-datasources.json: one case, id 32.content/docs/data-modeling/seed-data.mdx: the multi-object layout no longer saysindex.tsexports the array "in dependency order", and "One file per object" no longer says the index "orders" the datasets. Both now agree with the page's own Load Order section and with the skill after PR docs(skills): drop the retired seed modes, name Seed.locale / fallback / dependsOn, and stop teaching array order as load order #35312: lookups anddependsOnorder the load, array position only breaks ties. No other sentence on the page makes the old claim..changeset/34986-skills-seed-rows-obey-validation-rules.md:@objectstack/skillspatch.Token ratchet: paid in full by deletion, the row does not move
Standing ruling 6513306068, 「A:先削重复,余额按实测提高」: restatement is cut in the same file first, and the row moves only by a measured remainder. Here the cuts cover the teaching (3 bytes under), so
scripts/check-skills-token-ratchet.mjsis not edited.seeds.mdeca20d2219)f2d0e25610)Cuts (-447 bytes), each a restatement inside the file: the
'name'default row of the key table (the field table states the default); "Pick a stable natural key" (the field table's "Stable business key"); "(not its UUID)" and the "natural key of an Account record" comment (the sentence above both); "at load time" (the same sentence's "order the load"); the second half of the id-fallback note (it restated the first half); the seconddefineSeedimport (the quick start imports it); "and breaks build determinism" (the determinism gate line says it); theapplyOncomment (the sentence above the block); "(fixtures, reference rows, bootstrap data)" (the quick start's two comments); and the "never lands" clause of the malformed-value paragraph, folded into one sentence. The teaching is +444 bytes. Whole shipped tree at this head, by the gate's own price tag: 275304 tokens; the only priced file this PR touches isseeds.md(1759 before and after), and the rest of the movement is the eval case, which is measured and not priced. Lines:seeds.md178 to 182; everySKILL.mdin the catalog together 4853 to 4853; the wholeskills/tree 22229 to 22249 (16 of the 20 are the eval case, which the ratchet measures and does not price).Evals
Case 32: a
paymentrule that refuses a payment above the invoice's open balance, readingrecord.invoice.amount_paid, asumroll-up; seed one fully paid and one part-paid invoice. The expected answer seeds the invoices without a roll-up value and payments that each fit what the rows before left, and does not say seeds skip validation rules or weaken the rule.must_contain:defineSeed,invoice: 'INV-1'.must_not_contain:amount_paid: 4800,amount_paid: 2000, the two seeded roll-up literals. They are code spellings with the case's own numbers; the skill text uses a different number, so an answer that quotes the skill's warning does not trip them. The grader is a literal substring match (packages/qa/scenarios/src/skill-evals/grade.ts). No model run was made for this case.Verification
Gates below ran on
4408d12775; after the review delta (headf2d0e25610: the roll-up sentence now says a cap refuses the payments the seeded total already counts, and eval case 32 says the payments on the fully paid invoice are refused, not every payment) the token ratchet and its self-test,check:skill-eval-tokens, the skill-evals test (36 of 36),check:nul-bytesand the overlap check were run again and exit 0.node scripts/check-skills-token-ratchet.mjsprintsskills/objectstack-data/references/seeds.md is 1759 tokens (ceiling 1759; headroom 0)and exits 0.seeds.md(the riskiest hunk: it ships verbatim to customer agents), then the cuts in the same file, then eval case 32.Local gates and tests
pnpm --filter @objectstack/scenarios exec vitest run --maxWorkers=2 test/skill-evals/skill-evals.test.ts:Test Files 1 passed (1),Tests 36 passed (36),VERDICT command-exit 0.node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack --commands: 73 families.--ranwith recorded exit codes:73 derived, 72 run, 1 NOT-MEASURED, 0 UNRUN. 72 exited 0, among themcheck-skills-token-ratchetand its self-test,check:skill-examples(346 prose examples type-check across 3 surface(s)),check:skill-served-sections,check:skill-links,check:doc-authoring,check:nul-bytes,check-closing-keyword-parity,check-empty-changeset.pnpm check:dual-build-cjs-loads, exit 3, PREREQUISITE NOT MET (it needs every package built; this diff builds none). CI owns it.node scripts/pm/overlap-check.mjs --branch=claude/area-a4A-34986:VERDICT clean exit 0againstorigin/mainand PR skills eval: narrow analytics-inline-vs-dataset#5 must_not_contain to the defineDataset( call, and fifteen same-shape cases #35649, which shares the eval file.Acceptance notes
Which half is left. This PR is the teaching half of the direction on the card. The other half, a build or publish-time finding that names the refusing rule and the count, is not in this PR and no check code was written; the card stays open for it.
What the two builds did differently (the reading the direction asked for). The build records named in the reading on the sibling card (two directories under a project-files mount of another project) are not reachable from this session, so the rule text of each build was not read. What the card's own rows prove, in
docs/qa/scenarios/order_to_cash.jsononmain: the 95 seeded invoices carry their end state (amount_paid,balance), and exactly 66 of the 72 payments are larger than their invoice's seededbalance(all 66 belong to apaidinvoice whose seeded balance is 0); the other 6 belong to part-paid invoices and fit. So the refusing build judged each payment against a balance that already counted it. A later rebuild pair recorded on the sibling card split the same way (one build 619 of 619, the other 66 refused), so the split is not tied to the skills version. A roll-up that merely lags its inserts does not produce this number: measured below, the rule does see earlier rows.Measured on
main(scratch probe, real engine, sqlite, the real seed loader; not committed):state_machine. The loader writes every row underSEED_WRITE_EXECUTION_CONTEXT(packages/metadata-protocol/src/seed-loader.ts,SEED_OPTIONS); the engine skips onlystate_machinefor it (shouldSkipStateMachine,packages/objectql/src/engine-top-level.ts; the insert path hands it toevaluateValidationRulesinengine-insert.ts). Probe: ascriptrule refused a seeded payment withFailed to write xt_payment record #0 (name=P1): A payment may not exceed the invoice's open balance.recomputeSummaries, same file), and inside one batch the rows already admitted are overlaid on the value the rule reads (summary-batch-accumulation.ts, pinned bypackages/rest/src/import-batch-parent-summary-rule.test.ts). Probe: payments of 2000, 2000, 1000 against an invoice of 3000 land the first and third and refuse the second; with the payments dataset listed first the lookup still loads the invoice first.amount: 3000, amount_paid: 3000keeps 3000 and its only payment is refused, leaving a paid total with no payment under it. This is the shape of the 66.os validateandos buildjudge seed values by field shape and against declared state-machine states only; neither evaluates a validation rule against a seed row, so they pass. At boot the loader returns the refusal inresult.errorsandAppPluginlogs a[Seeder]warning with the dropped count and the first 20 messages (the rule's message, not its name).os verifycounts every dropped seed record as a failure and exits 1, printing the count and pointing at the log; it names no rule. Nothing at build or publish time reports it.Noted, not filed. The scenario card's seed rows carry end-state roll-up values for the invoices, which is what a build that declares those columns as roll-ups is then judged against. Carrier: the seat that owns the scenario cards.
🤖 Generated with Claude Code