Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
test(graph): pin each 'both' edge once in the parity and privacy E2E
garrytanc1c3ee44c5c3
diff --git a/test/e2e/engine-content-privacy.test.ts b/test/e2e/engine-content-privacy.test.tsindex dd9823797d..3a136e7c3c 100644--- a/test/e2e/engine-content-privacy.test.ts+++ b/test/e2e/engine-content-privacy.test.ts@@ -393,7 +393,7 @@ for (const kind of ['pglite', 'postgres'] as const) {const paths = await engine.traversePathsDetailed('people/root', { ...scope, direction, depth: 3 });expect(JSON.stringify(paths)).not.toContain(PRIVATE);expect(paths.paths.some(r => r.to_slug === 'people/tail' || r.to_slug === 'people/origin-target')).toBe(false);- expect(paths.paths).toHaveLength(direction === 'in' ? 0 : direction === 'both' ? 2 : 1);+ expect(paths.paths).toHaveLength(direction === 'in' ? 0 : 1);expect(paths.paths.every(r => [r.from_slug, r.to_slug].every(slug => ['people/root', 'people/z-visible'].includes(slug)))).toBe(true);}expect(await engine.traverseGraph('people/a-private', 3, scope)).toEqual([]);diff --git a/test/e2e/engine-parity.test.ts b/test/e2e/engine-parity.test.tsindex 7da2c453c7..3cc1a33425 100644--- a/test/e2e/engine-parity.test.ts+++ b/test/e2e/engine-parity.test.ts@@ -2128,11 +2128,11 @@ describeBoth('Engine parity — traverseGraph / traversePaths (D7)', () => {'tg/b>tg/a:cycle-back@1','tg/a>tg/b:cycle-fwd@2',]);- // 'both' emits every touched edge in its natural direction; the cycle- // pair shows at depth 1 and again from b's frontier at depth 2.+ // 'both' emits every touched edge once, in its natural direction, one+ // hop past its shallower walked endpoint: the cycle pair at depth 1 only.expect(edgeShape(await pgEngine.traversePaths('tg/a', { depth: 2, direction: 'both' }))).toEqual(['tg/a>tg/b:cycle-fwd@1', 'tg/b>tg/a:cycle-back@1',- 'tg/a>tg/b:cycle-fwd@2', 'tg/b>tg/a:cycle-back@2', 'tg/b>tg/c:step@2', 'tg/b>tg/x:xsrc@2',+ 'tg/b>tg/c:step@2', 'tg/b>tg/x:xsrc@2',]);});