Skip to content

feat(cipher): add TAC tree for Cipher Memory integration - #1023

Merged
POWERFULMOVES merged 1 commit into
mainfrom
feat/cipher-tac-tree
Mar 19, 2026
Merged

POWERFULMOVES merged 1 commit into
mainfrom
feat/cipher-tac-tree

Conversation

@POWERFULMOVES

@POWERFULMOVES POWERFULMOVES commented Mar 18, 2026

Copy link
Copy Markdown
Owner

Summary

  • New 7-phase TAC tree for Cipher Memory (port 8096)
  • 17 check nodes covering: service health, embedding quality, MCP bridge, gateway routing, NATS events, BoTZ agent memory, advanced features
  • Ensures Cipher properly integrates with embedding pipeline (qwen3-embedding:8b), TensorZero observability, and BoTZ agent ecosystem

Phases

  1. Core Service — compose definition, health endpoint, Neo4j dependency
  2. Embedding Pipeline — model quality, TensorZero routing, named vectors, reflexive loadout
  3. MCP Bridge — stdio transport, 4 MCP tools (store, search, store_reasoning, reasoning_patterns)
  4. Gateway Integration — CHIT route delegation, TensorZero embedding observability
  5. NATS Events — memory publish, Graphiti trail subscription
  6. BoTZ Agent Memory — agent registry, reasoning traces, Neo4j graph health
  7. Advanced Features — cross-dimensional queries, CHIT CGP provenance, multi-agent sync

Test plan

  • YAML validates: python -c "import yaml; yaml.safe_load(open('pmoves/configs/tac_trees/cipher-memory.tac.yaml'))"
  • TAC tree structure matches existing patterns (hirag-retrieval.tac.yaml)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Added comprehensive configuration framework for Cipher Memory system verification and integration across platform services and components.

7-phase TAC tree covering: core service health, embedding pipeline
quality (dark matter grade), MCP bridge verification, gateway routing
and TensorZero observability, NATS event integration, BoTZ agent memory
patterns, and advanced features (cross-dimensional queries, CHIT
provenance, multi-agent sync).

17 check nodes ensure Cipher Memory properly integrates with the
embedding pipeline, gateway, and BoTZ agent ecosystem.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Mar 18, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

A new TAC Tree configuration file for Cipher Memory is introduced, defining a seven-phase audit plan that verifies the knowledge graph memory system's integration across services, embeddings, MCP bridge, gateway routing, NATS event handling, agent patterns, and advanced features like cross-dimensional queries and multi-agent synchronization.

Changes

Cohort / File(s) Summary
Cipher Memory TAC Tree Configuration
pmoves/configs/tac_trees/cipher-memory.tac.yaml
Introduces 257-line TAC Tree configuration defining seven verification phases: Core Service (API, health, Neo4j), Embedding Pipeline (qwen3-embedding routing), MCP Bridge (stdio transport, tool registration), Gateway Integration (CHIT endpoints), NATS Event Integration (memory/trail events), BoTZ Agent Patterns (agent registry, reasoning traces), and Advanced Features (cross-dimensional queries, CHIT CGP encoding, multi-agent sync). Each phase includes explicit checks with grep/HTTP targets, patterns, and expected outcomes.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

Poem

🐰 A cipher keeps secrets in graphs so deep,
Seven phases of checks to guard every heap,
From embeddings flowing through NATS they go,
Memory patterns dance where the agents all know! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers the summary, phases, and test plan, but is missing the required 'Testing' section with executed commands/output and the 'Required Checks' checklist validation. Add a 'Testing' section documenting the actual commands run and their outputs (e.g., YAML validation results), and complete the 'Required Checks' checklist items from the template.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely describes the main change: adding a TAC tree configuration file for Cipher Memory integration.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/cipher-tac-tree
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@chatgpt-codex-connector chatgpt-codex-connector 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

Here are some automated review suggestions for this pull request.

Reviewed commit: fb88a7f37b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +36 to +37
type: http
target: "http://localhost:8096/health"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Replace unsupported http TAC action types

When this tree is executed by pmoves/tools/tac_runner.py or /tac:review, this node never performs the health check because the TAC schema and runner only implement file_exists, grep, command, and manual actions (pmoves/configs/tac_schema.yaml, pmoves/tools/tac_runner.py:evaluate_node). The result stays pending, and pending nodes do not make the runner exit nonzero, so a broken Cipher /health or Neo4j endpoint can still produce a successful audit. The same issue appears again at cipher.botz.knowledge-graph.

Useful? React with 👍 / 👎.

Comment on lines +168 to +169
target: "pmoves/services/cipher-api/"
pattern: "nats.*publish|NATS"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Point the NATS audit at the actual Cipher codebase

