Commit 10d05bb
fix(driver-memory)!: refuse an array comparand and compare Date comparands by time value (#16840)
* fix(driver-memory)!: refuse an array comparand and compare Date comparands by time value
`checkCondition` routed both `Date` and `Array` into `value == condition` and
called it "exact match" two lines above. Between two objects `==` compares
REFERENCES, so it is neither: a deep-equal array and an equal-instant `Date`
both answered false, fail-closed and silent.
The two halves get different dispositions, and the difference is the contract's:
- `Date` is a member of `ACCEPTED_FILTER_COMPARAND_TYPES` and the conformance
table requires a Date comparand to "pass the door and execute everywhere", so
it is EVALUATED — by time value, arm for arm with `@objectstack/formula`'s
`looseEq`, including the Date-against-stored-ISO-text case this driver's own
datetime canonicalisation produces.
- An array in an implicit or scalar-operator position is a cell the spec's
comparand door names and declines to rule; `ACCEPTED_FILTER_COMPARAND_TYPES`
has no array member and `driver-sql` refuses one. So it is REFUSED, from
`assertFilterConditionShape` — the one gate every face of this package runs —
so the live query path, the matcher and the analytics face answer alike.
Measured before the change, one row `{ tags: ['a','b'] }`, filter
`{ tags: ['a','b'] }`: the live path returned the row, the reference matcher
returned none. One filter, one package, two answers.
A scalar comparand against a stored ARRAY is deliberately untouched and now
pinned: that is the value side, which the comparand door does not judge.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADLdAs2pVcH17h9tZKWMBg
* docs(changeset): declare the array-comparand refusal and the Date equality repair
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADLdAs2pVcH17h9tZKWMBg
* fix(driver-memory): keep the tracker id out of the refusal's runtime string
`check:doc-authoring` red on the new message: a runtime string reaches authors,
operators and generated surfaces, none of whom can resolve `#NNNN`. The id stays
in the adjacent docblock, where the reader who can resolve it reads the source.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADLdAs2pVcH17h9tZKWMBg
* docs(changeset): grade @objectstack/spec minor to match this PR's clause-② declaration
The level axis of scripts/check-changeset-no-major.mjs refuses a `patch` on a
package whose packages/*/src/** the PR moves while the PR body declares
`Clause-②: yes`. Raising the level is route 1 of the two the gate names; the
declaration is the claim's and is not touched here.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADLdAs2pVcH17h9tZKWMBg
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: os-musk <elon@objectstack.ai>1 parent b37f0b1 commit 10d05bb
8 files changed
Lines changed: 408 additions & 14 deletions
File tree
- .changeset
- packages
- drivers/driver-memory/src
- spec/src/data
Lines changed: 19 additions & 0 deletions
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
34 | 38 | | |
35 | 39 | | |
36 | 40 | | |
| |||
553 | 557 | | |
554 | 558 | | |
555 | 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 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
556 | 639 | | |
557 | 640 | | |
558 | 641 | | |
| |||
669 | 752 | | |
670 | 753 | | |
671 | 754 | | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
672 | 760 | | |
673 | 761 | | |
674 | 762 | | |
| |||
702 | 790 | | |
703 | 791 | | |
704 | 792 | | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
705 | 802 | | |
706 | 803 | | |
707 | 804 | | |
| |||
Lines changed: 41 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
568 | 568 | | |
569 | 569 | | |
570 | 570 | | |
571 | | - | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
572 | 576 | | |
573 | 577 | | |
574 | 578 | | |
| |||
652 | 656 | | |
653 | 657 | | |
654 | 658 | | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
655 | 695 | | |
656 | 696 | | |
657 | 697 | | |
| |||
0 commit comments