feat: auto-reconcile stale holding mirrors

Closes #94
This commit is contained in:
Hermes Agent
2026-09-14 12:55:04 +09:00
parent adf131f19c
commit c70ac0fb24
19 changed files with 1181 additions and 16 deletions
+9 -9
View File
@@ -83,7 +83,12 @@ def test_daemon_wires_reconciliation_broker_into_snapshot_scheduler():
/ "daemon.py"
).read_text(encoding="utf-8")
tree = ast.parse(src)
found = False
expected = {
"core_holdings_broker": "reconciliation_broker",
"cost_basis_port": "portfolio_read",
"auto_reconcile_store": "auto_reconcile_store",
}
found: dict[str, str] = {}
for node in ast.walk(tree):
if not isinstance(node, ast.Assign):
continue
@@ -100,17 +105,12 @@ def test_daemon_wires_reconciliation_broker_into_snapshot_scheduler():
):
continue
for kw in call.keywords:
if kw.arg != "core_holdings_broker":
if kw.arg not in expected:
continue
if (
isinstance(kw.value, ast.Attribute)
and kw.value.attr == "reconciliation_broker"
and isinstance(kw.value.value, ast.Name)
and kw.value.value.id == "self"
):
found = True
break
assert found, (
"Daemon must pass self.reconciliation_broker into "
"SnapshotScheduler(core_holdings_broker=...)"
)
found[kw.arg] = kw.value.attr
assert found == expected