Skip to content

Commit ae9fe54

Browse files
committed
fix(qa): 下游消费者跟进 DriverQuery —— dogfood 删掉冗余的 object 键 (#6075)
上一版的消费半径扫描用了 `--filter 'pkg...'`(后缀省略号 = 该包 + 它 依赖的包,上游闭包),方向扫反了:签名收窄打到的是**下游**消费者。 真正该用的是前缀形 `--filter '...pkg'`,或者直接以全仓 `pnpm typecheck` 为准(CI 跑的就是全仓)。@objectstack/dogfood 因此没进上一轮扫描面。 全仓复扫命中一处真实编译错误:storage-growth.dogfood.test.ts:260 的 `cold.count(...)`,`cold` 是真实的 SqlDriver,内联字面量里的冗余 `object` 被收窄后的 DriverQuery 拒绝。 同包另有 9 处同形调用未被 tsc 标出 —— 它们走本地结构替身 `DriverLike.count(object, query?: Record<string, unknown>)`,任何键都收, 类型层看不见。一并按同一规矩删除,避免同一文件里两种写法并存。 删键用的是带反向引用的模式,只在 query 里的值与第一个实参**逐字相同** 时才匹配,等价性由模式本身保证;dogfood 包里其余 `{ object: ... }` (权限授予、端点策略入参、report 条目、类型声明)因此一处未被波及。 ⛔ 未放松任何驱动侧签名。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WyvqvKMG6asi9aXjKE6xtx
1 parent c450f00 commit ae9fe54

3 files changed

Lines changed: 10 additions & 10 deletions

File tree

packages/qa/dogfood/test/empty-group-bucket-parity.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ describe.each(DRIVERS)('empty group bucket parity: $name', ({ make }) => {
8989
const pushedDown = await driver.aggregate(TABLE, ast);
9090
// The rows the in-memory path would see — the driver's own read output, which
9191
// is exactly what `engine.aggregate` feeds the fallback.
92-
const inMemory = applyInMemoryAggregation(await driver.find(TABLE, { object: TABLE }), ast as never);
92+
const inMemory = applyInMemoryAggregation(await driver.find(TABLE, {}), ast as never);
9393

9494
expect(shape(pushedDown, field)).toEqual(shape(inMemory, field));
9595
// …and both agree on real `null`, not on a sentinel they happen to share.

packages/qa/dogfood/test/group-key-read-shape-parity.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ describe.each(DRIVERS)('group-key read-shape parity: $name', ({ make }) => {
9494
await driver.create(TABLE, { id: 'c', qty: 7, won: false, stage: 'lost', amount: 4 }, opts);
9595
// What `engine.aggregate` feeds the in-memory fallback, and the canonical
9696
// presentation both aggregate paths are measured against.
97-
rows = await driver.find(TABLE, { object: TABLE });
97+
rows = await driver.find(TABLE, {});
9898
});
9999

100100
afterEach(async () => {

packages/qa/dogfood/test/storage-growth.dogfood.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ describe('objectstack verify LIFECYCLE (ADR-0057): declared policies bound growt
152152
});
153153
}
154154

155-
const before = await driver.count('growth_probe_event', { object: 'growth_probe_event' });
155+
const before = await driver.count('growth_probe_event', {});
156156
expect(before).toBe(40);
157157

158158
const report = await lifecycle.sweep();
@@ -167,11 +167,11 @@ describe('objectstack verify LIFECYCLE (ADR-0057): declared policies bound growt
167167

168168
// The telemetry table is now bounded by its declared 30d window:
169169
// rows at 5,10,15,20,25d survive (5 rows), everything older is gone.
170-
const after = await driver.count('growth_probe_event', { object: 'growth_probe_event' });
170+
const after = await driver.count('growth_probe_event', {});
171171
expect(after, 'telemetry rows past retention.maxAge must be reaped').toBe(5);
172172

173173
// Record-class/business data is sacrosanct — same age, still alive.
174-
const records = await driver.count('growth_probe_record', { object: 'growth_probe_record' });
174+
const records = await driver.count('growth_probe_record', {});
175175
expect(records, 'record-class rows must NEVER be reaped').toBe(5);
176176

177177
// The sweep reported the reap and reclaimed the datasource.
@@ -209,12 +209,12 @@ describe('objectstack verify LIFECYCLE (ADR-0057): declared policies bound growt
209209
// sweep applies the 'rotation' policy without touching the rows inside
210210
// the window.
211211
await streamDriver.create('growth_probe_stream', { payload: 'tick' });
212-
expect(await streamDriver.count('growth_probe_stream', { object: 'growth_probe_stream' })).toBe(1);
212+
expect(await streamDriver.count('growth_probe_stream', {})).toBe(1);
213213

214214
const report = await lifecycle.sweep();
215215
const entry = report.swept.find((e) => e.object === 'growth_probe_stream');
216216
expect(entry?.policy).toBe('rotation');
217-
expect(await streamDriver.count('growth_probe_stream', { object: 'growth_probe_stream' })).toBe(1);
217+
expect(await streamDriver.count('growth_probe_stream', {})).toBe(1);
218218
});
219219

220220
it('ARCHIVE SAFETY: an audit ledger with a declared archive is never hot-deleted unarchived', async () => {
@@ -230,7 +230,7 @@ describe('objectstack verify LIFECYCLE (ADR-0057): declared policies bound growt
230230
// No archive datasource named 'archive_missing' exists ⇒ the rows are
231231
// RETAINED (today's behavior), not dropped. Compliance data cannot be
232232
// destroyed by declaring a lifecycle.
233-
const ledger = await driver.count('growth_probe_ledger', { object: 'growth_probe_ledger' });
233+
const ledger = await driver.count('growth_probe_ledger', {});
234234
expect(ledger, 'archive-declared audit rows must be retained until archived').toBe(3);
235235
expect(report.skipped).toContainEqual({ object: 'growth_probe_ledger', reason: 'archive-pending' });
236236
});
@@ -255,9 +255,9 @@ describe('objectstack verify LIFECYCLE (ADR-0057): declared policies bound growt
255255
expect((entry as { archived?: number })?.archived).toBe(3);
256256

257257
// Hot store drained, cold store holds the ledger.
258-
const hot = await driver.count('growth_probe_ledger', { object: 'growth_probe_ledger' });
258+
const hot = await driver.count('growth_probe_ledger', {});
259259
expect(hot, 'archived rows must leave the hot store').toBe(0);
260-
const coldRows = await cold.count('growth_probe_ledger', { object: 'growth_probe_ledger' });
260+
const coldRows = await cold.count('growth_probe_ledger', {});
261261
expect(coldRows, 'archived rows must land in the cold store').toBe(3);
262262
await cold.disconnect();
263263
});

0 commit comments

Comments
 (0)