#!/usr/bin/env python3
"""Bank batch-134: noun-phrase structure, modifier order, and apposition.

Rows are hand-authored in the main loop from Patz 4.1.1 and adjacent case /
possession sections. This script only stores the rows and guards duplicates.
"""

from __future__ import annotations

import datetime as dt
import json
import re
import sqlite3
import sys

DB = "/mnt/donto-data/donto-resources/research/translation-training/kuku-yalanji-runpod-2026-06-30/synthetic/claude-synthetic-v1-2026-07-02/synthetic.db"
LABEL = "batch-134"
NOW = dt.datetime.now(dt.timezone.utc).replace(microsecond=0).isoformat().replace("+00:00", "Z")

DENY = {
    "nyawa", "jinbi", "jibin", "walba", "julmbu", "wanan", "ngampula",
    "yalama", "ngana-jinji", "jubuny", "wural", "bigan", "jiwuny",
    "warngkul", "wanaba", "jarrkunji", "munjal", "murku", "buni",
    "kunya", "milkan", "kulur-jambul", "janyji", "buburr", "jarrmba",
    "jinji", "daga", "wanka", "yumbul", "kuku-yumbul", "jubi",
    "yilbay", "jarrakay", "janka-yukil", "jukarr", "kunkul",
    "bubu-jandu", "bubu-warral", "jani-warra", "balbay-nja",
    "bunjurril", "buri",
}


def js(values: list[str]) -> str:
    return json.dumps(values, ensure_ascii=False)


