Repository navigation
fix(lint)!: os validate refuses a dataset dimension over a JSON-stored field, and count_distinct over a field declared multiple: true - #21073
Conversation
…count_distinct over a field declared multiple: true The dataset-member rule gains the dimension leg the measure already had: a dataset dimension whose field is structured JSON (STRUCTURED_JSON_TYPES) or multi-value (isMultiValueField, the declaration with its multiple flag) is refused as dimension-json-stored-field-refused, the two predicates the analytics door refuses a grouped member by. The measure leg reads the declaration as well as the type: count_distinct over a multi-capable type flagged multiple: true is refused, as the compile leg and the engine's count_distinct door refuse it. Claude-Session: https://claude.ai/code/session_01Sfe5YjBLwB9J3y8fvm2xq1 Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Sfe5YjBLwB9J3y8fvm2xq1 Co-authored-by: Claude <noreply@anthropic.com>
…usal, not that nothing can select it Claude-Session: https://claude.ai/code/session_01Sfe5YjBLwB9J3y8fvm2xq1 Co-authored-by: Claude <noreply@anthropic.com>
…e rule-id barrel contract requires Claude-Session: https://claude.ai/code/session_01Sfe5YjBLwB9J3y8fvm2xq1 Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 1 package(s): 6 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 3 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 4 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 ed7e7bdc323a6479084fdaad53e109fecbaec1fd && git checkout ed7e7bdc323a6479084fdaad53e109fecbaec1fd
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 94608a7d72ecef7bf61d10dbab3bd80aea311055 b0afb0d7bad6c17f8514f7697e7af02538923976 && git checkout -B drift-repro 94608a7d72ecef7bf61d10dbab3bd80aea311055 && git merge --no-ff b0afb0d7bad6c17f8514f7697e7af02538923976
node scripts/docs-audit/affected-docs.mjs --json 94608a7d72ecef7bf61d10dbab3bd80aea311055
|
…s the seat ruled The package entry gains an export and the accept set narrows, so the declaration is yes with the narrowing arm. Only the Clause-② line moves. Claude-Session: https://claude.ai/code/session_01Sfe5YjBLwB9J3y8fvm2xq1 Co-authored-by: Claude <noreply@anthropic.com>
Contract reviewServed-tier: Inputs read: card #20890 (body, comments ① Derived judgmentsAccept-set changes the diff implies
Public-surface changes the diff implies
Pins, read not run
Every sentence the diff adds, tested against the tree
② Semver level
③ Boundary flags
Check-runs on Implemented-by: VERDICT: PASS Adopted and posted by
Generated by Claude Code |
…or count_distinct, and judges dimensions The page's account of measure-aggregate-field-type-refused now says that count_distinct over a multi-capable field declared multiple: true is refused, and that dimension-json-stored-field-refused refuses a dataset dimension over a structured-JSON or multi-value field. Claude-Session: https://claude.ai/code/session_01Sfe5YjBLwB9J3y8fvm2xq1 Co-authored-by: Claude <noreply@anthropic.com>
Contract reviewServed-tier: Delta re-review of PR #21073 on its new head. The prior record ( ① Derived judgmentsThe delta, bounded. Each new or changed sentence of §6, tested against the tree at the head. The sources are the lint rule (
Neither new passage carries a tracker number; the page's one The rest of §6 and the page's account of this rule. A grep of the page at the head for the family (
PR-body sentences at this head. The new line, "Docs: Prior judgments re-read, not re-derived (the delta cannot reach them; the blobs are unchanged and the door and spec helpers are identical on ② Semver level
③ Boundary flags
Check-runs on Implemented-by: VERDICT: PASS Adopted and posted by
Generated by Claude Code |
Closes #20890
Clause-②: yes (narrowing)
What changes
@objectstack/lint's dataset-member rule (packages/lint/src/validate-dataset-measure-aggregates.ts) gains the authoring-time legs the analytics door already enforces at query time:dimension-json-stored-field-refused(gating,error). A dataset dimension whosefieldresolves to a structured-JSON field (STRUCTURED_JSON_TYPES) or a multi-value field (isMultiValueField) is refused atdatasets[N].dimensions[M].field. These are the door's two predicates (service-analyticsstructured-json-dimension-door.ts), imported from@objectstack/spec/data; lint writes no type list.measure-aggregate-field-type-refusedreads the declaration:count_distinctover a multi-capable type flaggedmultiple: trueis refused. One helper,acceptsDeclaration(the table row ANDisMultiValueField), decides both the verdict and the hint.Both legs ride the existing registry entry, so they reach
os validate,os build,os lintand the runtimedatasetwrite door. A dottedrelationship.fieldis judged on the leaf's object.Declared beyond the claim:
packages/lint/src/index.ts, one line: the new id constant is exported from the package entry, because the package's barrel contract test (src/rule-id-barrel-exports.test.ts) fails without it.Docs:
content/docs/deployment/validating-metadata.mdx§6 now states themultiple: truedeclaration and the dimension leg (added after the at-tier review flagged the page).Not included: cube dimensions. No rule in
packages/lintwalksanalyticsCubes; that gap is filed separately.os validate, before (6073bb96b8) and after (c953ad2a58)jsontext(control)avgoverjson(control)count_distinctoverselectwithmultiple: truecount_distinctover a singleselect(control)tagsselectwithmultiple: trueselect(control)analyticsCubesdimension overjson(not in scope)examples/app-todo,app-crmandapp-showcasepassos validateafter the change, with no finding of either id.Tests and gates
The rule's tests and ablations (A1–A4, each red) and the local runs are in the
os-dev-reporton #20890.dispatch-gates.mjs --commandsatacde186204: 60 derived, 60 run, all exit 0.Changesets
Two, each
minorfor@objectstack/lintwith a BREAKING banner and one ADR-0087 disposition:20890-dataset-dimension-json-stored-refused.md:not-required (no-migration-prescription).20890-dataset-distinct-multiple-refused.md:not-required (already-registered dataset-measure-aggregate-field-type-refused).Acceptance notes
dataset-measure-aggregate-field-type-refusednames the JSON-stored types but not themultiple: truedeclaration. Widening that sentence is apackages/specedit outside this card. Carrier: none.Generated by Claude Code