Skip to content

Commit ce0aac9

Browse files
committed
fix(test): type the journal rows in the #16225 pins as Partial<Row>
`tsc --noEmit` refused the metadata-protocol pin with TS2352: `Row` declares no index signature, so asserting `Row[]` to `Record<string, unknown>[]` is not a legal widening. `Partial<Row>` is legal AND true of these rows — a journal row carries `type` and `name` and carries no `state`, which is exactly what the assertions beside it read. The objectql pin's `any[]` is spelled the same way for the same reason, replacing a cast that typechecked while saying nothing. Vitest never type-checks, so the suites were green over code tsc refuses; the error was only ever reachable through the package's own `typecheck` script, which this branch had last run before either pin existed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ADLdAs2pVcH17h9tZKWMBg
1 parent 220bfdb commit ce0aac9

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

packages/metadata-protocol/src/protocol.dashboard-dataset-publish-gate.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,11 @@ describe('#16225 a `sys_metadata` read is not answered from the journal tables',
397397
const journal = [
398398
...tableOf('sys_metadata_history').values(),
399399
...tableOf('sys_metadata_audit').values(),
400-
] as Record<string, unknown>[];
400+
// `Partial<Row>` and not `Record<string, unknown>`: `Row` declares no
401+
// index signature, so that widening is a TS2352, and `Partial` is
402+
// the honest type anyway — a journal row carries `type` and `name`
403+
// and does NOT carry the `state` the assertions below look for.
404+
] as Partial<Row>[];
401405
expect(
402406
journal.length,
403407
'the firing control: one save must WRITE the journal tables, or the read below '

packages/objectql/src/protocol-save-meta-repo-path.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ describe('#16225 a `sys_metadata` read is not answered from the journal tables',
439439
...tableOf('sys_metadata_history').values(),
440440
...tableOf('sys_metadata_commit').values(),
441441
...tableOf('sys_metadata_audit').values(),
442-
] as any[];
442+
] as Partial<Row>[];
443443

444444
// The firing control. Without it a green here would be consistent with
445445
// this save having stopped writing the journals altogether, which

0 commit comments

Comments
 (0)