Repository navigation
fix(service-analytics)!: the dataset query door refuses measures and dimensions the dataset does not declare - #34198
Conversation
…ed members (red first) Lifts the closed-member judgment out of the query_dataset tool into dataset-declared-members.ts so every face reads one rule, and adds the service-level pin, red until AnalyticsService.queryDataset asks it. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jUg7BKfRBcTPyMxbLh
…dimensions the dataset does not declare AnalyticsService.queryDataset (POST /analytics/dataset/query, single and batch, dashboards, reports) asks the closed-member rule query_dataset asks: an undeclared measure, dimension or time dimension is refused with 400 INVALID_FIELD before anything is read, naming the members this caller may use and the remedy (declare the member on the dataset). Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jUg7BKfRBcTPyMxbLh
…er rule moves Pins whose subject was minting or judging an undeclared selection member on the dataset path now assert the closed-member refusal on every face; pins whose subject is still reachable through declared members are re-spelled to declared dimensions over the same columns. Adds the REST-door dogfood pin. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jUg7BKfRBcTPyMxbLh
…r refusal Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jUg7BKfRBcTPyMxbLh
📓 Docs Drift CheckThis PR changes 1 package(s): 4 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 6 release-owned page(s) also name something this change touched. These are read-only:
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 55847cfd9f5f488887f395bc3bc9f9b8957e6aad && git checkout 55847cfd9f5f488887f395bc3bc9f9b8957e6aad
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin d01f399e3b741c8e0d54b811b5d6e29551151509 29a15c032bd4f35dc98d24b7d10030657187b181 && git checkout -B drift-repro d01f399e3b741c8e0d54b811b5d6e29551151509 && git merge --no-ff 29a15c032bd4f35dc98d24b7d10030657187b181
node scripts/docs-audit/affected-docs.mjs --json d01f399e3b741c8e0d54b811b5d6e29551151509
|
… first
Four rest pins selected members their dataset never declared and so now
meet the closed-member refusal before the gate they pin:
- dimension-gate: the source-field gate is reached through a stale
declared dimension; the raw-field leg is now its own closed-member pin,
and the positive control groups a declared dimension over phone.
- refusal-envelope: the include positive control reads account.region
through a declared dimension.
- unlisted-refusal-envelope: profit_sum is refused as undeclared; a
stale declared measure keeps the aggregates-field assertion.
- relationship-path-admission: the undeclared path member is refused 400
before any read; the declared-join reference stays 403.
The REST body is { code, message }; docs and changeset no longer claim
member, param and cube on the wire.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jUg7BKfRBcTPyMxbLh
…e dataset query The "How to spell a measure" callout under POST /analytics/query lists the inferred spellings (count, FIELD_sum and the rest) without saying they belong to the cube query only. The dataset query answers only its dataset's declared members and refuses any other name 400 INVALID_FIELD; the callout now says so and points to the Analytics page. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jUg7BKfRBcTPyMxbLh
Both files reach a dynamic import of @objectstack/objectql inside a handler, so the first case to get past the source's gates paid that load inside its clocked window. A module-top side-effect import moves the load to collection, as check:test-source-alias prescribes. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jUg7BKfRBcTPyMxbLh
…door The measure and dimension source-field gates ended every refusal with the cube door's hint: measures are inferred from the object's own fields as FIELD_sum and the rest, and any own field may be used as a dimension without declaring it. The dataset door now answers only declared members, so it reaches these gates only through a declared member over a field the object does not have, and that hint is false there. A dataset call's scope now carries datasetDoor, which ensureCube and the draft preview pass to both gates; on the dataset door the refusal points at the member's declared field (point it at one of the object's fields, or remove the member). The cube door's message is byte-identical. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jUg7BKfRBcTPyMxbLh
…n the changeset Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jUg7BKfRBcTPyMxbLh
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jUg7BKfRBcTPyMxbLh
|
domain:server#5 · zhuangjianguo · session_01QsR2jUg7BKfRBcTPyMxbLh Request: review · PR #34198 · area S2 (A3) · Fixes #34005 · head
|
|
domain:server#5 · zhuangjianguo · session_01QsR2jTyY9BGjj9WBi7QgH6 Review claim · head 73cf3b1 · 2026-11-16T03:27Z |
|
domain:server#5 · zhuangjianguo · session_01QsR2jTyY9BGjj9WBi7QgH6 Review — PASSHead-sha:
The patch-id is |
|
review#2 · os-tesla · session_01L9qibxTeW8xHnxoHxWNHWW Contract-review-claim: session_01L9qibxTeW8xHnxoHxWNHWW · head 73cf3b1 · 2026-11-16T05:03Z |
|
review#2 · os-tesla · session_01L9qibxTeW8xHnxoHxWNHWW Contract reviewServed-tier: Read at 2026-11-16T05:15Z. First review of this head; claim: comment 6907821382; no lane request (owed per check-owed-reviews). Independence: implemented in a project thread for domain:server#5 (zhuangjianguo); reviewed by os-tesla, who neither dispatched nor implemented it. No prior contract-review record exists for this PR, so no finding id is continued. The lane PASS 6906476633 is not adopted; every conclusion below was re-derived from the diff. ① Derived judgmentsJudged against card #34005, the maintainer ruling recorded in 6902027136 and the four seat rulings in 6904231154.
② Semver level
CI at this head: 53 check-runs, 38 success, 15 skipped, none failed, none pending. Nothing is still running. The pull request is still a draft. ③ Boundary flags
④ Design judgmentThe narrowing against the published spec on M1 (must-fix) — Two published statements still declare the capability this PR removes, and the PR leaves both standing. M2 (must-fix) — Seat ruling 4 rests on a rule that does not judge dashboards, and the breaking notice omits the consumer it affects. The ruling keeps a compare window over an undeclared date key refused because S1 (should-fix) — The refusal's order against the read gate is pinned for one verdict only. N1 (nit) — N2 (nit) — Each implementing file agrees with the rule it implements; M1 and M2 are about what is published and ruled around the code, not the code's own correctness. Implemented-by: VERDICT: FAIL |
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jUg7BKfRBcTPyMxbLh
…usal's order against the read gate - The undeclared-member refusal names the compare widget's remedy when the refused member is a comparison window's date key. - Pin the read gate's 503 and denial ahead of the member list, in process and through the REST door. - Restore a served control for a declared dimension over a backed path. - Note at the draft-preview gates that selection members no longer reach them. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jUg7BKfRBcTPyMxbLh
… envelope pin Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jUg7BKfRBcTPyMxbLh
…angeset and the dashboards page Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jUg7BKfRBcTPyMxbLh
|
domain:server#5 · zhuangjianguo · session_01QsR2jTyY9BGjj9WBi7QgH6 Review — PASSHead-sha: This is a delta L1 against my PASS 6909658253 at Since my PASS, the PR has one commit of its own,
The patch-id of the PR's own diff from the merge base is |
|
review#1 · os-mickey · session_01ASNY8Ywba8ySbMdWvra2vS Contract-review-claim: session_01ASNY8Ywba8ySbMdWvra2vS · head 75e3e06 · 2026-11-16T08:34Z |
|
review#1 · os-mickey · session_01ASNY8Ywba8ySbMdWvra2vS Contract reviewServed-tier: Full review of this head, which moved past FAIL 6909901648 (head 43b494b). The merge base equals ① Derived judgmentsOne check, Moved from served to refused,
Moved between refusals, nothing served either way: an undeclared name that used to meet the source-field gate, the relationship-path gate, the field gate (403) or the related-object read gate (403) now gets the name-only 400 first. Right: the answer no longer depends on whether the field or object exists, so it discloses less. A declared member over a field the object lacks keeps its code; only its sentence changes, on the dataset door alone ( Not moved: every declared member; Earlier graded findings, by id (review 6909901648):
② Semver levelRight as declared.
Check-runs on this head: 57, of which 40 success and 17 skipped; none failed, none pending. ③ Boundary flags
④ Design judgmentFor measures and dimensions the narrowing makes the spec's own sentence real: One attempt broke it. M1 (must-fix) — The compare-window refusal names a remedy the schema refuses when the date key is a related record's field, and that class was served on
No should-fix. The remaining files agree with the rule they implement; the test edits re-pin each moved case and keep the served controls as declared members. Implemented-by: VERDICT: FAIL |
… named gets no declare-it remedy A dotted relationship.field key (or any key the dimension-name grammar refuses) cannot be a declared dimension's name, so the refusal now says the comparison needs a date field of the dataset's own object that a declared date dimension names; a nameable key keeps its remedy, and a mixed set scopes each sentence to the keys it is true for. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jUg7BKfRBcTPyMxbLh
…with no in-dataset remedy The dashboards page, the changeset bullet and the ADR-0087 marker now say that a related record's dotted date field cannot be a dimension name, so the comparison needs a date field of the dataset's own object. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jUg7BKfRBcTPyMxbLh
|
domain:server#5 · zhuangjianguo · session_01QsR2jUg7BKfRBcTPyMxbLh Hand-off (maintainer order 2026-11-16 09:01Z: push now, hand off)
|
…compare-window date key tells the author to declare nothing
The select-or-declare sentence ("use one of these, or declare the member on
the dataset and query it by that name") preceded the compare-window sentence
even when the only undeclared member was a dotted date key, which no
declaration can carry. It now covers only the members it can fix: left out
when every undeclared member is such a key, scoped by name when some are.
Which members are refused, the code, status, member/param/cube and the
nameable-key text are unchanged.
Co-Authored-By: Claude <noreply@anthropic.com>
|
review#1 · os-mickey · session_01ASNY8Ywba8ySbMdWvra2vS Contract-review-claim: session_01ASNY8Ywba8ySbMdWvra2vS · head 7a6aa7d · 2026-11-16T11:21Z |
|
review#1 · os-mickey · session_01ASNY8Ywba8ySbMdWvra2vS Contract reviewServed-tier: Delta review after FAIL 6911685604 (head 75e3e06), and a full judgment of this head.
① Derived judgmentsEarlier graded finding, by id (record 6911685604): M1: closed. What closes it:
Moved by this round: message text only. No request moves between served and refused. Whole head, as judged at 75e3e06 and re-read here:
② Semver levelRight as declared.
Check-runs on this head: 53, all completed; 38 success, 15 skipped, none failed. ③ Boundary flags
④ Design judgmentThe narrowing makes the spec's own sentence real: Break attempts on the new wording that held:
No must-fix, no should-fix. N3 (nit) — The unnameable-key sentence is over-strong for a direct API caller. It says the comparison "cannot run on a dataset query unless" the date field is the dataset object's own, and for a lone dotted key the declare option is withheld. A caller who writes the selection can declare a dimension over the path under another name and send the window under that name. The changeset and the page scope "does not help" to the widget; the message does not. The wording is the ruling's, and whether the executor serves that window was not measured. N4 (nit) — Implemented-by: VERDICT: PASS |
|
review#1 · os-mickey · session_01ASNY8Ywba8ySbMdWvra2vS Contract-review-claim: session_01ASNY8Ywba8ySbMdWvra2vS · head 29a15c0 · 2026-11-16T13:28Z |
|
review#1 · os-mickey · session_01ASNY8Ywba8ySbMdWvra2vS Contract reviewServed-tier: This record covers a merge-only delta. The judgment of the narrowing itself is record 6915111092 (PASS on ① Derived judgments
② Semver levelUnchanged from 6915111092: ③ Boundary flags
④ Design judgmentNo must-fix, no should-fix. Nothing main brought changes what the narrowing accepts or refuses, its messages, its pins or its prose.
The two nits recorded in 6915111092 (N3, N4) stand as written there and are not re-graded. Implemented-by: VERDICT: PASS |
|
repo:objectstack#1 · os-project-manager · session_01FEkQ5pHNFS9mn8hS13iGyL Request: review · PR #34198 · area o1-B · Fixes #34005 · head
|
|
repo:objectstack#1 · os-project-manager · session_01FEkQ5kcNtBBExhz4DZqYbi 席位核对 · ACCEPT (L1, delta) · Head-sha: 29a15c0 · 2026-11-16T14:16ZThis is L1 thread L1-a for area o1-B, reading the head declared final in 6918897771. It is a delta read against the last L1 PASS, 6911215121 at
Landing: not Tier H. Area o1-B lands it with |
|
repo:objectstack#1 · os-project-manager · session_01FEkQ5pHNFS9mn8hS13iGyL Verdict: ACCEPT at 2026-11-16T14:17Z, and the landing rides this stroke. ACCEPT → PR #34198 comment 6918938218.
State: ready plus auto-merge through the merge queue. On MERGED, |
Requested by Steedos · project thread
Fixes #34005
Clause-②: no (narrowing)
Metadata-protocol: none
Skills-docs: follow-up #34328 —
skills/**teach dataset selections by the dataset's declared measures and dimensions (objectstack-ui: a report selectsrowsandvalues"from that dataset"), which the door now enforces; they do not yet say that a compare widget's date key must be the name of a declared date dimension, and that teaching is carried by #34328;content/docs/data-modeling/analytics.mdxandcontent/docs/ui/dashboards.mdxstate the rule in this change.Warning
BREAKING for a caller of
POST /api/v1/analytics/dataset/query(and each entry of/analytics/dataset/query/batch), or ofAnalyticsService.queryDatasetin process, that names a measure or dimension the dataset does not declare. That selection used to be answered with a member minted on the fly; it is now refused400 INVALID_FIELD, the same refusal the AI toolquery_datasetgives. ADR-0087 disposition (in the changeset, one marker):not-required (no-migration-prescription), because a runtime request refusal changes the shape of no metadata key, value or stored row. Authored dashboards, reports and charts are save-gated to declared members in their measures and dimensions, but one class is not: a dashboard compare widget whose date-range field is not also the name of a declared dimension passes every save and publish check and is refused after this change. When the date-range field is a field of the dataset's own object, the refusal names the remedy: declare a date dimension named after the date-range field (seat re-ruling 6909938292 on #34005 (question 4, M1 option a)). When it is a related record's dotted field (account.signed_at), which the dataset query used to answer through the dataset'sinclude, this is a break with no in-dataset remedy: no dimension name can carry a dot, so the refusal names no declaration for that key and says the comparison needs a date field of the dataset's own object that a declared date dimension names (seat ruling 6911721875 on #34005 (L2 M1, dotted date key, option A)). The renderer mapping a dotted date key onto a declared dimension over that path is carried by #34350. The missing save gate is #34308; the skills teaching for the compare widget's date key is #34328.维护者速读
queryDataset)现在只接受数据集自己声明的度量和维度,与 AI 工具query_dataset共用同一条判定。count、把原始字段当sum、_sum后缀、数据集名.前缀、原始字段当维度),看板上可能出现一个数据集从没定义过的「指标」,并且两个入口对同一个名字给出不同答案。account.signed_at)时,没有数据集内的修法,文案只说明对比需要本对象的日期字段,渲染端映射由 dashboard: a compare widget over a related-record date field has no date key a dataset can declare #34350 承接;补保存校验的卡是 dashboard: no save or publish gate judges a compare widget's date key against the dataset's declared dimensions #34308,技能文档补教的卡是 skills(objectstack-ui): the compareTo section does not say a compare widget's date key must be the name of a declared date dimension #34328。按名字普查了官方示例和 hotcrm 的看板与报表,命中为 0。回滚方式是 revert 本 PR(改动只在 service-analytics、测试和文档里)。packages/services/service-analytics/src/analytics-service.ts里的assertSelectionMembersDeclared(拒绝点和 403 先于成员清单的顺序),src/dataset-declared-members.ts(共用判定),src/dataset-tools.ts(AI 入口改为复用)。pnpm --filter @objectstack/service-analytics exec vitest run --maxWorkers=2 src/__tests__/dataset-query-declared-members.test.ts,预期全绿;拒绝用例断言INVALID_FIELD/400、member/param/cube,以及「可用成员」清单。What changes
src/dataset-declared-members.tsholdsundeclaredSelectionMembers. It judgesselection.measures,selection.dimensionsand eachtimeDimensions[].dimensionagainst the dataset's ownmeasures[].name/dimensions[].name, spelled exactly. The AI tool'sassertDeclaredMembers(dataset-tools.ts, from PR fix(service-analytics)!: query_dataset refuses measures and dimensions the dataset does not declare #33958) now calls it, so the judgment is lifted, not forked. Each face words its own next step: the AI face falls back to the object query tools, and the door tells an author to declare the member.AnalyticsService.answerDatasetcallsassertSelectionMembersDeclaredright after compiling the dataset, before anything is read. Order of answers:404 NOT_FOUND, first.403), never a member list.400 INVALID_FIELD. Over REST the body is{ code, message }; in process the thrown error also carriesmember,paramandcubefrom the first undeclared entry. The message names every undeclared member, the measures and dimensions THIS caller may use (never a withheld member, and never one over aninternalfield, per ADR-0100), and the remedy.403 PERMISSION_DENIED).runtimeFilterkeys are fields and are judged as before. The cube doorPOST /analytics/queryis not a dataset and keeps its ad-hoc members.FIELD_sum…, and any own field may be used as a dimension without declaring it), which is false on the dataset door. A dataset call's scope now carriesdatasetDoor, whichensureCubeand the draft preview pass to both gates. On the dataset door the refusal says "The dataset declares this measure/dimension over 'FIELD': point itsfieldat one of the object's fields, or remove the measure/dimension". The cube door's message is byte-identical. The changeset notes it (e2a0a9c).datasetbody is judged against its ownmeasuresanddimensions.content/docs/data-modeling/analytics.mdxstates the rule beside the body-key paragraph.content/docs/ui/dashboards.mdxno longer says the analytics query API accepts an object's own field as an ad-hoc dimension: the dataset query answers declared members only, and only the cube query (POST /analytics/query) still groups by an undeclared field. A new section, "The Date Key of a Compare Widget", says a compare widget's date key is the date-range field's name and must be the name of a declared date dimension, with the remedy, and (fix round 4) that a related record's dotted date field has no in-dataset remedy. The spec TSDoc on the dashboard global filter'sfield(packages/spec/src/ui/dashboard.zod.ts) says the same old thing and is outside this PR's surface: card spec(dashboard): the global filterfieldTSDoc says the analytics query API serves an undeclared object field as an ad-hoc dimension — false for dataset queries once PR #34198 lands #34307.timeDimensionsentry carrying adateRangein a selection withcompareTo, which is how a dashboard compare widget sends its date-range field), the message adds: the dimension is the date key of the comparison window; declare a date dimension named after it on the dataset (over that field). That is the only remedy it names, and only for a key that can be a dimension name (fix round 4: a key the dimension-name schema refuses, such as a dottedrelationship.field, gets the own-object requirement instead). With two or more such keys it names them together, in the plural.compareWindowRemedyindataset-declared-members.ts; the AI tool's wording is unchanged. The generic select-or-declare sentence ("Use one of these, or declare the member on the dataset … and query it by that name") covers only members it can fix (fix round 4 completion): it is left out when every undeclared member is such an unnameable key, and it names the members it is for when only some are.analytics-service.tsnow note that selection members never reach that branch (refused earlier byassertSelectionMembersDeclared)..changeset/34005-dataset-door-declared-members.mdis apatch(Metadata-protocolnone) with the BREAKING paragraph and the ADR-0087 disposition. Both now name the compare-widget class and its remedy, and the BREAKING paragraph says the refusal names that remedy in its message.Tests
New:
src/__tests__/dataset-query-declared-members.test.ts(realAnalyticsServicePlugin, security double).count, a raw field, a suffix spelling, aDATASET.-qualified spelling, an undeclared measure beside a declared one, a raw dimension, and a raw time dimension. Each assertscode,status,member,param,cube, the declared-member list and the remedy, and checks that nothing was read.count.New:
packages/qa/dogfood/test/analytics-dataset-declared-members.dogfood.test.ts(stock showcase, real HTTP stack).showcase_task_metrics.Triaged pins. These pinned the minting this PR removes. Each was re-judged, not batch-respelled:
preview-undeclared-measure-parityandpreview-undeclared-dimension-parity: every spelling now gets the closed-member refusal; the declared controls are kept.query-dataset-request-scope,dataset-drill-scopes,dimension-source-field-gateanddotted-path-preview-parity: the undeclared spellings are now refusals; theruntimeFilterand declared-member pins are kept.dotted-dimension-unbacked-join-parity: the case list was extended. The backed-join CONTROLs that passed only because a raw path was minted were removed.preview-filter-field-json-dimension-parity: now selects the declaredpayload_dim.preview-time-filter-fk-parity: the fixture now declaresclosed_on,account_id,account_nameandaccount_ref, and the FK pins select those names. A declared lookup dimension resolves display labels, so the expected rows are'Acme'/'Globex'. The raw spellings are a new refusal row.Rest pins moved (d9106e8). Four
@objectstack/restpins selected members their dataset never declared, so they now meet the closed-member refusal before the gate they pin:analytics-dataset-dimension-gate: the source-field gate (groups by field 'bogus_dim', andbuckets fieldfor the time dimension) is reached through a stale declared dimension. The raw-field leg (phone,bogus_dim) is its own closed-member pin. The positive control stays 200 and groups a declaredphone_dim.analytics-dataset-refusal-envelope: the include positive control stays 200 and readsaccount.regionthrough a declaredaccount_region.analytics-dataset-unlisted-refusal-envelope:profit_sumis refused as undeclared. A stale declaredprofit_totalkeeps theaggregates field 'profit'assertion.analytics-relationship-path-admission: the declared-join reference stays 403. The undeclared path member is refused 400 before any read; the dataset's own objects are readable, so the read 403 does not apply.Test-source alias (8e358c3).
analytics-dataset-dimension-gateandanalytics-dataset-refusal-envelopenow import@objectstack/objectqlat module top, so its first load is paid at collection rather than inside a clocked window.pnpm check:test-source-alias: exit 0.Docs (b25fa01). The
content/docs/api/data-api.mdx"How to spell a measure" callout now says that the inferred spellings belong to the cube query only, and that the dataset query refuses any undeclared name400 INVALID_FIELD.Remedy pins (5a127a4).
dataset-query-declared-members.test.tspins both directions: a stale declared measure and a stale declared dimension on the dataset door name the declared field and the fix and carry no inferred-member hint, while the cube door (query()) keeps both hints.preview-undeclared-measure-paritypins the same dataset-door message on the native, ObjectQL and draft-preview faces. The rest stale-declaration pins (analytics-dataset-dimension-gate,analytics-dataset-unlisted-refusal-envelope) assert the dataset-door remedy and the absence of the hint end to end.Fix round 2 (review 6908009392).
dataset-query-declared-members.test.tspins the message for an undeclaredclosed_onwindow withcompareTo(member/param/cube, the date-key sentence and the remedy; fix round 3 below narrows the remedy pin), plus a control that the same undeclared time dimension withoutcompareTogets no compare-widget sentence.503 SERVICE_UNAVAILABLEwith no member list and nothing read.packages/rest/src/analytics-read-gate-fault-envelope.test.ts, the real service): an undeclared selection answers403 PERMISSION_DENIEDfor a denied caller and503 SERVICE_UNAVAILABLEfor an undecidable one, both with no member list and nothing executed; the admitted control answers400 INVALID_FIELDwith "Measures you may use: revenue.". The file now imports@objectstack/objectqlat module top (pnpm check:test-source-alias).dotted-dimension-unbacked-join-parity: the served control is back as a DECLARED dimension over the backed path (account_namereadsaccount.name): both live strategies return Acme 130 / Globex 50, and the draft preview keeps its own refusal.Verification on 43b494b (fix round 2).
VERDICT queue-timeout (exit 99), about 65 minutes in all, behind sibling runs). The PR's own CI on this head carries them:Test Core(8/8 shards) success, withdataset-query-declared-members.test.ts(19 tests),dotted-dimension-unbacked-join-parity.test.ts(29 tests) andanalytics-read-gate-fault-envelope.test.ts(10 tests) each passing in the shard logs;TypeScript Type Checksuccess;Lint & Repo Gatessuccess;Build Coresuccess;Dogfood Regression Gatesuccess;Check Changesetsuccess.pnpm check:test-source-alias: exit 0.dispatch-gates --repo objectstack-ai/objectstack --ran, exit codes recorded): 101 derived, 91 exit 0, 10 NOT MEASURED because nodist/was built locally (9 exit 3, PREREQUISITE NOT MET;check:docsexit 1, refusing the missing spec build tree).Lint & Repo GatesandTypeScript Type Checkcarry those families on this head.compareTo.Ablation of the flag. One mutation through
scripts/ablation-replace.mjs:datasetDoor: compiled !== undefined→datasetDoor: false(blob 74714b8ca72c → 684ea485151b). Baseline 27/27; mutated 3 failed, 24 passed (the two dataset-door pins and the preview-face pin; the cube-door control stays green); restored blob == HEAD,git diff HEADempty. A first attempt ran before the workspace build and failed at collection (Cannot find package '@objectstack/spec/ui', no tests run): a no-op, discarded and re-run after the build.Verification on e2a0a9c (one lock hold, VERDICT command-exit 0):
pnpm --filter '@objectstack/rest^...' build: exit 0.pnpm --filter @objectstack/service-analytics test: exit 0, Test Files 216 passed (216), Tests 5251 passed, 335 skipped (5586).typecheck: exit 0.pnpm --filter @objectstack/rest test: exit 0, Test Files 413 passed (413), Tests 8463 passed, 332 skipped (8795).typecheck(withcheck:test-typecheck): exit 0.pnpm check:test-source-alias: exit 0.dispatch-gates --ran, exit codes recorded): 101 derived, 99 run with exit 0, 2 NOT-MEASURED (exit 3, prerequisitedist/absent locally:check:skill-examples,check:dual-build-cjs-loads).check-nul-bytes: exit 0.Fix round 3 (review 6909901648)
Ruling: seat re-ruling 6909938292 on #34005 (question 4, M1 option a). Head
75e3e0618c, after mergingorigin/mainat7917a19e54(16 commits behind; the merge touches no file of this PR).compareToqualification.compareWindowRemedy(dataset-declared-members.ts); thecompareTotable row on the page did not repeat the remedy and is unchanged.dataset-query-declared-members.test.ts:compareTonames the declaredclose_month, and a second datedtimeDimensionsentry names the undeclaredclosed_on. It assertsINVALID_FIELD/400 withmember: 'closed_on', the date-key sentence, the one remedy, that the message does not containcompareTo.dimension, and that nothing was read. The existing compare-window pin now asserts the same absence.Skills-docs:in this body and in the changeset now cites follow-up skills(objectstack-ui): the compareTo section does not say a compare widget's date key must be the name of a declared date dimension #34328: the skills teach declared measures and dimensions, and the compare widget's date key is carried by skills(objectstack-ui): the compareTo section does not say a compare widget's date key must be the name of a declared date dimension #34328.Verification on 75e3e06
pnpm --filter '@objectstack/rest^...' buildexit 0;dataset-query-declared-members.test.tsexit 0, Tests 21 passed (21);pnpm --filter @objectstack/service-analytics testexit 0, Test Files 216 passed (216), Tests 5259 passed, 335 skipped (5594);typecheckexit 0.scripts/ablation-replace.mjs): the old two-remedy sentence put back in the singular arm (anchor 1 → 0, injected text 0 → 1, blob e0e203e9d11b → 1356fedb9a4a).dataset-query-declared-members.test.ts: 2 failed, 19 passed. Red: the existing compare-window pin and the newcompareTo.dimensionpin. The plural pin stays green, as expected, because the mutation is in the singular arm. Restored withgit checkout HEAD --: blob == HEAD (e0e203e9d11b),git diff HEADempty.pnpm check:test-source-alias: exit 0.dispatch-gates --repo objectstack-ai/objectstack --ran, exit codes recorded): 101 derived, 98 exit 0, 3 NOT MEASURED (exit 3, PREREQUISITE NOT MET:check:skill-examplesandcheck:dual-build-cjs-loadsreaddist/not built here;check:type-check-debtnever acquired the shared lock behind a dogfood run). CI carries them.@objectstack/resttests were not re-run locally: this round changes no rest file, and no rest pin asserts the compare-window sentence. CI'sTest Corecarries them.Fix round 4 (review 6911685604)
Ruling: seat ruling 6911721875 on #34005 (L2 M1, dotted date key, option A). The refusal stays; no executor behaviour change. Head
d782833df3; 4 commits behindorigin/main, not merged.compareWindowRemedy(dataset-declared-members.ts) decides per key whether it can be a dimension name with the dataset schema's ownSnakeCaseIdentifierSchema(no hand-rolled pattern). A key that cannot (a dottedrelationship.field, or any key the grammar refuses) gets no "declare a date dimension named" sentence; the message says it cannot be a dimension name, so no date dimension can be declared under it, and that the comparison cannot run on a dataset query unless the dashboard's date field is a field of the dataset's own object that a declared date dimension names. A nameable key keeps the existing remedy, byte-identical. Mixed keys get one sentence per kind, the declare-it one scoped "For the key(s) that can be a dimension name(s)".compareTotable row), the changeset's BREAKING bullet and the ADR-0087 marker state the dotted class as a break with no in-dataset remedy. The changeset cites dashboard: a compare widget over a related-record date field has no date key a dataset can declare #34350 for the renderer mapping; the docs page cites no card.dotted-path-preview-parity.test.tsreplaces the removed served control: a compare window over the backedaccount.founded_atis refusedINVALID_FIELD/400 alike on every face, the message names no "declare a date dimension named" remedy, and it names the own-object requirement.dataset-query-declared-members.test.tspins one mixed plural case through the service, plus a grammar table over every combination the function produces (1 or 2 nameable, 1 or 2 unnameable, a non-dotted grammar failure, two mixes).service-analyticssuite,typecheck, the derived gates, and the dotted-only message.Verification on d782833
pnpm --filter '@objectstack/service-analytics^...' build, VERDICT command-exit 0.vitest runofdataset-query-declared-members.test.tsanddotted-path-preview-parity.test.tsonab7c7ca809(the code commit;d782833df3adds docs and changeset only): VERDICT command-exit 0, Test Files 2 passed (2), Tests 47 passed (47).check-adr-0087-registration --base origin/mainand its--self-test,check:test-source-alias,check:doc-authoring,check:doc-anchors,check-adr-links,check-changeset-no-major,check-empty-changeset,check-issue-citationsandcheck:issue-citations,check:nul-bytes,check:cross-package-test-inputs,check:undeclared-dep-imports,check-closing-keyword-parity,check-docs-section-name,check-comment-mask-adoption.Fix round 4 (completion)
Takeover of the handed-off round (hand-off 6912068262) by
repo:objectstack#1, under seat ruling 6911721875 on #34005 (dotted compare-window date key, option A). Code commit7a6aa7d0ed; final head29a15c032b, a merge oforigin/mainatd01f399e3btaken because sibling PR #34335 landed with its own edit ofcontent/docs/ui/dashboards.mdx(its native-SQL paragraph under "Filtering on a Related Record's Field"). The merge applied without conflicts and keeps both edits; the PR's own diff is still the same 23 files. CI on the handed-off headd782833df3was green: 53 checks, 36 success, 17 skipped, none failed or pending.d782833df3, a compare window whose only undeclared member is a dotted key read: "… Dimensions you may use: region. Use one of these, or declare the member on the dataset (itsmeasuresordimensions) and query it by that name. The dimension "account.founded_at" is the date key … "account.founded_at" cannot be a dimension name …, so no date dimension can be declared under it: …". The first sentence tells the author to declare the one member, the dotted key, under its name; the ruling says the refusal does not tell the author that. With an undeclared measure beside the dotted key, "declare the member" covered both members alike.undeclaredMembersRefusal(dataset-declared-members.ts) builds the select-or-declare sentence only for members it can fix: a compare-window date key that the dimension-name grammar refuses is never one. When every undeclared member is such a key, the sentence is left out and the compare-window sentence is the whole remedy. When some are, it reads "For the measure "amount_sum", use one of these, or declare the member on the dataset …". When none are, it is byte-identical to before. Unchanged: which members are refused,INVALID_FIELD/400,member/param/cube, andcompareWindowRemedy(the nameable-key text included). The changeset's general bullet and the dashboards page say the dotted key gets no declaration.dataset-query-declared-members.test.ts: a dotted key as the only undeclared member (the message goes straight from "Dimensions you may use: …" to the date-key sentence, names no declaration, and carries the ruling's sentence in full), a dotted key beside an undeclared measure (the sentence names the measure only), and the existing nameable-plus-dotted case now asserts its scoped sentence.dotted-path-preview-parity.test.ts: the dotted compare-window pin asserts the absence of the generic sentence on every face.Verification on 7a6aa7d (the code commit) and 29a15c0 (the merged final head)
pnpm --filter '@objectstack/service-analytics^...' build: VERDICT command-exit 0.pnpm --filter @objectstack/service-analytics test: exit 0, Test Files 216 passed (216), Tests 5271 passed, 335 skipped (5606).typecheck(tsc --noEmit): exit 0. One lock hold.scripts/ablation-replace.mjs:canBeDimensionNamereturnstrue, so a dotted key gets the old "declare a date dimension named …" remedy (anchor 1 → 0, blob 17f2d8f24422 → 9a8f74f32e22). The two files: 9 failed, 40 passed. Red: the dotted pin on every face, the dotted-only, dotted-plus-measure and nameable-plus-dotted service pins, and the five grammar-table rows with an unnameable key. Restored: blob == HEAD (17f2d8f24422),git diff HEADempty.const fixable = undeclared;(blob 17f2d8f24422 → f712c77fe6e6). 4 failed, 45 passed: the dotted pin on every face and the three service pins on the select-or-declare sentence. The grammar table stays green, as expected. Restored: blob == HEAD,git diff HEADempty.29a15c032b, one lock hold (VERDICT command-exit 0): the closure build plus service-analytics exit 0;pnpm --filter @objectstack/service-analytics testexit 0, Test Files 217 passed (217), Tests 5295 passed, 335 skipped (5630);typecheckexit 0.29a15c032b(dispatch-gates --repo objectstack-ai/objectstack --ran, exit codes recorded): 101 derived, 101 run, all exit 0 on the first run, 0 NOT-MEASURED (check:type-check-debt: 0 raw tsc errors).7a6aa7d0ed: 101 derived, 101 run, 0 NOT-MEASURED. Four families first exited 3 (PREREQUISITE NOT MET) and were re-run once the prerequisite held:check-plugin-teardown-shape --self-testaftergit fetch --unshallow;check:type-check-debt(0 raw tsc errors, every ledger entry at its number),check:skill-examples(347 examples) andcheck:dual-build-cjs-loadsafter the workspace build, under one lock hold. All exit 0.check-governed-merges.mjs --pr 34198: NOT governed, 0 of 23 paths on the register, 1867 changed lines.!, (narrowing) arm),pnpm --filter @objectstack/dogfood testunder the lock, no shard, no path: on7a6aa7d0ed, VERDICT command-exit 0, Test Files 474 passed, 3 skipped (477), Tests 4012 passed, 42 skipped (4054). On the final head29a15c032b(after its own@objectstack/dogfood^...closure build, exit 0): VERDICT command-exit 0, Test Files 475 passed, 3 skipped (478), Tests 4018 passed, 42 skipped (4060).7a6aa7d0ed: 53 checks, 38 success, 15 skipped, none failed or pending. CI on the final head29a15c032b: 53 checks, 38 success, 15 skipped, none failed or pending.Acceptance notes
Census (H2): 0 hits. The census resolved every dashboard widget, report and chart selection against its dataset, with a positive control of 6 seeded hits:
No declarations were needed. The save-time and build lint rules (
widget-measure-unknown,widget-dimension-unknown,chart-measure-unknown, the report rows/columns/values checks) keep the measures and dimensions of stored items on declared members.report-date-range-dimension-unknownjudges a report'sdateRange.dimensiononly; it does not cover dashboards.Compare windows. A dashboard compare widget lowers its date window, the dashboard date-range filter included, into
timeDimensionsunder the filtered field's name. A dashboard'sdateRange.fieldresolves against the object, not the dataset, and no save or publish rule reads a widget'scompareTo, so stored dashboards are NOT save-gated for this class: a compare widget whose date-range field is not also the name of a declared dimension is now refused. The census found none (each shipped compare widget's date field is also a declared dimension of the same name); a dashboard saved at runtime or by a third party has no such guarantee. The refusal names one remedy, declaring a date dimension named after the date-range field (seat re-ruling 6909938292 on analytics: the REST dataset door still answers measures and dimensions the dataset does not declare (query_dataset refuses them since #33745) — close it, or say the closed set binds the AI tools only #34005 (question 4, M1 option a)). For a related record's dotted date field it names no declaration and says the comparison needs a date field of the dataset's own object (seat ruling 6911721875). The missing save gate is card dashboard: no save or publish gate judges a compare widget's date key against the dataset's declared dimensions #34308. The skills' compare-widget section does not yet teach the date key: card skills(objectstack-ui): the compareTo section does not say a compare widget's date key must be the name of a declared date dimension #34328.Dead code. The preview path's member-minting branch in
answerDatasetis no longer reachable for selection members. It is left in place with a one-line note at the branch; this is an observation only, with no card.Out of scope. The code cites ADR-0149 D1 for the closed-member rule; the ADR carries no line for it yet. That line is governed text owed by the skills lane, card ADR-0149: record that every dataset face answers declared members only — its "Leaves unchanged" line still names /analytics/dataset/query #34309.
Verification
The readings below are from the first round, on
b263c8df14(a merge oforigin/maininto the branch). The final head's readings are in "Fix round 4 (completion)" above.service-analytics suite, typecheck, dependents (one lock hold, VERDICT command-exit 0)
pnpm install: exit 0.pnpm --filter '@objectstack/dogfood^...' build: exit 0.pnpm --filter @objectstack/service-analytics test: exit 0, Test Files 216 passed (216), Tests 5247 passed, 335 skipped (5582).tsc --noEmit: exit 0. Its tsconfig includes the src tests.Ablation (each leg landed and was restored to the HEAD blob)
Both legs ran through
scripts/ablation-replace.mjs, with a trap that restores toHEAD.await this.assertSelectionMembersDeclared(...)(anchor 1 → 0, blob 386a29b96ee3 → 156d9334211e)dataset-query-declared-members+preview-undeclared-measure-paritygit diff HEADemptyassertDeclaredMembers(...)(anchor 1 → 0, blob cc4635da3126 → 0069eb75e100)dataset-tools.test.tsgit diff HEADemptyFinal check:
DIFF_HEAD_EMPTY=yes.Dogfood battery (title carries `!` and a (narrowing) arm)
pnpm --filter @objectstack/dogfood testunder the lock. No shard and no path.analytics-dataset-declared-members.dogfood.test.ts.Derived gate families (dispatch-gates)
node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack --ranreports: 101 derived, 98 run, 3 NOT-MEASURED, 0 UNRUN. The exit codes are recorded per family.check-adr-0087-registration --base origin/main(exemption notice)check-changeset-no-majorcheck-closing-keyword-paritycheck-nul-bytescheck:docs-transcript-driftcheck:dts-closuredist/for the packages they read. The PR check-runs carry them:pnpm --filter @objectstack/spec run check:skill-examples:packages/client-react/distis not built.pnpm check:dual-build-cjs-loads: some package has nodist/.pnpm check:type-check-debt: closure build queued behind the shared lock; stopped.pnpm lintandtest:repoare left to CI.Merge-tree
origin/main: clean.git merge-treeexit 0.mainitself conflicts on. File overlap with this diff: none.🤖 Generated with Claude Code