From e494df9216ea714ec3b5399a753a95a4c3d3ecb9 Mon Sep 17 00:00:00 2001 From: Ed_ Date: Sat, 20 Jun 2026 12:49:35 -0400 Subject: [PATCH] =?UTF-8?q?chore:=20TIER-2=20READ=20conductor/code=5Fstyle?= =?UTF-8?q?guides/error=5Fhandling.md=20lines=20462-940=20before=20Phase?= =?UTF-8?q?=2010=20=E2=80=94=20Broad-Except=20Distinction=20+=20AI=20Agent?= =?UTF-8?q?=20Checklist=20(MUST-DO=20#1,#2;=20MUST-NOT-DO=20#6,#7)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Phase 10: ai_client Batch B (9 INTERNAL_BROAD_CATCH sites). Key rules for Phase 10: - MUST-DO #1: Use Result[T] for any function that can fail at runtime - MUST-DO #2: Catch SDK exceptions at the boundary, convert to ErrorInfo - MUST-NOT-DO #6: DO NOT catch except Exception and silently swallow - MUST-NOT-DO #7: DO NOT catch except Exception in non-*_result code without conversion to ErrorInfo Canonical BC pattern (lines 540-562): def _feature_result(self) -> Result[T]: try: return Result(data=compute()) except Exception as e: return Result(data=None, errors=[ErrorInfo(kind=INTERNAL, message=str(e), source=..., original=e)]) Per-site decision process (Tier 1's directive): - narrow + return ErrorInfo or dict[error]=True: Heuristic E match (already INTERNAL_COMPLIANT) - narrow + empty default (e.g., args={}): MIGRATE to Result[T] - broad except Exception: MIGRATE to Result[T] (BOUNDARY_CONVERSION) - broad + re-raise: classify per Pattern 1/2/3 (Phase 12 territory)