Skip to content

Commit 8651eff

Browse files
committed
test(objectql): pin the scoped-metadata governance fixture, and record its engine double
The fixture composes a SCOPED `metadata` service on a real ObjectKernel and asserts the audit REPORTS that scope's declarations — the acceptance bar the card names. Ablation (restore the synchronous read): 3 of its 5 cases go red. `scripts/engine-double-contract.pinned.json` learns the file's `findOne` double, written by `check-engine-double-contract --write` as the gate prescribed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ADLdAs2pVcH17h9tZKWMBg
1 parent bdf6bc8 commit 8651eff

2 files changed

Lines changed: 27 additions & 0 deletions

File tree

.changeset/eighty-poems-visit.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
'@objectstack/objectql': patch
3+
---
4+
5+
The boot-time action-governance audit now reaches a SCOPED `metadata` service.
6+
7+
`ObjectQLPlugin.runGovernanceInventory` acquired its metadata plane with
8+
`ctx.getService('metadata')`, which reads only the two synchronous service maps.
9+
A composition that registers `metadata` with `ServiceLifecycle.SCOPED` mints its
10+
instances into `PluginLoader.scopedServices` instead, so the call threw
11+
`Service 'metadata' is async - use await` before `loadMany`, `loadManyKeyed`,
12+
`loadDiagnosed` or `load` could run, the plugin swallowed the throw into "no
13+
metadata plane at all", and the ADR-0110 D5 inventory reported that scope's
14+
`action` declarations as absent — silently, because an empty declaration set is
15+
indistinguishable from a plane that holds nothing. On such a kernel a handler the
16+
router dispatches was reported as "registered handler with NO declaration …
17+
REFUSED at dispatch".
18+
19+
The plane is now resolved in the router's own order — `getServiceScoped('metadata',
20+
environmentId)` first, then the synchronous lookup — so the audit holds the same
21+
instance `HttpDispatcher.resolveService` hands the router. Statically registered
22+
planes (every shipped composition today) resolve to the same object as before.

scripts/engine-double-contract.pinned.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1871,6 +1871,11 @@
18711871
"verb": "update",
18721872
"pinned": 1
18731873
},
1874+
{
1875+
"file": "packages/objectql/src/plugin-governance-scoped-metadata.test.ts",
1876+
"verb": "findOne",
1877+
"pinned": 1
1878+
},
18741879
{
18751880
"file": "packages/objectql/src/protocol-boot-hydration-scoped.test.ts",
18761881
"verb": "findOne",

0 commit comments

Comments
 (0)