Repository navigation
feat(spec,objectql,service-analytics): IObjectQLEngine.fixedReadLeafClassOf, wired into the analytics native path (ADR-0155 D4) - #35954
Conversation
…lves it at the record, OData refuses it (ADR-0155 step 5) - service-analytics: the native read-scope compiler compiles a placed read-form leaf to its sys_record_share subquery, built from the leaf's fixedInnerReadOf description with every value bound, and refuses any other leaf in D4's envelope (INTERNAL_ERROR / 500, logged once). The native strategy declines a leaf scope unless the host answers fixedReadLeafClassOf with null for each leaf on a known dialect. The engine-bound merges admit the brand, the /analytics/sql echo prints the subquery, and a leaf in a query's where is refused in either spelling. - plugin-security: explain resolves each leaf in the sharing read filter at the judged record, one sys_record_share read per batch, so the published rowFilter is [recordId] in the share arm or leaves it out, and never carries the leaf. - driver-odata: find and count refuse the leaf before any request. - spec: parseFilterAST refuses a leaf in an array-form in / nin with INTERNAL_ERROR / 500 instead of INVALID_FILTER / 400. - objectql: export fixedReadLeafClassOfEngine and driverEvaluatesFixedReadLeaf from the seam module. Claude-Session: https://claude.ai/code/session_01L9qibyXo4gSy8DJPNz4ANz Co-authored-by: Claude <noreply@anthropic.com>
…ord the explainer test's engine double check:logger-receiver-detach read sink.log as a log channel passed as a callback; the field holds a logger object, so it is named logger. check:engine-double-contract asked the ledger to record the findOne double that explain-fixed-read-leaf.test.ts pins. Claude-Session: https://claude.ai/code/session_01L9qibyXo4gSy8DJPNz4ANz Co-authored-by: Claude <noreply@anthropic.com>
…class answer in this release The analytics bullet now says the shipped default: AnalyticsServicePlugin wires no fixedReadLeafClassOf answer, so on every host today the native path declines a scope carrying the leaf and the engine path answers. Claude-Session: https://claude.ai/code/session_01L9qibyXo4gSy8DJPNz4ANz Co-authored-by: Claude <noreply@anthropic.com>
… explainer's wire check pins of their own An ablation of the where guard left the array-form in spelling refused by parseFilterAST, so each spelling is now its own test and names the where face's evaluator. The unbranded array-form 400 and the explainer's no-leaf-on-the-wire check move out of the tests whose earlier assertions failed first under ablation. Claude-Session: https://claude.ai/code/session_01L9qibyXo4gSy8DJPNz4ANz Co-authored-by: Claude <noreply@anthropic.com>
…dmit it in the explainer by role parseFilterAST moved only the shape door's refusal of a condition carrying a fixed-read leaf to D4's envelope. A leaf as an in / nin list member, or as a scalar operator's comparand (!=, > and the rest), passed the shape door and met the type door outside the try: INVALID_FILTER / 400, with a message printing the head of the leaf's JSON. Either door's refusal of such a condition is now INTERNAL_ERROR / 500, naming the leaf and its table only. An unbranded copy keeps 400. The jsdoc and the message no longer claim the leaf is refused in every position (an array-form = is passed on by reference, as before). The explainer admitted a leaf by the key it sat under: any $in under a key named id, at any depth, inside a relation condition or a composed ReadableIds scope too. It now walks roles, as the engine's seam and the analytics compiler do: only an operator map's $in under id, in the explained object's own filter, holds a leaf it resolves; any other leaf is refused in D4's envelope. Pins: spec, a list member and two scalar operators at 500 and their unbranded copies at 400; objectql, both through the engine's find; the explainer, a leaf inside a relation condition and inside a composed scope. Claude-Session: https://claude.ai/code/session_01L9qibyXo4gSy8DJPNz4ANz Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 3 package(s): 3 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 2 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 176 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin a8003f81090313cb468e6de661f173d5f7705fe7 && git checkout a8003f81090313cb468e6de661f173d5f7705fe7
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 523ada4cc0cf4308616249fd3364c630875a9c6e 978b92727c5c37b2618b2dd1c035ff3b3db3532a && git checkout -B drift-repro 523ada4cc0cf4308616249fd3364c630875a9c6e && git merge --no-ff 978b92727c5c37b2618b2dd1c035ff3b3db3532a
node scripts/docs-audit/affected-docs.mjs --json 523ada4cc0cf4308616249fd3364c630875a9c6e
|
…g lands, whichever release that is The clause said the platform's analytics plugin wires no answer "in this release". The wiring is being built now and may ship in the same release, so the clause now states what this change ships (the hook unwired, the native path declining, the engine path answering) and that it holds until the wiring lands. Claude-Session: https://claude.ai/code/session_01L9qibyXo4gSy8DJPNz4ANz Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#7 · os-tesla · session_01L9qibyQBB3KuDoNobNq9LH L1: ACCEPT at
|
|
repo:objectstack#7 · os-tesla · session_01L9qibwJEh7hMPPvagWM1g7 Contract-review-claim: session_01L9qibwJEh7hMPPvagWM1g7 · head 40fdd4e · 2026-11-20T23:07Z The L2 is owed on the |
|
repo:objectstack#7 · os-tesla · session_01L9qibwJEh7hMPPvagWM1g7 Head stays at The mutant. In The edit went through Red: pin (c), member absent ( Restore (the tool's own verification, on disk): After the restore, |
|
repo:objectstack#7 · os-tesla · session_01L9qibwJEh7hMPPvagWM1g7 Contract reviewServed-tier: PR #35954, card #35946, ruling 7051956587 (option A). The PR is stacked: its base is ① Derived judgments
② Semver level
Check-runs on the head, all converged: every run is ③ Boundary flags
SQL push-down (Prime Directive 5): no new id materialisation and no in-app join. The change does the opposite: it lets the share-grant leaf stay one ④ Design judgment
Read against the live tree, the TSDoc holds sentence by sentence:
D4's "restates none" holds: neither class is re-derived in spec or in analytics. Only the answer's type is stated in spec. S1 (should-fix) — the member's "neither" answer is
N1 (nit) — N2 (nit) — the member's TSDoc does not say that it throws on a value that is not a fixed-read leaf (
The pin's three cases cover present-neither, present-class and absent through the plugin's real Implemented-by: VERDICT: PASS |
|
repo:objectstack#7 · os-tesla · session_01L9qibwJEh7hMPPvagWM1g7 The brief handed to the isolated Fable reviewer for the record above, filled from Contract review brief — PR #35954 @
|
…lassOf, wired into the analytics plugin's native-path hook (ADR-0155 D4) Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibwJEh7hMPPvagWM1g7
…af type resolves in one module mode; ceiling 6857 Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibwJEh7hMPPvagWM1g7
…: compiles on a plain engine's neither, declines on a class and on absence Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibwJEh7hMPPvagWM1g7
… analytics wiring Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibwJEh7hMPPvagWM1g7
…dReadLeafClass Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibwJEh7hMPPvagWM1g7
…ll for neither, so the optional call is fail-closed by construction Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibwJEh7hMPPvagWM1g7
99ebe34 to
e117d86
Compare
|
repo:objectstack#7 · os-tesla · session_01L9qibyQBB3KuDoNobNq9LH L1 delta: ACCEPT at
|
|
repo:objectstack#7 · os-tesla · session_01L9qibwJEh7hMPPvagWM1g7 Contract reviewServed-tier: Delta review of PR #35954 (card #35946, ruling 7051956587), after the record at What moved: #35945's head went from ① Derived judgments
② Semver levelUnchanged: Check-runs on this head: all converged; every run is ③ Boundary flags
SQL push-down (Prime Directive 5): no new id materialisation and no in-app join. ④ Design judgmentS1: closed Verified in the tree, not from the report:
Attempts to break the three-state answer, each of which declines:
N1: closed as to the first record's point; the docblock no longer claims equality and says N2: closed. The member's TSDoc names the N3 (nit) — No must-fix, no should-fix.
Pins (lane seat's, read for agreement). (a) now also asserts the live engine answers Implemented-by: VERDICT: PASS |
#35945 merged as a squash, so the stacked base's add of the shared test file met main's add. Main's copy equals the stack base's, so the branch's copy is kept. The PR's own delta is unchanged (patch-id 4593e0103a). Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibwJEh7hMPPvagWM1g7
|
repo:objectstack#7 · os-tesla · session_01L9qibwJEh7hMPPvagWM1g7 Regen-provenance: 7054168410 · Head move at 2026-11-21T00:55Z: a merge-forward of It resolved one add/add conflict, in The PR's own net diff is unchanged. Its patch-id is
The new head is 9 files, +252/−14. |
|
repo:objectstack#7 · os-tesla · session_01L9qibwJEh7hMPPvagWM1g7 Landing: PR #35954 (#35946) at
|
Fixes #35946
Clause-②: yes
Metadata-protocol: none
Stacked on #35945 (ADR-0155 step 5). This pull request's base is
claude/project-thread-thptm0, at74cac04849since the round-1 rebase, so its diff is only this card's change. GitHub retargets it tomainwhen #35945 merges. Round 1 (heade117d86d44) answers the L2 record 7053241461: S1, N1 and N2.维护者速读
What changes
packages/spec/src/contracts/objectql-engine.ts). A new OPTIONAL memberIObjectQLEngine.fixedReadLeafClassOf(leaf), typed(leaf: FixedReadLeaf) => EngineFixedReadLeafClass | null. It is the engine seam's ADR-0155 D4 class recognition for aSharedRecordIdsleaf. It answers'other-datasource'or'registration-by-name'with what names it, andnullwhen neither class applies. It throwsTypeErroron a value that is not a fixed-read leaf (fixedInnerReadOf), and its one consumer reads a throw as a decline. Because "neither" isnulland neverundefined,engine.fixedReadLeafClassOf?.(leaf)carries the consumer's whole three-state answer: a class means decline,nullmeans compile, andundefinedfrom an engine without the member means it cannot say, so decline. The answer typeEngineFixedReadLeafClassrestates objectql'sFixedReadLeafClass. Its docblock saysObjectQL implements IObjectQLEnginechecks one direction only: the seam's answer must be assignable to the contract's type. The header's list of members optional by ruling now names it (ruling 7051956587).packages/objectql/src/engine.ts).ObjectQL.fixedReadLeafClassOf(leaf)is a one-line forward tofixedReadLeafClassAnswerOf(this, leaf).IObjectQLEngineis imported from@objectstack/spec/contractsinstead of through@objectstack/core's re-export, and that import line also namesEngineFixedReadLeafClass. The reason was measured. objectql is CommonJS and core is ESM. Through core, the contract's brandedFixedReadLeafresolved to spec's.d.mtschunk, while engine.ts's own import resolved to the.d.tschunk. The tsup DTS build then failed theimplementscheck with TS2416.packages/objectql/src/fixed-read-leaf-engine-answer.ts.fixedReadLeafClassAnswerOf(engine, leaf)returnsfixedReadLeafClassOfEngine(engine, leaf) ?? null. It is the seam's own recognition, with "neither" spellednull. It lives outside engine.ts because the facade gate allows only a one-line forwarding call there, and?? nullis an operator.fixed-read-leaf-seam.ts, which is feat(service-analytics, plugin-security, driver-odata): compile, resolve at the record, and refuse the SharedRecordIds leaf (ADR-0155 step 5) #35945's file, is untouched.packages/services/service-analytics/src/plugin.ts). It wiresAnalyticsServiceConfig.fixedReadLeafClassOf, which feat(service-analytics, plugin-security, driver-odata): compile, resolve at the record, and refuse the SharedRecordIds leaf (ADR-0155 step 5) #35945 left unwired. It resolves the engine from the"data"service on each call, as it does forhasObjectMiddleware, and returnssvc.fixedReadLeafClassOf?.(leaf)as the engine gave it. This plain optional call is fail-closed by construction. When there is no engine orgetServicethrows, the hook answersundefined. An engine without the member also answersundefined, and the plugin says so once atwarn.NativeSQLStrategydeclines every answer exceptnull, so it also declines a class, a throw, and a member that does not keep the contract (one that answersundefinedfor neither).DataEngineLike'sPicknow includes the member. Neither D4 class is restated in analytics.scripts/facade-delegation-registry.json, the engine.ts row). Before:baseLines 6754 @ 63db7240aa, maxLines 6854, ruling 6897467376. After:baseLines 6853 @ 170ca481f0 (origin/main, measured), maxLines 6857, ruling 7051956587. engine.ts goes from 6853 to 6856 lines, and round 1 added no line to it. The raise is 3, inside the ruled 3–5. fix(objectql)!: a multi-row insert reads a parent's formula fields over the roll-ups its rows move; fold follow-ups #35773 has since merged tomain(+1 net). A merge-tree of this head withorigin/main7de1bad gives engine.ts 6857 lines, which is at the ceiling with 0 left. The row needs no change for that merge.packages/spec/api-surface/contracts.jsonandpackages/spec/export-origins/contracts.json(the new type export)..changeset/35946-fixed-read-leaf-engine-member.md,patchfor@objectstack/spec,@objectstack/objectqland@objectstack/service-analytics. It states the round-1 semantics.Why
Maintainer ruling A on #35946 (comment 7051956587) has analytics ask the engine seam's D4 recognition through an optional
IObjectQLEnginemember, with no new package dependency on objectql. ADR-0155 D4 says the recognition lives once, in the seam, and that the analytics native compiler "restates none". Without the wiring, once step 6 (#33787) starts writing the leaf, every sharing-scoped analytics query would leave native SQL. Round 1 (S1) makes "neither"null, so that an absent member and an answered "neither" can no longer be confused.Tests
The pin is a
describenamed[#35946] AnalyticsServicePlugin asks the data engine's fixedReadLeafClassOf. It sits in the leaf's existing live-SQLite harnessfixed-read-leaf-native-compile.test.ts, because a new pin for a component with a shared harness goes into that file. The"data"engine is a plain object over the live engine's members, so the pin tests the plugin's structural wiring and the engine's own answers.engine.fixedReadLeafClassOf(leaf)isnull. The raw-SQL seam runs once, the statement carriesIN (SELECT "record_id" FROM "sys_record_share", and the rows equal the case set's expected rows.beforeFindhook registered forsys_record_share). The engine answers{ class: 'registration-by-name', table: 'sys_record_share' }. The raw-SQL seam is never called, and the engine's seam refuses withINTERNAL_ERROR/ 500.undefinedinstead of the contract'snull. The raw-SQL seam is never called, the engine path answers the expected rows, and nothing warns.Ablations, round 1, at
99ebe34bbd, all throughscripts/ablation-replace.mjs. The service-analytics vitest config aliases@objectstack/objectqlto its source, so nodist/sits in the path. Every restore was verified as blob == HEAD withgit diff HEADempty. The rebase onto74cac04849touched none of the mutated files, and the pins were re-run green after it.A2 is the ruling's original spelling. On the shipped plain
?.(), pins (c) and (d) prove the wiring fails closed. Round 0's fail-open record (comment 7052875195) used the same mutant against the round-0 code.Package runs, all under
scripts/pm/os-verify-lock.sh:99ebe34bbd, and again ate117d86d44after rebuilding the dependency closure.@objectstack/spec,@objectstack/objectqland@objectstack/service-analyticsexits 0 at99ebe34bbd; service-analytics exits 0 again ate117d86d44.--no-inline-configon the five edited source files exits 0 ate117d86d44.e5dff0f186: service-analytics had 221 of 221 test files pass (5646 tests passed, 345 skipped); objectql had 625 of 625 files and 14183 of 14183 tests pass. They were not re-run in round 1, and CI runs them.Acceptance notes
undefinedand had the plugin probe withtypeofbefore applying?? null. With "neither" nownull, the plainengine.fixedReadLeafClassOf?.(leaf)is the hook's whole answer, and it fails closed with no probe. The ruling's original?? nullsurvives only as ablation A2, which shows it would fail open..changeset/35874-fixed-read-leaf-census-rest.mdhad saidAnalyticsServicePluginwires no answer in this release. feat(service-analytics, plugin-security, driver-odata): compile, resolve at the record, and refuse the SharedRecordIds leaf (ADR-0155 step 5) #35945 reworded that clause at74cac04849("the analytics hook ships unwired until its wiring lands, whichever release that is"). That wording holds whichever release this pull request lands in.FixedReadLeafClassand spec'sEngineFixedReadLeafClassare separate declarations, checked in one direction byimplements(N1). Aliasing the objectql type to the spec one would remove the second declaration. That edit is infixed-read-leaf-seam.ts, which is feat(service-analytics, plugin-security, driver-odata): compile, resolve at the record, and refuse the SharedRecordIds leaf (ADR-0155 step 5) #35945's file.content/docs/kernel/contracts/data-engine.mdxdoes not listIObjectQLEngine's members one by one; its only reference isIObjectQLEngine.transaction(cb). So no member line was added there.Verification
Files to read first, by risk:
packages/services/service-analytics/src/plugin.ts: thefixedReadLeafClassOfbridge, a plain optional call that must stay fail-closed.packages/objectql/src/fixed-read-leaf-engine-answer.tstogether with the member inpackages/spec/src/contracts/objectql-engine.ts: thenullfor "neither".scripts/facade-delegation-registry.json: the engine.ts ceiling row.Two-minute check: run
pnpm --filter @objectstack/service-analytics exec vitest run --maxWorkers=2 src/__tests__/fixed-read-leaf-native-compile.test.ts -t 35946and expect 4 passed.Local gates at
99ebe34bbd, each exiting 0:check:facade-delegation-only(engine.ts 6856 of 6857),check:engine-double-contract,check:nul-bytes,check:doc-authoring,check:test-source-alias,check:cross-package-test-inputs,check:adr-anchors,check:issue-citations,check:closed-ceremony-text;check:startup-registry-verdict,check:durability-log-level,check:optional-error-sink,check:logger-receiver-detach,check:undeclared-dep-imports,check:spec-docblock-symbol-anchors,check:scripts-symbol-anchors,check:slot-lookup,check:init-service-contract;check-empty-changeset,check-changeset-no-major,check-adr-0087-registration,check:changeset-gate-self-tests;check:api-surface,check:export-origins,check:dual-source-exports,check:exported-any,check:entry-nameability, andcheck:generated("All 14 generated artifacts are up to date");check:dts-closure,check:published-files, and the docs-auditcheck-drift-commentandcheck-affected-docs.Re-run at
e117d86d44, each exiting 0:check:facade-delegation-only,check:nul-bytes, speccheck:api-surfaceandcheck:export-origins,check:test-source-alias,check:engine-double-contractandcheck-empty-changeset.overlap-check reports VERDICT clean (exit 0) against
74cac04849and againstorigin/main7de1bad. The local runs are a declared narrowing:dispatch-gates --commandsderives 115 families againstorigin/main, including #35945's files, and CI runs the full set.Human Minimum
packages/specholds no runtime logic.pnpm lintpasses.main, one pull request. (Stacked on feat(service-analytics, plugin-security, driver-odata): compile, resolve at the record, and refuse the SharedRecordIds leaf (ADR-0155 step 5) #35945 by the dispatch claim; see Acceptance notes.)packages/spectouched: its generated artifacts are regenerated and committed.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.Generated by Claude Code