chore: curatare agresiva comentarii — scoatere referinte US/PRD din cod si template-uri
Eliminat zgomotul de trasabilitate (US-xxx, PRD x.x, Rn, OV-x, Tn, decizii/naratiune istorica) din 41 fisiere app/ + template-uri. Pastrate comentariile care documenteaza invarianti si logica ne-evidenta (idempotenta/hash, reconciliere anti-duplicat, RAR 500 esec definitiv, creds per cont, WAF User-Agent, 422 fara echo de parola, scope NULL->1), curatate doar de tokeni. Verificare: pentru cele 27 module .py curatate, structura de cod (tokeni non-comentariu/ non-string) e IDENTICA fata de HEAD -> doar comentarii/docstring-uri schimbate. Singura schimbare de cod e in tests/test_web_responsive.py (scos 3 assert pe markeri US-006/007/008, inlocuite de asertiunile structurale alaturate). 0 tokeni US/PRD reziduali in app/. Regresie: 896 passed, 1 deselected. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
14
app/db.py
14
app/db.py
@@ -61,13 +61,13 @@ def _migrate(conn: sqlite3.Connection) -> None:
|
||||
if "rar_creds_enc" not in acc_cols:
|
||||
conn.execute("ALTER TABLE accounts ADD COLUMN rar_creds_enc TEXT")
|
||||
if "active" not in acc_cols:
|
||||
# Conturi existente raman active (default 1). Lifecycle consumat de 3.3.
|
||||
# Conturi existente raman active (default 1).
|
||||
conn.execute("ALTER TABLE accounts ADD COLUMN active INTEGER NOT NULL DEFAULT 1")
|
||||
acc_cols.add("active")
|
||||
if "status" not in acc_cols:
|
||||
# Stare de ciclu de viata (5.5). Defensiv idempotent (ca is_admin in 3.3b).
|
||||
# Default 'active' (trece CHECK pe randurile existente), apoi derivam din `active`:
|
||||
# active=0 -> 'pending'. Invariant: active=1 <=> status='active'.
|
||||
# Stare de ciclu de viata. Default 'active' (trece CHECK pe randurile existente),
|
||||
# apoi derivam din `active`: active=0 -> 'pending'.
|
||||
# Invariant: active=1 <=> status='active'.
|
||||
conn.execute(
|
||||
"ALTER TABLE accounts ADD COLUMN status TEXT NOT NULL DEFAULT 'active' "
|
||||
"CHECK (status IN ('pending','active','blocked','archived','deleted'))"
|
||||
@@ -97,9 +97,7 @@ def _migrate(conn: sqlite3.Connection) -> None:
|
||||
if "email_verified" not in user_cols:
|
||||
conn.execute("ALTER TABLE users ADD COLUMN email_verified INTEGER NOT NULL DEFAULT 0")
|
||||
|
||||
# Coloana import_rows.override_json (3.6, Approach B): patch canonic editat in
|
||||
# preview, criptat Fernet. Defensiv idempotent (ca is_admin in 3.3b) — DB create
|
||||
# inainte de 3.6 nu au coloana.
|
||||
# Coloana import_rows.override_json: patch canonic editat in preview, criptat Fernet.
|
||||
irows_tbl = conn.execute(
|
||||
"SELECT name FROM sqlite_master WHERE type='table' AND name='import_rows'"
|
||||
).fetchone()
|
||||
@@ -151,7 +149,7 @@ def queue_depth(conn: sqlite3.Connection) -> int:
|
||||
return int(row["n"]) if row else 0
|
||||
|
||||
|
||||
# --- Jurnal de aplicatie (app_events, PRD 5.6 US-003) ---
|
||||
# --- Jurnal de aplicatie (app_events) ---
|
||||
|
||||
def insert_app_event(
|
||||
conn: sqlite3.Connection,
|
||||
|
||||
Reference in New Issue
Block a user