v0.297.0: burn-down round 2 — 24 small rows (R-591 R-568 R-567 R-363 R-547 R-10 R-552 R-251 R-104 R-619 R-362 R-675 R-256 R-257 R-240 R-365 R-425 R-565 R-564 R-603 R-454 R-208 R-457-swept) + the banner countdown and deepCopyStack twins; MinAgent 0.131.0
gates / gates (push) Failing after 50s
gates / gates (push) Failing after 50s
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
This commit is contained in:
@@ -4,20 +4,45 @@ customer-facing: the productized target is the Storage Box and the tier concept
|
||||
so "NAS-mentés"-style branding must not reappear in the offbox feature's customer strings.
|
||||
Python, not grep: Hungarian multibyte (the Windows-grep false-negative rule).
|
||||
|
||||
Scope: ONLY the offbox feature's files. The "Hálózati tárhely" NAS network-storage feature is a
|
||||
Scope: ONLY the offbox feature's files — discovered by pattern since R-425, see scoped_files(). The "Hálózati tárhely" NAS network-storage feature is a
|
||||
DIFFERENT feature and keeps its device-truthful NAS wording (its files are not scanned). Allowed
|
||||
by construction (no banned token): the intro's "saját NAS vagy Felhom offsite tárhely" and the
|
||||
manual-target form's "NAS vagy SFTP-kiszolgáló" mentions, comments, code identifiers/routes.
|
||||
|
||||
Run from controller/: python scripts/offbox_rename_gate.py
|
||||
"""
|
||||
import io, os, sys
|
||||
import glob, io, json, os, re, sys
|
||||
|
||||
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
||||
import i18n_bundle # noqa: E402
|
||||
|
||||
# R-425 — THE SCOPE IS DISCOVERED, NOT LISTED. The gate used to scan a fixed three-entry FILES list,
|
||||
# correct when written, and narrower every time the feature grew a file: measured 2026-09-01, a
|
||||
# `NAS-mentés` in a new `backups_offbox_extra.html` passed. And since localisation the customer copy of
|
||||
# the listed template lives in the i18n bundle, which no entry named — so the gate had become largely
|
||||
# hollow, not only narrow. The scope is now, by pattern:
|
||||
# * every backup-surface template (`templates/**/backups*.html`, `recovery.html`), judged AS IT
|
||||
# RENDERS in Hungarian (bundle markers expanded), so copy that moved into hu.json is still seen;
|
||||
# * every off-site Go file (`internal/web/offbox*.go`, `internal/backup/offbox*.go`, not tests);
|
||||
# * every hu.json value whose KEY one of those Go files names (flash/note/err keys travel by key).
|
||||
# A new file matching the patterns is scanned the day it is added. Decoys: test_gate_decoys.py.
|
||||
_HERE = os.path.dirname(os.path.abspath(__file__))
|
||||
_CTRL = os.path.dirname(_HERE)
|
||||
TEMPLATE_GLOBS = ["internal/web/templates/**/backups*.html", "internal/web/templates/**/recovery.html"]
|
||||
GO_GLOBS = ["internal/web/offbox*.go", "internal/backup/offbox*.go"]
|
||||
TEMPLATE_COMMENT = re.compile(r"\{\{/\*.*?\*/\}\}", re.S)
|
||||
KEY_LIT = re.compile(r'"([a-z][a-z0-9_]*(?:\.[a-z0-9_\-]+)+)"')
|
||||
|
||||
|
||||
def scoped_files():
|
||||
out = []
|
||||
for pats in (TEMPLATE_GLOBS, GO_GLOBS):
|
||||
for pat in pats:
|
||||
for f in glob.glob(os.path.join(_CTRL, pat), recursive=True):
|
||||
if not f.endswith("_test.go"):
|
||||
out.append(f)
|
||||
return sorted(set(out))
|
||||
|
||||
FILES = [
|
||||
os.path.join("internal", "web", "templates", "backups.html"),
|
||||
os.path.join("internal", "web", "offbox_handlers.go"),
|
||||
os.path.join("internal", "backup", "offbox.go"),
|
||||
]
|
||||
|
||||
BANNED = [
|
||||
"NAS-mentés",
|
||||
@@ -37,20 +62,39 @@ def is_comment(line):
|
||||
|
||||
|
||||
def main():
|
||||
files = scoped_files()
|
||||
if not files:
|
||||
print("OFFBOX RENAME GATE INCONCLUSIVE: no offbox file matched %s" % (TEMPLATE_GLOBS + GO_GLOBS))
|
||||
sys.exit(2)
|
||||
hu = json.load(io.open(os.path.join(_CTRL, "internal", "i18n", "locales", "hu.json"), encoding="utf-8"))
|
||||
sources = [] # (label, text)
|
||||
named = set()
|
||||
for path in files:
|
||||
rel = os.path.relpath(path, _CTRL)
|
||||
raw = io.open(path, encoding="utf-8").read()
|
||||
if path.endswith(".html"):
|
||||
raw = TEMPLATE_COMMENT.sub("", i18n_bundle.expand(raw, "hu"))
|
||||
else:
|
||||
named.update(k for k in KEY_LIT.findall(raw) if k in hu)
|
||||
sources.append((rel, raw))
|
||||
for key in sorted(named):
|
||||
if isinstance(hu[key], str):
|
||||
sources.append(("hu.json[%s]" % key, hu[key]))
|
||||
total = 0
|
||||
for path in FILES:
|
||||
for lineno, line in enumerate(io.open(path, encoding="utf-8"), 1):
|
||||
for label, text in sources:
|
||||
for lineno, line in enumerate(text.splitlines(), 1):
|
||||
if is_comment(line):
|
||||
continue
|
||||
for tok in BANNED:
|
||||
if tok in line:
|
||||
total += 1
|
||||
print("%s:%d [%s] %s" % (path, lineno, tok,
|
||||
print("%s:%d [%s] %s" % (label, lineno, tok,
|
||||
line.strip()[:100].encode("ascii", "backslashreplace").decode()))
|
||||
if total:
|
||||
print("OFFBOX RENAME GATE FAILED: %d customer-facing NAS-branding string(s) remain" % total)
|
||||
sys.exit(1)
|
||||
print("offbox rename gate OK — Tier-3 is 'Tavoli mentes' everywhere customer-facing")
|
||||
print("offbox rename gate OK — Tier-3 is 'Tavoli mentes' everywhere customer-facing "
|
||||
"(%d file(s) + %d bundle value(s) named by them)" % (len(files), len(named)))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user