fix(tests): close the Oura egress guard's module-scope escape hatch
The guard allowlisted (oura_auth, <module>, module_network_import) and then
treated that single entry as permission for any module-scope capability except
dynamic_import. Because the check fell back to that broad rule, a future
module-level `import subprocess`, `import socket`, `import ssl`, `import
smtplib`, or an `os.system(...)` call in oura_auth.py would have been reported
as allowed — defeating the guard's stated contract of allowlisting by module,
function, and capability, and defeating its requirement to fail on sockets, TLS
primitives, mail clients, and subprocess escape hatches.
_allowed is now an exact (module, owner, capability) membership test with no
fallback, and the broad entry is replaced by exactly the three capabilities
oura_auth.py genuinely needs at module scope, matching its imports:
urllib.request (http_client), webbrowser (browser_open), and http.server
(loopback_http_server). urllib.parse remains covered by SAFE_IMPORTS. oura.py's
lazy-import discipline is unchanged.
Detection also missed several transports the boundary is supposed to cover, so
urllib3 and pycurl are now recognized as HTTP clients and imaplib and poplib as
mail clients.
The synthetic self-test — which exists to prove the guard can actually fail —
now feeds module-scope subprocess imports and calls, os.system, socket, smtplib,
and urllib3 through the harness and asserts each is reported as a violation.
Also corrects two design-doc statements that no longer matched the code: the
Oura sync backend is registered and implements save-mode sync rather than
raising as an unregistered skeleton, and oura.py keeps a lazy-import discipline
with egress confined to the allowlisted transport rather than having no network
imports at all.