# -*- coding: utf-8 -*- """Hub native-confirm gate (take-two F-16, the hub sibling of drill F-11) — native confirm()/ prompt() dialogs are OS-modals that freeze browser automation (CDP) and are banned from the hub UI; consequential buttons use the inline felhomConfirm helper (templates/inline_confirm.html). The danger-zone typed-confirm flow does not use native dialogs either. Run from the repo root: python scripts/hub_confirm_gate.py Exit 1 if any native confirm(/prompt( call remains in hub templates. """ import io, os, re, sys ROOT = os.path.join("hub", "internal", "web", "templates") # A bare confirm(/prompt( CALL with an argument: not preceded by an identifier character, so felhomConfirm( # never matches. window.confirm( still matches ('.' is not an identifier char). NATIVE = re.compile(r"(?