ROWS = [
    (1, "The hairy-yam food is good.",
     "Mayi wukay ngulkurr.",
     "mayi wukay ngulkurr | plant.food hairy.yam good",
     "np_generic_specific_classifier", 4, js(["mayi", "wukay", "ngulkurr"]), js([]),
     "Patz 4.1.1(c): generic mayi before specific wukay.", "0.88"),
    (2, "This hairy-yam food is good.",
     "Yanyu mayi wukay ngulkurr.",
     "yanyu mayi wukay ngulkurr | this plant.food hairy.yam good",
     "np_demonstrative_generic_specific", 4, js(["yanyu", "mayi", "wukay", "ngulkurr"]), js([]),
     "Patz 4.1.1(d): demonstrative preferred initial with generic+specific NPs.", "0.88"),
    (3, "That echidna meat is good.",
     "Yinya minya ngangkin ngulkurr.",
     "yinya minya ngangkin ngulkurr | that meat echidna good",
     "np_demonstrative_generic_specific", 4, js(["yinya", "minya", "ngangkin", "ngulkurr"]), js([]),
     "Patz 4.1.1(c-d): minya generic plus specific noun, demonstrative initial.", "0.88"),
    (4, "The paperbark tree stands there.",
     "Juku buyku yinyay janay.",
     "juku buyku yinyay jana-y | tree paperbark there stand-NONPAST",
     "np_generic_specific_classifier", 4, js(["juku", "buyku", "yinyay", "janay"]), js([]),
     "Patz 4.1.1(c): juku buyku as a generic+specific tree NP.", "0.88"),
    (5, "The child saw the paperbark tree.",
     "Karrkay-ngku juku buyku nyajin.",
     "karrkay-ngku juku buyku nyaji-ny | child-ERG tree paperbark see-PAST",
     "np_generic_specific_object", 4, js(["karrkay", "juku", "buyku", "nyajil"]), js([]),
     "Patz 4.1.1(c) generic+specific NP used as a transitive object.", "0.86"),
    (6, "The people ate hairy-yam food.",
     "Jana mayi wukay nukan.",
     "jana mayi wukay nuka-ny | they plant.food hairy.yam eat-PAST",
     "np_generic_specific_object", 4, js(["jana", "mayi", "wukay", "nukal"]), js([]),
     "Patz 4.1.1(c): mayi wukay used as a compact object NP.", "0.86"),
    (7, "They got echidna meat.",
     "Jana minya ngangkin manin.",
     "jana minya ngangkin mani-ny | they meat echidna get-PAST",
     "np_generic_specific_object", 4, js(["jana", "minya", "ngangkin", "manil"]), js([]),
     "Patz 4.1.1(c): minya ngangkin as generic+specific NP.", "0.86"),
    (8, "The big paperbark tree is there.",
     "Juku buyku yalbay yinyay.",
     "juku buyku yalbay yinyay | tree paperbark big there",
     "np_generic_specific_modifier", 4, js(["juku", "buyku", "yalbay", "yinyay"]), js([]),
     "Patz 4.1.1(g): modifier follows the head constituent; generic+specific source juku buyku.", "0.86"),

    (9, "That child came.",
     "Yinya karrkay kadan.",
     "yinya karrkay kada-ny | that child come-PAST",
     "np_demonstrative_before_one_noun", 4, js(["yinya", "karrkay", "kaday"]), js([]),
     "Patz 4.1.1(d): with one noun, demonstrative may precede.", "0.88"),
    (10, "That child came.",
     "Karrkay yinya kadan.",
     "karrkay yinya kada-ny | child that come-PAST",
     "np_demonstrative_after_one_noun", 4, js(["karrkay", "yinya", "kaday"]), js([]),
     "Patz 4.1.1(d): with one noun, demonstrative may follow.", "0.88"),
    (11, "This dog is good.",
     "Yanyu kaya ngulkurr.",
     "yanyu kaya ngulkurr | this dog good",
     "np_demonstrative_before_one_noun", 4, js(["yanyu", "kaya", "ngulkurr"]), js([]),
     "Patz 4.1.1(d): demonstrative preceding one noun.", "0.87"),
    (12, "This dog is good.",
     "Kaya yanyu ngulkurr.",
     "kaya yanyu ngulkurr | dog this good",
     "np_demonstrative_after_one_noun", 4, js(["kaya", "yanyu", "ngulkurr"]), js([]),
     "Patz 4.1.1(d): demonstrative following one noun.", "0.87"),
    (13, "That big eel bit the girl.",
     "Yinya-ngka kubarr-angka yalbay-ngka maral baykan.",
     "yinya-ngka kubarr-angka yalbay-ngka maral bayka-ny | that-ERG eel-ERG big-ERG girl bite-PAST",
     "np_case_agreement_dem_noun_adj", 5, js(["yinya", "kubarr", "yalbay", "maral", "baykal"]), js([]),
     "Cheatsheet 6 from Patz 4.1.1/4.2: ERG agreement on demonstrative+noun+adjective.", "0.92"),
    (14, "That big dog bit the child.",
     "Yinya-ngka kaya-ngka yalbay-ngka karrkay baykan.",
     "yinya-ngka kaya-ngka yalbay-ngka karrkay bayka-ny | that-ERG dog-ERG big-ERG child bite-PAST",
     "np_case_agreement_dem_noun_adj", 5, js(["yinya", "kaya", "yalbay", "karrkay", "baykal"]), js([]),
     "Extends the Patz 4.1.1/4.2 agreement pattern to a familiar potent dog-agent NP.", "0.88"),
    (15, "This big tree stands.",
     "Yanyu juku yalbay janjanay.",
     "yanyu juku yalbay janja-na-y | this tree big stand-REDUP-NONPAST",
     "np_demonstrative_modifier_continuous", 4, js(["yanyu", "juku", "yalbay", "janjanay"]), js([]),
     "Patz 4.1.1(g): adjective follows the head in a continuous NP.", "0.86"),
    (16, "That old woman sat there.",
     "Yinya jalbu mukul yinyay bundan.",
     "yinya jalbu mukul yinyay bunda-ny | that woman old there sit-PAST",
     "np_demonstrative_modifier_continuous", 4, js(["yinya", "jalbu", "mukul", "yinyay", "bunday"]), js([]),
     "Patz 4.1.1(g): modifier follows head; demonstrative initial.", "0.86"),

    (17, "Which young man came?",
     "Wanya warru kadan?",
     "wanya warru kada-ny | who young.man come-PAST",
     "np_interrogative_human_noun", 4, js(["wanya", "warru", "kaday"]), js([]),
     "Patz 4.1.1(e): wanya warru 'which young man'.", "0.90"),
    (18, "Which girl came?",
     "Wanya maral kadan?",
     "wanya maral kada-ny | who girl come-PAST",
     "np_interrogative_human_noun", 4, js(["wanya", "maral", "kaday"]), js([]),
     "Patz 4.1.1(e): interrogative may combine with a common noun.", "0.88"),
    (19, "What meat did you eat?",
     "Yundu wanyu minya nukan?",
     "yundu wanyu minya nuka-ny | you what meat eat-PAST",
     "np_interrogative_what_noun_object", 4, js(["yundu", "wanyu", "minya", "nukal"]), js([]),
     "Patz 4.1.1(e): wanyu minya 'what meat'.", "0.90"),
    (20, "What fish did the child see?",
     "Karrkay-ngku wanyu kuyu nyajin?",
     "karrkay-ngku wanyu kuyu nyaji-ny | child-ERG what fish see-PAST",
     "np_interrogative_what_noun_object", 4, js(["karrkay", "wanyu", "kuyu", "nyajil"]), js([]),
     "Patz 4.1.1(e) plus 4.2: object NP stays ABS while child agent is ERG.", "0.88"),
    (21, "Which man spoke?",
     "Wanya dingkar balkan?",
     "wanya dingkar balka-ny | who man speak-PAST",
     "np_interrogative_human_noun", 4, js(["wanya", "dingkar", "balkal"]), js([]),
     "Patz 4.1.1(e): wanya plus human noun.", "0.88"),
    (22, "What tree is standing there?",
     "Wanyu juku yinyay janjanay?",
     "wanyu juku yinyay janja-na-y | what tree there stand-REDUP-NONPAST",
     "np_interrogative_what_noun_subject", 4, js(["wanyu", "juku", "yinyay", "janjanay"]), js([]),
     "Patz 4.1.1(e): wanyu may combine with a common noun.", "0.86"),

    (23, "The two mothers went to camp.",
     "Bula ngamu bayan-ka dungan.",
     "bula ngamu bayan-ka dunga-ny | they.two mother camp-DAT go-PAST",
     "np_personal_pronoun_noun_apposition", 4, js(["bula", "ngamu", "bayan", "dungay"]), js([]),
     "Patz 4.1.1(f): bula ngamu 'the two mothers'.", "0.90"),
    (24, "The people stayed at camp.",
     "Jana bama bayan-ba bundandan.",
     "jana bama bayan-ba bunda-nda-ny | they people camp-LOC sit-REDUP-PAST",
     "np_personal_pronoun_noun_apposition", 4, js(["jana", "bama", "bayan", "bunday"]), js([]),
     "Patz 4.1.1(f): jana bama 'the Aborigines/people'.", "0.88"),
    (25, "That one came.",
     "Nyulu yinya kadan.",
     "nyulu yinya kada-ny | he that come-PAST",
     "np_pronoun_demonstrative_apposition", 4, js(["nyulu", "yinya", "kaday"]), js([]),
     "Patz 4.1.1(f): nyulu yinya 'that one'.", "0.90"),
    (26, "You two women stay at camp.",
     "Yubal jalbu bayan-ba bunday.",
     "yubal jalbu bayan-ba bunda-y | you.two woman camp-LOC sit-NONPAST",
     "np_personal_pronoun_noun_apposition", 4, js(["yubal", "jalbu", "bayan", "bunday"]), js([]),
     "Patz 4.1.1(f): personal pronoun may be followed by a noun in apposition.", "0.84"),
    (27, "We all people will go.",
     "Ngana bama dungay.",
     "ngana bama dunga-y | we.all people go-NONPAST",
     "np_personal_pronoun_noun_apposition", 4, js(["ngana", "bama", "dungay"]), js([]),
     "Patz 4.1.1(f): personal pronoun plus common noun NP.", "0.84"),
    (28, "We two people went.",
     "Ngali bama dungan.",
     "ngali bama dunga-ny | we.two.incl people go-PAST",
     "np_personal_pronoun_noun_apposition", 4, js(["ngali", "bama", "dungay"]), js([]),
     "Patz 4.1.1(f): dual pronoun plus common noun apposition.", "0.84"),
    (29, "Those people came from there.",
     "Jana bama yinyay-muny kadan.",
     "jana bama yinyay-muny kada-ny | they people there-ABL come-PAST",
     "np_personal_pronoun_noun_apposition", 4, js(["jana", "bama", "yinyay", "kaday"]), js([]),
     "Patz 4.1.1(f) with jana bama as the subject NP.", "0.86"),

    (30, "Rough bark is hard.",
     "Dubal murru-murru dandi.",
     "dubal murru-murru dandi | bark rough hard",
     "np_head_modifier_order", 4, js(["dubal", "murru-murru", "dandi"]), js([]),
     "Patz 4.1.1(g): dubal murru-murru 'rough bark'.", "0.90"),
    (31, "The new spear is sharp.",
     "Kalka jirakal jinbal.",
     "kalka jirakal jinbal | spear new sharp",
     "np_head_modifier_order", 4, js(["kalka", "jirakal", "jinbal"]), js([]),
     "Patz 4.1.1(g-h): optional modifier after head noun.", "0.86"),
    (32, "The big house is there.",
     "Bayan yalbay yinyay.",
     "bayan yalbay yinyay | house big there",
     "np_head_modifier_order", 4, js(["bayan", "yalbay", "yinyay"]), js([]),
     "Patz 4.1.1(g): adjective follows head.", "0.86"),
    (33, "The little child is sleeping.",
     "Karrkay buban wunay.",
     "karrkay buban wuna-y | child small lie/sleep-NONPAST",
     "np_head_modifier_order", 4, js(["karrkay", "buban", "wunay"]), js([]),
     "Patz 4.1.1(g): adjective follows head.", "0.86"),
    (34, "Two vicious dogs stayed at camp.",
     "Jambul kaya kuli-ji bayan-ba bundan.",
     "jambul kaya kuli-ji bayan-ba bunda-ny | two dog anger-COMIT camp-LOC sit-PAST",
     "np_quantifier_head_modifier_order", 5, js(["jambul", "kaya", "kuli", "bayan", "bunday"]), js([]),
     "Patz 4.1.1(g): jambul kaya kuli-ji 'two vicious dogs'.", "0.90"),
    (35, "Three big trees are standing there.",
     "Kulur juku yalbay yinyay janjanay.",
     "kulur juku yalbay yinyay janja-na-y | three tree big there stand-REDUP-NONPAST",
     "np_quantifier_head_adjective", 5, js(["kulur", "juku", "yalbay", "yinyay", "janjanay"]), js([]),
     "Patz 4.1.1(g): quantifier tends to precede and adjective follows the head.", "0.88"),
    (36, "Two long spears are in the house.",
     "Jambul kalka kalbay bayan-ba.",
     "jambul kalka kalbay bayan-ba | two spear long house-LOC",
     "np_quantifier_head_adjective", 5, js(["jambul", "kalka", "kalbay", "bayan"]), js([]),
     "Patz 4.1.1(g): quantifier before, adjective after.", "0.88"),
    (37, "That big strong one came.",
     "Yinya yalbay junkurr-ji kadan.",
     "yinya yalbay junkurr-ji kada-ny | that big strength-COMIT come-PAST",
     "np_demonstrative_descriptive_modifiers", 5, js(["yinya", "yalbay", "junkurr", "kaday"]), js([]),
     "Patz 4.1.1(g): yinya yalbay junka/junkurr-ji descriptive demonstrative NP.", "0.86"),

    (38, "My big house is here.",
     "Ngayku bayan yalbay yaluy.",
     "ngayku bayan yalbay yaluy | my house big here",
     "np_possessive_before_head_modifier", 4, js(["ngayku", "bayan", "yalbay", "yaluy"]), js([]),
     "Patz 4.1.1(h): pronominal possessive may precede noun; modifier after head.", "0.88"),
    (39, "My big house is here.",
     "Bayan ngayku yalbay yaluy.",
     "bayan ngayku yalbay yaluy | house my big here",
     "np_possessive_after_head_modifier", 4, js(["bayan", "ngayku", "yalbay", "yaluy"]), js([]),
     "Patz 4.1.1(h): possessive may also follow noun in a continuous NP.", "0.86"),
    (40, "Mother's fishing line is in the house.",
     "Badur ngamu-mu bayan-ba.",
     "badur ngamu-mu bayan-ba | fishing.line mother-POSS house-LOC",
     "np_nominal_possessive_after_head", 4, js(["badur", "ngamu", "bayan"]), js([]),
     "Patz 4.1.1(h): badur ngamu-mu 'mother's fishing line'.", "0.90"),
    (41, "The man's new spear is sharp.",
     "Kalka jirakal dingkar-amu jinbal.",
     "kalka jirakal dingkar-amu jinbal | spear new man-POSS sharp",
     "np_nominal_possessive_with_modifier", 4, js(["kalka", "jirakal", "dingkar", "jinbal"]), js([]),
     "Patz 4.1.1(h): kalka jirakal dingkar-amu 'the man's new spear'.", "0.90"),
    (42, "The old woman's dog came.",
     "Kaya wulbuman-amu kadan.",
     "kaya wulbuman-amu kada-ny | dog old.woman-POSS come-PAST",
     "np_nominal_possessive_after_head", 4, js(["kaya", "wulbuman", "kaday"]), js([]),
     "Rule 54 plus Patz 4.1.1(h): alienable possessed noun plus possessor-POSS.", "0.86"),
    (43, "Your spear is good.",
     "Yunu kalka ngulkurr.",
     "yunu kalka ngulkurr | your spear good",
     "np_pronoun_possessive_before_head", 4, js(["yunu", "kalka", "ngulkurr"]), js([]),
     "Patz 4.1.1(h): pronominal possessive before noun.", "0.88"),
    (44, "Your good spear is here.",
     "Kalka ngulkurr yunu yaluy.",
     "kalka ngulkurr yunu yaluy | spear good your here",
     "np_pronoun_possessive_after_head_modifier", 4, js(["kalka", "ngulkurr", "yunu", "yaluy"]), js([]),
     "Patz 4.1.1(h): possessive may follow the noun; modifier remains after the head.", "0.84"),

    (45, "He has a good hand.",
     "Nyulu mara ngulkurr.",
     "nyulu mara ngulkurr | he hand good",
     "np_inalienable_part_apposition", 4, js(["nyulu", "mara", "ngulkurr"]), js([]),
     "Patz 4.1.1(i)/4.5.2: inalienable part follows whole with no possessive suffix.", "0.88"),
    (46, "The man has sharp teeth.",
     "Dingkar dirra jinbal.",
     "dingkar dirra jinbal | man tooth sharp",
     "np_inalienable_part_apposition", 4, js(["dingkar", "dirra", "jinbal"]), js([]),
     "Patz 4.1.1(i): inalienable body part in apposition after possessor.", "0.86"),
    (47, "The fish has a long tail.",
     "Kuyu biji kalbay.",
     "kuyu biji kalbay | fish tail long",
     "np_inalienable_part_apposition", 4, js(["kuyu", "biji", "kalbay"]), js([]),
     "Patz 4.5.2 ex.520: kuyu biji as fish-tail apposition.", "0.90"),
    (48, "The girl has wet hair.",
     "Maral mungka duna.",
     "maral mungka duna | girl hair wet",
     "np_inalienable_part_apposition", 4, js(["maral", "mungka", "duna"]), js([]),
     "Patz 4.1.1(i)/4.5.2: part follows whole; modifier refers to the part.", "0.86"),
    (49, "He hooked the fish by the tail.",
     "Nyulu kuyu biji kayin.",
     "nyulu kuyu biji kayi-ny | he fish tail hook-PAST",
     "np_inalienable_object_apposition", 5, js(["nyulu", "kuyu", "biji", "kayil"]), js([]),
     "Patz 4.5.2 ex.520: Nyulu kuyu biji kayi-ny.", "0.92"),
    (50, "He dropped the stone on the girl's foot.",
     "Nyulu kulji daray-manin maral-anda jina-nga.",
     "nyulu kulji dara-y-mani-ny maral-anda jina-nga | he stone fall-y-CAUS-PAST girl-LOC foot-LOC",
     "np_inalienable_locative_apposition", 5, js(["nyulu", "kulji", "daray-manil", "maral", "jina"]), js([]),
     "Patz 4.5.2 ex.521: same-case locative apposition maral-anda jina-nga.", "0.92"),
]


