# -*- coding: utf-8 -*- """Native-confirm gate (drill F-11) — native confirm()/prompt() dialogs are OS-modals that block browser automation (CDP freezes) and are banned from the UI; consequential actions use the inline felhomConfirm helper (layout.html) or the .confirm-overlay dialog. Run from controller/: python scripts/native_confirm_gate.py Exit 1 if any native confirm(/prompt( call remains in the templates. """ import io, os, re, sys ROOTS = [ os.path.join("internal", "web", "templates"), os.path.join("internal", "setup", "templates"), ] # A bare confirm(/prompt( CALL with an argument: not preceded by an identifier character, so felhomConfirm( and # onRestoreConfirmChange( never match. window.confirm( still matches ('.' is not identifier). NATIVE = re.compile(r"(?