refactor(8.0): remove the 4 deprecated query-operator aliases (clean break)

8.0 keeps the canonical operators (eq/ne/gt/gte/lt/lte) and their clean
long-form aliases (equals/notEquals/greaterThan/greaterThanOrEqual/lessThan/
lessThanOrEqual), and drops the four redundant deprecated spellings:
  is → eq,  isNot → ne,  greaterEqual → gte,  lessEqual → lte

Removed from every evaluator (metadataIndex criteria + range switches,
metadataFilter, the db whereMatcher egress path) and from the
BrainyFieldOperators type, the unsupported-operator error message, the docs
(QUERY_OPERATORS / api README / VFS projection + semantic guides), and the
whereMatcher alias tests. Also migrated Brainy's own internal use — the VFS
TemporalProjection queried with greaterEqual/lessEqual, which would have
silently broken — to gte/lte.

Full gate green: build, unit 1512, integration 607.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
David Snelling 2026-06-29 10:29:20 -07:00
parent b9369f260b
commit ddcc0c723d
9 changed files with 45 additions and 68 deletions

View file

@ -39,9 +39,9 @@ export class UnsupportedWhereOperatorError extends Error {
constructor(operator: string) {
super(
`The where-operator '${operator}' is not supported for historical/speculative ` +
`in-memory evaluation. Supported: eq/equals/is, ne/notEquals/isNot, in/oneOf, ` +
`gt/greaterThan, gte/greaterThanOrEqual/greaterEqual, lt/lessThan, ` +
`lte/lessThanOrEqual/lessEqual, between, contains, exists, missing, ` +
`in-memory evaluation. Supported: eq/equals, ne/notEquals, in/oneOf, ` +
`gt/greaterThan, gte/greaterThanOrEqual, lt/lessThan, ` +
`lte/lessThanOrEqual, between, contains, exists, missing, ` +
`plus allOf/anyOf/not.`
)
this.name = 'UnsupportedWhereOperatorError'
@ -150,12 +150,10 @@ function fieldConditionMatches(value: unknown, condition: unknown): boolean {
for (const [op, operand] of Object.entries(condition as Record<string, unknown>)) {
let matches: boolean
switch (op) {
case 'is':
case 'equals':
case 'eq':
matches = eqMatches(value, operand)
break
case 'isNot':
case 'notEquals':
case 'ne':
matches = !eqMatches(value, operand)
@ -170,7 +168,6 @@ function fieldConditionMatches(value: unknown, condition: unknown): boolean {
matches = cmp !== null && cmp > 0
break
}
case 'greaterEqual':
case 'greaterThanOrEqual':
case 'gte': {
const cmp = compare(value, operand)
@ -183,7 +180,6 @@ function fieldConditionMatches(value: unknown, condition: unknown): boolean {
matches = cmp !== null && cmp < 0
break
}
case 'lessEqual':
case 'lessThanOrEqual':
case 'lte': {
const cmp = compare(value, operand)