Skip to content

Support subgraph-scoped view routing#1037

Open
Jurij89 wants to merge 23 commits into
mainfrom
codex/issue-184-subgraph-view-routing
Open

Support subgraph-scoped view routing#1037
Jurij89 wants to merge 23 commits into
mainfrom
codex/issue-184-subgraph-view-routing

Conversation

@Jurij89

@Jurij89 Jurij89 commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Enables subGraphName with view-routed /api/query reads for Working Memory, Shared Working Memory, and Verified Memory while preserving existing no-view subgraph behavior.
  • Routes subgraph WM/SWM/VM queries to the correct subgraph graph shapes, including exact WM assertionName and exact VM verifiedGraph support, with a guard against view-routed child-context-graph URI collisions.
  • Defaults omitted /api/query Working Memory agentAddress to the resolved request identity so self reads match /api/agent/identity while preserving existing foreign-agent guards.
  • Exposes and forwards subgraph query scope through OpenClaw, Hermes, and MCP, and limits memory-search subgraph scope to project context graph fan-out only.

Related

Files changed

File What
packages/query/src/dkg-query-engine.ts Adds subgraph-aware WM/SWM/VM view graph resolution and child-CG collision guard.
packages/query/src/query-engine.ts Documents subGraphName behavior for view routing.
packages/core/src/constants.ts Adds optional subgraph support to the verified-memory URI helper.
packages/cli/src/daemon/routes/query.ts Infers omitted WM agentAddress from the resolved request identity.
packages/cli/skills/dkg-node/SKILL.md Updates operator/tool docs for subgraph-scoped view reads.
packages/adapter-openclaw/** Exposes, validates, forwards sub_graph_name, and scopes memory search to project fan-out only.
packages/adapter-hermes/** Exposes sub_graph_name, removes the old view-combination rejection, and forwards project-only memory-search scope.
packages/mcp-dkg/** Exposes optional query agentAddress, forwards subGraphName, and adds project-only memory-search subgraph scope.
packages/*/test/** Adds regression coverage for query routing, daemon forwarding/defaulting, adapters, MCP tools, and memory-search scope.

Test plan

  • git diff --check
  • python -m py_compile packages/adapter-hermes/hermes-plugin/__init__.py packages/adapter-hermes/hermes-plugin/client.py
  • pnpm --filter @origintrail-official/dkg-query exec vitest run test/sub-graph-query.test.ts (14 tests)
  • pnpm --filter @origintrail-official/dkg-query test (8 files, 267 tests)
  • pnpm --filter @origintrail-official/dkg exec vitest run test/daemon/routes/query.test.ts (5 tests)
  • pnpm --filter @origintrail-official/dkg-adapter-openclaw exec vitest run test/plugin.part-03.test.ts test/plugin.part-06.test.ts test/dkg-memory.test.ts test/memory-integration.test.ts test/memory-search-tool.test.ts (5 files, 118 tests)
  • pnpm --filter @origintrail-official/dkg-adapter-openclaw test (57 files, 1083 tests, 1 skipped)
  • pnpm --filter @origintrail-official/dkg-adapter-hermes exec vitest run test/hermes-adapter.test.ts (90 tests)
  • pnpm --filter @origintrail-official/dkg-adapter-hermes test (90 tests)
  • pnpm --filter @origintrail-official/dkg-mcp exec vitest run test/query-schema.test.ts test/memory-search.test.ts (32 tests)
  • Two local review rounds using .codex/review-prompt.md; fixed all valid findings.
  • pnpm --filter @origintrail-official/dkg-mcp test currently fails locally on unchanged hook tests with SyntaxError: Invalid or unexpected token; the affected hook tests and hooks are unchanged from main and pass node --check.
  • pnpm --filter @origintrail-official/dkg test currently fails locally on Windows environment issues: release/rollback helper suites cannot create symlinks (EPERM) and vector-store tests cannot load better-sqlite3 native bindings after the Windows install path used here.

Comment thread packages/query/src/dkg-query-engine.ts
Comment thread packages/mcp-dkg/src/tools.ts Outdated
Comment thread packages/adapter-openclaw/src/DkgMemoryPlugin.ts
Comment thread packages/mcp-dkg/src/tools.ts Outdated
Comment thread packages/cli/src/daemon/routes/query.ts Outdated
Comment thread packages/agent/src/dkg-agent-endorse.ts
Comment thread packages/cli/src/daemon/routes/query.ts Outdated
Comment thread packages/adapter-hermes/hermes-plugin/__init__.py
Comment thread packages/mcp-dkg/src/tools/memory-search.ts Outdated
Comment thread packages/adapter-openclaw/src/DkgMemoryPlugin.ts
Comment thread packages/mcp-dkg/src/tools/memory-search.ts Outdated
Comment thread packages/cli/skills/dkg-node/SKILL.md Outdated
Comment thread packages/adapter-openclaw/src/DkgNodePlugin.ts
Comment thread packages/adapter-hermes/hermes-plugin/__init__.py
Comment thread packages/adapter-hermes/hermes-plugin/__init__.py Outdated
Comment thread packages/adapter-openclaw/src/DkgMemoryPlugin.ts Outdated
Comment thread packages/query/src/dkg-query-engine.ts Outdated
Comment thread packages/cli/src/daemon/routes/query.ts
Comment thread packages/cli/src/daemon/routes/query.ts
Comment thread packages/cli/src/daemon/routes/query.ts
Comment thread packages/cli/src/daemon/routes/query.ts Outdated
Comment thread packages/mcp-dkg/src/tools/memory-search.ts
Comment thread packages/adapter-hermes/hermes-plugin/__init__.py
Comment thread packages/mcp-dkg/src/tools/memory-search.ts Outdated
Comment thread packages/mcp-dkg/src/tools.ts
Comment thread packages/query/src/dkg-query-engine.ts
Comment thread packages/adapter-openclaw/src/DkgMemoryPlugin.ts
Comment thread packages/adapter-openclaw/src/DkgMemoryPlugin.ts Outdated
Comment thread packages/mcp-dkg/src/tools.ts Outdated
Comment thread packages/query/src/dkg-query-engine.ts
Comment thread packages/adapter-openclaw/src/DkgMemoryPlugin.ts
Comment thread packages/query/src/dkg-query-engine.ts Outdated
Comment thread packages/core/src/constants.ts
Comment thread packages/adapter-hermes/hermes-plugin/__init__.py Outdated
Comment thread packages/mcp-dkg/src/tools.ts Outdated
Comment thread packages/cli/test/memory-graph-events.test.ts
Comment thread packages/adapter-openclaw/src/DkgMemoryPlugin.ts
Comment thread packages/mcp-dkg/src/tools.ts Outdated
Comment thread packages/mcp-dkg/src/tools.ts Outdated
Comment thread packages/adapter-openclaw/src/DkgMemoryPlugin.ts Outdated
Comment thread packages/adapter-hermes/hermes-plugin/__init__.py Outdated
Comment thread packages/adapter-openclaw/src/DkgMemoryPlugin.ts Outdated
Comment thread packages/adapter-openclaw/src/DkgMemoryPlugin.ts Outdated

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codex review completed — no issues found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable subGraphName scoping with view-based routing in the query engine

1 participant