Skip to content

$exists still reads KEY-PRESENCE rather than has-value on driver-memory's live mingo path and driver-mongodb — the #5499 freeze that excused it dissolved, #13166 explicitly excludes it, so it is now unexcused AND untracked #13195

Description

@os-trump

Surfaced while implementing #13168 (the stale-#5499-prose card). Recording it because the sentence that carried this gap named the dissolved freeze as the reason, and restating that sentence honestly is what makes the gap visible.

⚠️ Read, not re-measured. Everything below is read off the recorded measurement in packages/spec/src/data/filter-logic-conformance.ts and the two cards named at the bottom. I did not execute the matrix myself — #13166's filer did execute theirs, and their own finding was that reading UNDER-states divergence. Treat the numbers here as a hypothesis to execute, exactly as aggregation-conformance.ts's DEBT note prescribes ("A row read off the code is a hypothesis; the suite is the measurement. Add the next row the same way, and expect it to be optimistic.").

The divergence

The platform ruling is that $exists means "has a value" (!= null), never key-presence — #5298 leg ③ / #5369, landed in PR #5962. It is settled and shipped on the surfaces the ruling named: formula's matchesFilterCondition and driver-memory's reference matcher both read it that way.

Two of the FIVE drivers the conformance gate scores still read key-presence:

Surface $exists: true on a null value reason recorded
driver-memory live mingo path MATCH — reads KEY-PRESENCE mingo semantics
driver-mongodb translateFilter MATCH — mongo $exists IS key-presence BSON semantics

Both cells are in the measurement table in filter-logic-conformance.ts already; what has changed is only the excuse.

What changed, and why nothing is tracking it

Until 2026-08-11 the table explained the two cells by the #5499 investment freeze — the sentence read "both frozen by #5499, and both among the FIVE drivers this gate scores. So a $exists row cannot be enrolled here yet." The maintainer lifted that freeze for driver-mongodb and driver-memory on 2026-08-11 (recorded in the head note of packages/spec/src/data/aggregation-conformance.ts). The gap is therefore unexcused.

It is also untracked, and provably so rather than by assumption:

Why it cannot be closed by adding a row

Stated in filter-logic-conformance.ts itself, and worth repeating so the obvious workaround is not attempted: the DEBT ledger in scripts/check-driver-conformance.mjs is per (driver x case-set), not per case. An entry says "this driver's suite does not import this marker at all". There is no spelling for "this driver fails one row while passing the other thirty-five", so a row added ahead of a backend is simply a red gate — the thing #5903's note calls "a gate that reports a known red", which teaches every agent reading CI to discount the colour.

⇒ The backend has to move first, then the row enrols. Same shape as #13166's fence 2.

What a fix owes

  1. Execute the cell before deciding anything — both readings of "no value" (name: null and the key absent), on both surfaces, the way driver-memory's reference matcher still answers $notContains / $nin the pre-ruling way on a no-value row — the #5499 freeze that excused it dissolved 2026-08-11, so the divergence is now unexcused and untracked #13166's filer did for its own three cells. Expect the reading above to be optimistic.
  2. Decide the direction. Unlike driver-memory's reference matcher still answers $notContains / $nin the pre-ruling way on a no-value row — the #5499 freeze that excused it dissolved 2026-08-11, so the divergence is now unexcused and untracked #13166, this one may not be a pure implement-the-ruling job: mongo's $exists is key-presence at the wire level, so making driver-mongodb answer has-value means compiling $exists: true to something other than {$exists: true}. That is a real design question, not a mechanical alignment, and it may belong in the decision box rather than the queue.
  3. driver-memory's live mingo path and its reference matcher already disagree with each other on this cell (the reference matcher was aligned by fix(drivers,analytics,formula): $ne / $nin / $notContains 在 $not 之外也 NULL-safe (#5298) #5962, the mingo path was not) — a one-driver, two-faces split, which is the shape aggregation-conformance.ts's head note calls out as the worst kind.
  4. Only after the backends agree, enrol an $exists row in FILTER_LOGIC_CASES.

Related

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingdomain:enginepriority:p1High: required for production / M2

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions