Skip to content

Commit 5ad41ca

Browse files
committed
docs(spec): TOP_LEVEL_COLLECTIONS_NEVER_RESIDUAL names the readers the tree has
The docblock said top-level datasets are consumed by AppPlugin straight off the bundle. AppPlugin reads no datasets; a package body's datasets are read by the engine's registerApp METADATA_ARRAY_KEYS loop, and nothing reads a top-level datasets item no body declares. Claude-Session: https://claude.ai/code/session_01JQwxbad6xiDCcLYXcBsEa6 Co-authored-by: Claude <noreply@anthropic.com>
1 parent 94d3e25 commit 5ad41ca

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

‎packages/spec/src/stack.zod.ts‎

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -361,11 +361,17 @@ function applyCollectionItemOwnerStampGate(
361361
* The judged collections a `packages[]` stack's TOP LEVEL never files as
362362
* residual items: the boot's residual rule (`unclaimedTopLevel`,
363363
* `@objectstack/metadata`) walks the collections the metadata door registers
364-
* as items (its `ARTIFACT_FIELD_TO_TYPE`), and these three are not among them.
365-
* The boot reads them off the stack whole and judges no stamp on them: seed
366-
* `data` is applied by the seed loader, `jobs` are scheduled and `datasets`
367-
* consumed by `AppPlugin` straight off the bundle. A package BODY's items of
368-
* these collections are still judged, at both doors.
364+
* as items (its `ARTIFACT_FIELD_TO_TYPE`), and these three are not among them,
365+
* so the boot judges no stamp on a top-level item of any of them. Their readers
366+
* differ:
367+
* - seed `data` and `jobs` are read off the stack whole, the top level merged
368+
* with every body (`resolveArtifactCollections`, `@objectstack/runtime`):
369+
* `AppPlugin` hands the seed `data` to the seed loader and schedules the
370+
* `jobs`;
371+
* - `datasets` are read off the package BODIES only, by the engine's
372+
* `registerApp` (its `METADATA_ARRAY_KEYS` loop, `@objectstack/objectql`).
373+
* No boot reader takes a top-level `datasets` item that no body declares.
374+
* A package BODY's items of these collections are still judged, at both doors.
369375
*
370376
* Mirrored, because `@objectstack/spec` cannot import the rule it mirrors; a
371377
* `@objectstack/metadata` test holds the two equal, collection by collection.

0 commit comments

Comments
 (0)