These checks target pmoves/services/cipher-api/, but that path does not exist in this repo. The cipher-api service is built from ../Pmoves-cipher (pmoves/docker-compose.yml:2108-2133), and the NATS publishing logic lives under pmoves-cipher-mcp/cipher_mcp/nats_events.py. As written, both Phase 5 greps will always fail with target not found, so the tree reports a regression even when Cipher’s NATS integration is present.

Useful? React with 👍 / 👎.

Comment on lines +139 to +142
type: grep
target: "pmoves/services/gateway/gateway/api/chit.py"
pattern: "cipher|memory"
expect: "Gateway CHIT API can delegate to Cipher for storage"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Make the CHIT→Cipher check specific enough to avoid false passes

This regex is too broad to verify the behavior described in expect. In the current repo it already matches the unrelated cryptography.hazmat.primitives.ciphers.aead import in pmoves/services/gateway/gateway/api/chit.py, so this node can pass even if the gateway has no Cipher-memory delegation at all. That gives the TAC runner a green result for a feature it did not actually validate.

Useful? React with 👍 / 👎.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (2)
pmoves/configs/tac_trees/cipher-memory.tac.yaml (2)

249-257: Avoid hardcoding agent names in TAC context text.

This wording can drift from canonical registry data; keep the context tied to pmoves/config/agent_registry.yaml instead of listing specific agents inline.

🔧 Suggested adjustment
-          context: "ClawZ, Crush, Agent Zero all share Cipher memory layer"
+          context: "Agents defined in pmoves/config/agent_registry.yaml share the Cipher memory layer"

