fix(broker): enforce operator broker truth boundary

This commit is contained in:
Hermes Agent
2026-07-15 08:07:21 +09:00
parent 1b63e79edc
commit 216e462df4
19 changed files with 603 additions and 35 deletions
@@ -134,6 +134,18 @@ class PostgreSQLSlotRepository:
)
return [self._row_to_slot(r) for r in cur.fetchall()]
def find_managed_slot_by_symbol(self, instance_key: str, symbol: str) -> Optional[Slot]:
with self._psycopg.connect(self._dsn) as conn:
with conn.cursor() as cur:
cur.execute(
f"SELECT {_SLOT_COLUMNS} FROM daily_slot "
"WHERE instance_key = %s AND symbol = %s "
"ORDER BY updated_at DESC NULLS LAST, slot_id ASC LIMIT 1",
(instance_key, symbol),
)
row = cur.fetchone()
return self._row_to_slot(row) if row else None
def reconcile_universe(
self, instance_key: str, universe: dict[str, str],
*, allow_retire: bool = True,