Repository navigation
Commit 9594f37
committed
feat(spec,core,objectql,driver-sql,formula,driver-mongodb,service-analytics): now-anchored filter comparand shifted by days held on the record
A filter comparand `{ $now: true, addDays: <integer | { $field }> }`, the
maintainer's letter A on #25808 (ruling comment 6415710193): legal exactly
where a `{ $field }` reference is, as the whole comparand of $eq / $ne /
$gt / $gte / $lt / $lte on a date or datetime column. `addDays` is required
and shares `FieldReferenceSchema`'s grammar (there is no subDays; "now minus
the SLA" is a column holding negative days). The unshifted instant stays
the `{now}` placeholder.
- spec: `NowAnchorSchema` in the ordering and equality comparand unions;
refused by name as a set member or `$between` endpoint; the comparand
type door and the lowering face step around a well-formed anchor and
refuse a malformed one in its own words; authorable surface, json-schema
manifest, api surface and the filter reference page regenerated.
- core: `resolveFilterTokens` pins `$now` to the tree's one instant as an
ISO string; a missing or malformed addDays is INVALID_FILTER / 400.
- objectql: the temporal door skips the anchor; `aggregations[i].filter`
and `having` judge it by `where`'s rules and compare per row through the
formula evaluator.
- driver-sql: same-table push-down on SQLite, PostgreSQL and MySQL through
`crossFieldOffsetExpr` (NULL offset = 0 days), the instant bound in the
target column's storage form; NULL-total predicates so `$not` is the
exact complement; every other position refused with operands withheld.
- formula: `matchesFilterCondition` resolves the anchor in the stored
value's form, so the memory path answers the SQL path's rows.
- driver-mongodb: refuses the anchor in every position (INVALID_FILTER).
- service-analytics: NativeSQLStrategy declines the anchor as it declines a
`{ $field }` comparand, so dataset filters route to the engine path.
Pinned on the drivers' cross-field conformance corpus (CROSS_FIELD_NOW_CASES
/ CROSS_FIELD_NOW_REFUSALS) on both execution paths and on the analytics
dataset shape; changeset minor on @objectstack/spec.
Clause-②: yes (widening)
Metadata-protocol: added
Ruling-ref: 6415710193
Claude-Session: https://claude.ai/code/session_019YLF9PyrRqUX4N7C2pzSoH
Co-authored-by: Claude <noreply@anthropic.com>1 parent 6b93552 commit 9594f37
35 files changed
Lines changed: 2587 additions & 95 deletions
File tree
- .changeset
- content/docs
- protocol/objectql
- references
- data
- docs/audits/2026-07-unknown-key-strictness-ledger.counts
- packages
- core/src/utils
- drivers
- driver-mongodb/src
- driver-sqlite-wasm/src
- driver-sql/src
- formula/src
- lint/src
- objectql/src
- services/service-analytics/src
- __tests__
- strategies
- spec
- api-surface
- authorable-surface
- declaration-map
- export-origins
- json-schema.manifest
- src
- data
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
526 | 526 | | |
527 | 527 | | |
528 | 528 | | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
529 | 590 | | |
530 | 591 | | |
531 | 592 | | |
| |||
0 commit comments