From 82378339e012139ed3118dd1b2240b99db9f6a47 Mon Sep 17 00:00:00 2001 From: Ed_ Date: Sat, 20 Jun 2026 13:49:31 -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?=2011=20=E2=80=94=20CRITICAL=20ANTI-SLIMING=20(logging=20is=20N?= =?UTF-8?q?OT=20a=20drain)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Phase 11: ai_client silent-swallow (11 sites; was 9, +2 from Phase 9 narrowing set_tool_preset/set_bias_profile). CRITICAL ANTI-SLIMING RULES (MUST follow): 1. NO narrowing + logging: 'except (NarrowType): logging.error(...)' is a VIOLATION 2. NO empty defaults: 'except (NarrowType): args = {}' is a VIOLATION (sliming) 3. NO pass: 'except: pass' is a VIOLATION (silent) 4. NO traceback.print_exc alone: similar to logging, data is lost 5. logging.error / logger.exception / sys.stderr.write alone: NOT a drain Per MUST-NOT-DO #6: 'DO NOT catch except Exception and silently swallow.' Per MUST-NOT-DO #7: 'DO NOT catch except Exception in non-*_result code without conversion to ErrorInfo.' Per TIER1_REVIEW 2026-06-20 (Phase 9 redo): 'empty default is NOT a drain — the caller must observe the errors.' Canonical pattern for SS sites: def _feature_result(...) -> Result[T]: try: return Result(data=compute()) except (NarrowType) as e: return Result(data=, errors=[ErrorInfo(kind=INTERNAL, message=str(e), source=..., original=e)]) Legacy wrapper preserves original signature; surface errors via Result where possible. Some sites may not have a clear 'caller' (e.g., _extract_gemini_thoughts is called inline); for these, the _result helper captures the structured error and the legacy function returns the empty data default (preserving current behavior).