#!/usr/bin/env python3
"""Bank Batch 394: Rule 352 corrected bird-set-E non-singular past perception."""
from __future__ import annotations
import ast,datetime as dt,json,re,sqlite3
from pathlib import Path
from bank_386 import SUPPORT_EVIDENCE as PRONOUN_EVIDENCE,source_audit as pronoun_source_audit
from bank_392 import DB,DENY_ENGLISH,DENY_KUKU as BASE_DENY,EXPECTED_HASHES,SUPPORT_EVIDENCE as BIRD_SUPPORT,TARGET_CONFIDENCE,TARGET_EVIDENCE as BASE_EVIDENCE,TARGET_GLOSSES,TARGET_LABELS,TARGET_ORDER,count_words,source_audit as bird_source_audit
from process_ledger import ensure_schema,record_event
LABEL="batch-394";NOW=dt.datetime.now(dt.timezone.utc).replace(microsecond=0).isoformat().replace("+00:00","Z");LOG="process_logs/batch-394-corrected-bird-set-e-nonsingular-past-perception-after-rule351-process.md"
EXPECTED_TARGET_COVERAGE={"dakwurr-dakwun":10,"kurkunbay":15,"kurrujuwa":15,"mirrku":15,"baringkan":15,"barinkan":15,"bilu-warra":15,"dukunjulu":16,"jiwurrmal":15,"kujuway":15}
EXPECTED_SUPPORT_COVERAGE={"ngali":693,"ngaliny":635,"yubal":645,"yurra":630,"nganjin":358,"ngana":1115,"yaluy":4682,"yinyay":4854,"nyajin":2650}
FRAMES=[("ngali","yaluy","We two, not you, saw","here","1du.excl"),("ngaliny","yinyay","You and I saw","there","1du.incl"),("yubal","yaluy","You two saw","here","2du"),("yurra","yinyay","You all saw","there","2pl"),("nganjin","yaluy","We, not you, saw","here","1pl.excl")]
SELECTED={x[0] for x in FRAMES};DENY_KUKU=(set(BASE_DENY)-SELECTED)|{"ngayu","yundu","nyulu","bula","jana","ngana","ngalingan","ngalinyan","yubalan","yurrangan","nganjinan"}
TARGET_EVIDENCE={t:f"{BASE_EVIDENCE[t]} Rule 352 changes participant number/clusivity only and retains corrected Rule 350-351 boundaries." for t in TARGET_ORDER}
SUPPORT_EVIDENCE=f"{BIRD_SUPPORT} {PRONOUN_EVIDENCE} Rule 352 follows Patz for clusivity over the dictionary defect; ngana remains grammatical and deferred."
def row(seq,english,kuku,analysis,frame,words):
 t=words[1];return(seq,english,kuku,analysis,frame,3,json.dumps(words,ensure_ascii=False),json.dumps([],ensure_ascii=False),f"{TARGET_EVIDENCE[t]} {SUPPORT_EVIDENCE}",TARGET_CONFIDENCE[t])
