design(retrieval): graph-assisted evidence expansion
Motivation
This continues the useful graph retrieval direction from #30 by @RaviTharuma. The current product separates canonical memory, code state, graph projections, provenance, and bounded task context; a flat third RRF source would bypass those boundaries.
Scope
- Define when graph neighbors are evidence worth expanding, rather than treating every graph edge as a search hit.
- Route graph evidence through provenance, freshness, visibility, and task-budget checks before context assembly.
- Compare graph-assisted expansion against existing retrieval on representative coding and knowledge-work tasks.
- Preserve a deterministic fallback when no graph or no relevant evidence exists.
Acceptance
- The design specifies graph source, edge semantics, visibility rules, and ranking/evaluation evidence.
- Retrieval results can explain why graph evidence was included.
- Tests cover no-graph fallback, stale/hidden evidence, and bounded context assembly.
Credit
Created to preserve and evolve the design contribution in #30. The original PR remains the source of the initial BFS plus RRF proposal.
Proposed implementation plan: design the graph-evidence contract before adding retrieval behavior. Phase A defines source, edge, freshness, visibility, conflict, and confidence metadata. Phase B routes bounded neighbor expansion through the existing evidence governor/workset and task/token budgets. Phase C compares graph-assisted retrieval with the current baseline and explains why each graph fact was included. Add deterministic no-graph, stale, hidden, conflicting, and budget-exceeded fallbacks. Do not resurrect an unbounded BFS/RRF shortcut. The implementation will preserve and credit #30/RaviTharuma.