Implement P0 continual learning capabilities for Graphonomous: kappa activation, belief revision substrate, and conflict-aware consolidation. These three capabilities together solve the kappa=0 problem — the single biggest gap between Graphonomous's competitive thesis and its measured behavior.
Active Graphonomous goal: goal_ae39998e19f363c1519679b15d24744d — "Graphonomous v0.3 Continual Learning Capabilities"
Plan file: /home/travis/.claude/plans/smooth-tumbling-sunbeam.md
Current state: v0.2.0, 240 tests passing, 22 MCP tools, kappa=0 across all 150 benchmark questions
The Retriever's analyze_topology/1 only builds adjacency from edges between the ~20 retrieved nodes. EdgeExtractor creates unidirectional edges via regex (A imports B -> edge A->B). Cycles require bidirectional edges, which almost never form because:
Regex extraction misses conceptual back-references
No mechanism creates :contradicts/:supersedes edges automatically
Topology window is too narrow (only retrieved nodes, not their neighbors)
File: `graphonomous/lib/graphonomous/edge_extractor.ex`
Add extract_semantic_backrefs/1 — after forward edge creation, compute cosine similarity between target and source embeddings. If > 0.75, create reverse :supports edge.
This requires access to embeddings during extraction (currently regex-only).
File: `graphonomous/lib/graphonomous/retriever.ex`
Modify analyze_topology/1 to expand the topology window: include 1-hop neighbors of retrieved nodes, not just the retrieved nodes themselves.
Current code calls Store.list_edges_between(node_ids) where node_ids is ~20 retrieved results. Change to:
Get edges for each retrieved node (Store.list_edges_for_node/1)
Collect all neighbor IDs
Build adjacency over retrieved_ids ++ neighbor_ids
Run Tarjan SCC + kappa on the expanded set
Schema migration (new file in `graphonomous/lib/graphonomous/store.ex` or migration system):
ALTER TABLE nodes ADD COLUMN revision_id TEXT;
ALTER TABLE nodes ADD COLUMN superseded_by TEXT;
CREATE TABLE IF NOT EXISTS revisions (
id TEXT PRIMARY KEY,
operation TEXT NOT NULL, -- 'expansion' | 'revision' | 'contraction'
trigger_node_id TEXT NOT NULL,
affected_node_ids TEXT NOT NULL DEFAULT '[]',
rationale TEXT,
agent_id TEXT,
created_at TEXT NOT NULL
);
New file: `graphonomous/lib/graphonomous/belief_revision.ex`
defmodule Graphonomous.BeliefRevision do
@moduledoc """
AGM-rational belief revision operations with provenance tracking.
Provides storage/provenance substrate — reasoning about which belief wins
is delegated to external systems (Deliberatic, BendScript) via pluggable hooks.
"""
# Core operations
def expand(content, opts \\ []) # Add belief, check contradictions first
def revise(node_id, new_content, opts) # Supersede old belief, propagate confidence
def contract(node_id, opts) # Remove belief, retract dependents
# Detection
def detect_contradictions(node_id_or_content) # Find contradicting nodes
def propagate_retraction(node_id, opts) # Walk derived_from/supports, reduce confidence
# Hooks
def register_resolution_hook(module) # External resolver (Deliberatic, BendScript)
def resolve_contradiction(node_a, node_b) # Call registered hook or use default heuristic
end
New MCP tools (register in `graphonomous/lib/graphonomous/mcp/server.ex`):
belief_revise — {node_id, new_content, rationale, operation: "expand"|"revise"|"contract"}
belief_contradictions — {node_id} or {content} — returns contradicting nodes with similarity scores
New edge type: Add :superseded_by to valid edge types in Graph module.
Integration with Learner: In learn_from_interaction, after store_node, call detect_contradictions. If found, create :contradicts edges (these form 2-node SCCs = kappa=1).
Integration with Consolidator Stage 5: Before merging (cosine > 0.95), check if pair has :contradicts edges. If so, route to BeliefRevision.resolve_contradiction/2 instead of merging.
File: `graphonomous/lib/graphonomous/retriever.ex`
Add detect_and_tag_conflicts/1 after ranking, before return
Tag pairs where: semantic similarity > 0.8 AND confidence divergence > 0.3
Store conflict tags in node metadata (or a lightweight ETS cache)
File: `graphonomous/lib/graphonomous/consolidator.ex`
Add Stage 4.5 between "strengthen coactivated" and "merge similar"
stage_resolve_conflicts/0:
Find all conflict-tagged pairs
For each pair, try resolution strategies in order:
a. Temporal (newer supersedes older) b. Evidence (more outcome references wins) c. External hook (registered resolver) d. Escalate to attention (create attention item)
Winning resolution: call BeliefRevision.revise/3
Unresolved: create :contradicts edges (activates kappa)
Key insight: Unresolved conflicts get :contradicts edges = guaranteed kappa>=1. This is the PRIMARY kappa activation mechanism for organic (non-synthetic) knowledge.
Read these files FIRST to understand the current implementation:
graphonomous/lib/graphonomous/retriever.ex — retrieval pipeline, analyze_topology/1, scoring
graphonomous/lib/graphonomous/consolidator.ex — 7-stage pipeline, decay rates, prune logic
graphonomous/lib/graphonomous/learner.ex — learn_from_interaction, learn_from_outcome, confidence updates
graphonomous/lib/graphonomous/edge_extractor.ex — regex extraction, edge type assignment
graphonomous/lib/graphonomous/topology.ex — tarjan_scc/1, compute_kappa/2, analyze/1
graphonomous/lib/graphonomous/store.ex — SQLite schema, migrations, CRUD operations
graphonomous/lib/graphonomous/graph.ex — edge types, graph operations
graphonomous/lib/graphonomous/mcp/server.ex — MCP tool registration pattern
graphonomous/lib/graphonomous/types/node.ex — Node struct definition
graphonomous/lib/graphonomous/types/edge.ex — Edge struct definition
Use mix format style
All new modules need @moduledoc and @doc on public functions
Add to existing test files or create new ones in test/graphonomous/
New MCP tools follow the pattern in existing tool modules under lib/graphonomous/mcp/tools/
Schema changes go through the Store migration system
Emit telemetry events for new operations (follow existing [:graphonomous, :*, :*] pattern)
After implementing P0:
[ ] mix compile --warnings-as-errors passes
[ ] mix test — all 240+ existing tests pass (regression)
[ ] New tests for BeliefRevision module pass
[ ] New tests for conflict-aware consolidation pass
[ ] New tests for expanded topology window pass
[ ] Run mix benchmark.run — verify kappa>0 appears in at least some queries
[ ] Manual test: store two contradicting facts via MCP, verify :contradicts edges form, verify kappa=1 on retrieval involving both
Kumiho (arxiv 2603.17244) — AGM maps to property graph operations (validates our approach)
SleepGate (arxiv 2603.14517) — separate conflict detection from resolution (our Stage 4.5 design)
MemRL (arxiv 2601.03192) — two-phase retrieval (P1, not this session)
MAGMA (arxiv 2601.03236) — multi-view adjacency indexes (future optimization for kappa)
UtU (arxiv 2402.10695) — constant-time graph unlearning (P1 forgetting, not this session)
kappa > 0 activates on at least one real retrieval query (not synthetic)
Belief revision creates revision records and supersedes edges
Conflict detection tags conflicts during retrieval
Conflict resolution runs during consolidation Stage 4.5
All existing tests pass