As per coding guidelines, "Maintain canonical agent definitions in pmoves/config/agent_registry.yaml as the source of truth for all 60 agents".

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pmoves/configs/tac_trees/cipher-memory.tac.yaml` around lines 249 - 257, The
TAC entry with id "cipher.advanced.multi-agent-sync" contains a hardcoded
context string listing agent names; update the "context" value to avoid specific
agent names and instead reference the canonical agent registry (do not enumerate
agents) so the text stays accurate—e.g., replace "ClawZ, Crush, Agent Zero all
share Cipher memory layer" with a generic pointer to the agent registry or a
neutral description like "Agents defined in the agent registry share the Cipher
memory layer"; edit the "context" field in that TAC block and keep the rest of
the action (type: grep, pattern, expect) unchanged.

146-152: TensorZero observability check is too permissive.

pattern: "embed" can pass on unrelated text/comments. Use a specific section/key so this check is meaningful.

🔧 Suggested adjustment
-        - id: cipher.gateway.tensorzero-obs
+        - id: cipher.gateway.tensorzero-obs
           task: "Embedding calls logged in TensorZero"
           action:
             type: grep
             target: "pmoves/tensorzero/config/tensorzero.toml"
-            pattern: "embed"
-            expect: "Embedding model configured in TensorZero for observability"
+            pattern: "\\[embedding_models\\.qwen3_embedding_8b_local\\]|model_name = \"qwen3-embedding:8b\""
+            expect: "qwen3-embedding:8b is configured in TensorZero for embedding observability"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pmoves/configs/tac_trees/cipher-memory.tac.yaml` around lines 146 - 152, The
observability rule cipher.gateway.tensorzero-obs uses a too-broad pattern
"embed"; tighten the grep pattern in the action to match the actual embedding
configuration key or section (for example use a regex anchored to the config key
such as ^\s*embedding_model\s*= or ^\s*model\s*=\s*".*embed.*"), ensure the
grep/type supports regex or set the correct flag, and update the expect message
to reflect the specific key being validated so the check only passes when the
embedding config is present.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@pmoves/configs/tac_trees/cipher-memory.tac.yaml`:
- Around line 108-116: The TAC node with id "cipher.mcp.transport" currently
asserts only "stdio" (task "MCP bridge uses stdio transport", action grep target
"pmoves-cipher-mcp" pattern "stdio"), which conflicts with compose using
"--mcp-transport-type sse"; update this node to validate the actual runtime mode
or accept both modes by changing the action to check for either "stdio" or "sse"
(or add a conditional that inspects the running args/env and then asserts the
matching transport), and update the expect/context messages accordingly so the
check covers both valid deployment wiring options.
- Around line 42-48: The grep rule under id cipher.service.neo4j-dep
(action.type: grep, pattern) is brittle because it assumes cross-line regex
matching and can miss a valid nested depends_on -> neo4j -> condition:
service_healthy block; replace the simple grep with a YAML-aware assertion
(parse the compose YAML and verify service cipher-api has
depends_on.neo4j.condition == "service_healthy") or, if keeping grep, change the
check to either a DOTALL-enabled regex (e.g., use a (?s) /s flag to allow
newlines) or split into sequential checks that confirm "depends_on:" exists,
that "neo4j" is listed under it, and that "condition: service_healthy" appears
in that service block so the nested structure is correctly validated.
- Around line 159-180: The TAC checks under ids cipher.nats, cipher.nats.publish
and cipher.nats.subscribe reference a non-existent target value
("pmoves/services/cipher-api/") so their grep actions will always fail; either
remove these TAC entries or update their action.target to point to the actual
cipher-api source location (the external cipher repo used by docker-compose)
and/or adjust the grep patterns (action.pattern) accordingly; ensure any
retained checks correctly reference the repository where cipher-api lives and
validate that expect messages still match the code found.

---

Nitpick comments:
In `@pmoves/configs/tac_trees/cipher-memory.tac.yaml`:
- Around line 249-257: The TAC entry with id "cipher.advanced.multi-agent-sync"
contains a hardcoded context string listing agent names; update the "context"
value to avoid specific agent names and instead reference the canonical agent
registry (do not enumerate agents) so the text stays accurate—e.g., replace
"ClawZ, Crush, Agent Zero all share Cipher memory layer" with a generic pointer
to the agent registry or a neutral description like "Agents defined in the agent
registry share the Cipher memory layer"; edit the "context" field in that TAC
block and keep the rest of the action (type: grep, pattern, expect) unchanged.
- Around line 146-152: The observability rule cipher.gateway.tensorzero-obs uses
a too-broad pattern "embed"; tighten the grep pattern in the action to match the
actual embedding configuration key or section (for example use a regex anchored
to the config key such as ^\s*embedding_model\s*= or
^\s*model\s*=\s*".*embed.*"), ensure the grep/type supports regex or set the
correct flag, and update the expect message to reflect the specific key being
validated so the check only passes when the embedding config is present.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 08cbddd6-a4ec-4806-9f25-4ebe7832b54c

📥 Commits

Reviewing files that changed from the base of the PR and between d729277 and fb88a7f.

📒 Files selected for processing (1)
  • pmoves/configs/tac_trees/cipher-memory.tac.yaml

Comment on lines +42 to +48
- id: cipher.service.neo4j-dep
task: "Neo4j dependency declared"
action:
type: grep
target: "pmoves/docker-compose.yml"
pattern: "cipher.*neo4j|depends_on.*neo4j"
expect: "cipher-api depends on neo4j service_healthy"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Neo4j dependency check is brittle and can false-fail.

The current regex assumes cross-line matching in nested YAML, so valid depends_on -> neo4j -> condition: service_healthy config can be missed.

🔧 Suggested adjustment
-        - id: cipher.service.neo4j-dep
-          task: "Neo4j dependency declared"
-          action:
-            type: grep
-            target: "pmoves/docker-compose.yml"
-            pattern: "cipher.*neo4j|depends_on.*neo4j"
-            expect: "cipher-api depends on neo4j service_healthy"
+        - id: cipher.service.neo4j-uri
+          task: "Neo4j backend URI configured"
+          action:
+            type: grep
+            target: "pmoves/docker-compose.yml"
+            pattern: "NEO4J_URI=bolt://neo4j:7687"
+            expect: "Cipher API points to Neo4j backend"
+
+        - id: cipher.service.neo4j-dep
+          task: "Neo4j dependency declared"
+          action:
+            type: grep
+            target: "pmoves/docker-compose.yml"
+            pattern: "condition: service_healthy"
+            expect: "Neo4j dependency is health-gated in compose"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pmoves/configs/tac_trees/cipher-memory.tac.yaml` around lines 42 - 48, The
grep rule under id cipher.service.neo4j-dep (action.type: grep, pattern) is
brittle because it assumes cross-line regex matching and can miss a valid nested
depends_on -> neo4j -> condition: service_healthy block; replace the simple grep
with a YAML-aware assertion (parse the compose YAML and verify service
cipher-api has depends_on.neo4j.condition == "service_healthy") or, if keeping
grep, change the check to either a DOTALL-enabled regex (e.g., use a (?s) /s
flag to allow newlines) or split into sequential checks that confirm
"depends_on:" exists, that "neo4j" is listed under it, and that "condition:
service_healthy" appears in that service block so the nested structure is
correctly validated.

Comment on lines +108 to +116
- id: cipher.mcp.transport
task: "MCP bridge uses stdio transport"
action:
type: grep
target: "pmoves-cipher-mcp/"
pattern: "stdio"
expect: "stdio transport for Claude Code integration"
context: "Runs as sidecar process, not HTTP"
agent_hint: codex

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Transport assertion conflicts with current deployment wiring.