def scan_static() -> list[str]:
    issues: list[str] = []
    if len(ROWS) != 50:
        issues.append(f"expected 50 rows, got {len(ROWS)}")
    seqs = [r[0] for r in ROWS]
    if seqs != list(range(1, 51)):
        issues.append(f"seqs must be 1..50, got {seqs[:5]}...{seqs[-5:]}")
    seen_ku: set[str] = set()
    for row in ROWS:
        seq, english, kuku, analysis, _frame, _tier, words_used, loans_used, _evidence, _confidence = row
        label = f"{LABEL}.{seq:02d}"
        if not english[:1].isupper() or english.rstrip("'\"").rstrip()[-1:] not in ".!?":
            issues.append(f"{label}: English must be capitalized and final-punctuated")
        if " | " not in analysis:
            issues.append(f"{label}: analysis missing gloss separator")
        if not kuku[:1].isupper():
            issues.append(f"{label}: Kuku surface must start uppercase")
        for field_name, payload in (("words_used", words_used), ("loans_used", loans_used)):
            try:
                json.loads(payload)
            except Exception as exc:
                issues.append(f"{label}: {field_name} is not JSON: {exc}")
        low = f" {kuku.lower()} {analysis.lower()} "
        for word in DENY:
            if re.search(rf"(?<![a-z]){re.escape(word)}(?![a-z])", low):
                issues.append(f"{label}: denied phantom/wrong-sense token {word!r}")
        if kuku.lower() in seen_ku:
            issues.append(f"{label}: duplicate Kuku surface within batch")
        seen_ku.add(kuku.lower())
    return issues


