#!/usr/bin/env python3
"""Bank Batch 395: Rule 353 complementary 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_394 import DB,DENY_ENGLISH,DENY_KUKU,EXPECTED_HASHES,SUPPORT_EVIDENCE as BASE_SUPPORT,TARGET_CONFIDENCE,TARGET_EVIDENCE as BASE_EVIDENCE,TARGET_GLOSSES,TARGET_LABELS,TARGET_ORDER,count_words,bird_source_audit,pronoun_source_audit
from process_ledger import ensure_schema,record_event
LABEL="batch-395";NOW=dt.datetime.now(dt.timezone.utc).replace(microsecond=0).isoformat().replace("+00:00","Z");LOG="process_logs/batch-395-complementary-corrected-bird-set-e-nonsingular-past-perception-after-rule352-process.md"
EXPECTED_TARGET_COVERAGE={"dakwurr-dakwun":15,"kurkunbay":20,"kurrujuwa":20,"mirrku":20,"baringkan":20,"barinkan":20,"bilu-warra":20,"dukunjulu":21,"jiwurrmal":20,"kujuway":20}
EXPECTED_SUPPORT_COVERAGE={"ngali":703,"ngaliny":645,"yubal":655,"yurra":640,"nganjin":368,"ngana":1115,"yaluy":4712,"yinyay":4874,"nyajin":2700}
FRAMES=[("ngali","yinyay","We two, not you, saw","there","1du.excl"),("ngaliny","yaluy","You and I saw","here","1du.incl"),("yubal","yinyay","You two saw","there","2du"),("yurra","yaluy","You all saw","here","2pl"),("nganjin","yinyay","We, not you, saw","there","1pl.excl")];OPP={"yaluy":"yinyay","yinyay":"yaluy"}
TARGET_EVIDENCE={t:f"{BASE_EVIDENCE[t]} Rule 353 changes deictic location only and retains corrected Rule 350-352 boundaries." for t in TARGET_ORDER};SUPPORT_EVIDENCE=f"{BASE_SUPPORT} Rule 353 exactly complements Rule 352."
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 there.","Ngali dakwurr-dakwun yinyay nyajin.","ngali dakwurr-dakwun yinyay nyajin | 1du.excl.NOM dakwurr-dakwun.hammer-bird there see.PST","r353_1du_excl_there_bird_e_saw_dakwurr_dakwun",["ngali","dakwurr-dakwun","yinyay","nyajin"]),
row(2,"We two, not you, saw the kurkunbay butcherbird there.","Ngali kurkunbay yinyay nyajin.","ngali kurkunbay yinyay nyajin | 1du.excl.NOM kurkunbay.butcherbird there see.PST","r353_1du_excl_there_bird_e_saw_kurkunbay",["ngali","kurkunbay","yinyay","nyajin"]),
row(3,"We two, not you, saw the kurrujuwa sentry bird there.","Ngali kurrujuwa yinyay nyajin.","ngali kurrujuwa yinyay nyajin | 1du.excl.NOM kurrujuwa.sentry-bird there see.PST","r353_1du_excl_there_bird_e_saw_kurrujuwa",["ngali","kurrujuwa","yinyay","nyajin"]),
row(4,"We two, not you, saw the mirrku kidney bird there.","Ngali mirrku yinyay nyajin.","ngali mirrku yinyay nyajin | 1du.excl.NOM mirrku.kidney-bird there see.PST","r353_1du_excl_there_bird_e_saw_mirrku",["ngali","mirrku","yinyay","nyajin"]),
row(5,"We two, not you, saw the baringkan small bird there.","Ngali baringkan yinyay nyajin.","ngali baringkan yinyay nyajin | 1du.excl.NOM baringkan.small-bird there see.PST","r353_1du_excl_there_bird_e_saw_baringkan",["ngali","baringkan","yinyay","nyajin"]),
row(6,"We two, not you, saw the barinkan scrub bird there.","Ngali barinkan yinyay nyajin.","ngali barinkan yinyay nyajin | 1du.excl.NOM barinkan.scrub-bird there see.PST","r353_1du_excl_there_bird_e_saw_barinkan",["ngali","barinkan","yinyay","nyajin"]),
row(7,"We two, not you, saw the bilu-warra spoonbill there.","Ngali bilu-warra yinyay nyajin.","ngali bilu-warra yinyay nyajin | 1du.excl.NOM bilu-warra.spoonbill there see.PST","r353_1du_excl_there_bird_e_saw_bilu_warra",["ngali","bilu-warra","yinyay","nyajin"]),
row(8,"We two, not you, saw the dukunjulu golden whistler there.","Ngali dukunjulu yinyay nyajin.","ngali dukunjulu yinyay nyajin | 1du.excl.NOM dukunjulu.golden-whistler there see.PST","r353_1du_excl_there_bird_e_saw_dukunjulu",["ngali","dukunjulu","yinyay","nyajin"]),
row(9,"We two, not you, saw the jiwurrmal pheasant cuckoo there.","Ngali jiwurrmal yinyay nyajin.","ngali jiwurrmal yinyay nyajin | 1du.excl.NOM jiwurrmal.pheasant-cuckoo there see.PST","r353_1du_excl_there_bird_e_saw_jiwurrmal",["ngali","jiwurrmal","yinyay","nyajin"]),
row(10,"We two, not you, saw the kujuway pigeon there.","Ngali kujuway yinyay nyajin.","ngali kujuway yinyay nyajin | 1du.excl.NOM kujuway.pigeon there see.PST","r353_1du_excl_there_bird_e_saw_kujuway",["ngali","kujuway","yinyay","nyajin"]),
row(11,"You and I saw the dakwurr-dakwun hammer bird here.","Ngaliny dakwurr-dakwun yaluy nyajin.","ngaliny dakwurr-dakwun yaluy nyajin | 1du.incl.NOM dakwurr-dakwun.hammer-bird here see.PST","r353_1du_incl_here_bird_e_saw_dakwurr_dakwun",["ngaliny","dakwurr-dakwun","yaluy","nyajin"]),
row(12,"You and I saw the kurkunbay butcherbird here.","Ngaliny kurkunbay yaluy nyajin.","ngaliny kurkunbay yaluy nyajin | 1du.incl.NOM kurkunbay.butcherbird here see.PST","r353_1du_incl_here_bird_e_saw_kurkunbay",["ngaliny","kurkunbay","yaluy","nyajin"]),
row(13,"You and I saw the kurrujuwa sentry bird here.","Ngaliny kurrujuwa yaluy nyajin.","ngaliny kurrujuwa yaluy nyajin | 1du.incl.NOM kurrujuwa.sentry-bird here see.PST","r353_1du_incl_here_bird_e_saw_kurrujuwa",["ngaliny","kurrujuwa","yaluy","nyajin"]),
row(14,"You and I saw the mirrku kidney bird here.","Ngaliny mirrku yaluy nyajin.","ngaliny mirrku yaluy nyajin | 1du.incl.NOM mirrku.kidney-bird here see.PST","r353_1du_incl_here_bird_e_saw_mirrku",["ngaliny","mirrku","yaluy","nyajin"]),
row(15,"You and I saw the baringkan small bird here.","Ngaliny baringkan yaluy nyajin.","ngaliny baringkan yaluy nyajin | 1du.incl.NOM baringkan.small-bird here see.PST","r353_1du_incl_here_bird_e_saw_baringkan",["ngaliny","baringkan","yaluy","nyajin"]),
row(16,"You and I saw the barinkan scrub bird here.","Ngaliny barinkan yaluy nyajin.","ngaliny barinkan yaluy nyajin | 1du.incl.NOM barinkan.scrub-bird here see.PST","r353_1du_incl_here_bird_e_saw_barinkan",["ngaliny","barinkan","yaluy","nyajin"]),
row(17,"You and I saw the bilu-warra spoonbill here.","Ngaliny bilu-warra yaluy nyajin.","ngaliny bilu-warra yaluy nyajin | 1du.incl.NOM bilu-warra.spoonbill here see.PST","r353_1du_incl_here_bird_e_saw_bilu_warra",["ngaliny","bilu-warra","yaluy","nyajin"]),
row(18,"You and I saw the dukunjulu golden whistler here.","Ngaliny dukunjulu yaluy nyajin.","ngaliny dukunjulu yaluy nyajin | 1du.incl.NOM dukunjulu.golden-whistler here see.PST","r353_1du_incl_here_bird_e_saw_dukunjulu",["ngaliny","dukunjulu","yaluy","nyajin"]),
row(19,"You and I saw the jiwurrmal pheasant cuckoo here.","Ngaliny jiwurrmal yaluy nyajin.","ngaliny jiwurrmal yaluy nyajin | 1du.incl.NOM jiwurrmal.pheasant-cuckoo here see.PST","r353_1du_incl_here_bird_e_saw_jiwurrmal",["ngaliny","jiwurrmal","yaluy","nyajin"]),
row(20,"You and I saw the kujuway pigeon here.","Ngaliny kujuway yaluy nyajin.","ngaliny kujuway yaluy nyajin | 1du.incl.NOM kujuway.pigeon here see.PST","r353_1du_incl_here_bird_e_saw_kujuway",["ngaliny","kujuway","yaluy","nyajin"]),
row(21,"You two saw the dakwurr-dakwun hammer bird there.","Yubal dakwurr-dakwun yinyay nyajin.","yubal dakwurr-dakwun yinyay nyajin | 2du.NOM dakwurr-dakwun.hammer-bird there see.PST","r353_2du_there_bird_e_saw_dakwurr_dakwun",["yubal","dakwurr-dakwun","yinyay","nyajin"]),
row(22,"You two saw the kurkunbay butcherbird there.","Yubal kurkunbay yinyay nyajin.","yubal kurkunbay yinyay nyajin | 2du.NOM kurkunbay.butcherbird there see.PST","r353_2du_there_bird_e_saw_kurkunbay",["yubal","kurkunbay","yinyay","nyajin"]),
row(23,"You two saw the kurrujuwa sentry bird there.","Yubal kurrujuwa yinyay nyajin.","yubal kurrujuwa yinyay nyajin | 2du.NOM kurrujuwa.sentry-bird there see.PST","r353_2du_there_bird_e_saw_kurrujuwa",["yubal","kurrujuwa","yinyay","nyajin"]),
row(24,"You two saw the mirrku kidney bird there.","Yubal mirrku yinyay nyajin.","yubal mirrku yinyay nyajin | 2du.NOM mirrku.kidney-bird there see.PST","r353_2du_there_bird_e_saw_mirrku",["yubal","mirrku","yinyay","nyajin"]),
row(25,"You two saw the baringkan small bird there.","Yubal baringkan yinyay nyajin.","yubal baringkan yinyay nyajin | 2du.NOM baringkan.small-bird there see.PST","r353_2du_there_bird_e_saw_baringkan",["yubal","baringkan","yinyay","nyajin"]),
row(26,"You two saw the barinkan scrub bird there.","Yubal barinkan yinyay nyajin.","yubal barinkan yinyay nyajin | 2du.NOM barinkan.scrub-bird there see.PST","r353_2du_there_bird_e_saw_barinkan",["yubal","barinkan","yinyay","nyajin"]),
row(27,"You two saw the bilu-warra spoonbill there.","Yubal bilu-warra yinyay nyajin.","yubal bilu-warra yinyay nyajin | 2du.NOM bilu-warra.spoonbill there see.PST","r353_2du_there_bird_e_saw_bilu_warra",["yubal","bilu-warra","yinyay","nyajin"]),
row(28,"You two saw the dukunjulu golden whistler there.","Yubal dukunjulu yinyay nyajin.","yubal dukunjulu yinyay nyajin | 2du.NOM dukunjulu.golden-whistler there see.PST","r353_2du_there_bird_e_saw_dukunjulu",["yubal","dukunjulu","yinyay","nyajin"]),
row(29,"You two saw the jiwurrmal pheasant cuckoo there.","Yubal jiwurrmal yinyay nyajin.","yubal jiwurrmal yinyay nyajin | 2du.NOM jiwurrmal.pheasant-cuckoo there see.PST","r353_2du_there_bird_e_saw_jiwurrmal",["yubal","jiwurrmal","yinyay","nyajin"]),
row(30,"You two saw the kujuway pigeon there.","Yubal kujuway yinyay nyajin.","yubal kujuway yinyay nyajin | 2du.NOM kujuway.pigeon there see.PST","r353_2du_there_bird_e_saw_kujuway",["yubal","kujuway","yinyay","nyajin"]),
row(31,"You all saw the dakwurr-dakwun hammer bird here.","Yurra dakwurr-dakwun yaluy nyajin.","yurra dakwurr-dakwun yaluy nyajin | 2pl.NOM dakwurr-dakwun.hammer-bird here see.PST","r353_2pl_here_bird_e_saw_dakwurr_dakwun",["yurra","dakwurr-dakwun","yaluy","nyajin"]),
row(32,"You all saw the kurkunbay butcherbird here.","Yurra kurkunbay yaluy nyajin.","yurra kurkunbay yaluy nyajin | 2pl.NOM kurkunbay.butcherbird here see.PST","r353_2pl_here_bird_e_saw_kurkunbay",["yurra","kurkunbay","yaluy","nyajin"]),
row(33,"You all saw the kurrujuwa sentry bird here.","Yurra kurrujuwa yaluy nyajin.","yurra kurrujuwa yaluy nyajin | 2pl.NOM kurrujuwa.sentry-bird here see.PST","r353_2pl_here_bird_e_saw_kurrujuwa",["yurra","kurrujuwa","yaluy","nyajin"]),
row(34,"You all saw the mirrku kidney bird here.","Yurra mirrku yaluy nyajin.","yurra mirrku yaluy nyajin | 2pl.NOM mirrku.kidney-bird here see.PST","r353_2pl_here_bird_e_saw_mirrku",["yurra","mirrku","yaluy","nyajin"]),
row(35,"You all saw the baringkan small bird here.","Yurra baringkan yaluy nyajin.","yurra baringkan yaluy nyajin | 2pl.NOM baringkan.small-bird here see.PST","r353_2pl_here_bird_e_saw_baringkan",["yurra","baringkan","yaluy","nyajin"]),
row(36,"You all saw the barinkan scrub bird here.","Yurra barinkan yaluy nyajin.","yurra barinkan yaluy nyajin | 2pl.NOM barinkan.scrub-bird here see.PST","r353_2pl_here_bird_e_saw_barinkan",["yurra","barinkan","yaluy","nyajin"]),
row(37,"You all saw the bilu-warra spoonbill here.","Yurra bilu-warra yaluy nyajin.","yurra bilu-warra yaluy nyajin | 2pl.NOM bilu-warra.spoonbill here see.PST","r353_2pl_here_bird_e_saw_bilu_warra",["yurra","bilu-warra","yaluy","nyajin"]),
row(38,"You all saw the dukunjulu golden whistler here.","Yurra dukunjulu yaluy nyajin.","yurra dukunjulu yaluy nyajin | 2pl.NOM dukunjulu.golden-whistler here see.PST","r353_2pl_here_bird_e_saw_dukunjulu",["yurra","dukunjulu","yaluy","nyajin"]),
row(39,"You all saw the jiwurrmal pheasant cuckoo here.","Yurra jiwurrmal yaluy nyajin.","yurra jiwurrmal yaluy nyajin | 2pl.NOM jiwurrmal.pheasant-cuckoo here see.PST","r353_2pl_here_bird_e_saw_jiwurrmal",["yurra","jiwurrmal","yaluy","nyajin"]),
row(40,"You all saw the kujuway pigeon here.","Yurra kujuway yaluy nyajin.","yurra kujuway yaluy nyajin | 2pl.NOM kujuway.pigeon here see.PST","r353_2pl_here_bird_e_saw_kujuway",["yurra","kujuway","yaluy","nyajin"]),
row(41,"We, not you, saw the dakwurr-dakwun hammer bird there.","Nganjin dakwurr-dakwun yinyay nyajin.","nganjin dakwurr-dakwun yinyay nyajin | 1pl.excl.NOM dakwurr-dakwun.hammer-bird there see.PST","r353_1pl_excl_there_bird_e_saw_dakwurr_dakwun",["nganjin","dakwurr-dakwun","yinyay","nyajin"]),
row(42,"We, not you, saw the kurkunbay butcherbird there.","Nganjin kurkunbay yinyay nyajin.","nganjin kurkunbay yinyay nyajin | 1pl.excl.NOM kurkunbay.butcherbird there see.PST","r353_1pl_excl_there_bird_e_saw_kurkunbay",["nganjin","kurkunbay","yinyay","nyajin"]),
row(43,"We, not you, saw the kurrujuwa sentry bird there.","Nganjin kurrujuwa yinyay nyajin.","nganjin kurrujuwa yinyay nyajin | 1pl.excl.NOM kurrujuwa.sentry-bird there see.PST","r353_1pl_excl_there_bird_e_saw_kurrujuwa",["nganjin","kurrujuwa","yinyay","nyajin"]),
row(44,"We, not you, saw the mirrku kidney bird there.","Nganjin mirrku yinyay nyajin.","nganjin mirrku yinyay nyajin | 1pl.excl.NOM mirrku.kidney-bird there see.PST","r353_1pl_excl_there_bird_e_saw_mirrku",["nganjin","mirrku","yinyay","nyajin"]),
row(45,"We, not you, saw the baringkan small bird there.","Nganjin baringkan yinyay nyajin.","nganjin baringkan yinyay nyajin | 1pl.excl.NOM baringkan.small-bird there see.PST","r353_1pl_excl_there_bird_e_saw_baringkan",["nganjin","baringkan","yinyay","nyajin"]),
row(46,"We, not you, saw the barinkan scrub bird there.","Nganjin barinkan yinyay nyajin.","nganjin barinkan yinyay nyajin | 1pl.excl.NOM barinkan.scrub-bird there see.PST","r353_1pl_excl_there_bird_e_saw_barinkan",["nganjin","barinkan","yinyay","nyajin"]),
row(47,"We, not you, saw the bilu-warra spoonbill there.","Nganjin bilu-warra yinyay nyajin.","nganjin bilu-warra yinyay nyajin | 1pl.excl.NOM bilu-warra.spoonbill there see.PST","r353_1pl_excl_there_bird_e_saw_bilu_warra",["nganjin","bilu-warra","yinyay","nyajin"]),
row(48,"We, not you, saw the dukunjulu golden whistler there.","Nganjin dukunjulu yinyay nyajin.","nganjin dukunjulu yinyay nyajin | 1pl.excl.NOM dukunjulu.golden-whistler there see.PST","r353_1pl_excl_there_bird_e_saw_dukunjulu",["nganjin","dukunjulu","yinyay","nyajin"]),
row(49,"We, not you, saw the jiwurrmal pheasant cuckoo there.","Nganjin jiwurrmal yinyay nyajin.","nganjin jiwurrmal yinyay nyajin | 1pl.excl.NOM jiwurrmal.pheasant-cuckoo there see.PST","r353_1pl_excl_there_bird_e_saw_jiwurrmal",["nganjin","jiwurrmal","yinyay","nyajin"]),
row(50,"We, not you, saw the kujuway pigeon there.","Nganjin kujuway yinyay nyajin.","nganjin kujuway yinyay nyajin | 1pl.excl.NOM kujuway.pigeon there see.PST","r353_1pl_excl_there_bird_e_saw_kujuway",["nganjin","kujuway","yinyay","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")
  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("r353_") 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")
 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}")
 for seq,_en,ku,_an,_fr,_tier,wjson,_l,_ev,_c in ROWS:
  w=json.loads(wjson);ch=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'",(ku,)).fetchall();opp=f"{w[0].capitalize()} {w[1]} {OPP[w[2]]} nyajin.";oh=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'",(opp,)).fetchall()
  if ch or oh!=[("batch-394",seq)]:raise SystemExit(f"map {seq} {ch}/{oh}")
 verified,words=db.execute("SELECT COUNT(*),SUM(LENGTH(kuku)-LENGTH(REPLACE(kuku,' ',''))+1) FROM sentences WHERE status IN('accepted','revised')").fetchone()
 if (verified,words)!=(19797,134547):raise SystemExit(f"baseline {verified}/{words}")
 notes="COMPLEMENTARY CORRECTED BIRD SET-E NON-SINGULAR PAST PERCEPTION AFTER RULE 352 (Rule 353). 50 exact complements; full 100-cell non-singular grid complete; corrected heads and Patz clusivity retained; gap 162->172."
 bid=db.execute("INSERT INTO batches(label,cheatsheet_version,guide_version,notes,created_at) VALUES(?,?,?,?,?)",(LABEL,"Rule353 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}."),("planning","sense-preservation-audit","Corrected heads, rejected-head exclusions and cultural boundaries retained."),("planning","complement-map-audit","50 candidates absent; opposites exactly Batch394 seq1-50."),("planning","balance-audit","Gap162->172; inverse duplicate."),("preflight","coverage-audit",f"targets={tc};support={sc}."),("preflight","duplicate-preflight","50 unique/absent."),("preflight","static-guard-pass","AST 50 literal; source/sense/clusivity/lint 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 Rule353; verified {verified}; words {words}.",command="python3 batch_scripts/bank_395.py",artifact_path=LOG,created_at=NOW);db.commit();print("banked batch-395: 50 under_review");return 0
if __name__=="__main__":raise SystemExit(main())
