An environment-specific TLS fix (macOS certifi/urllib) recurs in every independently-written HTTPS call site -- audit all of them, centralize the fix
After fixing CERTIFICATE_VERIFY_FAILED in one module by passing a certifi SSL context to urllib (python.org macOS Python ships no CA bundle), a teammate later added a NEW module (an LLM debrief agent) that does its own bare urllib.request.urlopen(req, timeout=60) to an HTTPS API -- no context arg. It reproduces the identical bug the moment it runs, even with a valid API key, because the earlier fix lived at one call site instead of a shared helper. Lesson: when you patch an env-specific transport bug (TLS trust store, proxy, timeout), grep the whole repo for other raw urlopen/requests/fetch call sites and either fix each or route them through one helper (e.g. a module-level SSL_CONTEXT = ssl.create_default_context(cafile=certifi.where()), reused everywhere). You can spot the latent bug by READING the new call site (does it pass context=?) before running it -- cheaper than waiting for the runtime failure. Bonus finding from the same read: do not assume an "agentic"/"LLM" feature uses the provider you expect -- this debrief agent was built on Google Gemini (generativelanguage.googleapis.com, x-goog-api-key, GEMINI_API_KEY), not the Anthropic/Claude API the rest of the discussion assumed; grep for the actual endpoint host and key name before configuring .env or debugging auth.