Repository navigation
Commit cef2bd7
Fixes #21647
Clause-②: no
This is the remainder of #21647, per triage's answer on the card. The
enumeration pin's named exception is `driver-turso`'s remote face. It
now asserts the **equivalence**, not merely that a statement prints: the
printed statement, run with its params on that face's datasource,
answers the face's keys and rows. The rule itself landed with PR #21664
(`31e3e00939`). This PR is test-only.
## What changes
One file changes:
`packages/services/service-analytics/src/__tests__/objectql-echo-bucket-enumeration.test.ts`
(+104 / -20).
- **The harness.**
- A face that declares `printsWhileEngineBucketsInMemory` is served over
a seeded table (`EXCEPTION_DEALS`, six rows). Its two data doors record
the tier and pass through, so its rows are real.
- Every other face keeps the spies that answer nothing.
- `ask()` now also returns the face's rows and the dry run's params.
- `run()` sends a printed statement, with its params, through the
engine's raw-SQL bridge (`engine.execute`, with `args` and `object`).
The measure-filter case in `objectql-echo-date-bucket.test.ts` does the
same.
- **The cell.**
- The exception prints in 10 cells: UTC and unset, each of the five
granularities.
- Each of them runs `dryRun.sql` with `dryRun.params`, and asserts the
`[closed_at, amount_sum]` pairs equal the face's rows.
- A non-vacuity guard asserts that the face answered more than one
bucket and counted every seeded row (total 40).
- The query asks no `order`, so both sides are compared ordered by the
bucket.
- **The fixture.**
- It straddles an ISO week-year boundary: Sunday 2025-12-28 is
`2025-W52`, and Monday 2025-12-29 is `2026-W01`. Both fall in calendar
2025.
- Every granularity has a bucket that sums two rows.
- **The header.** "The one named exception" is now "The two named
exceptions, and the equivalence each asserts". It names both cells, what
each asserts, and where.
- **No new call site.** No `analytics.query(` call site is added. The
file still has 2, as the client envelope-caller census ledgers it.
## PM assumption 1, the measure-filter case: confirmed, not touched
Read on `main` `7d0781482d`:
- The case "a measure filter, which the engine aggregates in memory"
(`objectql-echo-date-bucket.test.ts` :258-:266) sits inside the `for
(const cell of CELLS)` loop.
- So it runs on SQLite on every run, and on PostgreSQL where
`OS_TEST_POSTGRES_URL` is set.
- CI sets that variable for this package's full suite in the required
`Temporal Conformance (live PG + MySQL)` job, in the step "Run the
non-SQL temporal backends under the skewed process zone".
- It was also measured here, on a throwaway PostgreSQL 16.14: both of
its cells passed (see below).
That file is unchanged.
## Evidence (all at `ce0acc38d2`)
- **Probe.** It was read once, and the file was restored. In all 10
printed cells, the face's rows equal the rows of the printed statement,
run. For example, at `week` both sides answer `2025-W52 3, 2026-W01 20,
2026-W05 7, 2026-W06 5, 2026-W14 5`. The params are `[]`.
- **Ablation, predicted before the run.**
- The mutation is in the comparison only: the statement that is run has
its bucket expression swapped for the next granularity's (day to week,
and so on, year to day).
- Prediction: exactly the 10 remote-face printed cells turn red, and 201
stay green.
- Observed through `scripts/ablation-replace.mjs`, in wrap mode, under
the verify lock. The anchor went from 1 to 0, and the blob from
`9c7149174d19` to `391589af96fb`.
- Result: **10 failed / 201 passed (211)**. Each failure is the
equivalence assertion. For example, it received `2025-W52` where the
face answered `2025-12-28`.
- Restore: the blob after restore is `9c7149174d19`, equal to `HEAD`,
and `git diff HEAD` is empty.
- There is no `dist` leg: the mutation is in the test file, which vitest
reads from `src`.
- **The two echo files on live PostgreSQL 16.14:** 260 of 260 passed, 0
skipped. The measure-filter case passed on SQLite and on PostgreSQL.
- **The `@objectstack/service-analytics` `test` script:** 177 files
passed; 4403 tests passed and 262 skipped (the live-server cells, with
no server).
- **Typecheck:** `pnpm --filter @objectstack/service-analytics
typecheck` exits 0, and `tsc --listFiles` includes the edited test file.
- **Client census:** `src/envelope-caller-census.test.ts`, 20 of 20.
- **Gates.**
- `dispatch-gates --repo objectstack-ai/objectstack --commands` derived
55 commands for the one path.
- All 55 exited 0, after a full `turbo run build` (73 of 73).
- `--ran`: 55 derived, 55 run, 0 NOT-MEASURED, 0 UNRUN.
- The deriver names three roster gates whose roster shares a directory
with this path: `check:authz-resolver`, `check:error-code-casing` and
`check:filter-alias-parity`. They exited 0 too.
- **Lint, a declared narrowing.**
- Population: eslint's own config admits the file (`--print-config`
answers).
- Count: `--no-inline-config --format json` reports 1 file, 0 errors, 0
warnings.
- Invariance: `eslint.config.mjs` enables no type-aware linting, so this
diff cannot move the verdict on an untouched file.
## Changeset
There is none. The diff is one test file, and
`@objectstack/service-analytics` ships only `dist`, `README.md` and
`CHANGELOG.md`. The declaration is the `skip-changeset` label.
## Acceptance notes
- **The exception's datasource.** Here it is better-sqlite3, the row's
stand-in by code path. That libSQL answers the same labels as
better-sqlite3 for this expression is pinned by `driver-turso` itself,
in the `dateBucketSql` block of
`turso-remote-inherited-members.test.ts`. This file does not import
`driver-turso`.
- **The pushdown printing cells.** The enumeration's other printing
cells (sqlite, sqlite-wasm, the Turso local face) are not run here.
There, the driver grouped by the printed expression itself, and
`objectql-echo-date-bucket.test.ts` runs that echo on SQLite and
PostgreSQL.
- **An observation, not measured.**
- `ObjectQLStrategy.generateSql` renders the table as `FROM "TABLE"`,
with ANSI double quotes, on every dialect (`objectql-strategy.ts` :820).
- `driver-sql` does not enable `ANSI_QUOTES` on a MySQL session.
- Read that way, MySQL would refuse a UTC echo at its `FROM`.
- No MySQL server was available, and the echo pin's MySQL cells never
run a statement.
- Recorded, not filed.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01DiCSbmJrkzNhuEAier4VoJ)_
Co-authored-by: Claude <noreply@anthropic.com>
1 parent 251a7dd commit cef2bd7
1 file changed
Lines changed: 104 additions & 20 deletions
Lines changed: 104 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
36 | 39 | | |
37 | 40 | | |
38 | 41 | | |
| |||
81 | 84 | | |
82 | 85 | | |
83 | 86 | | |
84 | | - | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
85 | 95 | | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
92 | 111 | | |
93 | 112 | | |
94 | 113 | | |
| |||
123 | 142 | | |
124 | 143 | | |
125 | 144 | | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
126 | 172 | | |
127 | 173 | | |
128 | 174 | | |
| |||
154 | 200 | | |
155 | 201 | | |
156 | 202 | | |
157 | | - | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
158 | 206 | | |
159 | 207 | | |
160 | 208 | | |
| |||
230 | 278 | | |
231 | 279 | | |
232 | 280 | | |
233 | | - | |
| 281 | + | |
234 | 282 | | |
235 | 283 | | |
236 | 284 | | |
| |||
256 | 304 | | |
257 | 305 | | |
258 | 306 | | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
264 | 323 | | |
265 | 324 | | |
266 | 325 | | |
267 | 326 | | |
268 | 327 | | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
269 | 332 | | |
270 | 333 | | |
271 | 334 | | |
| |||
277 | 340 | | |
278 | 341 | | |
279 | 342 | | |
280 | | - | |
| 343 | + | |
281 | 344 | | |
282 | 345 | | |
283 | 346 | | |
284 | 347 | | |
285 | 348 | | |
286 | 349 | | |
287 | | - | |
288 | | - | |
| 350 | + | |
| 351 | + | |
289 | 352 | | |
290 | | - | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
291 | 364 | | |
292 | 365 | | |
293 | 366 | | |
| |||
297 | 370 | | |
298 | 371 | | |
299 | 372 | | |
300 | | - | |
| 373 | + | |
301 | 374 | | |
302 | 375 | | |
303 | 376 | | |
| |||
341 | 414 | | |
342 | 415 | | |
343 | 416 | | |
344 | | - | |
| 417 | + | |
345 | 418 | | |
346 | 419 | | |
347 | 420 | | |
| |||
360 | 433 | | |
361 | 434 | | |
362 | 435 | | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
363 | 447 | | |
364 | 448 | | |
365 | 449 | | |
| |||
0 commit comments