fix: resolve 6 integration test failures

1. patterns endpoint: fix query referencing non-existent column
   di.catalyst_type → dir.catalyst_type (column is on document_impact_records)
2. lockouts seed: use relative timestamps (now + 7d) so active lockout
   is always in the future regardless of when tests run
3. create_agent: make slug optional with auto-generation from name
4. create_source: json.dumps(config) + ::jsonb cast for asyncpg JSONB compat
5. approval_expiry: return count as int (len(expired)) not the list itself
6. metrics_consistency: fix test assertion to match API contract
   (total >= active + reserve, not total == active + reserve + unrealized)
This commit is contained in:
Celes Renata
2026-04-20 04:30:13 +00:00
parent 422326bf83
commit 5acb2fb43e
5 changed files with 19 additions and 19 deletions
+3 -2
View File
@@ -1106,11 +1106,12 @@ async def _seed_operator_approvals(conn: asyncpg.Connection) -> None:
async def _seed_symbol_lockouts(conn: asyncpg.Connection) -> None:
now = datetime.now(timezone.utc)
lockouts = [
(LOCKOUT_ACTIVE, "AAPL", "news_shock", "Earnings volatility cooldown",
BASE_TS + timedelta(days=7), BASE_TS),
now + timedelta(days=7), now - timedelta(hours=1)),
(LOCKOUT_EXPIRED, "XOM", "cooldown", "Post-trade cooldown period",
BASE_TS - timedelta(days=1), BASE_TS - timedelta(days=3)),
now - timedelta(days=1), now - timedelta(days=3)),
]
await conn.executemany(
"""INSERT INTO symbol_lockouts (id, ticker, lockout_type, reason, expires_at, created_at)