Commit Graph
3 Commits
Author SHA1 Message Date
KaifAhmad1andClaude Sonnet 4.6 13eed9cf6d fix(context): fix isinstance regression, hoist BFS find_edges, expand tests
- Replace isinstance(graph_store, ContextGraph) with type() is ContextGraph
  in all 12 guards across decision_query.py and decision_recorder.py.
  Fixes 2 regressions where Mock(spec=ContextGraph) triggered fallback
  paths, causing TypeError on iteration of mock return values.

- Hoist find_edges() calls out of the BFS while-loop in trace_decision_path
  so edges are fetched once per call instead of once per visited node,
  eliminating O(nodes * total_edges) repeated full-graph fetches.

- Expand test_decision_query_fallback.py: keep the original integration
  test and add 13 targeted unit tests covering all 7 DecisionQuery and
  4 DecisionRecorder ContextGraph fallback methods, including tz-aware/naive
  datetime mixing and Mock guard validation.

Result: 353 passed, 0 failed (was 338 passed, 2 failed on this branch)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-21 17:08:44 +05:30
ZohaibHassan16 ee7c00f655 fix(context): resolve DecisionQuery fallback bugs and metadata preservation 2026-03-16 16:44:42 +05:00
ZohaibHassan16 4146fbf277 fix(context): Implement ContextGraph traversal fallbacks for DecisionQuery 2026-03-16 02:12:49 +05:00