Skip to content

Commit b1c2043

Browse files
committed
test(metadata): the residual mirror reading drops datasets; collection-maps waiver row loses datasets
Claude-Session: https://claude.ai/code/session_01JQwxbaRjbDqdsjbNUjKQJZ Co-authored-by: Claude <noreply@anthropic.com>
1 parent 04a25ce commit b1c2043

3 files changed

Lines changed: 31 additions & 10 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
'@objectstack/metadata': patch
3+
---
4+
5+
fix(metadata): a `packages[]` stack's top-level dataset that no package body declares is registered under the stack's own manifest id, like every other residual item
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
A stack that carries `packages[]` registers each package body under its own id, and what its top level carries that no body declares (the residual, ADR-0130 D4) under the stack's `manifest.id`. The residual rule did not walk `datasets` (the ADR-0021 analytics datasets a dashboard or report names), so such a dataset was neither registered nor refused: the boot succeeded, `GET /meta/dataset` listed only the bodies' datasets, and a dashboard or report naming the missing one failed at run time, far from the cause.
11+
12+
- **What changes.** `datasets` now maps to the `dataset` metadata type at the artifact door. A residual dataset is registered under the stack's manifest id and version through both boot doors, in the metadata service and in the ObjectQL registry, and the boot's residual `warn` line counts it with the other residual items. A top-level dataset that a body repeats stays the body's, registered once.
13+
- **What else the artifact door now registers.** Every package body's datasets also reach the metadata service from a compiled artifact, stamped with their package's provenance. A sealed (`bootstrap: 'artifact-only'`) runtime used to answer an empty `GET /meta/dataset` for a package that ships datasets; it now lists them. The seed `data:` collection is unchanged and still never registered as metadata items.

‎packages/metadata/src/owner-stamp-residual-build-boot.test.ts‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,12 @@ describe('[ADR-0010 · ADR-0130 D4] a residual\'s foreign stamp: refused at the
172172
expect(await bootRefusesStamp(stack), `${key}: the metadata door refuses what it lists`).toBe(listed);
173173
if (!listed) notResidual.push(key);
174174
}
175-
// The reading, so the equality above is not vacuous: the three
176-
// collections the boot reads off the stack whole, never as items.
177-
expect(notResidual.sort()).toEqual(['data', 'datasets', 'jobs']);
175+
// The reading, so the equality above is not vacuous: the two judged
176+
// collections the residual rule does not walk. Seed `data` is applied
177+
// by the seed loader and `jobs` are scheduled, both straight off the
178+
// stack, never registered as items. `datasets` left this list when the
179+
// rule began registering a residual dataset under the stack's id.
180+
expect(notResidual.sort()).toEqual(['data', 'jobs']);
178181
});
179182
});
180183

‎scripts/check-stack-collection-maps.mjs‎

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -661,17 +661,22 @@ const SITES = [
661661
},
662662
{
663663
direction: 'missing',
664-
keys: ['datasets', 'jobs', 'datasources', 'translations'],
664+
keys: ['jobs', 'datasources', 'translations'],
665665
reason:
666-
'DRIFT with a real, bounded consequence — #6242 row 4(b). All four are consumed '
666+
'DRIFT with a real, bounded consequence — #6242 row 4(b). All three are consumed '
667667
+ 'functionally by AppPlugin straight off the bundle, so boot is not broken; what they never do is '
668668
+ 'register as METADATA ITEMS, so under `bootstrap: \'artifact-only\'` (edge / serverless / '
669-
+ 'immutable image) `GET /meta/job`, `/meta/translation`, `/meta/datasource` and `/meta/dataset` '
670-
+ 'answer empty for a package that ships them. Adding them changes what a sealed runtime serves '
671-
+ 'and must be measured on a real artifact-only boot first — the filing card says so, and this '
672-
+ 'gate does not smuggle it in. `capabilities` was the FIFTH key on this row and left it at '
669+
+ 'immutable image) `GET /meta/job`, `/meta/translation` and `/meta/datasource` answer empty for '
670+
+ 'a package that ships them. Adding them changes what a sealed runtime serves and must be '
671+
+ 'measured on a real artifact-only boot first — the filing card says so, and this gate does not '
672+
+ 'smuggle it in. `datasets` left this row when the residual rule began walking it: it was never '
673+
+ 'the same fact, since AppPlugin reads no dataset off the bundle (the ObjectQL registry takes a '
674+
+ 'package body\'s datasets through its own collection loop), and with no entry here a '
675+
+ '`packages[]` stack\'s top-level dataset that no body declared was neither registered nor '
676+
+ 'refused. Measured on an artifact boot before the entry landed. `capabilities` was the FIFTH key '
677+
+ 'on this row and left it at '
673678
+ '#12892 step 1 (maintainer ruling, option 1: the door owns the registration route for the five '
674-
+ 'security collections). It was never the same fact as the other four: AppPlugin registers it as '
679+
+ 'security collections). It was never the same fact as the other three: AppPlugin registers it as '
675680
+ 'a METADATA ITEM through `registerInMemory`, so `GET /meta/capability` was already non-empty on '
676681
+ 'an artifact-only boot — what was missing from that answer was the strict-parsed shape, the '
677682
+ '`scope` default and the ADR-0010 provenance stamp. Driven on a real artifact-only boot before '

0 commit comments

Comments
 (0)