681cc663ef
gates / gates (push) Failing after 13s
Every gate was DECOYED - the label constructed without the fact, the gate run, the verdict recorded.
No verdict here was reached by reading, because reading is exactly how the five prior instances hid.
SCOPE IS A FACT TOO, and it was the big one. Six gates decided what to look at with os.listdir - one
directory level. Every one was green AND CORRECT, because no template subdirectory exists today; every
one would have gone blind the moment anyone added templates/partials/, which is an ordinary act. A
single planted file carrying an emoji, a native confirm(), hand-rolled row markup, a dangling JS id
reference, a templated secret and an unregistered retrieval promise passed all six.
THE CONTROL IS WHAT MAKES THAT A MEASUREMENT: mojibake and docker-v already used os.walk, saw the
identical planted file, and convicted. So the cause was the listing, not the decoy.
COMMENTS ARE NOT CODE, AND COMMENTS ARE NOT CONTROLS. debug-routes matched `case subpath == "x"` in
raw text, so a case left in a commented-out block counted as a live handler - which is R-400's
original defect (seven dead controls on the page an operator opens when something is already wrong)
reached through the one door its own gate could not see. app-row-dedup's MUST_USE check had the same
shape: a commented-out {{template "app_list_row"}} satisfied it.
Stripping is deliberately crude in debug_route_gate, and that is correct there: its own docstring
insists on ten lines that cannot rot. A // inside a string literal truncates that line, which can
only ever HIDE a reference, never invent one - it fails in the safe direction.
NOT FIXED, and left open with its decoy rather than quietly patched: R-425, offbox-rename scans a
fixed three-entry FILES list, so banned NAS branding in a NEW offbox template passes. The scope was
correct when written and silently narrows every time the feature grows a file.
test_gate_decoys.py holds 10 decoys and declares COVERS, which felhom.eu's new decoy-coverage gate
AST-parses - a substring search for coverage would be the very shape this sweep exists to find.
No Go code. No version bump. No image. No golden owed.
Survey: felhom.eu/documentation/audits/AUDIT-gate-decoys-2026-09-01.md
56 lines
2.5 KiB
Python
56 lines
2.5 KiB
Python
# -*- coding: utf-8 -*-
|
|
"""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(/alert( 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(/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 _html_files(root):
|
|
# R-421 (2026-09-01): AT ANY DEPTH. This was `os.listdir`, one level only. There are no
|
|
# template subdirectories today, so the gate was green and correct — and would have stayed
|
|
# green the moment anyone added `templates/partials/`, which is an ordinary thing to do.
|
|
# Measured: a planted template in a new partials/ directory passed every listdir-based gate
|
|
# and was caught by the two that already used os.walk. See AUDIT-gate-decoys-2026-09-01.md.
|
|
out = []
|
|
for dirpath, _dirs, names in os.walk(root):
|
|
for fn in sorted(names):
|
|
if fn.endswith('.html'):
|
|
out.append(os.path.join(dirpath, fn))
|
|
return sorted(out)
|
|
|
|
|
|
def main():
|
|
total = 0
|
|
for root in ROOTS:
|
|
for path in _html_files(root):
|
|
fn = os.path.relpath(path, root)
|
|
for lineno, line in enumerate(io.open(path, encoding="utf-8"), 1):
|
|
if NATIVE.search(line):
|
|
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()/alert() call(s) remain" % total)
|
|
sys.exit(1)
|
|
print("native-confirm gate OK — no native confirm()/prompt()/alert() in templates")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|