Skip to content

Commit b8562ff

Browse files
os-muskclaude
andauthored
docs(objectql): correct MetadataFacade's class docblock — it is not the installed 'metadata' kernel service (#14525)
* docs(objectql): correct MetadataFacade's class docblock to match the file's own true statement The class docblock claimed the facade is "Registered as the 'metadata' kernel service"; sixty lines later, registerObjectBothPlaces' header states the opposite and is the true one. Re-measured on this tree: the only non-test ctx.registerService('metadata', ...) site registers MetadataPlugin's manager, the kernel's core-fallback pre-injection registers createMemoryMetadata, and new MetadataFacade(...) appears nowhere outside tests. Rewrite the class docblock to say what the class is (an injectable IMetadataService over a SchemaRegistry, exported for downstream hosts) and what it is not (installed into the 'metadata' slot by anything here), and bind the two statements so the next reader cannot pick the wrong one. Prose only; no registration and no behaviour change. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0112hMx9hjJ9BgB28X97DS68 * chore(changeset): patch changeset for the MetadataFacade docblock correction The class docblock reaches the published declaration chunk that dist/index.d.ts and dist/core.d.ts re-export MetadataFacade from, so the correction is a reader-visible change in the published package. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0112hMx9hjJ9BgB28X97DS68 --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 2f2a0b2 commit b8562ff

2 files changed

Lines changed: 41 additions & 5 deletions

File tree

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
"@objectstack/objectql": patch
3+
---
4+
5+
docs(objectql): correct `MetadataFacade`'s class docblock — it is not the installed `'metadata'` kernel service (#14019)
6+
7+
The class docblock claimed `MetadataFacade` is "Registered as the 'metadata'
8+
kernel service". Sixty lines down the same file, `registerObjectBothPlaces`'
9+
header states the opposite — nothing installs a `MetadataFacade` into that
10+
slot — and the second statement is the true one. This docblock ships to
11+
consumers inside the package's declaration files, so the false half was
12+
readable from an editor's hover on an imported `MetadataFacade`.
13+
14+
Re-measured on the current tree: the only non-test `registerService('metadata',
15+
…)` site registers `MetadataPlugin`'s own manager; the kernel's core-fallback
16+
pre-injection registers `createMemoryMetadata`; and `new MetadataFacade(...)`
17+
appears nowhere outside tests.
18+
19+
The docblock now says what the class is — an injectable `IMetadataService` over
20+
a `SchemaRegistry`, exported from this package's root and `core` entrypoints
21+
for a downstream host that chooses to install it — and what it is not, in the
22+
same voice as the header that already said so. Prose only: no registration, no
23+
behaviour change, no API change.

packages/objectql/src/metadata-facade.ts

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,25 @@ function toKeyedDefinition(type: string, name: string, data: unknown): any {
6666
/**
6767
* MetadataFacade
6868
*
69-
* Provides a clean, injectable interface over SchemaRegistry.
70-
* Registered as the 'metadata' kernel service to eliminate
71-
* downstream packages needing to manually wrap SchemaRegistry.
69+
* A clean, injectable `IMetadataService` over a `SchemaRegistry`, so a host
70+
* does not have to wrap `SchemaRegistry` by hand. Implements the async
71+
* `IMetadataService` interface (`@objectstack/spec/contracts`) by delegating
72+
* to `SchemaRegistry` (in-memory) with Promise wrappers.
7273
*
73-
* Implements the async IMetadataService interface.
74-
* Internally delegates to SchemaRegistry (in-memory) with Promise wrappers.
74+
* ⛔ **Nothing in this repository installs a `MetadataFacade` into the
75+
* `'metadata'` kernel slot — this class is not that service.** In-tree the
76+
* slot is filled by `MetadataPlugin`'s own manager
77+
* (`ctx.registerService('metadata', this.manager)`, `@objectstack/metadata`)
78+
* or, when no plugin provides one, by the kernel's core fallback
79+
* `createMemoryMetadata` (`CORE_FALLBACK_FACTORIES.metadata`,
80+
* `@objectstack/core`). This class exists for DOWNSTREAM hosts: it is
81+
* exported from this package's root and `core` entrypoints, and a host that
82+
* wants a `SchemaRegistry`-backed metadata service installs it itself. An
83+
* earlier revision of this docblock asserted the opposite; that sentence, not
84+
* any code, is the likely source of #13331's premise.
85+
* {@link registerObjectBothPlaces}'s header states the same fact with the
86+
* fuller account of what being uninstalled in-tree costs — the two are meant
87+
* to be read as one voice, so change both or neither.
7588
*
7689
* Each facade is bound to a specific SchemaRegistry instance — passed in the
7790
* constructor — so that multi-kernel servers can give every kernel its own

0 commit comments

Comments
 (0)