"""Decision register and evidence ledger, document register."""
import json
from pathlib import Path

from site_common import CLAIMS, DATA, R, RG, G, S, at, esc, write_page

GRADE_LINE = {
    "A": "grade A - holds regardless of model progress",
    "B": "grade B - current-generation measurement; confirmed at the bakeoff",
    "C": "grade C - superseded-generation number; mechanism only",
}


def dec(anchor, question, recommendation, why, evidence_rows, changes, facts):
    rows = "".join(evidence_rows)
    facts_line = '<p class="facts">%s</p>' % esc(facts) if facts else ""
    return """
<section class="decision" id="%s">
<h3>%s</h3>
%s
<p><b>Recommendation: %s</b></p>
<p>%s</p>
<p><b>Evidence.</b></p>
%s
<p><b>What would change this.</b> %s</p>
</section>
""" % (anchor, esc(question), facts_line, recommendation, why, rows, changes)


def build_decisions():
    parts = []
    at("decisions.html", "top", "Decisions - how to use this page")
    parts.append("""
<h1>The decision register</h1>
<p class="doc-dateline">Every open call: options, evidence, and what would change the answer - 2026-07-15</p>

<p>This page is where evidence meets decisions. Each entry states a question, a recommendation, the evidence it
rests on with the grade of each piece spelled out, and - because this territory is genuinely new - the specific
measurement that would flip the answer. The reasoning underneath every entry is <a href="KERNEL.md">the
kernel</a>; the receipts behind every bracket are <a href="evidence.html">the evidence ledger</a>. The standing
rule for everything here: permanent constraints shape the design; capability numbers only ever fill measured,
re-measurable slots. Dated evidence sets no threshold in either direction.</p>
""")

    at("decisions.html", "authorize", "Decisions - section A")
    parts.append('<h2 id="authorize">Section A</h2>')

    at("decisions.html", "a1", "Decisions - the standard")
    parts.append(dec("a1",
        "A1. What does \"quality\" mean here?",
        "define quality as satisfying the written instructions, grounded in the evidence record - not as matching an average reviewer.",
        """Consensus-matching caps the system's validity at the reviewers' own unmeasured reliability, and on
genuinely ambiguous items it manufactures an answer where none exists. Instruction-grounding makes every verdict
traceable to a clause and a span a worker can check - which is what makes verdicts contestable at all.""",
        [RG("AJ-02", "Validating judges against forced-choice consensus labels selected systems up to 31 percent worse when criteria admit multiple readings."),
         RG("AQ-03", "Judge accuracy means different things on clear and contested items; they cannot be pooled."),
         RG("AQ-04", "Most annotator disagreement traces to underspecified tasks and style, not error - signal about instructions, not people."),
         RG("F26-08", "Current lab practice preserves disagreement as a record rather than voting it away.")],
        "Nothing in the reviewed corpus contradicts this. The baseline (E1) measures how much of our own disagreement is instruction ambiguity, which sizes the benefit.",
        "Needs leadership sign-off. Reversibility: moderate - gold sets built under one standard do not transfer cheaply."))

    at("decisions.html", "a2", "Decisions - first project and gold funding")
    parts.append(dec("a2",
        "A2. Which project, and who pays for ground truth?",
        "pick one project with bounded evidence, real reviewer disagreement, and expert access - and fund its adjudicated gold set as the price of knowing anything.",
        """Adjudicated gold is the one cost that cannot be engineered away, and its size is computable in advance
from pilot correlations, so the budget is knowable before signing.""",
        [RG("HS-01", "Small human gold sets go far when fused correctly with judge scores - but only if they exist; the method's guarantees survive a bad judge."),
         RG("HS-03", "Required human labels are computable in closed form - the budget is a formula, not a hope."),
         RG("CT-03", "When the checker is no better than the work, nothing cuts gold needs by more than half - ground truth is structural."),
         RG("RR-02", "Production-grade rubric practice runs on expert-written criteria at scale; expert access is the scarce input.")],
        "If no candidate project can fund adjudication, shrink the pilot, not the measurement discipline - E1 still runs on dual review alone.",
        "Needs leadership sign-off. Reversibility: moderate - per-project compilation cost is sunk. Depends on: A4, D5."))

    at("decisions.html", "a3", "Decisions - baseline first")
    parts.append(dec("a3",
        "A3. Do we measure ourselves before judging the machine?",
        "yes - fund the reviewer-baseline measurement first; it is cheap, and every later threshold depends on it.",
        """How often our reviewers agree, and why they disagree, has never been measured for our population.
Without it, no claim that the system beats the humans it augments can even be stated.""",
        [RG("CG-02", "The canonical rater-science result: training improves a rater's self-consistency but does not equalize severity across raters."),
         RG("CG-04", "Variance decompositions: the reviewer-item-criterion interaction dominates stable harshness - per-item verification is the only lever on the dominant term.")],
        "Nothing - this purchase is valuable under every downstream outcome, including a decision not to build.",
        "Needs leadership sign-off. Reversibility: total. This is experiment E1."))

    at("decisions.html", "a4", "Decisions - authority boundaries")
    parts.append(dec("a4",
        "A4. What may the system decide on its own?",
        "measurement broadly; enforcement narrowly and earned. No autonomous accept/reject below calibrated level B, and decisions of significant detriment stay with a human - everywhere by our choice, in the EU by law.",
        """The consequence math is unforgiving at low failure rates: at 3 percent prevalence, 95 percent recall and
99 percent specificity, roughly a quarter of fail verdicts are false accusations; reaching 95 percent precision
needs specificity near 99.8 percent, and proving that requires thousands of adjudicated passes. So consequences
are gated by measurement cost, not model quality - and lanes are re-derived per model generation, in both
directions, because dated pessimism is as misleading as dated optimism.""",
        [RG("CG-07", "EU platform-work law: decisions of significant detriment must be taken by a human - no consent exception."),
         RG("CG-11", "Court doctrine: a determining automated score is itself the decision, and rubber-stamp review counts as none."),
         RG("DA-02", "US side: consequential verdicts over workers are selection-procedure shaped - validity evidence and adverse-impact monitoring are duties, not options."),
         RG("CT-02", "Across 370 effect sizes, naive human-verifies-machine teams underperformed the better party alone; deference is the default failure."),
         RG("CM-03", "Evidence-only assistance is the one tested format that helps without anchoring the human to the machine's answer."),
         RG("CM-10", "The closest production system ships pass / fail / cannot-verify with human escalation - not autonomous enforcement.")],
        "Per-lane graduation under the precommitted rule: for every critical error class, the upper confidence bound sits below its approved ceiling on untouched adjudicated data (E2, E3 feed this). Ceilings, sample sizes, and stop rules are locked before the test is opened.",
        "Needs leadership sign-off. Reversibility: a ratchet - authority is easy to grant later, hard to claw back."))

    at("decisions.html", "a5", "Decisions - permanent audit")
    parts.append(dec("a5",
        "A5. Is the audit channel a phase or a fixture?",
        "a fixture. Blind seeded items, randomized deep audits, and drift sensors are an operating cost, priced from the standard sampling-plan tradition.",
        """The checker cannot audit itself: models trained alike share blind spots, so agreement among them is weak
evidence, and the theoretical ceiling above means gold never becomes optional. Audits of confident passes are
where assisted review has shown its largest lift.""",
        [RG("CT-03", "The two-times ceiling: no method substitutes for ground truth when the judge is not clearly better than the judged."),
         RG("AQ-10", "Gold labels themselves run about 3 percent wrong in canonical sets - even the reference needs error accounting."),
         RG("CM-02", "Assisted second looks found four times the rating-changing problems on the confident-pass slice (older-generation number; direction is what we use)."),
         RG("CG-13", "A decade of deployed moderation practice ran three to four percent random audit with QA-of-QA on top."),
         RG("CG-14", "Industry codification: seeded items work only if indistinguishable - a live property to test, not assume.")],
        "Nothing structural. Audit rates move with measured drift and gaming pressure; the switching-rule tradition from acceptance sampling is the starting template.",
        "Needs leadership sign-off. Reversibility: none - removing the audit removes the certificate."))

    at("decisions.html", "design-decisions", "Decisions - owner calls")
    parts.append('<h2 id="design-decisions">Section B - open calls on the program owner\'s desk</h2>')

    at("decisions.html", "d1", "Decisions - enforcement weight")
    parts.append(dec("d1",
        "D1. Do verdicts carry consequences at launch?",
        "no - launch advisory, and attach consequences lane by lane only after seeded error rates exist.",
        """The lane most likely to produce false accusations - praise and completeness verification - has never been
measured by anyone """ + G("gap-01") + """, so a consequence-bearing launch would price it blind. Advisory
launches still move behavior, and incentive theory says enforcement weight on partially measured quality
diverts effort from everything unmeasured.""",
        [RG("CM-05", "27 percent of reviewers revised after gated model feedback in a 20,000-review randomized deployment - advisory works."),
         RG("CG-19", "More than a third of feedback interventions reduce performance - the channel needs instrumentation before teeth."),
         RG("DA-03", "The multitask theorem: strong incentives on measured dimensions pull effort away from unmeasured ones."),
         RG("CG-07", "Consequences for EU workers arrive together with the legal floor.")],
        "Per-lane seeded recall and false-flag rates from E2 and E3 at the project's declared error prices.",
        "Open - owner call. Reversibility: advisory-to-consequential is a ratchet; go slow. Depends on: A4, D5, C5."))

    at("decisions.html", "d2", "Decisions - rubric authority")
    parts.append(dec("d2",
        "D2. When the owner's instinct contradicts their own rubric, which wins?",
        "the rubric - with a fast, versioned amendment path, never a silent override.",
        """Criteria drift is normal and expected; the only question is whether changes are versioned. Standing
overrides quietly re-import the unexplained variance this system exists to remove.""",
        [RG("RR-05", "Graders' criteria measurably change as they grade - amendment pressure is structural."),
         RG("CT-04", "Evaluation criteria are unstable even when fixed in advance - ad-hoc authority cannot be the arbiter.")],
        "If E1 shows amendment latency is operationally intolerable, add a bounded interim-ruling path - still versioned, never silent.",
        "Open - owner call. Reversibility: high - this is process, not infrastructure."))

    at("decisions.html", "d3", "Decisions - AI-assistance policy")
    parts.append(dec("d3",
        "D3. Is heavily AI-assisted worker output acceptable?",
        "judge the work, not the workflow: content-validity by default, with per-project override where a buyer pays for human-only process.",
        """A third of text workers already used assistance years ago; detection is economically beaten; and process
surveillance has hard legal limits for EU workers. Integrity defenses that work are economic and account-level,
not per-item forensics.""",
        [RG("AQ-01", "Roughly a third of crowdworkers used assistance on an advantaged task - a floor that rises."),
         RG("AQ-02", "An autonomous agent passed 99.8 percent of standard checks at about five cents a task - content detection is a lost race."),
         RG("AQ-08", "Worker-level statistical auditing exists without per-item detection - the defensible instrument if provenance matters."),
         RG("CG-10", "Monitoring is allowlist-bounded for EU workers; no off-task collection.")],
        "A buyer contract that pays for verified human-only process - then the gate is economic and account-level, per project.",
        "Open - owner call. Reversibility: high."))

    at("decisions.html", "d4", "Decisions - judge sourcing")
    parts.append(dec("d4",
        "D4. Build judge models, or rent them?",
        "rent both tiers - frontier models for verdicts, commodity checkers for screening - and revisit owning the screening tier only at measured volume.",
        """Reasoning-tier models have led on checkable judging every time it has been measured, and the screening
tier is already a commodity. The training data an owned judge would need does not exist until the pilot creates
it.""",
        [RG("AJ-01", "Frontier reasoning models dominated trained judges on verifiable tasks (2024-era ranking; direction has held, magnitudes get re-measured)."),
         RG("GF-01", "Small specialist checkers landed within a few points of frontier models at about one percent of the cost - screening is commoditized (older-generation pricing; re-price at bakeoff)."),
         RG("GF-02", "The best measured grounding setup is a frontier judge anchored with human-annotated examples - rented capability plus our data."),
         RG("IP-08", "Vendor cost arithmetic: judge review at dollars per ten thousand items versus expert review at hundreds per five hundred - routing is the economic lever.")],
        "Screening volume crossing the fine-tune breakeven at the bakeoff's measured prices, plus adjudicated data sufficient to train on.",
        "Open - owner call. Reversibility: high - tiers are swappable by design."))

    at("decisions.html", "d5", "Decisions - where it runs and which law binds")
    parts.append(dec("d5",
        "D5. Where does the pilot run, and which legal floors bind?",
        "census the workforce both ways before choosing - EU-resident exposure and US jurisdiction exposure - and put counsel on both questions before any consequence attaches.",
        """The project choice is silently a legal-posture choice. EU-resident workers bring the platform-work floor
(human decisions on detriment, explanations, appeal deadlines, monitoring limits) from December 2026. US workers
in enacted jurisdictions bring bias-audit and notice duties for automated employment decision tools, and
validation duties where adverse impact appears. Neither is a preference; both are facts to look up per project.""",
        [RG("CG-09", "The directive covers online-performed platform work; the worker's location decides, not the platform's."),
         RG("CG-07", "Human decision on significant detriment, no consent exception, from the 2026 transposition."),
         RG("CG-08", "Plain-language explanation, a human contact, and substantiated review on a deadline - our evidence dossier is designed to be that explanation."),
         RG("DA-01", "NYC Local Law 144: independent bias audit and notice, enforced since July 2023."),
         RG("DA-02", "The Uniform Guidelines: validation evidence where selection procedures show adverse impact."),
         RG("CG-12", "ISO/IEC 5259 gives the neutral vocabulary buyers are converging on - map to it now, cheaply.")],
        "The census results and counsel's answer on the single-item pay-denial question (C5).",
        "Open - owner call plus counsel, both jurisdictions. Reversibility: low once live. Depends on: A2, D1, C5."))

    at("decisions.html", "d6", "Decisions - the throughput dial")
    parts.append(dec("d6",
        "D6. When deadlines demand leniency, what moves?",
        "thresholds move; measurement never does - and every delivered batch carries its operating profile and estimated residual error, disclosed to the buyer.",
        """Telling the judge to be lenient corrupts the instrument invisibly - consequence framing measurably shifts
verdicts with no trace in the reasoning. Applying leniency downstream, over unchanged measurements, keeps every
batch re-filterable later and turns deadline pressure into a priced, contractual fact instead of hidden
degradation.""",
        [RG("F26-03", "Consequence framing shifted judge verdicts with zero trace in the stated reasoning - the instrument must be kept sterile."),
         RG("F26-09", "Corrected pass-rate reporting under an imperfect judge is a solved statistical problem - the stamp is computable."),
         RG("HS-08", "Plug-in corrected estimators exist exactly for reporting rates measured through a noisy judge."),
         RG("CG-12", "Disclosure aligns with where buyer-side data-quality contracting is going.")],
        "Nothing on the mechanism. Whether to disclose the stamped estimate is the one genuinely commercial call here, and it is flagged as such rather than dressed up as a technical conclusion.",
        "Open - owner call. Reversibility: high - disclosure can begin with the first stamped batch."))

    at("decisions.html", "defaults", "Decisions - standing defaults")
    parts.append("""
<h2 id="defaults">Section C - defaults adopted, with the test that retires each</h2>
<p>Positions the evidence does not settle, adopted explicitly so work can proceed - each with its falsifier
named. This is what operating honestly in new territory looks like: not certainty, but owned choices with exit
conditions.</p>
""")

    at("decisions.html", "c1", "Decisions - default: entailment standard")
    parts.append(dec("c1",
        "C1. How strict is \"supported by the evidence\"?",
        "reasonable-expert support, three-way verdicts; only contradicted auto-triggers a fail; unsupported triggers an evidence request, not a penalty.",
        "Strict logical entailment fails nearly all competent human prose; loose support re-imports the variance being removed. There is no theoretically privileged point - so the point is chosen, and its cost is measured " + R("GF-05") + " " + R("GF-07") + ".",
        [],
        "The ship gate measures the false-flag rate under this standard per project; if it exceeds the project's error prices, the standard tightens per lane - a measured output, not an assumption.",
        "Default adopted - reversible per lane."))

    at("decisions.html", "c2", "Decisions - default: re-solving routing")
    parts.append(dec("c2",
        "C2. Do we hard-gate checks the judge cannot itself solve?",
        "route by checkability, but treat the quantified collapse as provisional until we replicate it - it rests on one study still under review.",
        "The reported effect is dramatic - reference-checking collapsing when the task exceeds the judge's own ability " + R("F26-01") + " - and the mechanism is plausible, but a single unreviewed study does not hard-gate an architecture.",
        [],
        "E3 includes an internal replication on our workload. If it fails to replicate, the hard gate is dropped; the routing surface stays.",
        "Default adopted - provisional, and said out loud."))

    at("decisions.html", "c3", "Decisions - default: who sees what")
    parts.append(dec("c3",
        "C3. What do escalated humans and workers each see?",
        "adjudicators see evidence only, never the machine's verdict; workers get the full grounded explanation. The combination is untested as a pair - so it is A/B tested, not assumed.",
        "Each half is separately supported - verdict-visible review anchors adjudicators " + R("CM-03") + ", and full explanations move workers " + R("CM-05") + " - but no study has tested the split together.",
        [],
        "E6 randomizes the formats directly.",
        "Default adopted - reversible."))

    at("decisions.html", "c4", "Decisions - default: statistics staging")
    parts.append(dec("c4",
        "C4. How much statistical machinery at launch?",
        "chance-corrected agreement, corrected population estimates, and entropy-based routing at version one; full psychometric enrollment and always-valid drift statistics as phase two.",
        "The version-one floor is already sound - corrected estimates stay valid under a bad judge " + R("HS-01") + " and raw percent agreement is banned from day one " + R("AQ-06") + ". The heavier machinery has precedent " + R("CG-06") + " and activates when volume makes it estimable.",
        [],
        "Nothing - this is sequencing, not selection.",
        "Default adopted - staging."))

    at("decisions.html", "c5", "Decisions - default: the pay-denial question")
    parts.append(dec("c5",
        "C5. Is a single-item pay denial a \"significant detriment\" in the EU sense?",
        "treat it as one until counsel says otherwise - consequential item fails route through the human lane for EU workers.",
        "The boundary is legally untested, and enforcement in this area is active " + R("CG-07") + " " + R("CG-11") + ". Guessing wrong is expensive; the conservative reading costs little.",
        [],
        "A counsel opinion or the national transposition texts, due December 2026. This is the one default that law, not measurement, will flip.",
        "Default adopted - conservative. Depends on: D5."))

    at("decisions.html", "experiments", "Decisions - the experiments")
    parts.append("""
<h2 id="experiments">Section D - the experiments that settle the open questions</h2>
<p>Ordered so that each result funds or kills a component. Sequencing note, recommendation only: the single
highest-information measurement available is a stripped version of E2 - a seeded praise-and-planted-defect set
scored by the deployment-tier models - which can run first, in parallel with the baseline, and prices the moat
and the enforcement timeline before any apparatus exists. Nothing operational is authorized by this note;
foundation before implementation stands.</p>
<table>
<thead><tr><th>Experiment</th><th>What it measures</th><th>What it settles</th></tr></thead>
<tbody>
<tr id="e1"><td>E1 - Reviewer baseline</td><td>Dual review plus disagreement coding on one project</td>
<td>Calibrates A1; funds A3; closes the reliability-floor gap %s</td></tr>
<tr id="e2"><td>E2 - Seeded praise and defects</td><td>Judge precision and recall per praise type; absence
recall behind clean writeups - planted in records of realistic length and structure, never short synthetic
items, so the number measured is the number deployed</td><td>Prices D1's consequences; closes the moat
question %s %s</td></tr>
<tr id="e3"><td>E3 - Transfer check</td><td>Compiled judge against adjudicated labels on human writeups;
includes the re-solving replication</td><td>Tests C2; closes the transfer gap %s; gates every borrowed
number</td></tr>
<tr id="e4"><td>E4 - Confidence shootout</td><td>Which uncertainty signal predicts human overturns</td>
<td>Picks the routing statistic behind A4 %s</td></tr>
<tr id="e5"><td>E5 - Divergence sensor dry run</td><td>Held-out gold tracking from the first live week</td>
<td>Arms the gaming alarm behind A5 and D6 %s</td></tr>
<tr id="e6"><td>E6 - Feedback trial</td><td>Verdict-only versus full explanation; repeat-error rates;
the C3 format split</td><td>Decides whether feedback is an instrument or decoration %s</td></tr>
<tr id="e7"><td>E7 - Second project through config alone</td><td>Onboarding without touching core prompts</td>
<td>Tests the project-agnostic claim itself</td></tr>
</tbody>
</table>
""" % (G("gap-07"), G("gap-01"), G("gap-03"), G("gap-02"), G("gap-06"), G("gap-04"), G("gap-05")))

    at("decisions.html", "invariants", "Decisions - settled constraints")
    parts.append("""
<h2 id="invariants">Section E - settled constraints, so meetings do not re-litigate them</h2>
<ul>
<li>No raw percent-agreement in any report - corrected statistics only %s %s.</li>
<li>Judge prompts never mention stakes or leniency; the dial moves thresholds downstream %s.</li>
<li>No person is ever scored on agreement with the machine or the consensus %s.</li>
<li>Absence claims cap at "not contradicted" until planted-defect recall is measured %s.</li>
<li>Spam defense is economics and provenance, never content detection %s.</li>
<li>Calibration data comes only from adjudicated or owner-signed artifacts, never from raw override streams %s.</li>
<li>The bar workers are judged against never moves silently or retroactively - simultaneously the trust posture,
the legal posture, and the anti-gaming posture.</li>
</ul>
<p>These trace to <a href="KERNEL.md">the kernel</a>; disputes about them are resolved there, not re-argued
per meeting.</p>
""" % (R("AJ-03"), R("AQ-06"), R("F26-03"), R("CG-16"), R("CM-06"), R("AQ-02"), R("AQ-10")))

    write_page("decisions.html", "Decisions", "The decision register: each open call with its options, graded evidence, recommendation, and the measurement that would change it.", "decisions", "".join(parts))


