#!/usr/bin/env python3 """Clean-home source contracts. Complements compiled UI and optional real-device probe; this does not claim to run Compose or prove device appearance/lifecycle.""" from pathlib import Path import re ROOT=Path(__file__).resolve().parents[1] source=(ROOT/'app/src/main/java/com/gorios/lanvoice/avatar/CallScreen.kt').read_text() # Blank comments/strings without changing offsets, so nested lambdas can be inspected. pattern=r'"""[\s\S]*?"""|"(?:\\.|[^"\\])*"|//[^\n]*|/\*[\s\S]*?\*/' clean=re.sub(pattern,lambda m:' '*len(m[0]),source) def block(marker,within=None): start,end=within or (0,len(source)) at=clean.index(marker,start,end) left=clean.index('{',at+len(marker),end) depth=1;right=left+1 while depth: assert right