Commit aa3f9ba
fix(drivers): a declared field written as an explicit
* fix(drivers): a declared field written as an explicit `undefined` is indistinguishable from one never written
A row has two states to say about a field — the key is absent, or the key
holds a value. An own key holding `undefined` is neither, so every consumer
had to invent a reading of it, and measured on `origin/main` they disagreed:
CEL (`has(record.f)` is `false`) and `materializeDeclaredFields` read it as
absent, a bare `f in row` reads it as present.
Both JS-backed drivers were measured separately and did NOT match.
`driver-memory` emitted the own key from `create` and `find` alike, while its
own projection path and its own matcher already read the shape as absent.
`driver-mongodb` split: `create()` returned an own key holding `undefined`
while BSON stored `null` for the same field (MongoClient default
`ignoreUndefined: false`, no override here), so `find()` answered with a
value — one write, two answers, from one driver.
Both drivers now drop own keys holding `undefined` on the way into storage.
`null` is untouched and stays a value. No accept set moves and no exported
name changes. On `driver-mongodb` the scope is the insert doors and the
returned values; `$set`-shaped patches are left alone, and on `driver-memory`
the normalisation is post-merge, so neither driver answers "what does a patch
carrying `undefined` mean" — that is a storage-contract question this repair
does not reopen.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W6HFzyH98W1YaQXhJUJt6o
* wip(drivers): recovered uncommitted own-key-undefined pins from a killed seat
NOT REVIEWED, NOT VERIFIED. The resumed dispatch was killed before it
committed these; recovered so they survive the container.
Both files are the card's two outstanding obligations by name:
memory-own-key-undefined.test.ts and mongodb-own-key-undefined.test.ts —
the second being the driver-mongodb measurement the card asked for
explicitly and told the dev not to assume matched driver-memory.
No gate was run against them, no ablation exists, and the fail-OPEN
consumer sweep the card stars as a separate, more urgent card is not
evidenced anywhere in this branch.
* record: correcting e87cf37 — the seat it rescued was alive, and its verification exists
e87cf37 was written by a worktree-rescue actor at 2026-08-27T02:23:47Z. Its
content is correct and is kept as-is; its MESSAGE is not, and it cannot be
amended from this seat without a force-push, which the dev contract forbids.
So the correction is additive, here.
That message says the dispatch "was killed before it committed these", and
that "No gate was run against them, no ablation exists, and the fail-OPEN
consumer sweep ... is not evidenced anywhere in this branch."
The seat was not killed. It was mid-task, in the same session that had already
run all three of those things against exactly the content e87cf37 committed,
and it continued from there to finish this branch. On that content:
* 23 gate families derived by scripts/pm/dispatch-gates.mjs --repo, all green,
each exit code captured before any pipe and each quoted from the gate's own
verdict line;
* two ablation legs with the direction AND the exact failure count written
down first — 8 of 10 in driver-memory, 4 of 6 in driver-mongodb, both as
predicted, mutation proved on disk with anchored grep -cF counts, restored
under `trap ... EXIT INT TERM` with an empty `git diff` verified;
* the fail-OPEN consumer sweep, over 110 non-test presence tests under
packages/, with a synthetic positive control that fires in the same scan.
No fail-open consumer found.
Recorded because the branch is squash-merged and `git log` otherwise ends on a
commit stating that this branch's verification does not exist.
The mechanism defect is filed as #12637, a sub-issue
of #12627 (which proposes the rescue step that has no liveness precondition).
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W6HFzyH98W1YaQXhJUJt6o
---------
Co-authored-by: Claude <noreply@anthropic.com>undefined is indistinguishable from one never written (#12641)1 parent 2fc96ab commit aa3f9ba
5 files changed
Lines changed: 555 additions & 8 deletions
File tree
- .changeset
- packages/drivers
- driver-memory/src
- driver-mongodb/src
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
98 | 157 | | |
99 | 158 | | |
100 | 159 | | |
| |||
252 | 311 | | |
253 | 312 | | |
254 | 313 | | |
255 | | - | |
| 314 | + | |
256 | 315 | | |
257 | 316 | | |
258 | 317 | | |
| |||
399 | 458 | | |
400 | 459 | | |
401 | 460 | | |
402 | | - | |
| 461 | + | |
403 | 462 | | |
404 | 463 | | |
405 | 464 | | |
| |||
426 | 485 | | |
427 | 486 | | |
428 | 487 | | |
429 | | - | |
| 488 | + | |
430 | 489 | | |
431 | 490 | | |
432 | 491 | | |
| |||
525 | 584 | | |
526 | 585 | | |
527 | 586 | | |
528 | | - | |
| 587 | + | |
529 | 588 | | |
530 | 589 | | |
531 | 590 | | |
| |||
1467 | 1526 | | |
1468 | 1527 | | |
1469 | 1528 | | |
| 1529 | + | |
| 1530 | + | |
| 1531 | + | |
| 1532 | + | |
| 1533 | + | |
| 1534 | + | |
| 1535 | + | |
| 1536 | + | |
| 1537 | + | |
| 1538 | + | |
| 1539 | + | |
| 1540 | + | |
1470 | 1541 | | |
1471 | 1542 | | |
1472 | 1543 | | |
| |||
0 commit comments