Skip to content

Commit d996462

Browse files
committed
test(metadata-protocol): the draft verdict harness honours the caller's bound and joins the engine-double ledger
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5oVR19x7NPLf4YzCzj
1 parent 6f54ceb commit d996462

2 files changed

Lines changed: 20 additions & 5 deletions

File tree

‎packages/metadata-protocol/src/protocol.draft-publish-verdict.test.ts‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,11 @@ function makeStubEngine() {
143143
}
144144
return findRow(opts.where)?.row ?? null;
145145
},
146-
async find(table: string, opts: { where: Record<string, unknown> }) {
147-
if (table === 'sys_metadata_history') {
148-
return historyRows.filter((h) => matchesHistory(h, opts.where));
149-
}
150-
return Array.from(rows.values()).filter((r) => matchesMetadataWhere(r, opts.where));
146+
async find(table: string, opts: { where: Record<string, unknown>; limit?: number }) {
147+
const matched = table === 'sys_metadata_history'
148+
? historyRows.filter((h) => matchesHistory(h, opts.where))
149+
: Array.from(rows.values()).filter((r) => matchesMetadataWhere(r, opts.where));
150+
return typeof opts?.limit === 'number' ? matched.slice(0, opts.limit) : matched;
151151
},
152152
async insert(table: string, data: Record<string, unknown>) {
153153
if (table === 'sys_metadata_audit') return { id: 'audit_skip' };

‎scripts/engine-double-contract.pinned.json‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -746,6 +746,21 @@
746746
"verb": "update",
747747
"pinned": 1
748748
},
749+
{
750+
"file": "packages/metadata-protocol/src/protocol.draft-publish-verdict.test.ts",
751+
"verb": "delete",
752+
"pinned": 1
753+
},
754+
{
755+
"file": "packages/metadata-protocol/src/protocol.draft-publish-verdict.test.ts",
756+
"verb": "findOne",
757+
"pinned": 1
758+
},
759+
{
760+
"file": "packages/metadata-protocol/src/protocol.draft-publish-verdict.test.ts",
761+
"verb": "update",
762+
"pinned": 1
763+
},
749764
{
750765
"file": "packages/metadata-protocol/src/protocol.driver-text-disclosure.test.ts",
751766
"verb": "delete",

0 commit comments

Comments
 (0)