Skip to content

Commit f16fcd0

Browse files
committed
docs(objectql): the claims comments read true with positions in the engine's collection loop
With positions registered by ObjectQL.registerApp's collection loop (now on main), three comments this change added said the loop never registers them. The claims doc and the installPackage comment now say what the claims are for on either tree: installPackage itself registers no items, so the claim is how the package door remembers every declared name. The declared-names reader's note and the runtime pin's header no longer say positions reach no engine slot. Comments only; no behaviour change. Claude-Session: https://claude.ai/code/session_01EUBvqtauTDmHi2ZgY759p2 Co-authored-by: Claude <noreply@anthropic.com>
1 parent b5335b4 commit f16fcd0

3 files changed

Lines changed: 16 additions & 14 deletions

File tree

‎packages/objectql/src/registry.ts‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2254,13 +2254,13 @@ export class SchemaRegistry {
22542254
* {@link refuseSecurityCatalogNameConflicts}, forgotten by
22552255
* {@link uninstallPackage}.
22562256
*
2257-
* The registry's item store answers "who holds this name?" for every item it
2258-
* registered — but it does not register every catalog item a package
2259-
* declares: the engine's collection loop has no `positions` entry, so a
2260-
* package's positions reach only the metadata service's in-memory registrars
2261-
* (`AppPlugin`'s security block, the artifact door). The claim is how the
2262-
* package door remembers them, so a second package declaring one of them is
2263-
* refused like any other second holder.
2257+
* The registry's item store answers who holds a name only for items
2258+
* something registered into it, and `installPackage` registers none: a
2259+
* package's collections reach the item store through `ObjectQL.registerApp`'s
2260+
* collection loop (positions only where that loop carries them), never
2261+
* through a bare `installPackage`. The claim is how the package door
2262+
* remembers every name a package declared, so a second package declaring one
2263+
* of them is refused like any other second holder.
22642264
*/
22652265
private securityCatalogClaims = new Map<SecurityCatalogType, Map<string, string>>();
22662266

@@ -4653,8 +4653,8 @@ export class SchemaRegistry {
46534653
this.debug(`[Registry] Overwriting package: ${manifest.id}`);
46544654
}
46554655
collection.set(manifest.id, pkg);
4656-
// The names this package now holds — positions included, which the
4657-
// engine's collection loop never registers (see `securityCatalogClaims`).
4656+
// The names this package now holds, recorded whether or not an item store
4657+
// entry will carry them (see `securityCatalogClaims`).
46584658
if (selfId !== undefined) this.recordSecurityCatalogClaims(selfId, manifest);
46594659
this.log(`[Registry] Installed package: ${manifest.id} (${manifest.name})`);
46604660
return pkg;

‎packages/objectql/src/security-catalog-namespace.ts‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,11 @@ function itemName(item: unknown): string | undefined {
135135
* nested `plugins[]` entry's (a nested plugin contributes under its parent
136136
* package — `ObjectQL.registerPlugin`), one level deep, arrays only.
137137
*
138-
* `positions` is read although the engine's collection loop does not register
139-
* it: the in-memory registrars (`AppPlugin`'s security block, the artifact
140-
* door) do, for the very same package, so the package's claim covers it.
138+
* `positions` is read like the other two collections. The engine's collection
139+
* loop registers a package's positions under the package
140+
* (`ObjectQL.registerApp`), and the in-memory registrars (`AppPlugin`'s
141+
* security block, the artifact door) register them for the very same package;
142+
* the package's claim covers them either way.
141143
*
142144
* ⚠️ A non-array `permissions` is skipped, not misread: at the manifest stage
143145
* that key is the ADR-0025 capability GRANT (`{ services, hooks, … }`), not a

‎packages/runtime/src/standalone-stack-security-catalog-one-holder.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
//
88
// ## Why the refusal is asserted at the boot, not inside the in-memory registrars
99
//
10-
// Positions reach no engine registry slot: `AppPlugin`'s security block
10+
// Positions also reach the metadata service: `AppPlugin`'s security block
1111
// (`registerInMemory`, the `'app-plugin'` registrar) and the artifact door
1212
// (`MetadataPlugin._registerArtifactBodyCollections`, the `'artifact-door'`
13-
// registrar) write them to the metadata service, in `start()`. But neither runs
13+
// registrar) write them there, in `start()`. But neither runs
1414
// for a package the engine has not installed first: `AppPlugin.init()` registers
1515
// every package of the bundle through the `manifest` service in Phase 1 — a
1616
// multi-package artifact package by package — and the engine's package door

0 commit comments

Comments
 (0)