Skip to content

test(service-analytics): the Turso remote-face echo exception asserts its equivalence (#21647) - #21684

Merged
objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/issue-21647-turso-remote-echo-equivalence
Oct 4, 2026
Merged

objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/issue-21647-turso-remote-echo-equivalence

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

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

… its equivalence

The enumeration pin's named exception (driver-turso's remote face, where the
engine buckets in memory and the echo still prints the inherited SQLite
expression) pinned only that a statement prints. Per #21647's triage, an
exception must assert the equivalence: the printed statement, run with its
params on the face's datasource, answers the face's keys and rows.

A face that declares printsWhileEngineBucketsInMemory is now served over a
seeded table with pass-through doors. Each of its printed cells (UTC and
unset, every granularity) runs dryRun.sql with dryRun.params through the
engine's raw-SQL bridge and asserts the closed_at / amount_sum pairs equal
the face's rows, with a non-vacuity guard. The header names both exceptions
and where each asserts its equivalence. No new analytics.query call site.

Claude-Session: https://claude.ai/code/session_01DiCSbmJrkzNhuEAier4VoJ
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet objectstack-fleet Bot added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Oct 4, 2026
@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

Nothing in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 0 changed package(s)), so this run has no opinion about the docs.

What this run could not see

Coarse fallback — 0 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 7d0781482dbb6502aa33c29bec96ca03636f7df9 → packageMentionDocs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/m skip-changeset PR has no user-facing published change; bypasses the changeset gate tests

Projects

None yet

2 participants