"""Run the fixed baseline only in an empty, disposable CI database. Credentials are supplied explicitly in a private JSON file. This script never reads live configuration; reusing a live provider requires explicit operator authorization. The providers map has grouping/analysis/outlook entries containing protocol, base_url and api_key. No quality-acceptance flag is set automatically. """ import argparse import asyncio from datetime import UTC, datetime import hashlib import json import os import time from pathlib import Path from urllib.parse import urlparse from sqlalchemy import select, func from alphapulse.core.crypto import encrypt from alphapulse.core.db import SessionLocal, engine from alphapulse.models import AiProvider, NewsItem from alphapulse.models.risk import RiskSettings, ArticleAnalysis, NewsSummary, NewsEvent, EventMember, EventVersion, RiskSnapshot from alphapulse.news_risk import worker, pipeline, event_research from alphapulse.ai.skills import create_node, add_version async def bounded(identifiers, action, limit=4): pending=iter(identifiers) tasks=set() try: while tasks or pending is not None: while pending is not None and len(tasks)