v0.126.4: edge-safe error statuses + native-alert ban — writeDiskJSON maps 502/504→500 (CF swallows those bodies; the M1 refusal reached the operator as a JSON SyntaxError popup), M1 refusal = typed errLastUsableDrive → 409; all 29 native alert() swept to showAlert + native_confirm_gate now bans alert( (F-11 class complete)
This commit is contained in:
@@ -1,10 +1,13 @@
|
||||
# -*- 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.
|
||||
"""Native-confirm gate (drill F-11; alert added v0.126.4) — native confirm()/prompt()/alert()
|
||||
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; error/info surfaces use showAlert (layout.html modal). alert() joined the ban after the
|
||||
0.87.0 wizard leg: a decommission error path alert() froze the automation exactly like F-11
|
||||
predicted (the operator had to click the OS-modal away).
|
||||
|
||||
Run from controller/: python scripts/native_confirm_gate.py
|
||||
Exit 1 if any native confirm(/prompt( call remains in the templates.
|
||||
Exit 1 if any native confirm(/prompt(/alert( call remains in the templates.
|
||||
"""
|
||||
import io, os, re, sys
|
||||
|
||||
@@ -13,9 +16,10 @@ ROOTS = [
|
||||
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"(?<![A-Za-z0-9_$])(?:confirm|prompt)\(\s*[^)\s]")
|
||||
# A bare confirm(/prompt(/alert( CALL with an argument: not preceded by an identifier character,
|
||||
# so felhomConfirm(, showAlert( and onRestoreConfirmChange( never match. window.confirm( /
|
||||
# window.alert( still match ('.' is not an identifier character).
|
||||
NATIVE = re.compile(r"(?<![A-Za-z0-9_$])(?:confirm|prompt|alert)\(\s*[^)\s]")
|
||||
|
||||
|
||||
def main():
|
||||
@@ -30,9 +34,9 @@ def main():
|
||||
total += 1
|
||||
print("%s:%d %s" % (fn, lineno, line.strip()[:120].encode('ascii', 'backslashreplace').decode()))
|
||||
if total:
|
||||
print("NATIVE CONFIRM GATE FAILED: %d native confirm()/prompt() call(s) remain" % total)
|
||||
print("NATIVE CONFIRM GATE FAILED: %d native confirm()/prompt()/alert() call(s) remain" % total)
|
||||
sys.exit(1)
|
||||
print("native-confirm gate OK — no native confirm()/prompt() in templates")
|
||||
print("native-confirm gate OK — no native confirm()/prompt()/alert() in templates")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user