Repository navigation
Commit 42d78b9
fix(driver-turso,driver-sql): refusals and log lines state each decision in words instead of a tracker number (stage 4) (#20877)
Part of #20513
Clause-②: no
**Stage 4 of 5 of this lane (`driver-turso`), under the maintainer's A /
A ruling on the card, plus the three `driver-sql` aggregate refusals
stage 1 held for their Turso twins.** The card stays open for stage 5,
so this PR carries no closing keyword. Text only: no error `code`, field
name, HTTP status, export or control flow moves. Every changed source
line sits inside a string literal: a TypeScript-scanner skeleton of each
of the four source files (every literal replaced by one placeholder,
pure-literal `+` joins collapsed, comments dropped) is identical at the
merge base and at the head, and the same check reports DIFF on a file
with a real code change (control).
## What this does
The Turso driver's refusals and log lines sent the reader to a tracker
number for the reason behind them. Most of the remote transport's
numbers were bare ids from the repository that file used to live in
(`remote-transport.ts` was moved here from the cloud repository), so in
this repository they resolve to unrelated cards: a Vercel deploy fix, a
CLI command, a version-packages PR. Each rewritten string now says the
reason in words (form D, as the migration-entry rewrite and stages 1 to
3 applied it). Where the sentence already stated what was decided, only
the citation goes. Where it did not, the decision is added in words:
| Where | Cited | The sentence now says |
|---|---|---|
| `remote-transport.ts` non-boolean `$null` diagnostic | objectstack
5347, objectstack 5368, cloud 1116 | Every driver now refuses it, so one
filter no longer gets a different answer per backend. |
| `turso-driver.ts` remote `auto_number` refusal (thrown, 501) | 6944 |
It is refused rather than resolved, because resolving would write NULL
into the slot and persist the row without its record number. This
replaces "Until this change the same call RESOLVED and wrote NULL",
which described history rather than today. |
| `remote-canonical-backfill.ts` info line | 5770 | The converted rows
now hold the one canonical text form, and the column drops the
unindexable read-side repair only once a pass finds nothing left to
convert. |
| `remote-canonical-backfill.ts` unresolvable-remainder warning | cloud
1005 (with a Chinese tag) | A value that cannot be read as an instant is
counted and reported, never guessed at. |
| everything else: the five aggregate refusals, the withheld cross-field
and unbindable-comparand wire sentences, the full diagnostics of the
unsupported-operator, unlowered-`$between`, undeclared and non-list
combinator, non-node operand, non-object `where`, empty operator map,
undefined comparand, unbindable comparand and non-boolean `$exists`
refusals, and the unnumbered-upsert warning | 5907, 10413, 6409, 6212,
5347, 5369, 5903, 5769, 5348, 6050, 7929, 8197, 7099, cloud 1003, 1004,
1051, 1058, 1066, 1073, 1075, 1076 | The sentence already said what was
decided; only the citation goes. |
Each new sentence was checked against today's code, not only against the
cited card: a non-boolean `$null` is refused by all five drivers
(`driver-sql`'s `nonBooleanNullComparandError`, inherited by
`driver-sqlite-wasm` and Turso local; `driver-memory`'s
`filter-refusal.ts` door and query path; `driver-mongodb`'s
`mongodb-filter.ts`; this transport);
`refuseUngeneratableRemoteAutonumber` runs on `create`, `bulkCreate` and
a match-key-less `upsert`, and `RemoteTransport.create` builds its own
INSERT without `fillAutoNumberFields`; the backfill marks a column
canonical only when its post-pass probe finds nothing left to change,
and leaves out-of-band digit rows alone, counted into
`unresolvedEpochTextRows`.
## The three held pairs, moved together
Stage 1 held three `driver-sql` aggregate refusals (undeclared function,
`count_distinct` without `field`, per-aggregation `filter`) because
`driver-turso` compares them byte for byte with the remote transport's
copies. Both faces drop the citation in one commit (`fe71ac88e`), and
the pins stay byte-exact:
`remote-transport-aggregate-function-refusal.test.ts` (the undeclared
`median` / `array_agg` / `string_agg` and miscased cases, the field-less
`count_distinct` case, the per-aggregation filter case) and
`remote-transport-undeclared-aggregate-keys.test.ts` (the `func:`
spelling) compare the two runtime messages. The same commit drops the
remote declared-but-uncompiled and date-bucket citations, whose
`driver-sql` copies stage 1 already cleared, so those pairs read
identically again.
One-off ablation on the committed head, run under a shell trap: the
three old citations planted back on the `driver-sql` face only
(`scripts/ablation-replace.mjs`, each anchor hit once, disk-verified),
`driver-sql` rebuilt, each marker confirmed in `dist/`
(`scripts/ablation-dist-preflight.mjs`). The two `driver-turso` files
then gave **10 failed, 23 passed**: every pair has a live pin. After the
restore (blob equal to HEAD, `git diff HEAD` empty), the rebuild, and
all three markers confirmed absent from `dist/`, they gave 33/33. `git
status --porcelain` was empty afterwards.
`remote-transport-compile-refusal-seam.test.ts` derives the remote
`$between` arity sentence from `driver-sql`'s by stripping a
parenthesised id. Neither side carries one any more, so that strip is
now an identity; no sentence in this stage is derived that way.
## Order inside the stage
32 literals (47 occurrences) fit one PR, under the stop line, so the
stage lands whole in four ordered commits. Each of the first three
recomputes the ledger, so every commit is green on
`check:doc-authoring`:
1. `fe71ac88e` author-visible: the aggregate refusal family, 8 literals
on both faces;
2. `ab16ca922` author-visible: the remote filter refusals and the
`auto_number` refusal, 21 literals (36 occurrences), plus the two
re-pinned tests;
3. `8c7541655` log lines: 3 literals;
4. `252a378f9` the changeset.
`driver-turso` has no ledgered `src/`-shipped test string (its two
testkits carry no id).
## Pins re-pinned: 2 tests in 2 test files (4 id assertions become 3
sentence assertions)
- `remote-transport-null-comparand-refusal.test.ts`: "cites the ruling
and the framework landing so both repos are findable" asserted three
ids. It now states the ruling in words and asserts "It is refused rather
than coerced" and "Every driver now refuses it, so one filter no longer
gets a different answer per backend."
- `remote-transport-comparand-refusal.test.ts` 234 matched two ids. It
now asserts `indistinguishable from "no rows matched".`
A one-off mutation proves each moved pin can fail, run on the committed
head with `scripts/ablation-replace.mjs` in wrap mode under a shell
trap. The tests import the transport from `src`, so no build leg
applies. "Every driver now" to "Every backend now": 1 failed / 54
passed. Appending "here" after "no rows matched": 1 failed / 26 passed.
After each leg the blob equals HEAD and `git diff HEAD` is empty; both
files then gave 82/82, and `git status --porcelain` had 0 lines.
No test outside `driver-turso` pins a changed string. Every fragment of
every changed sentence was searched in all test files of the repository:
the hits are unrelated uses of common phrases, and `rest`'s
`rest-4xx-message-truncation.test.ts`, whose own copy of a `$null`
sentence is never compared with a driver's (see Acceptance notes).
## Ledger burn-down
`scripts/doc-authoring-prose-id.baseline.json` was regenerated with
`node scripts/check-doc-authoring.mjs --census-ledger` into a scratch
file, so the growth refusal ran against the checked-in baseline, and
then copied into place. Only these four rows move, and every one leaves:
| File | Occurrences before | after | (file, id) pairs before | after |
|---|---:|---:|---:|---:|
| `driver-turso/src/remote-transport.ts` | 40 | 0 (row leaves) | 22 | 0
|
| `driver-turso/src/turso-driver.ts` | 2 | 0 (row leaves) | 2 | 0 |
| `driver-turso/src/remote-canonical-backfill.ts` | 2 | 0 (row leaves) |
2 | 0 |
| `driver-sql/src/sql-driver.ts` (the three held) | 3 | 0 (row leaves) |
3 | 0 |
| **whole ledger** | **769** | **722** | **514** | **485** |
The ledger's file count goes from 204 to 200; the gate's printed pinned
sites (id-bearing literals) go from 647 to 615. A census of every other
package's (file, id) occurrences before and after is identical (722 =
722).
**The census count, reconciled.** The census counted 24 messages for
`driver-turso`; the ledger holds 44 occurrences. The gate counts 29
string literals. The census folds a `+` chain into one message, and five
two-literal chains (the `$exists` diagnostic, the undeclared-combinator
tail, the `$and` / `$or` requirement, and the cross-field and unbindable
wire sentences) make 29 literals into 24 messages. Those 29 literals
carry 44 occurrences, the census's own "id occurrences 44". With
`driver-sql`'s 3 held literals, this stage moves 32 literals and 47
occurrences.
## Verification (head `252a378f99`)
- Build: `turbo run build` over `./packages/*` and `./packages/*/*`,
71/71, under the verify lock. `driver-sql` was rebuilt directly by the
ablation's restore leg, and `driver-turso` directly after the pin
mutations (their restore rewrote `remote-transport.ts`). The new
sentences are in `dist/index.js` of both packages; the only citations
left in either `dist/` are docblocks.
- `@objectstack/driver-turso` tests (`vitest run --maxWorkers=2`,
reading the rebuilt `driver-sql` `dist/`): 80 files passed; 2,195 tests
passed, 33 skipped.
- `@objectstack/driver-sql` tests: 201 files passed and 11 skipped (the
live PG / MySQL cells; no server here); 3,254 tests passed, 188 skipped.
- `@objectstack/driver-sqlite-wasm` (extends `SqlDriver`): 36 files, 675
tests passed.
- Typecheck: `@objectstack/driver-turso` and `@objectstack/driver-sql`
`typecheck` exit 0; `tsc --listFiles` for `driver-turso` reads 80 test
files, both re-pinned ones among them.
- Derived gates: `node scripts/pm/dispatch-gates.mjs --commands` (no
paths; 8 paths against merge base `72f8c3820`) names 71 commands, and
all 71 exit 0. `check:type-check-debt` first answered exit 3
(PREREQUISITE NOT MET: `driver-turso`'s type entry older than its
sources, after the mutation restore); after the direct `driver-turso`
rebuild it exits 0, and `check:dts-closure`,
`check:dual-build-cjs-loads` and `check:lean-entry-closure` were re-run
there too. `--ran` with exit codes recorded: "71 derived, 71 run, 0
NOT-MEASURED, 0 UNRUN". `check:doc-authoring`: "sibling-package prose
ids hold the baseline — 615 pinned site(s) across 200 file(s) ... no
growth, no burn-down unrecorded".
- Narrowed lint: `eslint --no-inline-config --format json` over the 6
touched `.ts` files reports 6 files, 0 errors, 0 warnings. The resolved
`parserOptions` are `ecmaVersion: latest` and `sourceType: module` only,
with no `project` or `projectService`, so no type-aware rule can move an
untouched file. Repo-wide `pnpm lint` is CI's.
- NOT MEASURED locally (CI's): the live PG / MySQL cells of the
`driver-sql` suite (the required `Temporal Conformance (live PG +
MySQL)` job runs them), the Test Core shards, Dogfood, and the workspace
type-check lanes. `origin/main` moved 4 commits after the branch point;
none touches these files or the ledger, and CI tests the merge ref.
## Acceptance notes
- **Cited cards read.** The 15 objectstack issues cited read closed as
completed, and PR 5368 is merged; no cited decision has been reversed.
The 10 cloud-repository ids (1003, 1004, 1005, 1051, 1058, 1066, 1073,
1075, 1076, 1116) are not readable from this session (the REST read
answers 403, repository not enabled). The same numbers in this
repository are unrelated cards, so they were never resolvable here.
Those sentences were rewritten from their own words and the file's
docblocks, checked against today's code.
- **Noted, not filed (carrier: #20595).** `remote-transport.ts`'s
comments and docblocks still cite those bare cloud ids, which in this
repository resolve to unrelated cards. Comments are outside this ruling
and belong to #20595.
- **Noted, not filed (carrier: stage 5 of this card).**
`driver-memory`'s non-boolean `$null` refusal (`filter-refusal.ts`)
still ends with its citation; `driver-memory` is in stage 5.
- **Noted, not filed (carrier: none).** `rest`'s
`rest-4xx-message-truncation.test.ts` builds its own copy of
`driver-sql`'s `$null` sentence, citation included, as a truncation
fixture. It is a test file outside the ledger, and nothing compares it
with the driver's text.
- **Noted, not filed (carrier: none).** The test titles in
`driver-turso`'s `*.test.ts` files still carry cloud ids (for example
the refusal-envelope table in
`remote-transport-null-comparand-refusal.test.ts`). They are test files,
outside the ledger and outside the ruling's shipped-`src/` scope.
- **Noted, not filed (carrier: none).** The new `$null` sentence says
"every driver", not "every evaluator": `@objectstack/formula`'s
`matchesFilter` reads a non-`true` `$null` as IS NOT NULL. Nothing here
measured a public door that hands it a non-boolean, so this is a reading
only.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01DEvba2nBuD4tWzfq8r8NFY)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent ca5408c commit 42d78b9
8 files changed
Lines changed: 77 additions & 78 deletions
File tree
- .changeset
- packages/drivers
- driver-sql/src
- driver-turso/src
- scripts
Lines changed: 33 additions & 0 deletions
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1696 | 1696 | | |
1697 | 1697 | | |
1698 | 1698 | | |
1699 | | - | |
| 1699 | + | |
1700 | 1700 | | |
1701 | 1701 | | |
1702 | 1702 | | |
| |||
1800 | 1800 | | |
1801 | 1801 | | |
1802 | 1802 | | |
1803 | | - | |
| 1803 | + | |
1804 | 1804 | | |
1805 | 1805 | | |
1806 | 1806 | | |
| |||
1834 | 1834 | | |
1835 | 1835 | | |
1836 | 1836 | | |
1837 | | - | |
| 1837 | + | |
1838 | 1838 | | |
1839 | 1839 | | |
1840 | 1840 | | |
| |||
Lines changed: 5 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
810 | 810 | | |
811 | 811 | | |
812 | 812 | | |
813 | | - | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
814 | 816 | | |
815 | 817 | | |
816 | 818 | | |
| |||
833 | 835 | | |
834 | 836 | | |
835 | 837 | | |
836 | | - | |
837 | | - | |
| 838 | + | |
| 839 | + | |
838 | 840 | | |
839 | 841 | | |
840 | 842 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
234 | | - | |
| 234 | + | |
235 | 235 | | |
236 | 236 | | |
237 | 237 | | |
| |||
Lines changed: 5 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
177 | | - | |
| 177 | + | |
178 | 178 | | |
179 | | - | |
180 | | - | |
181 | | - | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
182 | 183 | | |
183 | 184 | | |
184 | 185 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
945 | 945 | | |
946 | 946 | | |
947 | 947 | | |
948 | | - | |
| 948 | + | |
949 | 949 | | |
950 | 950 | | |
951 | 951 | | |
| |||
984 | 984 | | |
985 | 985 | | |
986 | 986 | | |
987 | | - | |
| 987 | + | |
988 | 988 | | |
989 | 989 | | |
990 | 990 | | |
| |||
1011 | 1011 | | |
1012 | 1012 | | |
1013 | 1013 | | |
1014 | | - | |
| 1014 | + | |
1015 | 1015 | | |
1016 | 1016 | | |
1017 | 1017 | | |
| |||
1068 | 1068 | | |
1069 | 1069 | | |
1070 | 1070 | | |
1071 | | - | |
| 1071 | + | |
1072 | 1072 | | |
1073 | 1073 | | |
1074 | 1074 | | |
| |||
1105 | 1105 | | |
1106 | 1106 | | |
1107 | 1107 | | |
1108 | | - | |
| 1108 | + | |
1109 | 1109 | | |
1110 | 1110 | | |
1111 | 1111 | | |
| |||
3853 | 3853 | | |
3854 | 3854 | | |
3855 | 3855 | | |
3856 | | - | |
3857 | | - | |
| 3856 | + | |
| 3857 | + | |
3858 | 3858 | | |
3859 | 3859 | | |
3860 | 3860 | | |
| |||
3946 | 3946 | | |
3947 | 3947 | | |
3948 | 3948 | | |
3949 | | - | |
| 3949 | + | |
3950 | 3950 | | |
3951 | 3951 | | |
3952 | 3952 | | |
3953 | 3953 | | |
3954 | | - | |
| 3954 | + | |
3955 | 3955 | | |
3956 | 3956 | | |
3957 | 3957 | | |
| |||
4156 | 4156 | | |
4157 | 4157 | | |
4158 | 4158 | | |
4159 | | - | |
| 4159 | + | |
4160 | 4160 | | |
4161 | 4161 | | |
4162 | 4162 | | |
| |||
4182 | 4182 | | |
4183 | 4183 | | |
4184 | 4184 | | |
4185 | | - | |
| 4185 | + | |
4186 | 4186 | | |
4187 | 4187 | | |
4188 | 4188 | | |
| |||
4239 | 4239 | | |
4240 | 4240 | | |
4241 | 4241 | | |
4242 | | - | |
| 4242 | + | |
4243 | 4243 | | |
4244 | 4244 | | |
4245 | 4245 | | |
4246 | 4246 | | |
4247 | 4247 | | |
4248 | 4248 | | |
4249 | 4249 | | |
4250 | | - | |
4251 | | - | |
| 4250 | + | |
4252 | 4251 | | |
4253 | 4252 | | |
4254 | 4253 | | |
| |||
4291 | 4290 | | |
4292 | 4291 | | |
4293 | 4292 | | |
4294 | | - | |
| 4293 | + | |
4295 | 4294 | | |
4296 | 4295 | | |
4297 | 4296 | | |
| |||
4439 | 4438 | | |
4440 | 4439 | | |
4441 | 4440 | | |
4442 | | - | |
| 4441 | + | |
4443 | 4442 | | |
4444 | 4443 | | |
4445 | 4444 | | |
| |||
4490 | 4489 | | |
4491 | 4490 | | |
4492 | 4491 | | |
4493 | | - | |
| 4492 | + | |
4494 | 4493 | | |
4495 | 4494 | | |
4496 | 4495 | | |
4497 | | - | |
4498 | | - | |
| 4496 | + | |
| 4497 | + | |
4499 | 4498 | | |
4500 | 4499 | | |
4501 | 4500 | | |
| |||
4562 | 4561 | | |
4563 | 4562 | | |
4564 | 4563 | | |
4565 | | - | |
4566 | | - | |
| 4564 | + | |
| 4565 | + | |
4567 | 4566 | | |
4568 | 4567 | | |
4569 | 4568 | | |
| |||
4601 | 4600 | | |
4602 | 4601 | | |
4603 | 4602 | | |
4604 | | - | |
| 4603 | + | |
4605 | 4604 | | |
4606 | 4605 | | |
4607 | 4606 | | |
| |||
4687 | 4686 | | |
4688 | 4687 | | |
4689 | 4688 | | |
4690 | | - | |
| 4689 | + | |
4691 | 4690 | | |
4692 | | - | |
| 4691 | + | |
4693 | 4692 | | |
4694 | 4693 | | |
4695 | 4694 | | |
| |||
4712 | 4711 | | |
4713 | 4712 | | |
4714 | 4713 | | |
4715 | | - | |
| 4714 | + | |
4716 | 4715 | | |
4717 | 4716 | | |
4718 | 4717 | | |
4719 | 4718 | | |
4720 | 4719 | | |
4721 | | - | |
4722 | | - | |
| 4720 | + | |
| 4721 | + | |
4723 | 4722 | | |
4724 | 4723 | | |
4725 | 4724 | | |
| |||
0 commit comments