Repository navigation
Commit 357f499
feat(service-analytics)!: refuse an aggregate a datetime measure's field type cannot carry, and reconcile the storage-form annotations to one measured statement (#16778)
* feat(service-analytics)!: refuse an aggregate a measure's field type cannot carry
WIP — compile-leg refusal + the four reconciled datetime-storage annotations.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012zTkyNHJ7TkuN2oXtP5x37
* wip: changeset + adr-0087 ledger entry
* fix(service-analytics): scope the compile-leg refusal to temporal source fields
The full table refuses `min`/`max` over the string classes and the boolean rows,
both of which this platform answers on purpose and pins with tests (#15768,
maintainer ruling #11152). Executing those is a product judgement that belongs to
#16099; the temporal rows carry no such collision and are the ones this card is
about. Re-points the two `measure-result-type.test.ts` fixture measures that
aggregated a datetime column, and corrects the module header that recorded the
missing refusal as an open finding.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012zTkyNHJ7TkuN2oXtP5x37
* docs(changeset,spec): scope the breaking declaration to the temporal class it actually withdraws
The compile leg was scoped to TEMPORAL source fields in 80ec9f2, but the
changeset and the ADR-0087 ledger entry still described the pre-scoping
full-table gate. A breaking-change record that overstates what changed tells
every consumer reading the release notes that behaviour was withdrawn which
was not.
F1 — the breaking declaration:
- changeset FROM/TO: the two `percent` rows dropped (`sum` x `percent` is a
table row this leg does not execute; `avg` x `percent` was never a
migration at all), and the surviving `avg` row widened to name all three
temporal members it does refuse.
- changeset: a new scope section states the temporal scope outright, and that
the string rows sit under #16785 (ruled C - the table is to be AMENDED to
accept them), the boolean rows were settled as ACCEPT by #16685 / #16750,
and `sum` x `percent` is not executed here.
- ledger `surface`: scoped to the temporal class; "sum over a percent" removed.
- ledger `replacement`: the "`avg` for a `percent`" prescription dropped with
the surface rows it belonged to.
- ledger `acceptanceCriteria`: qualified to a measure over a
`date` / `datetime` / `time` field, and says outright that a field of any
other class is neither refused nor certified by this leg.
- `registry.ts` REGENERATED with `pnpm --filter @objectstack/spec
gen:migration-registry`, never hand-edited; two consecutive runs are
byte-identical and the diff is confined to this entry's block.
- also corrected: the changeset said "four contradictory annotations"; the
sweep reconciled seven source sites plus two test narratives.
F2 — the boolean collision is settled, so stop narrating it as live. #16685
was ruled A and #16750 added `boolean` / `toggle` to the four arithmetic /
order rows, so the table ACCEPTS them. Reworded in `dataset-compiler.ts`'s
scope docblock, the refusal suite's module header, and `measure-result-type.ts`
(whose boolean paragraph still referred a missing refusal onward). All three
now also record #16785 C for the string rows.
F3 — the ledger `reason` presented both dialect halves as measured alike. The
SQLite half is pinned by a live `sql.js` suite; the Postgres 42883 half was
measured in-session and is pinned by nothing. Said so where it is stated.
F4 — the scope-boundary test asserted `isAggregateCompatibleWithFieldType(
'min', 'text') === false`, a verdict #16785 C is about to amend. Dropped: the
case now pins only what this PR owns - a non-temporal field is not judged, so
the measure compiles and SQL is emitted. Refutability is carried by a second
case on `sum` x `text`, a row no ruling is moving, plus a non-vacuity
assertion that SQL reached the driver in both.
F5 — the changeset now names the two uncovered faces: `/analytics/query` and
any `compileDataset` caller wiring no `declaredFieldType` probe.
Refs #16737. Review: PR #16778 contract review, comment 5580295870.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012zTkyNHJ7TkuN2oXtP5x37
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 0e7ef84 commit 357f499
13 files changed
Lines changed: 1173 additions & 70 deletions
File tree
- .changeset
- packages
- services/service-analytics/src
- __tests__
- strategies
- spec/src/migrations
- entries/semantic
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
0 commit comments