Commit 458025f
test(where-matcher): empty the combinator-blind ledger — 75 files, refuse unrecognised $-keys (#8618)
* test(where-matcher): batch 1 — refuse unrecognised $-keys (metadata-protocol, objectql, plugin-approvals, plugin-auth)
Part of the #8582 sweep: 39 test-double matches(row, where) fakes across
these four packages treated $or/$and as ordinary field names and silently
dropped rows on any combinator query. Each now throws on an unrecognised
$-prefixed key instead — the recorded practice already pinned in
packages/objectql/src/engine-autonumber-*.test.ts ("silently ignoring an
unknown operator would let a bad query pass as a good one").
Ledger (scripts/where-matcher-conformance.baseline.json) ratcheted down by
the same 39 entries in this commit — pnpm check:where-matcher confirms
0 problems for these files.
Refs #8582
* test(where-matcher): batch 2 — refuse unrecognised $-keys (plugin-email, plugin-hono-server, plugin-reports, plugin-security, plugin-sharing, rest)
Part of the #8582 sweep. 22 more combinator-blind matches(row, where) fakes
now throw on an unrecognised $-prefixed key instead of treating it as a
field name and silently dropping every row a combinator query touches.
Two files needed more than the mechanical guard:
- packages/plugins/plugin-sharing/src/business-unit-graph.test.ts already
implements $or correctly (a real, exercised recursive conjunction) — added
a refusal for any OTHER $-key ($and included) rather than growing a second
combinator implementation nothing in the suite exercises.
- packages/plugins/plugin-email/src/outbox-sweep.test.ts was the ledger's
one UNJUDGED matcher. Its nested-operator throw message (`fakeEngine:
unsupported operator ${op}`) coincidentally repeats its enclosing factory
function's exact name, and the gate's identifiersIn() text-scanner reads
that string-literal word as if it were a reference to the factory —
pulling in the whole `fakeEngine(seed)` closure and its unsuppliable
`seed` parameter, so the standalone extraction always threw
`ReferenceError: seed is not defined`. Disposition: RESTRUCTURE (rename
the message so it no longer shadows the enclosing scope) rather than
extractor-reach — a one-line, zero-blast-radius fix versus changing the
shared identifiersIn() text-scanner every one of the 168 discovered
matchers depends on. The matcher now judges CONFORMING.
Ledger ratcheted down by these 22 entries in this commit; 14 remain
(services/*, triggers) for the next batch.
Refs #8582
* test(where-matcher): batch 3 — refuse unrecognised $-keys (service-analytics, service-automation, service-messaging, service-queue, service-settings, service-storage, trigger-schedule)
Part of the #8582 sweep. Final 14 combinator-blind matches(row, where)
fakes now throw on an unrecognised $-prefixed key.
Two files already implement $and genuinely (a real, exercised recursive
conjunction) — service-analytics/src/__tests__/objectql-daterange.test.ts
and objectql-read-scope.test.ts. Both get a refusal for any OTHER $-key
($or included) rather than growing a second combinator implementation
nothing in their suites exercises.
Ledger (scripts/where-matcher-conformance.baseline.json) ratcheted to
empty — its intended steady state (pnpm check:where-matcher reference:
"78 (4 by refusing)" is now zero grandfathered, matching shape (a)'s empty
ledger). pnpm check:where-matcher: 168 matcher(s) discovered, 168
conforming (83 by refusing), 0 silently wrong, 0 unjudged.
Refs #8582
* fix(service-analytics): implement $or in objectql-daterange.test.ts's matcher, not refuse it
Batch 3 (e089b9f) added a blanket $-key refusal to this file's matches()
double, on the (wrong) assumption that $or was dormant here like the rest
of the sweep. It is not: the "keeps both operands when a bare equality
meets an operator object" test drives query() through fieldLeaves' real
NULL-safe $ne expansion (#5298), which emits `$and: [{ $or: [{field:null},
{field:{$ne}}] }]` — the double genuinely receives $or at runtime, and the
new refusal turned a passing test red (`Error: test bridge: unhandled
operator $or`).
Per the issue's own guidance, option 1 (implement) applies where a suite
genuinely exercises the combinator — $and was already handled this way in
this file, $or now gets the same treatment (`.some()` over the branches),
matching the file's existing recursive style. pnpm check:where-matcher
confirms this matcher now CONFORMS by correctly answering the combinator
battery, not by refusing.
Refs #8582
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 424bbd4 commit 458025f
76 files changed
Lines changed: 167 additions & 258 deletions
File tree
- packages
- metadata-protocol/src
- objectql/src
- plugins
- plugin-approvals/src
- plugin-auth/src
- plugin-email/src
- plugin-hono-server/src
- plugin-reports/src
- plugin-security/src
- plugin-sharing/src
- rest/src
- services
- service-analytics/src/__tests__
- service-automation/src
- builtin
- service-messaging/src
- service-queue/src
- service-settings/src
- service-storage/src
- triggers/trigger-schedule/src
- scripts
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
| 137 | + | |
137 | 138 | | |
138 | 139 | | |
139 | 140 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| 97 | + | |
97 | 98 | | |
98 | 99 | | |
99 | 100 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
61 | 62 | | |
62 | 63 | | |
63 | 64 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
| 155 | + | |
155 | 156 | | |
156 | 157 | | |
157 | 158 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
| |||
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
84 | 87 | | |
85 | 88 | | |
86 | 89 | | |
| |||
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
98 | 101 | | |
99 | 102 | | |
100 | 103 | | |
| |||
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
109 | 112 | | |
110 | 113 | | |
111 | 114 | | |
| |||
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
56 | 59 | | |
57 | 60 | | |
58 | 61 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
54 | 57 | | |
55 | 58 | | |
56 | 59 | | |
| |||
0 commit comments