refactor(graph): settle past decisions in graph/settlement.py

- resolve_benchmark, fetch_returns and settle_pending are module functions; the graph's settle_pending runs them under its config
- create_run_state settles through settle_pending, so the CLI path also settles under the graph's config
This commit is contained in:
Yijia-Xiao
2026-09-24 05:00:36 +00:00
parent c9695673bf
commit 969861e8be
7 changed files with 201 additions and 213 deletions
+1 -1
View File
@@ -30,7 +30,7 @@ def test_create_run_state_settles_pending_and_carries_context(tmp_path, monkeypa
graph = _bare_graph(tmp_path)
graph.propagator = Propagator()
settled = []
monkeypatch.setattr(graph, "_resolve_pending_entries", settled.append, raising=False)
monkeypatch.setattr(graph, "settle_pending", settled.append, raising=False)
monkeypatch.setattr(graph, "resolve_instrument_context", lambda t, a="stock", d=None: f"id:{t}", raising=False)
monkeypatch.setattr(graph, "_memory_as_of", lambda d: d, raising=False)
graph.memory_log.store_decision("NVDA", "2026-01-05", "Rating: Buy\nold call")