Repository navigation
fix(service-analytics)!: a dotted member like vendor.region no longer filters the base field of the same name - #31878
Conversation
…ind the cube's own qualifier One rule (declaredCubeMemberKey) for the door's gates, both strategies' lookupMember and the structured-JSON door: a dotted spelling never names a declared member by its tail alone, and a flattened key answers only when its sql is the same relationship path. Claude-Session: https://claude.ai/code/session_01ADHkmP7cP3t3ncc39aFhhx Co-authored-by: Claude <noreply@anthropic.com>
… declared member on both strategies Claude-Session: https://claude.ai/code/session_01ADHkmP7cP3t3ncc39aFhhx Co-authored-by: Claude <noreply@anthropic.com>
… control Claude-Session: https://claude.ai/code/session_01ADHkmP7cP3t3ncc39aFhhx Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADHkmP7cP3t3ncc39aFhhx Co-authored-by: Claude <noreply@anthropic.com>
…pply Claude-Session: https://claude.ai/code/session_01ADHkmP7cP3t3ncc39aFhhx Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift Check13 anchor(s) derived from 1 changed package(s); no hand-written page names any of them, so this run has nothing to list — not a clean bill of health. This check sees only pages that NAME a derived anchor: one that documents this change in prose, or enumerates it in an authoring dialect, names none and stays invisible to it on every run. What this run could not see
Coarse fallback — 10 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 dac458fa739259c9f2a164e883a2885c83d14f6e && git checkout dac458fa739259c9f2a164e883a2885c83d14f6e
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 3f0e3acea404fe707d6f83f42b97f0d689bd5fdb 93e3a44aa4f4c0116075f7189f57d1eafe709665 && git checkout -B drift-repro 3f0e3acea404fe707d6f83f42b97f0d689bd5fdb && git merge --no-ff 93e3a44aa4f4c0116075f7189f57d1eafe709665
node scripts/docs-audit/affected-docs.mjs --json 3f0e3acea404fe707d6f83f42b97f0d689bd5fdb |
|
domain:server#2 · os-steve · session_01ADHkmQKZzp4DLtqiCkZZRM Contract reviewServed-tier: ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgmentThe narrowing against the published spec on Trying to break it (read in the head, not run):
Findings:
No must-fix, no should-fix. Nits alone end the round. Implemented-by: VERDICT: PASS |
|
domain:server#2 · os-steve · session_01ADHkmQKZzp4DLtqiCkZZRM 维护者速读
席位核对 — ACCEPT · domain:server#2 · Head-sha
|
…ifier in a filter answers what its bare spelling answers (objectstack-ai#31899) <!-- claude-projects-attribution: {"github_login":"os-steve"} --> _Requested by **Steve** · [project thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi95Mj725hLGj2V2T51uRpven)_ Fixes objectstack-ai#31880 Clause-②: no Metadata-protocol: none ## 维护者速读 - **改了什么:** 筛选里写"数据集名.度量"、"对象名.度量"或"立方体名.度量"(如 `orders.total`,`total` 是已声明的度量)时,两种查询策略现在先查已声明的维度、再查已声明的度量,然后才当关联路径处理,与入口校验的读法一致;结果与只写 `total` 完全相同(同一条 SQL、同样的行)。 - **为什么改:** 以前入口校验放行了它,执行时却被编译成以数据集名命名的关联跳转:原生 SQL 报 `DATASET_INVALID`,手写立方体直接 500,引擎策略报跨对象筛选拒绝;只写 `total` 却正常(main 上实测)。 - **风险与回滚:** 只是"原来报错的写法现在给出与简写相同的答案";第一段不是本数据集/对象名的带点写法(如 `vendor.total`)行为不变,有对照测试钉住。回滚即还原本 PR。 - **先看:** `packages/services/service-analytics/src/cube-member-key.ts`(新的 `declaredCubeFilterMember`),然后两个策略里的 `lookupFilterMember` / `lookupCubeFilterMember`。 - **两分钟验证:** `pnpm --filter @objectstack/service-analytics exec vitest run src/__tests__/dotted-dimension-unbacked-join-parity.test.ts`,预期 21 个全过;其中 `[objectstack-ai#31880]` 四条在 main 上有两条红。 - **需要你做的:** 无,席位落地。 ## What changes - `cube-member-key.ts` gains `declaredCubeFilterMember(cube, member)`: the declared member a FILTER spelling names across both bags, dimensions first, then measures (the order `declaredMemberEntry(…, 'any')` already reads them in the where gate). The measure arm answers a bare spelling or a dotted one behind the cube's own qualifier (`CUBE.total`, `OBJECT.total`); a dotted spelling behind any other first segment that names no declared dimension stays a relationship path exactly as objectstack-ai#31878 left it. - Native: `resolveFieldSql` and `resolveStorageTarget` read the filter member through a new `lookupFilterMember` (that helper, else the synthetic traversal). ObjectQL: `resolveCubeFieldName(…, 'any')` and `resolveStorageTarget` read it through the module-level twin `lookupCubeFilterMember`. The dimension-only and measure-only readings are unchanged. - A measure in a filter does what bare `total` does on each strategy today: a row-level predicate on the measure's column (`WHERE amount > ?` native; `where: { amount: { $gt } }` to the engine aggregate). The qualified spelling now produces the byte-identical statement / aggregate call. - Carried nits from objectstack-ai#31878's contract review: (a) ObjectQL `resolveStorageTarget` no longer keeps the `member.split('.').slice(1).join('.')` fallback its native twin dropped: an undeclared member is the member itself on both; (b) the helper module's jsdoc no longer claims to be the rule for every reader: it names the two measure readers that resolve by tail (`resolveMeasureAggregation`'s alias arm, `assertMeasureFields`' qualifier strip) and why `mintableMeasureKey` keeps them unreachable for a dotted non-qualifier spelling; (c) the draft preview face is pinned for `DATASET.total` (it accepts a `runtimeFilter` and answers it exactly as `total`). ## Tests A new top-level `describe('[objectstack-ai#31880] …')` in the existing real-SQLite harness `dotted-dimension-unbacked-join-parity.test.ts` (shared-harness rule), with the engine's `execute` / `aggregate` wrapped so each pin compares what was SENT as well as the rows: 1. `DATASET.total` and `OBJECT.total` in a `runtimeFilter` answer exactly what `total` answers (rows and statement), native and ObjectQL. **RED on main.** 2. A hand-authored cube: `CUBE.total` and `OBJECT.total` in a `where` answer exactly what `total` answers, both strategies. **RED on main.** 3. The draft preview answers `DATASET.total` exactly as `total` (green on main too: the preview already reads members through the gate's lookup; pinned per review nit 4). 4. CONTROL: `vendor.total` (first segment not the cube's own) is still refused `INVALID_FIELD` / 400 "traverses relationship path 'vendor'" on both strategies through a dataset, and refused as a cross-object filter by the engine face on a hand-authored cube. No existing test is edited; objectstack-ai#31878's eight pins run unedited and green. ## Acceptance notes - Measured on `main` `ac8fede8` before writing code (seat ruling 1), filter `{ MEMBER: { $gt: 5 } }`: <details><summary>main ac8fede answers</summary> | face | `total` | `DATASET.total` | `OBJECT.total` | `CUBE.total` (hand-authored) | |:--|:--|:--|:--|:--| | native, dataset | `WHERE amount > ?`, 2 rows | `DATASET_INVALID` / 400 join not backed | `DATASET_INVALID` / 400 join not backed | n/a | | native, cube | `WHERE amount > ?`, 2 rows | n/a | `DATABASE_ERROR` / 500 (self-join) | `DATABASE_ERROR` / 500 (join to a table named for the cube) | | ObjectQL, dataset | `where: { amount: { $gt: 5 } }`, 2 rows | `INVALID_FIELD` / 400 cross-object filter | `INVALID_FILTER` / 400 (engine has no such column) | n/a | | ObjectQL, cube | same, 2 rows | n/a | `INVALID_FILTER` / 400 | `INVALID_FIELD` / 400 cross-object filter | On this branch every qualified cell answers the bare cell's statement and rows byte-for-byte. </details> - The where gate (`declaredMemberEntry(…, 'any')`) is unchanged. For a dotted spelling NOT behind the own qualifier it still reads a flat or verbatim measure key, where the strategies hand that spelling to the traversal tier; per seat ruling 2 that half keeps objectstack-ai#31878's behaviour exactly and is not moved here (no first-party measure key mints one: `mintableMeasureKey`). - Not folded: objectstack-ai#31878 review nit 3 (the objectstack-ai#31842 changeset lists `an order key` among narrowed positions). It is a wording fix to an existing, unreleased changeset, which the delta does not name; left for the seat. - objectstack-ai#31881 (hand-authored cube related-column 500) is not touched. ## Verification Head `2c2c10a0` (`3e83c779` + merge of `origin/main` `a15b544d5`; the merge touches no `service-analytics` file). <details><summary>Red first, ablation</summary> - Pins on main source (`git restore --source=ac8fede8` of the three source files, test kept): `Tests 2 failed | 19 passed (21)`, the two failing being pins 1 and 2 (`[NativeSQLStrategy] join "os31880_deals" is not backed …`; `DATABASE_ERROR … no such table: os31880_cube`). Restored with `git checkout HEAD --`, `git diff HEAD` empty. - Ablation via `scripts/ablation-replace.mjs`: `cube-member-key.ts` measure arm replaced by `undefined` (anchor 1 → 0, blob `0edd12a8` → `8ae80de1`): `Tests 2 failed | 19 passed (21)`, pins 1 and 2 red; restored, blob == HEAD, `git diff HEAD` empty. Tests import the package source, so no dist leg. </details> <details><summary>Package and gates</summary> - `pnpm --filter @objectstack/service-analytics test && … typecheck` on `3e83c779`: `Test Files 214 passed (214)`, `Tests 5152 passed | 332 skipped`; `tsc --noEmit` exit 0 (lock VERDICT command-exit 0). - eslint (`--no-inline-config`, the package has no `lint` script) on the four touched source/test files: exit 0. - After the main merge: `objectql` rebuilt, the harness plus `cube-qualified-measure-filter.test.ts`: `Tests 28 passed (28)`. - `dispatch-gates --commands`: 66 families on `3e83c779`, all exit 0; `--ran` reconciliation: 66 derived, 66 run, 0 NOT-MEASURED, 0 UNRUN. Re-run on `2c2c10a0`: see the report comment on the card. - Dogfood battery: n/a (no `!`, no `(narrowing)` arm). </details> ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic (not touched). - [x] 2. Every name I added uses the casing for its kind. - [x] 3. No formatter ran; eslint passes on the touched files. - [x] 4. One issue, one branch off an up-to-date `main`, one pull request. - [x] 5. Patch changeset `.changeset/31880-qualified-measure-filter.md` with both declaration lines. - [x] 6. `packages/spec` not touched. - [x] 7. No hand edits to reference docs, CHANGELOGs or release notes. - [x] 8. Title, body and comments are in English. --- _Generated by [Claude Code](https://claude.ai/code/session_01ADHkmPssfuxFFm8in9oCRq)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
…ts related object lacks answers 400 INVALID_FIELD, not a database error (objectstack-ai#31943) <!-- claude-projects-attribution: {"github_login":"os-steve"} --> _Requested by **Steve** · [project thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi99NaHA8uVthXXC139JxE9ZB)_ Fixes objectstack-ai#31881 Clause-②: no — a 500 becomes the 400 the same input already gets on the compiled-dataset path; nothing served changes, and no export, error code or status is added. Metadata-protocol: none ## 维护者速读 - 改了什么:手写分析立方上,按关联对象并不存在的字段查询(如 `vendor.nope`,或 vendor 没有 region 时的 `vendor.region`),现在在编译前被拒绝为 400 字段无效,并点名成员和关联对象;以前原生 SQL 策略会拼出 JOIN 后报 500 数据库错误。 - 为什么改:同样的输入走编译后的数据集路径早就被同一道关联字段闸门拒为 400;手写立方路径因为没有 include 白名单而跳过了这道闸门。现在两条路径问的是同一道闸门、同一句话。 - 风险与回滚:只放宽闸门的一个提前返回条件,并在调用处传入原生策略本来就执行的白名单;存在的关联字段照常关联和筛选。只动 `@objectstack/service-analytics`,回滚即 revert 本 PR。 - 先看:`packages/services/service-analytics/src/analytics-service.ts` 的 `assertRelationshipColumnsExist`(`!allowed` 不再提前返回)与 `callCtx` 中它的调用处(改传 `getAllowedRelationships`);测试 `dotted-dimension-unbacked-join-parity.test.ts` 末尾新增的 `[objectstack-ai#31881]` 块。 - 两分钟验证:`pnpm --filter @objectstack/service-analytics exec vitest run src/__tests__/dotted-dimension-unbacked-join-parity.test.ts`,应见 24 个用例全绿,其中末尾 3 个是本卡新加的。 - 需要你做的:无,席位落地。 ## What changes `packages/services/service-analytics/src/analytics-service.ts`, one gate, no second copy of the rule: - **The gate** is `AnalyticsService.assertRelationshipColumnsExist` (objectstack-ai#28558), the related-column gate the compiled-dataset path already asks in `callCtx`. It returned early when `allowed` (the compiled dataset's `allowedRelationships`) was `undefined`, which is every hand-authored cube. It now runs on every cube; the `include`-backed check inside it (`unbackedRelationshipPath`) runs only when there is an allowlist. - **The call site in `callCtx`** passes `reads.getAllowedRelationships(query.cube)`, the allowlist the native strategy itself enforces for that cube (`cubeReads`: a compiled dataset's `include`, else the configured `getAllowedRelationships` hook, else none). So a compiled dataset gets exactly the set it got before, and on a hand-authored cube with the legacy hook a path the hook does not back keeps the strategy's own `DATASET_INVALID`, as an unbacked path keeps `assertDimensionJoinsBacked`'s refusal on the dataset path. `assertDimensionJoinsBacked` and the draft-preview call site are unchanged. - **The refusal** is the gate's own: `INVALID_FIELD` / 400 via `invalidMemberError`, `member` / `param` / `cube` plus `field` and `object`, in the dataset path's sentence ("Filter member 'vendor.nope' on cube 'CUBE' reads field 'nope' through relationship path 'vendor', which object 'VENDOR' does not have. …"). No new code, status or envelope. Reach of the gate (seat ruling 3), measured on `80c4c9a2` and on the fix with the same harness: | Input on a hand-authored cube | Native before | Native after | Engine-aggregate before | Engine-aggregate after | |:--|:--|:--|:--|:--| | `vendor.nope` / `vendor.region` as a `where` leaf | 500 `DATABASE_ERROR` | 400 `INVALID_FIELD` (gate) | 400 `INVALID_FIELD` (cross-object filter refusal) | 400 `INVALID_FIELD` (gate) | | … as a dimension | 500 `DATABASE_ERROR` | 400 (gate) | 400 `INVALID_FIELD` (engine group-by guard) | 400 (gate) | | … as a windowed time dimension | 500 `DATABASE_ERROR` | 400 (gate) | 400 `INVALID_FIELD` (cross-object bucket refusal) | 400 (gate) | | … as a bucketed time dimension | 400 `INVALID_FIELD` (cross-object bucket refusal) | 400 (gate) | same as native | 400 (gate) | | `supplier.region` / `supplier.since` (column exists) | served | served, unchanged | unchanged | unchanged | | `nope.region` (no relationship field `nope` on the cube's object) | 500 `DATABASE_ERROR` | unchanged | 400 (its own refusals) | unchanged | | a cube whose `sql` is a statement (`SELECT * FROM deal`), `vendor.*` | 500 `DATABASE_ERROR` | unchanged | 400 / 404 `OBJECT_NOT_FOUND` | unchanged | - **Unknown hop** (`nope.region`): the hop resolver names an object called `nope` (the alias tier), the field probe has no answer for it, and the gate stands down, as it does on the dataset path. The dataset path refuses this input through a different gate (`assertDimensionJoinsBacked`, "traverses relationship path 'nope', which the dataset does not declare in its include"), which judges the `include` a hand-authored cube does not have; the related-column gate itself never refuses it. So per ruling 3 it keeps its native answer (500); listed in open questions. - **Raw `sql` cube**: the gate needs the cube's object name and stands down (`BARE_IDENTIFIER`), unchanged. - **Engine-aggregate face**: the same inputs were already 400 `INVALID_FIELD`; they now get the gate's sentence (naming the member and the related object) in place of three different ones. ## Tests New top-level `describe('[objectstack-ai#31881] …')` at the end of the shared objectstack-ai#28258 harness, `src/__tests__/dotted-dimension-unbacked-join-parity.test.ts` (real SQLite, `AnalyticsServicePlugin` on both strategies, a hand-authored cube named apart from its object, no allowlist): - `vendor.nope` and `vendor.region` (vendor has no `region`) answer 400 `INVALID_FIELD` on the native strategy as a `where` leaf, a dimension and a windowed time dimension: `code`, `status`, `param`, `member`, `field` and `object`. - On both strategies the cube's refusal message equals the compiled dataset's refusal for the same member (`include: ['vendor', 'supplier']`), with only the cube name differing. - CONTROL: `supplier.region` still joins and filters (`{region: emea, count: 2}`) and groups (`apac: 2`, `emea: 1`) on the native strategy. - objectstack-ai#31878's and objectstack-ai#31899's pins in the same file: unedited and green (24/24). **Forced test edit** (one): `src/__tests__/field-read-admission-gate.test.ts`, "judges only names the object's field list carries, and every name when that list is unavailable". Its first leg pinned a hand-authored cube query with `owner.not_a_field` (a related column the object's field list does not carry) EXECUTING on the native strategy. That is the input this card now refuses, so the leg now expects 400 `INVALID_FIELD` naming `owner.not_a_field` / `fr_owner` / `not_a_field` and nothing executed. Its claim (the read gate answers no 403 for an unlisted name) still holds; the second leg (no field list ⇒ 403) is unedited. <details><summary>Red on main, then ablation (mutation landed via scripts/ablation-replace.mjs; tests import package source, no dist leg)</summary> - **Red on main**: `analytics-service.ts` restored to the `80c4c9a2` blob (`584d6803`), `-t 31881`: 2 failed | 1 passed (the CONTROL). `AssertionError: where vendor.nope: The database refused to run a raw statement. … expected 'DATABASE_ERROR' to be 'INVALID_FIELD'`; `native vendor.nope: … expected 'DATABASE_ERROR' to be 'INVALID_FIELD'`. Restored: blob == HEAD. - **Ablation, skip the gate on the cube path** (`if (!probe || !cube) return;` → `if (!probe || !cube || !allowed) return;`, i.e. main's early return): `ok mutation landed: anchor 1 -> 0, blob 9bba336 -> a829f3584788`. Whole harness file: 2 failed | 22 passed (24), the two objectstack-ai#31881 400 pins back to `DATABASE_ERROR` (500); every objectstack-ai#28258 / objectstack-ai#31842 / objectstack-ai#31880 pin green. `ok restored: blob == HEAD (9bba336) and git diff HEAD is empty`. </details> ## Acceptance notes - The bucketed time-dimension row reads "ObjectQLStrategy cannot bucket a cross-object time dimension" on the NATIVE face on `main` for every dotted time dimension, `supplier.since` included (an existing column). That is the native strategy delegating cross-object bucketing (`cross-object-rebucket.ts`), not this card; recorded only. ## Verification Head `5be116d2` (fix `c8a7bf76`, changeset `ec72a669`, forced test edit `2ecf02ad`, merge of `origin/main` `6180c874`). - `pnpm --filter @objectstack/service-analytics test` on `5be116d2`, after `turbo run build --filter='./packages/**'` (81/81): Test Files 214 passed (214), Tests 5155 passed, 332 skipped. `typecheck` (`tsc --noEmit`) exit 0. Lock VERDICT command-exit 0. - Harness file alone on `2ecf02ad`: 24/24. - Lint: root `npx eslint --no-inline-config` on the three touched source/test files, exit 0 (the package has no `lint` script). `node scripts/check-nul-bytes.mjs` OK. - Gates: `dispatch-gates --commands` on `5be116d2` derives 69 families (the same 69 as on `2ecf02ad`); all 69 run on `5be116d2`, each exit 0. `--ran` reconciliation: "69 derived famil(ies) accounted for — 69 run, 0 NOT-MEASURED". Round 1 on `2ecf02ad`: 69/69 exit 0 after the teardown self-test's pinned fixture was fetched (first attempt exit 3, the shallow-clone prerequisite). - `main` moved 4 commits after the merge (`73bfe10e`); none touches `service-analytics` or this changeset. - Dogfood battery: n/a (no `!` in the title, no `(narrowing)` arm). --- _Generated by [Claude Code](https://claude.ai/code/session_01ADHkmPfkQkDAAzanWLnAyz)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
Requested by Steve · project thread
Fixes #31842
Clause-②: no (narrowing)
Metadata-protocol: none
维护者速读
vendor.region)只在第一段是本数据集/本对象名时才按本对象字段解析;否则一律按关联路径处理(未声明 include 就明确拒绝,已声明就筛关联对象的字段)。校验门和两种执行策略共用同一条规则。vendor.region就会悄悄按本对象自己的 region 筛选,图表数字是错的,且没有任何提示。packages/services/service-analytics/src/cube-member-key.ts(唯一规则)、analytics-service.ts的declaredMemberEntry、两个策略的lookupMember。pnpm --filter @objectstack/service-analytics exec vitest run src/__tests__/dotted-dimension-unbacked-join-parity.test.ts,预期 17 个全绿(其中 8 个是本卡新增)。What changes
One rule for which declared cube member a spelling names, in a new module
cube-member-key.ts(declaredCubeMemberKey, not exported from the package root), read by every resolver that used to carry its own copy:declaredMemberEntryinanalytics-service.ts(the where gate, the dimension gate, the include gate, the field-read admission, the preview column map);NativeSQLStrategy.lookupMemberandObjectQLStrategy'slookupCubeMember;measureEntryOf(the same lookup for measures; see Acceptance notes).A spelling names a declared key verbatim (a declared dotted key included), behind the cube's own qualifier (CUBE.region, or OBJECT.region where OBJECT is the bare object the cube's
sqlreads), or through an underscore-flattened key ONLY when that key's ownsqlis the same relationship path. The bare-tail arm (if (bag[tail]) return bag[tail]), which made thefirst === cube.namearm above it dead, is gone from all four copies. Any other dotted member is a relationship path: the dimension tier hands it to the join machinery, and on a compiled dataset the existing include gate (or the existing related-column gate) answers. No error code, envelope or export is added.The three undeclared fallbacks that read
member.split('.')[1]as a base column (resolveFieldSql,resolveDimensionSql,resolveCubeFieldName) and thesplit('.').slice(1)one inresolveStorageTargetnow return the member itself. Measured: they were unreachable for a dotted member, because the dimension lookup answers every dotted member first (a declared key, or the synthetic traversal), so the only path into them was a bare member;resolveCubeFieldName's could be reached dotted only with kindmeasure, which no caller passes.Seat ruling 3 (flat keys): nothing in the package MINTS a flat key.
inferCubeFromQuerymints a dotted member verbatim, and the dataset compiler keys a dimension by its authoredname. A flat key is authored only;skills/objectstack-ui/rules/dashboards.mdteachesaccount_industrywithsql: 'account.industry', which names the related field and still answersaccount.industry. A flat key over a base column (a dataset dimensionvendor_regionoverregion) no longer answersvendor.region.Tests
dotted-dimension-unbacked-join-parity.test.ts(the existing real-SQLite harness for dotted members on both strategies) gains one top-leveldescribewith its own fixture: a deal with its ownregion, avendorlookup to an object with noregion, and asupplierlookup to one that has it (the supplier's region disagrees with the deal's on every row, so the answer shows which column was read). Eight pins:vendor.regionthrough no include: refusedINVALID_FIELD/ 400, paramwhere, on both strategies. RED on main (served the base filter).vendor.regionthrough a declared include to an object withoutregion: refusedINVALID_FIELD/ 400 on both. RED on main.supplier.regionthrough a declared include: native filters the joined supplier column; the engine-aggregate face refuses it as it refuses every related filter. RED on main (both served[], the base filter).vendor.regionbeside a flatvendor_regionover the BASE column: refused on both. RED on main.supplier_regionoversupplier.regionanswers that spelling with the related column. RED on main (the bare-tail arm caught it first).query): native joins the supplier forsupplier.region; the engine face refusesvendor.region. RED on main.No existing test was edited.
Red on main, then green
Sources restored from
origin/main31ae944b(tree only), the new pins run, then restored fromHEAD(git diff HEADempty):On the fix:
Tests 17 passed (17).Ablations (scripts/ablation-replace.mjs, anchor hit 1 to 0 and blob moved each time; restored, git diff HEAD empty)
cube-member-key.tsNativeSQLStrategy.lookupMemberonlynative-sql-strategy.tslookupCubeMemberonlyobjectql-strategy.tscube-member-key.tsThe tests import the sources (
../plugin.js), not adist/, so no build leg applies.Acceptance notes
origin/main31ae944b, realSqlDriver(SQLite), the engine'sexecute/aggregaterecorded. A dataset over a deal with its ownregionansweredruntimeFilter: { 'vendor.region': 'emea' }with[{ region: 'emea', total: 11 }]on both strategies: native ran... WHERE region = ? ..., the engine face handedwhere: { region: 'emea' }, with and withoutvendorin the include.supplier.region: 'apac'(supplier HASregion) served[]on both, from the same base filter. A flatvendor_regionoverregionansweredvendor.regionthe same way. A hand-authored cube throughquerydid too. An undeclared dotted member with no same-named member (supplier.name) already reached the JOIN machinery on main (native LEFT JOIN, include gate refusal when unbacked).no (narrowing):vendor.regionis now refused where the related object lacks the column or the path is undeclared, so not every such input resolves to a related field. BREAKING banner, ADR-0087 dispositionnot-required (no-migration-prescription), and the full dogfood battery on the final head below. First-party count of a dotted analytics member whose tail names a base member: 0 (greppedcontent/,examples/,skills/,packages/qa/dogfood; the three dottedwherehits are ObjectQL data-query docs, not analytics).sqlas an own qualifier too. Raised as an open question in the report.no-migration-prescription, so the remedy is stated in prose (spell it CUBE.region or region; a stored member is not rewritten, because only its author knows which field it meant).src/cube-member-key.ts(new module, the one rule, not exported from the package root) andsrc/structured-json-dimension-door.ts(measureEntryOfcarried the same bare-tail copy for measures; same defect class, mechanical, no new gate family).where(DATASET.total) is read by the gate as the declared measure but compiled by both strategies as a join through a hop named for the dataset (nativeDATASET_INVALID"join ... is not backed", engine face the cross-object refusal), while baretotalserves. Pre-existing on main, unchanged here. (b) On a hand-authored cube (no include gate), the native strategy answersDATABASE_ERROR/ 500 for a related column the related object lacks (vendor.nopeon main; nowvendor.regionlands there too, instead of being served from the wrong column). The dataset path refuses the same inputINVALID_FIELD/ 400.Verification
Head
93e3a44a(merge oforigin/mainef194d79).Local runs
pnpm --filter @objectstack/service-analytics teston93e3a44a: Test Files 214 passed (214), Tests 5148 passed, 332 skipped.pnpm --filter @objectstack/service-analytics typecheckon93e3a44a(closure built with DTS): 0 errors.eslint packages/services/service-analytics --no-inline-config: exit 0.node scripts/pm/dispatch-gates.mjs --commands: 70 families, all run with exit 0 recorded;--ranreconciliation: 70 derived, 70 run, 0 NOT-MEASURED (derived zero). After the merge the derivation is unchanged and the diff-sensitive families (adr-0087 registration, changeset no-major, empty changeset, closing-keyword parity, issue citations, doc-authoring, nul-bytes, cross-package test inputs, test-source alias, affected docs) were re-run: all exit 0.93e3a44a· os-verify-lock VERDICT command-exit 0 · Test Files 441 passed, 3 skipped (444) · Tests 3662 passed, 42 skipped (3704) · no failures. (Also green on the pre-merge head21e229dc, same counts.)Generated by Claude Code