ROWS=[
row(1,"We two, not you, saw the dakwurr-dakwun hammer bird here.","Ngali dakwurr-dakwun yaluy nyajin.","ngali dakwurr-dakwun yaluy nyajin | 1du.excl.NOM dakwurr-dakwun.hammer-bird here see.PST","r352_1du_excl_here_bird_e_saw_dakwurr_dakwun",["ngali","dakwurr-dakwun","yaluy","nyajin"]),
row(2,"We two, not you, saw the kurkunbay butcherbird here.","Ngali kurkunbay yaluy nyajin.","ngali kurkunbay yaluy nyajin | 1du.excl.NOM kurkunbay.butcherbird here see.PST","r352_1du_excl_here_bird_e_saw_kurkunbay",["ngali","kurkunbay","yaluy","nyajin"]),
row(3,"We two, not you, saw the kurrujuwa sentry bird here.","Ngali kurrujuwa yaluy nyajin.","ngali kurrujuwa yaluy nyajin | 1du.excl.NOM kurrujuwa.sentry-bird here see.PST","r352_1du_excl_here_bird_e_saw_kurrujuwa",["ngali","kurrujuwa","yaluy","nyajin"]),
row(4,"We two, not you, saw the mirrku kidney bird here.","Ngali mirrku yaluy nyajin.","ngali mirrku yaluy nyajin | 1du.excl.NOM mirrku.kidney-bird here see.PST","r352_1du_excl_here_bird_e_saw_mirrku",["ngali","mirrku","yaluy","nyajin"]),
row(5,"We two, not you, saw the baringkan small bird here.","Ngali baringkan yaluy nyajin.","ngali baringkan yaluy nyajin | 1du.excl.NOM baringkan.small-bird here see.PST","r352_1du_excl_here_bird_e_saw_baringkan",["ngali","baringkan","yaluy","nyajin"]),
row(6,"We two, not you, saw the barinkan scrub bird here.","Ngali barinkan yaluy nyajin.","ngali barinkan yaluy nyajin | 1du.excl.NOM barinkan.scrub-bird here see.PST","r352_1du_excl_here_bird_e_saw_barinkan",["ngali","barinkan","yaluy","nyajin"]),
row(7,"We two, not you, saw the bilu-warra spoonbill here.","Ngali bilu-warra yaluy nyajin.","ngali bilu-warra yaluy nyajin | 1du.excl.NOM bilu-warra.spoonbill here see.PST","r352_1du_excl_here_bird_e_saw_bilu_warra",["ngali","bilu-warra","yaluy","nyajin"]),
row(8,"We two, not you, saw the dukunjulu golden whistler here.","Ngali dukunjulu yaluy nyajin.","ngali dukunjulu yaluy nyajin | 1du.excl.NOM dukunjulu.golden-whistler here see.PST","r352_1du_excl_here_bird_e_saw_dukunjulu",["ngali","dukunjulu","yaluy","nyajin"]),
row(9,"We two, not you, saw the jiwurrmal pheasant cuckoo here.","Ngali jiwurrmal yaluy nyajin.","ngali jiwurrmal yaluy nyajin | 1du.excl.NOM jiwurrmal.pheasant-cuckoo here see.PST","r352_1du_excl_here_bird_e_saw_jiwurrmal",["ngali","jiwurrmal","yaluy","nyajin"]),
row(10,"We two, not you, saw the kujuway pigeon here.","Ngali kujuway yaluy nyajin.","ngali kujuway yaluy nyajin | 1du.excl.NOM kujuway.pigeon here see.PST","r352_1du_excl_here_bird_e_saw_kujuway",["ngali","kujuway","yaluy","nyajin"]),
row(11,"You and I saw the dakwurr-dakwun hammer bird there.","Ngaliny dakwurr-dakwun yinyay nyajin.","ngaliny dakwurr-dakwun yinyay nyajin | 1du.incl.NOM dakwurr-dakwun.hammer-bird there see.PST","r352_1du_incl_there_bird_e_saw_dakwurr_dakwun",["ngaliny","dakwurr-dakwun","yinyay","nyajin"]),
row(12,"You and I saw the kurkunbay butcherbird there.","Ngaliny kurkunbay yinyay nyajin.","ngaliny kurkunbay yinyay nyajin | 1du.incl.NOM kurkunbay.butcherbird there see.PST","r352_1du_incl_there_bird_e_saw_kurkunbay",["ngaliny","kurkunbay","yinyay","nyajin"]),
row(13,"You and I saw the kurrujuwa sentry bird there.","Ngaliny kurrujuwa yinyay nyajin.","ngaliny kurrujuwa yinyay nyajin | 1du.incl.NOM kurrujuwa.sentry-bird there see.PST","r352_1du_incl_there_bird_e_saw_kurrujuwa",["ngaliny","kurrujuwa","yinyay","nyajin"]),
row(14,"You and I saw the mirrku kidney bird there.","Ngaliny mirrku yinyay nyajin.","ngaliny mirrku yinyay nyajin | 1du.incl.NOM mirrku.kidney-bird there see.PST","r352_1du_incl_there_bird_e_saw_mirrku",["ngaliny","mirrku","yinyay","nyajin"]),
row(15,"You and I saw the baringkan small bird there.","Ngaliny baringkan yinyay nyajin.","ngaliny baringkan yinyay nyajin | 1du.incl.NOM baringkan.small-bird there see.PST","r352_1du_incl_there_bird_e_saw_baringkan",["ngaliny","baringkan","yinyay","nyajin"]),
row(16,"You and I saw the barinkan scrub bird there.","Ngaliny barinkan yinyay nyajin.","ngaliny barinkan yinyay nyajin | 1du.incl.NOM barinkan.scrub-bird there see.PST","r352_1du_incl_there_bird_e_saw_barinkan",["ngaliny","barinkan","yinyay","nyajin"]),
row(17,"You and I saw the bilu-warra spoonbill there.","Ngaliny bilu-warra yinyay nyajin.","ngaliny bilu-warra yinyay nyajin | 1du.incl.NOM bilu-warra.spoonbill there see.PST","r352_1du_incl_there_bird_e_saw_bilu_warra",["ngaliny","bilu-warra","yinyay","nyajin"]),
row(18,"You and I saw the dukunjulu golden whistler there.","Ngaliny dukunjulu yinyay nyajin.","ngaliny dukunjulu yinyay nyajin | 1du.incl.NOM dukunjulu.golden-whistler there see.PST","r352_1du_incl_there_bird_e_saw_dukunjulu",["ngaliny","dukunjulu","yinyay","nyajin"]),
row(19,"You and I saw the jiwurrmal pheasant cuckoo there.","Ngaliny jiwurrmal yinyay nyajin.","ngaliny jiwurrmal yinyay nyajin | 1du.incl.NOM jiwurrmal.pheasant-cuckoo there see.PST","r352_1du_incl_there_bird_e_saw_jiwurrmal",["ngaliny","jiwurrmal","yinyay","nyajin"]),
row(20,"You and I saw the kujuway pigeon there.","Ngaliny kujuway yinyay nyajin.","ngaliny kujuway yinyay nyajin | 1du.incl.NOM kujuway.pigeon there see.PST","r352_1du_incl_there_bird_e_saw_kujuway",["ngaliny","kujuway","yinyay","nyajin"]),
row(21,"You two saw the dakwurr-dakwun hammer bird here.","Yubal dakwurr-dakwun yaluy nyajin.","yubal dakwurr-dakwun yaluy nyajin | 2du.NOM dakwurr-dakwun.hammer-bird here see.PST","r352_2du_here_bird_e_saw_dakwurr_dakwun",["yubal","dakwurr-dakwun","yaluy","nyajin"]),
row(22,"You two saw the kurkunbay butcherbird here.","Yubal kurkunbay yaluy nyajin.","yubal kurkunbay yaluy nyajin | 2du.NOM kurkunbay.butcherbird here see.PST","r352_2du_here_bird_e_saw_kurkunbay",["yubal","kurkunbay","yaluy","nyajin"]),
row(23,"You two saw the kurrujuwa sentry bird here.","Yubal kurrujuwa yaluy nyajin.","yubal kurrujuwa yaluy nyajin | 2du.NOM kurrujuwa.sentry-bird here see.PST","r352_2du_here_bird_e_saw_kurrujuwa",["yubal","kurrujuwa","yaluy","nyajin"]),
row(24,"You two saw the mirrku kidney bird here.","Yubal mirrku yaluy nyajin.","yubal mirrku yaluy nyajin | 2du.NOM mirrku.kidney-bird here see.PST","r352_2du_here_bird_e_saw_mirrku",["yubal","mirrku","yaluy","nyajin"]),
row(25,"You two saw the baringkan small bird here.","Yubal baringkan yaluy nyajin.","yubal baringkan yaluy nyajin | 2du.NOM baringkan.small-bird here see.PST","r352_2du_here_bird_e_saw_baringkan",["yubal","baringkan","yaluy","nyajin"]),
row(26,"You two saw the barinkan scrub bird here.","Yubal barinkan yaluy nyajin.","yubal barinkan yaluy nyajin | 2du.NOM barinkan.scrub-bird here see.PST","r352_2du_here_bird_e_saw_barinkan",["yubal","barinkan","yaluy","nyajin"]),
row(27,"You two saw the bilu-warra spoonbill here.","Yubal bilu-warra yaluy nyajin.","yubal bilu-warra yaluy nyajin | 2du.NOM bilu-warra.spoonbill here see.PST","r352_2du_here_bird_e_saw_bilu_warra",["yubal","bilu-warra","yaluy","nyajin"]),
row(28,"You two saw the dukunjulu golden whistler here.","Yubal dukunjulu yaluy nyajin.","yubal dukunjulu yaluy nyajin | 2du.NOM dukunjulu.golden-whistler here see.PST","r352_2du_here_bird_e_saw_dukunjulu",["yubal","dukunjulu","yaluy","nyajin"]),
row(29,"You two saw the jiwurrmal pheasant cuckoo here.","Yubal jiwurrmal yaluy nyajin.","yubal jiwurrmal yaluy nyajin | 2du.NOM jiwurrmal.pheasant-cuckoo here see.PST","r352_2du_here_bird_e_saw_jiwurrmal",["yubal","jiwurrmal","yaluy","nyajin"]),
row(30,"You two saw the kujuway pigeon here.","Yubal kujuway yaluy nyajin.","yubal kujuway yaluy nyajin | 2du.NOM kujuway.pigeon here see.PST","r352_2du_here_bird_e_saw_kujuway",["yubal","kujuway","yaluy","nyajin"]),
row(31,"You all saw the dakwurr-dakwun hammer bird there.","Yurra dakwurr-dakwun yinyay nyajin.","yurra dakwurr-dakwun yinyay nyajin | 2pl.NOM dakwurr-dakwun.hammer-bird there see.PST","r352_2pl_there_bird_e_saw_dakwurr_dakwun",["yurra","dakwurr-dakwun","yinyay","nyajin"]),
row(32,"You all saw the kurkunbay butcherbird there.","Yurra kurkunbay yinyay nyajin.","yurra kurkunbay yinyay nyajin | 2pl.NOM kurkunbay.butcherbird there see.PST","r352_2pl_there_bird_e_saw_kurkunbay",["yurra","kurkunbay","yinyay","nyajin"]),
row(33,"You all saw the kurrujuwa sentry bird there.","Yurra kurrujuwa yinyay nyajin.","yurra kurrujuwa yinyay nyajin | 2pl.NOM kurrujuwa.sentry-bird there see.PST","r352_2pl_there_bird_e_saw_kurrujuwa",["yurra","kurrujuwa","yinyay","nyajin"]),
row(34,"You all saw the mirrku kidney bird there.","Yurra mirrku yinyay nyajin.","yurra mirrku yinyay nyajin | 2pl.NOM mirrku.kidney-bird there see.PST","r352_2pl_there_bird_e_saw_mirrku",["yurra","mirrku","yinyay","nyajin"]),
row(35,"You all saw the baringkan small bird there.","Yurra baringkan yinyay nyajin.","yurra baringkan yinyay nyajin | 2pl.NOM baringkan.small-bird there see.PST","r352_2pl_there_bird_e_saw_baringkan",["yurra","baringkan","yinyay","nyajin"]),
row(36,"You all saw the barinkan scrub bird there.","Yurra barinkan yinyay nyajin.","yurra barinkan yinyay nyajin | 2pl.NOM barinkan.scrub-bird there see.PST","r352_2pl_there_bird_e_saw_barinkan",["yurra","barinkan","yinyay","nyajin"]),
row(37,"You all saw the bilu-warra spoonbill there.","Yurra bilu-warra yinyay nyajin.","yurra bilu-warra yinyay nyajin | 2pl.NOM bilu-warra.spoonbill there see.PST","r352_2pl_there_bird_e_saw_bilu_warra",["yurra","bilu-warra","yinyay","nyajin"]),
row(38,"You all saw the dukunjulu golden whistler there.","Yurra dukunjulu yinyay nyajin.","yurra dukunjulu yinyay nyajin | 2pl.NOM dukunjulu.golden-whistler there see.PST","r352_2pl_there_bird_e_saw_dukunjulu",["yurra","dukunjulu","yinyay","nyajin"]),
row(39,"You all saw the jiwurrmal pheasant cuckoo there.","Yurra jiwurrmal yinyay nyajin.","yurra jiwurrmal yinyay nyajin | 2pl.NOM jiwurrmal.pheasant-cuckoo there see.PST","r352_2pl_there_bird_e_saw_jiwurrmal",["yurra","jiwurrmal","yinyay","nyajin"]),
row(40,"You all saw the kujuway pigeon there.","Yurra kujuway yinyay nyajin.","yurra kujuway yinyay nyajin | 2pl.NOM kujuway.pigeon there see.PST","r352_2pl_there_bird_e_saw_kujuway",["yurra","kujuway","yinyay","nyajin"]),
row(41,"We, not you, saw the dakwurr-dakwun hammer bird here.","Nganjin dakwurr-dakwun yaluy nyajin.","nganjin dakwurr-dakwun yaluy nyajin | 1pl.excl.NOM dakwurr-dakwun.hammer-bird here see.PST","r352_1pl_excl_here_bird_e_saw_dakwurr_dakwun",["nganjin","dakwurr-dakwun","yaluy","nyajin"]),
row(42,"We, not you, saw the kurkunbay butcherbird here.","Nganjin kurkunbay yaluy nyajin.","nganjin kurkunbay yaluy nyajin | 1pl.excl.NOM kurkunbay.butcherbird here see.PST","r352_1pl_excl_here_bird_e_saw_kurkunbay",["nganjin","kurkunbay","yaluy","nyajin"]),
row(43,"We, not you, saw the kurrujuwa sentry bird here.","Nganjin kurrujuwa yaluy nyajin.","nganjin kurrujuwa yaluy nyajin | 1pl.excl.NOM kurrujuwa.sentry-bird here see.PST","r352_1pl_excl_here_bird_e_saw_kurrujuwa",["nganjin","kurrujuwa","yaluy","nyajin"]),
row(44,"We, not you, saw the mirrku kidney bird here.","Nganjin mirrku yaluy nyajin.","nganjin mirrku yaluy nyajin | 1pl.excl.NOM mirrku.kidney-bird here see.PST","r352_1pl_excl_here_bird_e_saw_mirrku",["nganjin","mirrku","yaluy","nyajin"]),
row(45,"We, not you, saw the baringkan small bird here.","Nganjin baringkan yaluy nyajin.","nganjin baringkan yaluy nyajin | 1pl.excl.NOM baringkan.small-bird here see.PST","r352_1pl_excl_here_bird_e_saw_baringkan",["nganjin","baringkan","yaluy","nyajin"]),
row(46,"We, not you, saw the barinkan scrub bird here.","Nganjin barinkan yaluy nyajin.","nganjin barinkan yaluy nyajin | 1pl.excl.NOM barinkan.scrub-bird here see.PST","r352_1pl_excl_here_bird_e_saw_barinkan",["nganjin","barinkan","yaluy","nyajin"]),
row(47,"We, not you, saw the bilu-warra spoonbill here.","Nganjin bilu-warra yaluy nyajin.","nganjin bilu-warra yaluy nyajin | 1pl.excl.NOM bilu-warra.spoonbill here see.PST","r352_1pl_excl_here_bird_e_saw_bilu_warra",["nganjin","bilu-warra","yaluy","nyajin"]),
row(48,"We, not you, saw the dukunjulu golden whistler here.","Nganjin dukunjulu yaluy nyajin.","nganjin dukunjulu yaluy nyajin | 1pl.excl.NOM dukunjulu.golden-whistler here see.PST","r352_1pl_excl_here_bird_e_saw_dukunjulu",["nganjin","dukunjulu","yaluy","nyajin"]),
row(49,"We, not you, saw the jiwurrmal pheasant cuckoo here.","Nganjin jiwurrmal yaluy nyajin.","nganjin jiwurrmal yaluy nyajin | 1pl.excl.NOM jiwurrmal.pheasant-cuckoo here see.PST","r352_1pl_excl_here_bird_e_saw_jiwurrmal",["nganjin","jiwurrmal","yaluy","nyajin"]),
row(50,"We, not you, saw the kujuway pigeon here.","Nganjin kujuway yaluy nyajin.","nganjin kujuway yaluy nyajin | 1pl.excl.NOM kujuway.pigeon here see.PST","r352_1pl_excl_here_bird_e_saw_kujuway",["nganjin","kujuway","yaluy","nyajin"]),]
def literal_guard():
 m=ast.parse(Path(__file__).read_text());a=[n for n in m.body if isinstance(n,ast.Assign) and any(isinstance(t,ast.Name) and t.id=="ROWS" for t in n.targets)];issues=[]
 if len(a)!=1 or not isinstance(a[0].value,ast.List):return["ROWS"]
 if len(a[0].value.elts)!=50:issues.append("count")
 for i,e in enumerate(a[0].value.elts,1):
  if not isinstance(e,ast.Call) or not isinstance(e.func,ast.Name) or e.func.id!="row":issues.append(f"{i}:call");continue
  try:v=[ast.literal_eval(x) for x in e.args]
  except Exception:issues.append(f"{i}:literal");continue
  if len(v)!=6 or v[0]!=i:issues.append(f"{i}:args")
 return issues
