Skip to content

Commit 861e41f

Browse files
committed
test(runtime): route the probe harness findOne through the engine predicate; pin it
Claude-Session: https://claude.ai/code/session_01CxBKycaiUpA1yGx1XyoGqX Co-authored-by: Claude <noreply@anthropic.com>
1 parent 5e25f33 commit 861e41f

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

‎packages/runtime/src/domains/packages-publish-drafts-probe-caller-context.test.ts‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import { afterEach, describe, expect, it, vi } from 'vitest';
2626
import { DatasetSchema } from '@objectstack/spec/ui';
2727
import type { ExecutionContext } from '@objectstack/spec/kernel';
2828
import { AnalyticsService } from '@objectstack/service-analytics';
29+
import { assertEngineFindOnePredicate } from '@objectstack/metadata-core';
2930
import { ObjectStackProtocolImplementation } from '@objectstack/metadata-protocol';
3031
import { HttpDispatcher } from '../http-dispatcher.js';
3132

@@ -97,7 +98,11 @@ function makeDoor() {
9798
const rows = [{ id: 'r1' }, { id: 'r2' }];
9899
return typeof query?.limit === 'number' ? rows.slice(0, query.limit) : rows;
99100
},
100-
findOne: async () => null,
101+
// The ADR-0067 pre-publish capture: never published, so no active row.
102+
findOne: async (object: string, query: unknown) => {
103+
assertEngineFindOnePredicate(object, query as never);
104+
return null;
105+
},
101106
// The ADR-0067 commit row the batch writes; not under test here.
102107
insert: async (_object: string, row: unknown) => row,
103108
};
@@ -153,7 +158,7 @@ describe('publish-drafts widget probes run as the publishing caller (#25484)', (
153158
const { probes, admissionContexts } = await publishAs(NON_READER);
154159

155160
expect(probes?.checked?.widgets).toBe(1);
156-
const failed = probes.issues.filter((i: any) => i.code === 'widget_query_failed');
161+
const failed = probes.issues.filter((i: any) => i.code === 'widget_query_failed'); // adr0112-ok: D6c build-probe diagnostics code
157162
expect(failed).toHaveLength(1);
158163
expect(failed[0]).toMatchObject({
159164
layer: 'runtime',

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4241,6 +4241,11 @@
42414241
"verb": "update",
42424242
"pinned": 1
42434243
},
4244+
{
4245+
"file": "packages/runtime/src/domains/packages-publish-drafts-probe-caller-context.test.ts",
4246+
"verb": "findOne",
4247+
"pinned": 1
4248+
},
42444249
{
42454250
"file": "packages/runtime/src/domains/packages-seed-apply-org-scope.test.ts",
42464251
"verb": "delete",

0 commit comments

Comments
 (0)