Skip to content

Commit dc6bfbf

Browse files
committed
test(objectql): 正控的 find 选项不再擦成 any,过 #4918 query-options 棘轮
`check:query-options-erasure`(PR #5600 / #4918,在本分支切出之后落地) 把测试面计入只增不减的棘轮。本分支新增的正控里 `engine.find('task', {} as any)` 是其中一处擦除,使测试面 267 → 268 而红。 该调用点是**合约内**形状——`find(object, query?: EngineQueryOptions)` 的空查询——不是「断言引擎拒绝未知选项」那类刻意越契约的输入,所以按 门禁处方的第 1 条直接给它正确类型(这里等于去掉断言,签名本就能推 断),而不是写 `as unknown as EngineQueryOptions`。 基线文件未动:抬高天花板是「reviewed edit, not a remedy」,这里修的是 站点本身。 验证(合并 origin/main 后): - node scripts/check-query-options-erasure-ratchet.mjs → 267,at the ceiling,no files added - @objectstack/objectql test → 1934 passed (120 files) - @objectstack/spec + @objectstack/objectql typecheck → Done Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018fxLGQdatPbBUvCgiVxg6D
1 parent dee19aa commit dc6bfbf

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

packages/objectql/src/hook-input-shape-contract.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,11 @@ describe('[#5273] a bulk write carries no `ast` on `input`', () => {
7777
const { engine } = await boot();
7878
engine.registerHook('beforeFind', async (ctx: any) => { seen.push(ctx.input); }, { object: 'task' });
7979

80-
await engine.find('task', {} as any);
80+
// No `as any` on the options: `find(object, query?: EngineQueryOptions)`
81+
// already infers an empty query, and erasing it would add a site to the
82+
// #4918 query-options ratchet (`check:query-options-erasure`) for no gain —
83+
// this call is in-contract, not a deliberate off-contract probe.
84+
await engine.find('task', {});
8185

8286
expect(seen).toHaveLength(1);
8387
expect('ast' in seen[0]!).toBe(true);

0 commit comments

Comments
 (0)