""" Adaptive router — chooses among COMPLIANT methods only (docs/06). Order of preference: official API > bulk > authorized public web > licensed. There are NO bypass/stealth/proxy-rotation tiers here, by design (CLAUDE.md §1). """ from __future__ import annotations # market -> ordered list of source_ids to try (compliant connectors only) MARKET_SOURCES: dict[str, list[str]] = { "NO": ["brreg", "gleif"], "GB": ["companies_house", "gleif"], "FI": ["prh", "gleif"], "DK": ["cvr", "gleif"], "SE": ["gleif"], # Bolagsverket bulk is licensed; SE company core via GLEIF + licensed/partner } # Access rank: lower = preferred (cheapest compliant path first). ACCESS_RANK = {"api": 0, "bulk": 1, "authorized_web": 2, "licensed": 3} def plan_for_market(market: str) -> list[str]: """Return the ordered, compliant source plan for a market.""" return MARKET_SOURCES.get(market, ["gleif"])