3.3 KiB
Graph Discovery Spec
Status: demo-backed / active Scope: how PodMan discovers graph nodes, edges, risk paths, and learning paths from MongoDB Owner: graph discovery / Team memory observatory
Purpose
Graph discovery turns MongoDB memory into a legible Team memory graph. It is not only layout. It decides which relationships matter, which path is highlighted, and which evidence explains the graph.
The graph must answer:
- Who is working?
- Which files or symbols overlap?
- Where is the risk?
- What did PodMan do?
- What outcome changed memory?
What Is Implemented Now
- Live materializer first: build from current MongoDB records.
- Seeded graph second: read
team_model.graphand mirrored graph collections. - Demo fallback third: return a grounded demo graph when live data is empty or unavailable.
- Reachability uses MongoDB
$graphLookupovergraph_edges.
What Is Intentionally Cut
- A graph database migration.
- Whole-history rendering as the default view.
- Claims that seeded graph data is live learning.
Source Data
Graph discovery reads:
podsengineer_statesobservationscollisionsinterventionsoutcomesteam_modelgraph_nodesgraph_edges- optional
memory_vectors - optional
agent_runs - optional
strategy_versions
UI Graph Contract
PodGraph
podId
generatedAt
nodes
edges
metrics
loop?
activity?
Node kinds:
engineer, feature, file, collision, intervention
Edge kinds:
owns, editing, touches, collides, warns, learned_from
Discovery Rules
Engineer nodes
Create from pod roster, recent observations, git state, or collision membership.
File nodes
Create only from normalized real file paths. Reject noise such as URLs, env values, scratch names, and non-file strings.
Collision nodes
Create from distinct collision signatures. Collapse repeats. Prioritize collisions referenced by accepted outcomes.
Intervention nodes
Create one visible intervention per surviving collision unless whole-graph mode explicitly expands history.
Learned paths
Create learned_from only when an accepted real outcome links an intervention
to a durable memory update.
Path Modes
Risk path
Default mode. Highlight the clearest current chain:
engineer -> file -> collision -> intervention -> learned owner
Dim unrelated graph material.
Learning edges
Highlight learned_from, owns, and the outcomes that produced them.
Whole graph
Show all materialized nodes and edges with de-emphasized non-critical edges.
MongoDB Traversal
Use graph_edges for reachability:
source -> target -> next target
Primary traversal questions:
- What risks does this engineer reach?
- Which files feed this collision?
- Which intervention came from this collision?
- Which learned owner came from this intervention?
Metrics
Minimum metrics:
- Learned owners.
- Open risk paths.
- Accept rate.
Optional metrics:
- Observations.
- Interventions.
- Memory vectors.
- Strategy versions.
Acceptance Criteria
- Default graph is not a hairball.
- Every visible learned edge has outcome evidence.
- Every selected node can explain why it matters.
- Activity stream matches graph events.
- Graph can be rebuilt from MongoDB source records.