Skip to content

Commit 3aaa463

Browse files
committed
chore(changeset): patch for the engine's fixedReadLeafClassOf and its analytics wiring
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibwJEh7hMPPvagWM1g7
1 parent 7efe67f commit 3aaa463

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
'@objectstack/spec': patch
3+
'@objectstack/objectql': patch
4+
'@objectstack/service-analytics': patch
5+
---
6+
7+
feat: the analytics plugin asks the engine which share-grant scopes its native SQL path may compile (ADR-0155 D4)
8+
9+
Clause-②: yes
10+
Metadata-protocol: none
11+
12+
- **New optional contract member** (`@objectstack/spec`). `IObjectQLEngine.fixedReadLeafClassOf(leaf)` answers which of ADR-0155 D4's two classes a `SharedRecordIds` leaf falls in on an engine: `'other-datasource'` (the leaf's object is bound to another datasource than `sys_record_share`) or `'registration-by-name'` (a middleware or a `beforeFind` / `afterFind` hook is registered for `sys_record_share` by name), with what names it. It answers `undefined` when neither class applies. The answer type is the new `EngineFixedReadLeafClass`. The member is optional: a caller probes `typeof engine.fixedReadLeafClassOf === 'function'` and treats an engine without it as one that cannot say.
13+
- **The engine implements it** (`@objectstack/objectql`). `ObjectQL.fixedReadLeafClassOf` returns the seam's own recognition, `fixedReadLeafClassOfEngine(engine, leaf)`. It reads only datasource bindings, middlewares and hooks. It calls no driver and logs nothing.
14+
- **The analytics plugin wires it** (`@objectstack/service-analytics`). `AnalyticsServicePlugin` now fills `AnalyticsServiceConfig.fixedReadLeafClassOf` from the `"data"` engine on each call. When the engine answers neither class, the native SQL path compiles a read scope that carries the leaf. When the engine names a class, or the engine has no such member, the query goes to the ObjectQL engine path, as before. An engine without the member is reported once at `warn`. Neither class is restated in analytics.
15+
16+
Nothing a metadata author writes changes. On a host that runs `ObjectQLPlugin`'s engine as `"data"`, a sharing-scoped analytics query outside both classes keeps the native SQL path once the producer starts writing the leaf (ADR-0155 step 6).

0 commit comments

Comments
 (0)