Commit dfa2502
committed
test(objectql): type the #7095 query-options sites instead of erasing them to
The four call sites the #7095 pins added tripped the #4918 query-options-erasure
ratchet (test surface 249 -> 253). Fixed at the call sites, per the rule's own
prescription — the ceiling is unchanged and no pin is weakened.
Three were ON-contract and are now typed:
- the `it.each` sort table is `Array<[string, NonNullable<EngineQueryOptions['orderBy']>]>`,
so the three refused sorts are checked as the well-formed `SortNode[]` they
are. It is the FIELD they name that the engine refuses, never their shape,
and an `as any` there would have erased the one channel that enforces
`{ field, order }` on a direct engine call — the `direction`-vs-`order`
mistake #4674 is about.
- both `expand` sites drop the assertion entirely: `EngineQueryOptions.expand`
is `Record<string, QuerySchema>`, so the nested `{ orderBy }` was always
assignable and the cast was never buying anything.
One is DELIBERATELY off-contract — the negative pin that smuggles an opt-out
flag onto the public options bag — and is now `as unknown as EngineQueryOptions`
rather than a bare `as any`: it names the contract being bypassed, keeps the
rest of the call type-checked, and greps as an intentional act. That is exactly
the case #4918 carved the spelling out for, since the assertion's whole subject
is that the engine rejects the unknown key.
Refs #7095, #4918, #4674, #4721
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HJgGahRqaYPRJ2oKmk9Czcany
1 parent 1ff0e37 commit dfa2502
1 file changed
Lines changed: 20 additions & 6 deletions
Lines changed: 20 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
| |||
698 | 699 | | |
699 | 700 | | |
700 | 701 | | |
701 | | - | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
702 | 709 | | |
703 | 710 | | |
704 | 711 | | |
705 | | - | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
706 | 715 | | |
707 | 716 | | |
708 | 717 | | |
709 | | - | |
| 718 | + | |
710 | 719 | | |
711 | 720 | | |
712 | 721 | | |
| |||
769 | 778 | | |
770 | 779 | | |
771 | 780 | | |
772 | | - | |
| 781 | + | |
773 | 782 | | |
774 | 783 | | |
775 | 784 | | |
| |||
780 | 789 | | |
781 | 790 | | |
782 | 791 | | |
783 | | - | |
| 792 | + | |
784 | 793 | | |
785 | 794 | | |
786 | 795 | | |
| |||
797 | 806 | | |
798 | 807 | | |
799 | 808 | | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
800 | 814 | | |
801 | 815 | | |
802 | 816 | | |
803 | | - | |
| 817 | + | |
804 | 818 | | |
805 | 819 | | |
806 | 820 | | |
| |||
0 commit comments