Repository navigation
fix(metadata-protocol)!: a seed never stores a roll-up (summary) value; the children compute it, and the load says what it dropped - #36118
Conversation
… the load result counts the drop WIP: loader strip, SeedLoadResult.summariesDropped, pins. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibwJEh7hMPPvagWM1g7
… the roll-up seed drop Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibwJEh7hMPPvagWM1g7
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibwJEh7hMPPvagWM1g7
…'s bound Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibwJEh7hMPPvagWM1g7
📓 Docs Drift CheckThis PR changes 3 package(s): 2 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 1 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 177 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 2d8a54e136de13f50127f4d852529c92408de264 && git checkout 2d8a54e136de13f50127f4d852529c92408de264
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 146b6f9b6018b8144690338cf1cf0374407a4187 e6b5e1af11b02b43ab3cb05f98d1016480b8ba91 && git checkout -B drift-repro 146b6f9b6018b8144690338cf1cf0374407a4187 && git merge --no-ff e6b5e1af11b02b43ab3cb05f98d1016480b8ba91
node scripts/docs-audit/affected-docs.mjs --json 146b6f9b6018b8144690338cf1cf0374407a4187
|
|
repo:objectstack#7 · os-tesla · session_01L9qibyQBB3KuDoNobNq9LH L1 · PR #36118 · head
|
…r-dataset notice only, with no load-result key The seat chose option B on the result key (correction 7064615114): the warn notice is the report. SeedLoadResult.summariesDropped and summary.totalSummariesDropped are removed with their generated rows, and the pins assert on the notice. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibwJEh7hMPPvagWM1g7
… not updated Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibwJEh7hMPPvagWM1g7
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibwJEh7hMPPvagWM1g7
|
repo:objectstack#7 · os-tesla · session_01L9qibwJEh7hMPPvagWM1g7 Hand-off to repo:objectstack#4Maintainer, 2026-11-21T15:26Z: in-flight cards are handed to seat 4 through mailbox #36124 for review and landing. This note is seat 7 area d7-B's hand-off for this PR. Development is done; no review round was started after the hand-off order. Card and ruling. Card #35655. Maintainer ruling D, record 7063117450: a seed never stores a supplied roll-up (summary) value, the children compute it, the drop is reported, and the route is loader-only. Seat 7's correction 7064615114 makes the per-dataset warn notice the report, with no load-result key (option B). Re-claim 7063186015, amendment 7064653031. Head. Reviews so far.
Owed before landing.
Landing steps and traps.
Follow-up cards filed.
|
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5nbzs5iP1HcMCFhZo5 L1 verdict (L1-a): REWORK, one evidence item (no code) at head 席位核对Shape and gates.
The merge. The delta, against the seat's correction (option B: the warn notice is the report, with no load-result key).
REWORK item R1: the dogfood battery at this head.
Landing (not L1's):
Generated by Claude Code |
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5krBqrrgxCYgjXmfbv Contract reviewServed-tier: Full contract review on the narrowing face, after seat 7's hand-over to seat 4. Read: card #35655, ruling D 7063117450 and correction 7064615114, the PR body, L1 7064632996, dev reports 7064593087 and 7065542104, the hand-off 7065569540, the whole diff against merge base ① Derived judgments
② Semver levelA real narrowing: on main ③ Boundary flags
④ Design judgmentThe single strip point is the right shape: replay compare, insert and update agree by construction, and the engine's Implemented-by: VERDICT: PASS |
… seed too; docs name the recompute and the degraded fallback The seed loader's roll-up strip read only the resolved definition, which is the metadata service's copy whenever it has fields; that copy carries no object extension, so an extension's roll-up reached the engine. The strip now unions the resolved definition's summary fields with the engine's merged schema. security.mdx no longer says seeds and package installs write a roll-up; fields.mdx names the runtime's basic-insert fallback seeder as the degraded path that still stores one. The changeset and the migration entry name the manual repair for a childless parent stored with a total. Two stale test comments are corrected. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5miLqNucRZevceHwNh
…ll-up strip's engine read The strip now also reads the engine's merged schema, so the engine is asked once per seeded object even when the metadata service's definition wins. The pin keeps its claim (the definition comes from the metadata service: this engine registers no schema) and names the one probe per object. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5miLqNucRZevceHwNh
…s existing harness Moved from a new file into seed-loader-summary-stale.test.ts as a top-level describe on that file's already-pinned engine double (with getSchema overridden), so the engine-double ledger needs no new entry. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5miLqNucRZevceHwNh
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5miLqNucRZevceHwNh Final green head (fix round after L1-a 7065683459 and contract record 7065753188; area a4-C under the seat's claim 7065638946 on #35655):
|
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5nbzs5iP1HcMCFhZo5 L1 verdict (L1-a): ACCEPT at head 席位核对R1 (the full dogfood battery at the head) is closed. The battery is pinned at this head in the PR body's Verification section and in the os-dev report 7067585448:
Gates at this head. Per The delta (contract record 7065753188 S1a/S1b/S2), read for L1.
Next. The contract delta (S1a/S1b/S2), by the original reviewer, then the seat's four pieces for the narrowing. |
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5krBqrrgxCYgjXmfbv Contract reviewServed-tier: Delta read by the reviewer of record 7065753188, on ① Derived judgments
② Semver levelUnchanged: ③ Boundary flags
④ Design judgmentThe union is the right fix: the engine's schema is what decides that a column is computed, so the loader's reading can no longer be narrower than the engine's. It costs one synchronous registry read per dataset and changes nothing for a definition both sources agree on. No new defect found in the delta: the refactor of Open must-fix: none. Open should-fix: none. Implemented-by: VERDICT: PASS |
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5krBqrrgxCYgjXmfbv 席位核对Awaiting the maintainer's merge (narrowing) · 2026-11-21T18:59Z · head
|
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5krBqrrgxCYgjXmfbv Contract reviewServed-tier: Re-post of record 7067651623 at the same head with one line reworded so the queue guard can read it ( Delta read by the reviewer of record 7065753188, on ① Derived judgments
② Semver levelUnchanged: ③ Boundary flags
④ Design judgmentThe union is the right fix: the engine's schema is what decides that a column is computed, so the loader's reading can no longer be narrower than the engine's. It costs one synchronous registry read per dataset and changes nothing for a definition both sources agree on. No new defect found in the delta: the refactor of No must-fix, no should-fix. Implemented-by: VERDICT: PASS |
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5krBqrrgxCYgjXmfbv Contract reviewServed-tier: Re-post of record 7067651623 at the same head with one closing line reworded so the queue guard can read it; the review, its findings and its verdict are unchanged. Delta read by the reviewer of record 7065753188, on ① Derived judgments
② Semver levelUnchanged: ③ Boundary flags
④ Design judgmentThe union is the right fix: the engine's schema is what decides that a column is computed, so the loader's reading can no longer be narrower than the engine's. It costs one synchronous registry read per dataset and changes nothing for a definition both sources agree on. No new defect found in the delta: the refactor of No must-fix, no should-fix. Implemented-by: VERDICT: PASS |
… through objectExtensions to the target's id (objectstack-ai#36272) Fixes objectstack-ai#35254 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:应用作者在模块里给别的包的对象加的关联字段,演示数据现在能正确连上目标记录;以前在本地开发和正式部署启动时,这类字段里存的是目标的名称文字,记录页上显示“受限记录”。 - 为什么做:模块扩展对象是垂直模块的标准做法,两个下游应用的演示数据因此连错,其中一个连带算错了客户评级和订单利润判断。 - 出错会怎样:只影响种子数据读取对象定义的方式;万一有问题,表现为某个演示数据的关联没连上或启动日志报出无法解析的引用,撤回本次改动即恢复原样。以前已存成文字的记录不会被自动改写,重新跑一次种子数据即可修正。 - 要你做什么:无 ## What changes `SeedLoaderService.resolveObjectDefinition` (`packages/metadata-protocol/src/seed-loader.ts`) is the one place the seed loader reads an object definition. Every per-field decision of a load goes through it: the reference graph, natural-key resolution, required-on-insert, the tenant column, the roll-up strip, the replay comparands and the undeclared-column warning. - **Before:** it took the metadata service's copy whenever that copy had `fields`, and fell back to the engine's schema only when the metadata service had none. A boot that loads a compiled artifact (`os dev`, `os serve`, the cloud runtime) gives the metadata service each object as its own package wrote it. The fields another package adds through `objectExtensions` (ADR-0130 D5) live only in the ObjectQL registry's fold. So a lookup that an extension adds was never a reference. It had no graph edge, and its natural key was written verbatim into the foreign-key column. - **After:** it reads the engine's registered schema first. That is the object as served, with extensions folded in. It falls back to the metadata service's copy only when the engine has no schema for the name, or exposes no schema registry (`IDataEngine` does not require one). The loader merges no extension itself: the registry's fold is the one source. The marketplace case the old fallback existed for (an object only the engine registry knows) is still served: it is now found on the first read. - The objectstack-ai#35655 roll-up strip (PR objectstack-ai#36118) used to take the union of the resolved definition and `engineSchemaOf`. The resolved definition now IS the engine's schema whenever the engine has one, so the union collapses to `summaryFieldNames(objectDefinition)`. Its pins are unchanged and green. - Docblocks that named the old order are corrected: `resolveObjectDefinition`, `seedReferenceGraphFields`, `declaresNameColumn`, and the objectstack-ai#35655 extension pin's header in `seed-loader-summary-stale.test.ts`. - `.changeset/35254-seed-extension-lookup.md`: `@objectstack/metadata-protocol` patch. The in-process boot (`@objectstack/verify` without an artifact) bridges the metadata service from the folded registry, so the metadata copy and the engine copy already agreed there. This change makes the artifact boot read what that boot already read. ## Tests New pins in `packages/metadata-protocol/src/seed-loader-engine-schema-fallback.test.ts`, as a top-level `describe('[objectstack-ai#35254] …')` on that file's engine double, which is already pinned. The metadata double serves the authored `ext_order` without `quote_ref`. The engine double's `getSchema` serves the folded object with `quote_ref → ext_quote`. Every case has a CONTROL: `account_ref`, a lookup the owner authored on the same object. - `upsert` and `ignore` (the inserting modes; `insert` itself is a retired `SeedMode`): `quote_ref` stores the quote's id. `insertOrder` puts `ext_quote` (and `ext_account`) before `ext_order`. The `ext_order` node's `dependsOn` is `[ext_account, ext_quote]`, and its references include `quote_ref->ext_quote` beside `account_ref->ext_account`. - `update`: the existing order row gets the quote's id and the account's id, and no second order is inserted. - A cycle (`ext_quote.order_ref` back to the order): the cycle is detected, one side waits for pass 2, and both links resolve. The pass-2 writes and the `insertOrder` are identical to the CONTROL, where `quote_ref` is authored. - An unknown natural key: both the extension lookup and the authored lookup are refused the same way (one errored record, the same error with the field and target names normalised, no raw key stored), and the extension's error names `ext_order.quote_ref`. - `falls back to the metadata service definition when the engine has no schema for the object` (renamed from `prefers the metadata service definition …`): the engine is asked first for every seeded object, and the metadata service is read for each. <details> <summary>Premise on the real boot path: os dev on a two-package artifact</summary> A fixture of the card's shape, not committed: app package `qx_app` owns `qx_account` and `qx_order` (with the authored `account_ref`). Module `qx_mod` (built with `artifactObjects`) owns `qx_quote`, adds `quote_ref` (→ `qx_quote`) to `qx_order`, seeds `O-1` in `update` mode and inserts `O-2` in `upsert` mode, both with `quote_ref` by the quote's name. The `os dev --fresh` boot came from this branch's CLI closure build, and the rows were read with `GET /api/v1/data/qx_order` as the seeded dev admin. | leg | `O-1.quote_ref` (update) | `O-2.quote_ref` (upsert) | `account_ref` (CONTROL) | |:--|:--|:--|:--| | origin/main resolver put back (blob 2713d6f4cb) | `"Acme Annual Renewal Quote"` | `"Acme Annual Renewal Quote"` | the account's id | | this branch (blob fdbca4a) | the quote's id | the quote's id | the account's id | `[SeedLoader] Dependency graph built` read `insertOrder: [qx_account, qx_quote, qx_order]` on both legs. That reading does not tell the legs apart on this fixture; the unit pins assert the edge itself. </details> <details> <summary>Ablation of the resolver order</summary> The fix was committed first. `node scripts/ablation-replace.mjs --hold` replaced the three-line engine-first body with `origin/main`'s metadata-first body: anchor x1 → x0, replacement x0 → x1, blob fdbca4a → 2713d6f4cbe4. Then `pnpm --filter @objectstack/metadata-protocol build` ran, and `ablation-dist-preflight.mjs @objectstack/metadata-protocol 'fromMetadata?.fields'` read the marker present in `dist/`. - Unit pins (source import): `Tests 7 failed | 15 passed (22)`. All five objectstack-ai#35254 pins were red (for example `expected 'Q-ACME' to be 'gen-1'`). So were the renamed fallback pin (`expected [] to deeply equal [ 'crm_account', … ]`, metadata read first) and the objectstack-ai#35655 extension roll-up pin (`expected [ 'name', 'total', 'ext_refunds' ] to not include 'ext_refunds'`, because the union is gone). The throwing-schema CONTROL stayed green. - `os dev` on that build: the raw names in the table above. - Restore: `git checkout HEAD -- ABS_PATH` in a trap. Blob after restore fdbca4a equals the HEAD blob, `git diff HEAD` is empty, and `git status --porcelain -- packages/` is empty. After a rebuild, the `--absent` dist reading passed. The tree reading reported only the uncommitted `os dev` fixture (since deleted). Green again: `Tests 22 passed (22)`, and `os dev` stored the ids. The pins were later moved from a new file into `seed-loader-engine-schema-fallback.test.ts` unchanged (see Acceptance notes). `seed-loader.ts` did not change after the ablation. </details> <details> <summary>Suite and gate readings</summary> - `pnpm --filter @objectstack/metadata-protocol test` at e3d3340: `Test Files 363 passed | 9 skipped (372)`, `Tests 23325 passed | 45 skipped (23370)`. `typecheck`: VERDICT command-exit 0. At the head (dd69776, a test-file move only), the two edited test files read `Tests 22 passed (22)` and `typecheck` exits 0. - `dispatch-gates.mjs --commands` derived 67 families, and the list is identical at the head. All 67 ran locally, with each exit captured before any pipe: - 65 exited 0. - `check:engine-double-contract` exited 1 at e3d3340 (RETAINED: the new file's pinned double was not in the pinned ledger). The pins moved onto the file's already-pinned double, and the gate exits 0 at dd69776. - `check:dual-build-cjs-loads` exited 3 (PREREQUISITE NOT MET: no local `dist/` for packages outside this diff). NOT MEASURED locally; CI runs it. - `--ran` reconciliation: "67 derived, 67 run, 0 NOT-MEASURED, 0 UNRUN", exit 0. - `overlap-check` at dd69776: VERDICT clean, exit 0. </details> ## Acceptance notes - **The pins live in an existing file.** The dispatch asked for a new file named after the card, unless `check:engine-double-contract` refused a new engine double. The gate asked for its pinned ledger to be regenerated (`--write`), and that ledger write was refused in this session. So the pins were folded into `seed-loader-engine-schema-fallback.test.ts`, whose engine double is already pinned and is the same double the new file had copied. - **The test harness boot does not reproduce the defect.** It was measured: a dogfood test booting `bootStack` from `@objectstack/verify` with `MetadataPlugin({ artifactSource })` over the same two-package artifact read the extension field absent from `metadata.getObject('qa_ext_order')` and present in `getSchema`. Yet it stored the quote's id on BOTH legs of the ablation, so it could not pin this defect, and it is not committed. Only the real `os dev` boot showed the raw key. Why the harness's seed load sees a different definition was not established. This is reported as a finding, not fixed here. Carried by objectstack-ai#36274. - Rows an earlier load stored with the raw key are not rewritten. Re-running the seed in `update` or `upsert` mode replaces the key with the id (the replay compare sees a difference). The changeset says so. - The basic-insert fallback seeder in `packages/runtime/src/app-plugin.ts` (no metadata service, or the loader threw) does not go through this resolver, as objectstack-ai#36118's notes already record. ## Verification Two-minute check: `pnpm --filter @objectstack/metadata-protocol exec vitest run --maxWorkers=2 src/seed-loader-engine-schema-fallback.test.ts`. Expect `Tests 8 passed`, including five `[objectstack-ai#35254]` cases. Read first, by risk: 1. `packages/metadata-protocol/src/seed-loader.ts`, the `resolveObjectDefinition` hunk: the order flip that every per-field read inherits. 2. The same file, the `summaryFields` hunk in `loadDataset`: objectstack-ai#36118's union collapsed onto the single source. 3. `packages/metadata-protocol/src/seed-loader-engine-schema-fallback.test.ts`: the probe assertion of the renamed fallback pin, and the new `[objectstack-ai#35254]` block. --- _Generated by [Claude Code](https://claude.ai/code/session_01FEkQ5miLqNucRZevceHwNh)_ <!-- signed: repo:objectstack#4 · os-project-manager · session_01FEkQ5miLqNucRZevceHwNh --> --------- Co-authored-by: Claude <noreply@anthropic.com>
Fixes #35655
Clause-②: no (narrowing)
Metadata-protocol: narrowed
Skills-docs: follow-up #36122
维护者速读
What changes
A seed never stores a value a seed record supplies for a roll-up (
summary) field, on insert or on update. This follows maintainer ruling D as analysed in 7062334196, with the seat's correction 7064615114. The roll-up is computed from the child rows. The drop is reported by one warn notice per dataset, which is the whole report: no load-result key is added. The change is in the loader only:packages/objectql/src/engine.tsis not touched.packages/metadata-protocol/src/seed-loader.tssummaryFieldNames(definition)returns every field a definition declarestype: 'summary', whatever its aggregate and whether or not it isreadonly. It keys ontype === 'summary'literally, as the engine's roll-up readers do.loadDataset, the roll-up fields are the union ofsummaryFieldNamesover the resolved definition AND over the engine's merged schema (engine.getSchema, read through the new privateengineSchemaOf, whichresolveObjectDefinitionnow shares). The metadata service's copy winsresolveObjectDefinitionwhenever it hasfields, and that copy carries no object extension, so a roll-up an extension contributes is read from the engine's schema (contract review S1b). An engine without a schema registry, or whose read throws, leaves the resolved definition the only source.initializeSummaryFields), and the child inserts compute it, as before.warnper dataset names the object, the fields and how many values were dropped ({ object, fields, droppedValues }). A suppliednullcounts as a value. A dry run (validate) logs the same notice.successanderroreddo not move. One row counter does: on a replay (upsertorupdate), a matched row whose only difference from the seed record was a roll-up value is now countedskipped, with nothing written. It used to be countedupdated.packages/spec/src/migrations/entries/semantic/18.seed-summary-value-not-stored.ts: the ADR-0087 semantic entry for the narrowing. No tombstone and no D2 conversion, because no key is added or removed and no rewrite is mechanical. It names the manual repair for a parent with no child rows that an earlier load stored a total on (review nit n3): insert a child row under it and delete that row again..changeset/35655-seed-summary-value-not-stored.md:@objectstack/specand@objectstack/metadata-protocolatminor, with a BREAKING banner,adr-0087: registered seed-summary-value-not-stored, FROM → TO, the compatibility note for seed authors, and the same manual repair (n3).content/docs/data-modeling/fields.mdx: the sentence "seed data, package installs and a historical import … keep a pre-computed total" is rewritten to the ruled behaviour. The historical import (treatAsHistorical: true) keeps its sentence, because it is a separate door. The degraded path is named (review S2): when the runtime has no metadata service, or the seed loader throws, it falls back to a basic insert of the seed records, and that fallback still stores a supplied summary value. Ruling D keeps the change loader-only.content/docs/protocol/objectql/security.mdx(review S1a): Rule 1's sentence no longer says seed data and package installs write a roll-up from a system context. It names the roll-up's own recompute and a historical import, and says the seed loader takes a seed record's value out before the write.Comment-only edits in objectql, to text this change made false:
summaryFieldsLockedOnWritedocblock inengine-top-level.ts;summarynote invalidation/rule-validator.ts;engine-summary-update-lock.test.ts.They no longer say a seed load keeps a pre-computed total. The engine behaviour they describe (an
isSystemwrite keeps its value) is unchanged, and so is the test's assertion.Stale test comments (review nit n1):
packages/objectql/src/summary-rollup.test.ts(the comment above, and the name of, the "system writer supplied on insert" case no longer list seed loads) andpackages/spec/src/data/field-autonumber-readonly.test.ts(thesummarynote no longer says a caller may seed one). Assertions unchanged.packages/metadata-protocol/src/seed-loader-engine-schema-fallback.test.ts: the "prefers the metadata service definition" pin asserted that the engine is never probed for a seeded object. The S1b union probes it once per seeded object, for the roll-up strip alone, so the pin now asserts exactly that probe list. Its claim stands: the engine double registers no schema, so the resolved references prove the metadata definition was used.Package installs go through the same loader:
packages/runtime/src/domains/packages.tsapplies a package's seeds withnew SeedLoaderService(...);packages/metadata-protocol/src/protocol-publish-batch.ts;packages/runtime/src/app-plugin.ts.The only seed path outside the loader is the runtime's basic-insert fallback (see above and the Acceptance notes).
No existing pin asserted that a seed load keeps a roll-up value.
engine-summary-update-lock.test.ts"an isSystem create keeps its value" pins the engine'sisSystemexemption, which this PR does not change.Tests
Pins. Each asserts the stored rows or the engine's calls, plus the warn notice. None reads a count key.
packages/objectql/src/seed-summary-never-stored.test.ts, on the real ObjectQL engine and the realSeedLoaderService. The parent has asum, acountand areadonlymaxroll-up, seeded with 999 / 99 / 500, over lines of 10 and 32.{ object: 'ss_inv', fields: [line_total, line_count, line_max], droppedValues: 3 }.skipped, inupsertand inupdatemode.registerObject(..., 'extend'), engine-fallback rung) is dropped like the base object's own.packages/metadata-protocol/src/seed-loader-summary-stale.test.ts, on the file's existing engine double:a seed never hands the engine a roll-up value: noinsertorupdatepayload carries a roll-up key; a suppliednullcounts; a roll-up-only difference writes nothing; another change is written without the roll-up;validategives the notice and writes nothing; acurrencyCONTROL is written as authored with no notice.a roll-up an object extension contributes is never seeded either: the metadata double's copy lacks the extension's roll-up and the engine double'sgetSchemahas it. Neither roll-up reaches the engine, and the one notice reads{ object: 'ext_invoice', fields: ['paid', 'ext_refunds'], droppedValues: 2 }. CONTROL: an engine whosegetSchemathrows leaves the metadata copy the only source; its roll-up is still dropped, andext_refunds(declared a roll-up nowhere) is written as authored.Ablation of the S1b union (this round, head e6b5e1a)
The metadata-protocol pins import
./seed-loader.jsfrom source, so no rebuild is involved.node scripts/ablation-replace.mjs --file packages/metadata-protocol/src/seed-loader.ts --anchor ' ...summaryFieldNames(this.engineSchemaOf(objectName)),' --delete -- …:Tests 2 failed | 15 passed (17), VERDICT command-exit 1. Red: the extension pin (expected [ 'name', 'total', 'ext_refunds' ] to not include 'ext_refunds') and the engine-schema-fallback probe pin (expected [] to deeply equal [ 'crm_account', 'crm_contact', … ]). The throwing-schema CONTROL stayed green.git diff HEADempty,git status --porcelainempty.Tests 17 passed (17), VERDICT command-exit 0.Round 2's ablation of the strip loop itself (objectql 6 red / 1 green control, metadata-protocol 4 red / 8 green, restore proven) is recorded in dev report 7065542104.
Suite readings (this round)
@objectstack/metadata-protocoltypecheck: VERDICT command-exit 0 (at e6b5e1a).@objectstack/metadata-protocoltest at 9737321:Test Files 1 failed | 362 passed | 9 skipped (372),Tests 1 failed | 23311 passed | 45 skipped (23357). The one red was the engine-schema-fallback probe pin the S1b union made false; it is updated in c4dc426. At e6b5e1a the two changed files readTest Files 2 passed (2),Tests 17 passed (17); no source file changed after 9737321.summary-rollup.test.ts+seed-summary-never-stored.test.tsTests 133 passed (133); specfield-autonumber-readonly.test.tsTests 8 passed (8).Dogfood battery at the final head
e6b5e1af11:pnpm --filter @objectstack/dogfood test(no shard, no path) under the verify lock, on the closure built at 9737321 (pnpm --workspace-concurrency=2 --filter '@objectstack/dogfood^...' --filter '@objectstack/metadata-protocol' build, VERDICT command-exit 0). Every commit after 9737321 changes test files only, so that build is the head's source.Test Files 483 passed | 3 skipped (486)Tests 4101 passed | 68 skipped (4169)os-verify-lock: VERDICT command-exit 0 · held the lock 2099sGates at the final head
e6b5e1af11:dispatch-gates.mjs --commandsderives 123 families; the list is identical at c4dc426.Gate readings
--ranreconciliation: "123 derived, 123 run, 0 NOT-MEASURED, 0 UNRUN", exit 0.check-adr-0087-registration:[BREAKING+bang+clause-②-narrowing+metadata-protocol-narrowed] registered seed-summary-value-not-stored.check:engine-double-contractexited 1 on the extension pin's new engine double in a new file (ledger RETAINED rows). The pin moved intoseed-loader-summary-stale.test.tson that file's already-pinned double (e6b5e1a), and the gate exits 0.check:skill-examplesandcheck:dual-build-cjs-loadsexited 3 (PREREQUISITE NOT MET, no localdist/for packages outside this diff); after building those packages both exit 0.check:dev-prereqsexit 1: 35 of 108 workspace packages unbuilt in this container (mostlyui/), not this diff.overlap-checkbefore each of the three pushes this round: VERDICT clean, exit 0. Noorigin/mainmerge this round (no conflict, CI green).Lint & Repo Gates,TypeScript Type Check,Test Core(all 10 shards),Build Core,Governed Surface Queue Guard,Type Check UI,Test UI,Build & E2E UI,Live E2E UI,Dogfood Regression GateandCheck Changesetread success;Lint UIand the sharded dogfood matrix read skipped.Acceptance notes
packages/runtime/src/app-plugin.ts, the twoql.insertloops under "basic insert fallback") writes seed records with a plainql.insert. It runs only when no metadata service is present (logged at debug) or the loader throws (logged at warn). Ruling D routes the change through the loader only, so on that path a roll-up value still reaches the engine.fields.mdxand the changeset now both say so.os migrate summary-nullsbackfills onlyNULLcolumns, so the changeset and the migration entry name the manual repair.externalIdnaming a roll-up) would now see that key blank, and the record would be refused as a blank-key record. No such seed exists in the tree, and a roll-up is not a natural key.skills/objectstack-data/references/seeds.md:146-147) gives the right instruction ("Never seed the roll-up"), but its reason ("stored as written") is now out of date. Follow-up Data skill seeds.md still says a seeded roll-up value is stored as written #36122.Verification
Read first, in order of risk:
packages/metadata-protocol/src/seed-loader.ts: thesummaryFieldsunion inloadDatasetand the strip loop right afterconst record = { ...(seedResult.value ...) }. The strip must run before every read of the record.packages/objectql/src/seed-summary-never-stored.test.ts: cases 3, 4 and 6..changeset/35655-seed-summary-value-not-stored.md: the FROM → TO, the row-counter sentence, the compatibility note and the manual repair.Two-minute check:
pnpm --filter @objectstack/metadata-protocol exec vitest run --maxWorkers=2 src/seed-loader-summary-stale.test.ts. ExpectTests 14 passed (14); the extension case's notice namespaidandext_refunds.Generated by Claude Code