def emit_decision_record():
    from site_common import SITE, USAGE

    def ev_ids(anchor):
        return sorted(cid for cid, uses in USAGE.items()
                      if any(u["anchor"] == anchor and u["page"] == "decisions.html" for u in uses))

    record = {
        "record_version": "1.2.0",
        "date": "2026-07-15",
        "status": "proposed - pending leadership sign-off (A1-A5) and owner calls (D1-D6)",
        "register_page": "decisions.html",
        "evidence_page": "evidence.html",
        "kernel": {
            "path": "KERNEL.md", "version": "0.3.1",
            "standing_rule": "Permanent constraints shape the design; capability numbers only fill measured, re-measurable slots, re-derived every model generation. Dated evidence sets no threshold in either direction.",
        },
        "recommendation": {
            "authorization_to_learn": "GO - one-project measurement pilot: baseline, contract compilation, adjudicated gold, deployment-tier bakeoff, shadow scoring, human-loop experiment",
            "authorization_to_act": "NO - no autonomous enforcement below calibrated level B; decisions of significant detriment are taken by a human everywhere",
        },
        "capability_currency": {
            "deployment_tier": "Claude Fable / Opus 4.8 class; GPT-5.5 / 5.6 class",
            "published_deployment_tier_measurements_on_this_task": 0,
            "grade_distribution": S.get("decision_grades", {}),
        },
        "valid_outcomes": ["stop", "narrow", "assisted_only", "selective_graduation"],
        "graduation_rule": "For every critical error class, the one-sided 95 percent upper confidence bound must be below its approved ceiling on an untouched, adjudicated test set; ceilings, minimum effective sample, multiplicity treatment, and stop rules are locked before the test is opened.",
        "sequencing_note": "Recommendation only: a stripped E2 probe (seeded praise and planted defects, scored by deployment-tier models) runs first, in parallel with the baseline. Nothing operational is authorized by this note.",
        "legal_gate": "Two-sided workforce census (EU platform-work scope; US AEDT and selection-procedure exposure) with counsel on both before any consequence attaches.",
        "authorizations": [{"id": a, "title": t, "status": "needs leadership sign-off", "evidence_ids": ev_ids(a)} for a, t in [
            ("a1", "Approve the standard: instruction satisfaction grounded in evidence"),
            ("a2", "Choose the project and fund its adjudicated gold set"),
            ("a3", "Measure the reviewer baseline first"),
            ("a4", "Authority boundaries: measurement broadly, enforcement narrowly and earned"),
            ("a5", "The audit channel is a fixture, not a phase")]],
        "open_decisions": [{"id": d, "title": t, "recommended": r, "evidence_ids": ev_ids(d)} for d, t, r in [
            ("d1", "Enforcement weight at launch", "advisory first; consequences per lane after seeded error rates exist"),
            ("d2", "Rubric authority", "rubric as law with fast versioned amendment"),
            ("d3", "AI-assistance policy", "content validity by default; per-project override"),
            ("d4", "Judge sourcing", "rent both tiers; revisit at measured volume"),
            ("d5", "Pilot locale and legal floors", "two-sided census plus counsel before consequences"),
            ("d6", "The throughput dial", "thresholds move, measurement never; stamped batches, disclosed")]],
        "standing_defaults": [{"id": c, "title": t, "falsifier": f} for c, t, f in [
            ("c1", "Reasonable-expert support, three-way verdicts", "measured false-flag rate vs project error prices"),
            ("c2", "Checkability routing; quantified collapse held provisional", "E3 internal replication"),
            ("c3", "Evidence-only to adjudicators; full explanations to workers", "E6 A/B"),
            ("c4", "Statistics staged: corrected estimates at v1, psychometrics at phase 2", "sequencing, not selection"),
            ("c5", "Single-item pay denial treated as significant detriment", "counsel opinion or transposition texts, due 2026-12")]],
        "never_authorized": [
            "silent or retroactive changes to the bar workers are judged against",
            "calibration from unadjudicated override streams",
            "scoring any person on agreement with the machine or consensus",
            "stakes or leniency language in judge prompts",
            "raw percent-agreement in reporting",
            "verified labels on absence claims without seeded-recall evidence",
        ],
    }
    out = SITE / "assets" / "decision-record.json"
    out.write_text(json.dumps(record, indent=2, ensure_ascii=True), encoding="utf-8")
    print("decision-record.json written (v1.2.0)")
