Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
test(ontology): pin remote/local parity for ontology_get through MCP dispatch
garrytan93bc65f662c0
diff --git a/test/ontology-fact-visibility.test.ts b/test/ontology-fact-visibility.test.tsindex 79fb473e2e..ff9cd75140 100644--- a/test/ontology-fact-visibility.test.ts+++ b/test/ontology-fact-visibility.test.ts@@ -13,6 +13,7 @@ import { describe, test, expect, beforeAll, afterAll, beforeEach } from 'bun:tesimport { PGLiteEngine } from '../src/core/pglite-engine.ts';import { operationsByName, type OperationContext } from '../src/core/operations.ts';import { resetPgliteState } from './helpers/reset-pglite.ts';+import { dispatchToolCall } from '../src/mcp/dispatch.ts';let engine: PGLiteEngine;const ALICE = 'people/alice-example';@@ -74,4 +75,14 @@ describe('ontology reads hide private observations from untrusted callers', () =const local = await run('volunteer_chronicle', false, { entities: ALICE }) as { ontologies: Record<string, unknown> };expect(JSON.stringify(local.ontologies)).toContain('privmarker');});++ test('MCP dispatch: the remote transport tier gets world rows only, the local tier every tier', async () => {+ const viaDispatch = async (remote: boolean) => {+ const r = await dispatchToolCall(engine, 'ontology_get', { entity: ALICE }, { remote, sourceId: 'default', transport: remote ? 'stdio' : undefined });+ expect(r.isError).toBeFalsy();+ return values(JSON.parse(r.content[0].text));+ };+ expect(await viaDispatch(true)).toEqual(['decision_style=deliberate']);+ expect(await viaDispatch(false)).toEqual(['decision_style=deliberate', 'risk_tolerance=high privmarker']);+ });});