"""Conflicts & Revenue — who pays Alpha Covenant, what they get, what money cannot touch. Live counts from the billing collections; nothing here is aspirational.""" from datetime import datetime, timezone import ast import os from pathlib import Path from fastapi import APIRouter from deps import db import firewall import verification router = APIRouter(prefix="/api/public") RECORD_MODULES = ["covenantscore", "record", "ledger", "watchdog", "rootcause", "carriercheck", "fmcsa_qc", "stateregistry", "exclusions", "dol", "lawsuits", "recompete", "studentloans", "publicrecord", "cfpb_match"] BILLING_MODULES = {"sponsors", "carrier_billing", "academy_billing", "investor_billing", "carriermonitor", "billing", "stripe", "emergentintegrations.payments"} def separation_check() -> dict: """Static proof: no record/scoring module imports a billing module. Re-run on every request; the result is what the page shows.""" here = Path(__file__).parent violations, checked = [], [] for m in RECORD_MODULES: f = here / f"{m}.py" if not f.exists(): continue checked.append(m) for node in ast.walk(ast.parse(f.read_text())): names = [a.name for a in node.names] if isinstance(node, ast.Import) else ([node.module] if isinstance(node, ast.ImportFrom) and node.module else []) for n in names: if n.split(".")[0] in BILLING_MODULES or n in BILLING_MODULES: violations.append({"module": m, "imports": n}) return {"pass": not violations, "checked_modules": checked, "forbidden_modules": sorted(BILLING_MODULES), "violations": violations, "checked_at": datetime.now(timezone.utc).isoformat(), "method": "AST scan of every import statement in the record and scoring modules; a build test (tests/test_separation.py) fails if this ever finds one."} SOURCES = [ {"name": "CFPB Consumer Complaint Database", "publisher": "Consumer Financial Protection Bureau", "url": "https://www.consumerfinance.gov/data-research/consumer-complaints/", "used_for": "Complaints, issues, timeliness, relief, open files; Ledger; Student Loan Servicer Index", "key": None}, {"name": "Federal Student Aid Data Center", "publisher": "U.S. Department of Education", "url": "https://studentaid.gov/data-center/student/portfolio", "used_for": "Servicer portfolio balances and borrowers", "key": None}, {"name": "FMCSA SAFER Company Snapshot", "publisher": "FMCSA", "url": "https://safer.fmcsa.dot.gov/", "used_for": "Carrier status, authority, inspections, crashes, safety rating", "key": None}, {"name": "FMCSA QCMobile API", "publisher": "FMCSA", "url": "https://mobile.fmcsa.dot.gov/QCDevsite/", "used_for": "Authority types, BIPD/cargo/bond insurance on file", "key": "FMCSA_WEBKEY"}, {"name": "SAM.gov Exclusions", "publisher": "GSA", "url": "https://sam.gov/search/?index=ex", "used_for": "Active suspension/debarment records", "key": "SAM_API_KEY"}, {"name": "SAM.gov Contract Opportunities", "publisher": "GSA", "url": "https://sam.gov/search/?index=opp", "used_for": "Government bid watch", "key": "SAM_API_KEY"}, {"name": "FedConnect Public Opportunities", "publisher": "Participating agencies", "url": "https://www.fedconnect.net/", "used_for": "Government bid watch", "key": None}, {"name": "USAspending.gov API", "publisher": "U.S. Treasury", "url": "https://www.usaspending.gov/", "used_for": "Prime awards, obligations, re-compete radar", "key": None}, {"name": "CourtListener / RECAP", "publisher": "Free Law Project", "url": "https://www.courtlistener.com/", "used_for": "Federal docket counts and case lists (partial coverage)", "key": None}, {"name": "DOL Enforcement Data API v4", "publisher": "U.S. Department of Labor", "url": "https://dataportal.dol.gov/", "used_for": "OSHA inspections, Wage & Hour cases", "key": "DOL_API_KEY"}, {"name": "Colorado Business Entities", "publisher": "Colorado Secretary of State", "url": "https://data.colorado.gov/d/4ykn-tg5h", "used_for": "State registry rows", "key": None}, {"name": "New York Active Corporations", "publisher": "NY Department of State", "url": "https://data.ny.gov/d/n9v6-gdp6", "used_for": "State registry rows (active only)", "key": None}, {"name": "HHS-OIG LEIE (exclusions)", "publisher": "HHS Office of Inspector General", "url": "https://oig.hhs.gov/exclusions/exclusions_list.asp", "used_for": "Exclusion-list entries by exact business name / NPI", "key": None}, {"name": "Connecticut Business Registry", "publisher": "CT Secretary of the State", "url": "https://data.ct.gov/d/n7gp-d28j", "used_for": "State registry rows", "key": None}, {"name": "CPSC Recall API", "publisher": "Consumer Product Safety Commission", "url": "https://www.cpsc.gov/Recalls", "used_for": "Product recalls", "key": None}, {"name": "openFDA", "publisher": "U.S. Food and Drug Administration", "url": "https://open.fda.gov/", "used_for": "Drug labels, adverse events, enforcement recalls", "key": None}, {"name": "FDIC BankFind (institutions + Call Report financials)", "publisher": "FDIC", "url": "https://banks.data.fdic.gov/", "used_for": "Active insured-institution flag; PCA capital ratios on Standards Check", "key": None}, {"name": "SEC EDGAR (submissions, XBRL company facts)", "publisher": "U.S. Securities and Exchange Commission", "url": "https://www.sec.gov/edgar", "used_for": "Registrant filings and filing dates on Standards Check; financial facts in Business Verifier", "key": None}, {"name": "eCFR / U.S. Code", "publisher": "Office of the Federal Register / GPO", "url": "https://www.ecfr.gov/", "used_for": "Text of the published standards cited on Standards Check", "key": None}, {"name": "CMS provider & hospital data", "publisher": "Centers for Medicare & Medicaid Services", "url": "https://data.cms.gov/", "used_for": "Doctor and hospital Records", "key": None}, {"name": "National Weather Service API", "publisher": "NOAA", "url": "https://api.weather.gov/", "used_for": "HQ-area weather alerts", "key": None}, ] @router.get("/conflicts") async def conflicts(): now = datetime.now(timezone.utc).isoformat() sponsors = await db.sponsors.count_documents({"status": "active", "period_end": {"$gt": now}}) monitors = await db.carrier_watchlists.count_documents({"status": "active", "period_end": {"$gt": now}}) recruiting = await db.carrier_subscriptions.count_documents({"status": "active"}) paid_tx = await db.payment_transactions.count_documents({"payment_status": "paid"}) import covenantscore changelog = covenantscore.METHODOLOGY.get("versions", []) return { "entity": "Alpha Covenant Holdings is a trade name (DBA) of Build Break Build Fitness and Promo (Cincinnati, Ohio). Registered details are on file with the Ohio Secretary of State — see 'Check the entity' below.", "principle": "Every figure on a record is copied from a named official source. Money buys placement, alerts or tooling next to a record. It cannot add, remove, reorder, reword or delay any line of the record, the Covenant Index, the Correction Ledger, or the Directory ranking.", "streams": [ {"name": "Record sponsorship", "buyer": "Companies, law firms, trade groups", "gets": "A labelled 'Sponsor' slot beside a record or state page, with the sponsor's own message.", "cannot": "Change or hide any line of the record it sits beside; sponsors are shown on the record whether the record is favourable or not.", "active": sponsors, "writes_to": ["sponsors"], "url": "/sponsor"}, {"name": "Record Monitor", "buyer": "Shippers, brokers, procurement teams", "gets": "Daily change alerts on public lines (FMCSA, SAM, courts, DOL, state registries, CFPB) for up to 300 carriers or vendors, prepaid 30 days.", "cannot": "Alter the watched records; the monitor only re-reads the same public sources and reports old → new.", "active": monitors, "writes_to": ["carrier_watchlists", "carrier_watch_state", "carrier_watch_events"], "url": "/carrier-check?monitor=1"}, {"name": "Carrier recruiting page", "buyer": "Motor carriers", "gets": "Openings, pay and equipment shown beside the carrier's live FMCSA report card, prepaid 30 days.", "cannot": "Edit the report card — it is pulled from FMCSA and is never editable by the carrier or by us.", "active": recruiting, "writes_to": ["carrier_subscriptions", "carrier_recruit_pages"], "url": "/carrier-pricing"}, {"name": "Diagnosis and score reports", "buyer": "Companies named in records", "gets": "A PDF assembling the same public lines with the formula applied, for internal use.", "cannot": "Improve the score; the report and the public score are computed by the same code from the same public calls.", "active": None, "writes_to": ["payment_transactions", "covenant_reports"], "url": "/methodology"}, {"name": "Marketing, affiliate-commission, creator and agent-growth services", "buyer": "Small businesses, creators, insurance agents (formerly)", "gets": "REMOVED FROM THIS DOMAIN. These services and the 30%-commission partner program are no longer sold on alphacovenantholdings.com; they are being moved to a separate business and website. Their pages now show a notice.", "cannot": "Reach any record data: no code path into record, score, ledger or directory collections; no record page links to them; no longer offered under the records platform's name.", "active": 0, "writes_to": [], "url": "/partners", "separate_line_of_business": True, "status": "removed_from_this_domain"}, ], "invariants": [ {"claim": "Records changed by payment", "value": 0, "how_verified": "Record collections (watchdog_snapshots, carrier_cache, carrier_history, registry_snapshots, public_record_cache, covenant_scores, ledger) are written only by source-pull code. Billing modules write only to the collections listed per stream above."}, {"claim": "Ranking or visibility sold", "value": 0, "how_verified": "Directory order and record content have no sponsor, subscription or payment input. Sponsor slots are labelled and positioned outside the record body."}, {"claim": "Formula changes", "value": len(changelog), "how_verified": "Every change to the Covenant Index formula is dated and published with its reason on /methodology; the current version is stamped on every score.", "latest": changelog[0] if changelog else None}, {"claim": "Paid transactions to date (all streams)", "value": paid_tx, "how_verified": "Count of Stripe sessions marked paid in payment_transactions."}, ], "independent_check": [ {"what": "Recompute any score yourself", "how": "Every record's 'Reproduce this score' panel lists the exact public API calls and arithmetic."}, {"what": "Check the entity", "how": "Ohio Secretary of State business search for 'Build Break Build Fitness and Promo'.", "url": "https://businesssearch.ohiosos.gov/"}, {"what": "Check any figure against its source", "how": "Every line carries a 'View official source' link with the pull time."}, ], "separation_check": separation_check(), "runtime_firewall": await firewall.stats(), "sealed_off": {"api": "/api/public/sealed", "policy": "Only the public-records platform is served from this domain. The former agency/marketing businesses were removed from the frontend, refused at the API edge (HTTP 410) and un-scheduled; the full manifest is public."}, "accuracy": {"url": "/accuracy", "api": "/api/public/accuracy", "policy": "Daily random re-check of published figures against their sources; misses published as plain counts and ticketed. Our own automated check, not an independent audit."}, "verification": {"url": "/api/public/verification", "running_code": "/api/public/code", "auditor_packet": "/api/public/auditor-packet"}, "entity_disclosure": verification.entity_disclosure(), "independent_audit": {"status": "none yet", "statement": "Alpha Covenant Holdings has not yet been independently audited. Until it is, every check on this page is self-reported and reproducible by anyone: the source roster, the reproduce-this-score steps, the corrections log hashes, the import scan and the firewall counter.", "invitation": "Auditors, journalists and researchers may request read access to the collections named on this page via /press. Findings will be published on this page unedited."}, "sources": {"policy": "Closed roster. Every figure comes from one of these publishers, is shown with its pull time and links back. No other source is used; paid services cannot add, remove or alter a source.", "list": [{**src, "active": (bool(os.environ.get(src["key"])) if src["key"] else True), "key_required": bool(src["key"])} for src in SOURCES]}, "corrections": {"url": "/corrections", "policy": "Free for anyone; every request and outcome logged publicly with date, reason and source."}, "contact": "/press", "generated_at": now, }