This node enforces stdio, but cipher-api in compose is configured with --mcp-transport-type sse. The TAC should validate the active runtime mode (or allow both modes explicitly).

🔧 Suggested adjustment
-        - id: cipher.mcp.transport
-          task: "MCP bridge uses stdio transport"
+        - id: cipher.mcp.transport
+          task: "MCP transport mode explicitly configured"
           action:
             type: grep
-            target: "pmoves-cipher-mcp/"
-            pattern: "stdio"
-            expect: "stdio transport for Claude Code integration"
+            target: "pmoves/docker-compose.yml"
+            pattern: "--mcp-transport-type.*(sse|stdio)"
+            expect: "MCP transport mode is explicit for deployment/runtime"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- id: cipher.mcp.transport
task: "MCP bridge uses stdio transport"
action:
type: grep
target: "pmoves-cipher-mcp/"
pattern: "stdio"
expect: "stdio transport for Claude Code integration"
context: "Runs as sidecar process, not HTTP"
agent_hint: codex
- id: cipher.mcp.transport
task: "MCP transport mode explicitly configured"
action:
type: grep
target: "pmoves/docker-compose.yml"
pattern: "--mcp-transport-type.*(sse|stdio)"
expect: "MCP transport mode is explicit for deployment/runtime"
context: "Runs as sidecar process, not HTTP"
agent_hint: codex
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pmoves/configs/tac_trees/cipher-memory.tac.yaml` around lines 108 - 116, The
TAC node with id "cipher.mcp.transport" currently asserts only "stdio" (task
"MCP bridge uses stdio transport", action grep target "pmoves-cipher-mcp"
pattern "stdio"), which conflicts with compose using "--mcp-transport-type sse";
update this node to validate the actual runtime mode or accept both modes by
changing the action to check for either "stdio" or "sse" (or add a conditional
that inspects the running args/env and then asserts the matching transport), and
update the expect/context messages accordingly so the check covers both valid
deployment wiring options.

Comment on lines +159 to +180
- id: cipher.nats
task: "NATS event bus integration"
context: "pmoves/services/cipher-api/"
agent_hint: codex
children:
- id: cipher.nats.publish
task: "Cipher publishes memory events"
action:
type: grep
target: "pmoves/services/cipher-api/"
pattern: "nats.*publish|NATS"
expect: "Publishes memory store/search events for agent coordination"
context: "BoTZ agents subscribe to cipher events for knowledge sync"
agent_hint: codex

- id: cipher.nats.subscribe
task: "Cipher subscribes to agent trail events"
action:
type: grep
target: "pmoves/services/cipher-api/"
pattern: "agent.graphiti.signed"
expect: "Subscribes to Graphiti trail for automatic memory ingestion"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Verify TAC targets exist =="
for p in \
  pmoves/services/cipher-api \
  pmoves-cipher-mcp \
  pmoves/services/gateway/gateway/api/chit.py \
  pmoves/services/hi-rag-gateway-v2/app.py \
  pmoves/config/agent_registry.yaml \
  pmoves/tensorzero/config/tensorzero.toml \
  pmoves/docker-compose.yml
do
  if [ -e "$p" ]; then
    echo "FOUND   $p"
  else
    echo "MISSING $p"
  fi
done

echo
echo "== Show cipher-api source wiring in compose =="
rg -n -C2 'cipher-api:|build:|context:|mcp-transport-type' pmoves/docker-compose.yml

Repository: POWERFULMOVES/PMOVES.AI

Length of output: 12590


Remove or correct TAC checks targeting non-existent cipher-api path.

The TAC checks at lines 159-180 target pmoves/services/cipher-api/, which does not exist in this repository. Cipher-api is built from an external repository (../Pmoves-cipher, as seen in docker-compose.yml line 2111), so these grep patterns will not find the source code. Either remove these checks or adjust them to reference the correct external repository path if cipher-api source is included elsewhere.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pmoves/configs/tac_trees/cipher-memory.tac.yaml` around lines 159 - 180, The
TAC checks under ids cipher.nats, cipher.nats.publish and cipher.nats.subscribe
reference a non-existent target value ("pmoves/services/cipher-api/") so their
grep actions will always fail; either remove these TAC entries or update their
action.target to point to the actual cipher-api source location (the external
cipher repo used by docker-compose) and/or adjust the grep patterns
(action.pattern) accordingly; ensure any retained checks correctly reference the
repository where cipher-api lives and validate that expect messages still match
the code found.

@POWERFULMOVES
POWERFULMOVES merged commit 9f81f8c into main Mar 19, 2026
6 checks passed
@POWERFULMOVES
POWERFULMOVES deleted the feat/cipher-tac-tree branch March 21, 2026 03:55
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.

1 participant