def main() -> int:
    issues = scan_static()
    if issues:
        print("pre-bank scan failed:")
        for issue in issues:
            print(f"  - {issue}")
        return 1

    db = sqlite3.connect(DB)
    db.execute("PRAGMA foreign_keys = ON")
    db.execute("BEGIN")
    existing = db.execute("SELECT id FROM batches WHERE label=?", (LABEL,)).fetchone()
    if existing:
        batch_id = existing[0]
        accepted = db.execute(
            "SELECT COUNT(*) FROM sentences WHERE batch_id=? AND status IN ('accepted','revised')",
            (batch_id,),
        ).fetchone()[0]
        if accepted:
            raise SystemExit(f"{LABEL} already has accepted/revised rows; refusing to overwrite")
        db.execute("DELETE FROM reviews WHERE sentence_id IN (SELECT id FROM sentences WHERE batch_id=?)", (batch_id,))
        db.execute("DELETE FROM sentences WHERE batch_id=?", (batch_id,))
        db.execute("UPDATE batches SET notes=?, created_at=? WHERE id=?", ("rebanked under_review", NOW, batch_id))
    else:
        cur = db.execute(
            "INSERT INTO batches(label, cheatsheet_version, guide_version, notes, created_at) VALUES(?,?,?,?,?)",
            (LABEL, "Rule 92 draft: noun-phrase structure", "operator-guide-2026-07-07", "under_review", NOW),
        )
        batch_id = cur.lastrowid

    dupes = []
    for seq, _english, kuku, *_rest in ROWS:
        hit = db.execute(
            """
            SELECT b.label, s.seq
            FROM sentences s JOIN batches b ON b.id=s.batch_id
            WHERE lower(trim(s.kuku))=lower(trim(?))
              AND s.status!='rejected'
              AND s.batch_id!=?
            """,
            (kuku, batch_id),
        ).fetchone()
        if hit:
            dupes.append(f"{LABEL}.{seq:02d} duplicates {hit[0]}.{hit[1]:02d}: {kuku}")
    if dupes:
        db.rollback()
        print("cross-corpus duplicate check failed:")
        for dupe in dupes:
            print(f"  - {dupe}")
        return 1

    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(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
        """,
        [
            (
                batch_id, seq, english, kuku, analysis, frame, tier, words_used,
                loans_used, evidence, "under_review", confidence,
                "project_approved_synthetic_pending_elder_verification",
                "claude-main", NOW, NOW,
            )
            for seq, english, kuku, analysis, frame, tier, words_used, loans_used, evidence, confidence in ROWS
        ],
    )
    db.commit()
    count = db.execute("SELECT COUNT(*) FROM sentences WHERE batch_id=?", (batch_id,)).fetchone()[0]
    avg_words = db.execute(
        "SELECT AVG(LENGTH(kuku)-LENGTH(REPLACE(kuku,' ',''))+1.0) FROM sentences WHERE batch_id=?",
        (batch_id,),
    ).fetchone()[0]
    print(f"banked {LABEL}: {count} rows under_review; avg Kuku words/row={avg_words:.2f}")
    return 0


if __name__ == "__main__":
    sys.exit(main())