def scan_static():
 issues=literal_guard()
 if len(ROWS)!=50 or [r[0] for r in ROWS]!=list(range(1,51)) or len({r[1] for r in ROWS})!=50 or len({r[2] for r in ROWS})!=50:issues.append("inventory")
 for seq,en,ku,an,fr,_tier,wjson,ljson,ev,conf in ROWS:
  p,d,prefix,loc,person=FRAMES[(seq-1)//10];t=TARGET_ORDER[(seq-1)%10];w=json.loads(wjson);den=[x for x in DENY_KUKU if re.search(rf"(^|\s){re.escape(x)}([\s\.]|$)",ku.lower())];dr=[x for x in DENY_ENGLISH if re.search(rf"\b{re.escape(x)}\b",en.lower())]
  if json.loads(ljson) or den or dr:issues.append(f"{seq}:deny {den}/{dr}")
  if ku!=f"{p.capitalize()} {t} {d} nyajin." or en!=f"{prefix} the {TARGET_LABELS[t]} {loc}." or an!=f"{p} {t} {d} nyajin | {person}.NOM {TARGET_GLOSSES[t]} {loc} see.PST":issues.append(f"{seq}:fields")
  if w!=[p,t,d,"nyajin"] or not fr.startswith("r352_") or TARGET_EVIDENCE[t] not in ev or SUPPORT_EVIDENCE not in ev or conf!=TARGET_CONFIDENCE[t]:issues.append(f"{seq}:meta")
 return issues
def main():
 br,bh=bird_source_audit();_tr,pr=pronoun_source_audit();issues=scan_static()
 if issues:raise SystemExit("\n".join(issues))
 db=sqlite3.connect(DB);db.execute("PRAGMA foreign_keys=ON");db.execute("BEGIN");ensure_schema(db)
 if db.execute("SELECT 1 FROM batches WHERE label=?",(LABEL,)).fetchone() or db.execute("SELECT COUNT(*) FROM sentences WHERE status='under_review'").fetchone()[0]:raise SystemExit("open/existing")
 tc=count_words(db,TARGET_ORDER);sc=count_words(db,list(EXPECTED_SUPPORT_COVERAGE))
 if tc!=EXPECTED_TARGET_COVERAGE or sc!=EXPECTED_SUPPORT_COVERAGE:raise SystemExit(f"coverage {tc}/{sc}")
 collisions=[]
 for p in [x[0] for x in FRAMES]:
  for t in TARGET_ORDER:
   for d in ("yaluy","yinyay"):
    s=f"{p.capitalize()} {t} {d} nyajin.";h=db.execute("SELECT b.label,s.seq FROM sentences s JOIN batches b ON b.id=s.batch_id WHERE lower(s.kuku)=lower(?) AND s.status!='rejected'",(s,)).fetchall()
    if h:collisions.append((s,h))
 if collisions:raise SystemExit(f"matrix {collisions}")
 verified,words=db.execute("SELECT COUNT(*),SUM(LENGTH(kuku)-LENGTH(REPLACE(kuku,' ',''))+1) FROM sentences WHERE status IN('accepted','revised')").fetchone()
 if (verified,words)!=(19747,134347):raise SystemExit(f"baseline {verified}/{words}")
 notes="CORRECTED BIRD SET-E NON-SINGULAR PAST PERCEPTION AFTER RULE 351 (Rule 352). 100 non-singular cells empty; Patz clusivity controls; rejected draft heads excluded; gap 172->162."
 bid=db.execute("INSERT INTO batches(label,cheatsheet_version,guide_version,notes,created_at) VALUES(?,?,?,?,?)",(LABEL,"Rule 352 under review","operator-guide-2026-07-10",notes,NOW)).lastrowid;db.executemany("""INSERT INTO sentences(batch_id,seq,english,kuku,analysis,frame,tier,words_used,loans_used,evidence,status,confidence,rights_status,author,created_at,updated_at) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)""",[(bid,seq,en,ku,an,fr,tier,w,l,ev,"under_review",conf,"project_approved_synthetic_pending_elder_verification","codex-main",NOW,NOW) for seq,en,ku,an,fr,tier,w,l,ev,conf in ROWS])
 events=[("source","source-audit-pass",f"Bird={br}/{bh}; pronouns={pr}; hashes={EXPECTED_HASHES}."),("source","pronoun-ruling","Patz ngali exclusive/ngaliny inclusive controls; ngana grammatical/deferred."),("planning","sense-preservation-audit","Corrected heads and all Rule350-351 exclusions retained."),("planning","construction-gap-audit","All 100 non-singular target/deictic cells absent."),("planning","balance-audit","Gap 172->162."),("preflight","coverage-audit",f"targets={tc};support={sc}."),("preflight","duplicate-preflight","50 selected surfaces unique/absent."),("preflight","static-guard-pass","AST 50 literal calls; source/sense/clusivity/lint contracts passed.")]
 for ph,et,d in events:record_event(db,batch_label=LABEL,phase=ph,event_type=et,actor="codex",detail=d,artifact_path=LOG,created_at=NOW)
 record_event(db,batch_label=LABEL,phase="bank",event_type="bank-success",actor="codex",detail=f"Banked 50 Rule352 rows; verified {verified}; words {words}.",command="python3 batch_scripts/bank_394.py",artifact_path=LOG,created_at=NOW);db.commit();print("banked batch-394: 50 under_review");return 0
if __name__=="__main__":raise SystemExit(main())
