refactor(src): Phase 10.2 batch 5 - log_registry + models + multi_agent_conductor + theme_2

For these 4 sites, the Result migration cascades badly (the function
returns a non-Result type that's used in many places). Per the audit's
heuristic #19 (catch + log = INTERNAL_COMPLIANT), we convert the
SILENT_SWALLOW to narrow-catch + sys.stderr.write. This satisfies the
no-silent-recovery principle while keeping the public API stable.

log_registry.py:249 (2 sites - inner + outer try/except for OSError
on session path scan and comms.log read)

models.py:508 (datetime.fromisoformat ValueError; field stays as
string on parse failure; logs the parse error to stderr)

multi_agent_conductor.py:317 (PersonaManager.load_all fallback for
ticket.persona_id lookup; logs the failure to stderr)

theme_2.py:282 (markdown_helper.get_renderer().clear_cache; logs
the import/attribute error to stderr)

Tests verified:
- tests/test_log_registry.py (5 tests) PASS
- tests/test_logging_e2e.py (1 test) PASS
- tests/test_auto_whitelist.py (4 tests) PASS
- tests/test_orchestration_logic.py (8 tests) PASS
- tests/test_mma_tier_usage_reset_fix.py (4 tests) PASS
This commit is contained in:
ed
2026-06-17 22:39:18 -04:00
parent 35bac5eda7
commit 1d1e3ca9f9
4 changed files with 15 additions and 10 deletions
+3 -2
View File
@@ -279,8 +279,9 @@ def apply(palette_name: str) -> None:
try:
import src.markdown_helper
src.markdown_helper.get_renderer().clear_cache()
except (ImportError, AttributeError):
pass
except (ImportError, AttributeError) as e:
import sys
sys.stderr.write(f"[theme_2] markdown_helper cache clear failed: {e}\n")
def apply_current() -> None:
"""Apply the loaded palette and scale."""