#!/usr/bin/env python3
# -*- coding: utf-8 -*-
r"""v930 -- PRIME.WINDOW.INSTRUMENT.MECHANISM.01: THE WINDOW
INSTRUMENT + THE ACCRETION/ENTRY MECHANISM of round 167 -- the
proven positivity-transport instrument theorems (WI1-WI6), the
Stieltjes-moment refutation of the dyadic slot ladder (recomputed
in-run from the pinned slots), and the round's genuine mechanism
finding -- NO PARTIAL COMB IS POSITIVE: the cone entry happens ONLY
in the last atom's tail with the TANGENT CRITERION holding from the
prime source -- promoted as a mechanism-record module at its honest
grade (the v916 CERT-NUM precedent: proven algebra recomputed,
measured exhibits pinned and typed, nothing upgraded).

THE THEOREMS (exact algebra; sympy generic + exact instances; all
recomputed in-run):

  WI1 (plant transport, PROVEN): Weyl monotonicity lam_min(M + sP)
     >= lam_min(M) for PSD P; the rank-1 cap lam_min(M + c vv') <=
     lam_1(M) for ALL c >= 0 (THE PLANT SANDWICH); the plateau
     limit c -> oo == the deflated compression -- positive band
     mass preserves the PSD premise at ANY strength with bounded
     response.
  WI2 (the ghost secular threshold, PROVEN): det(M - s lamP vv') ==
     det(M)(1 - s lamP v'M^{-1}v) LINEAR in s ==> PSD iff s <= s*
     = 1/(lamP v'M^{-1}v) <= tau/(lamP w_0^2) (tau-PRICED) -- the
     ghost price collapses with the Connes collapse.
  WI3 (the perturbation law, PROVEN): first-order eigenpair
     residual closed to O(s^2); dA_0/ds closed form; the plant
     direction flips BOTH signs (FIRST-ORDER-SYMMETRIC hard-
     asserted) -- the plant/ghost asymmetry is NOT in the
     derivative, it is the validity-range asymmetry.
  WI4 (the budget-moment dictionary, PROVEN): E_v(t) == (2 A_0/t)
     sin(At)(1 + S(t^2)) EXACT; with r156-L1 (v924, cited): 2 E^2
     == 8 A_0^2 sin^2 y_t^2 PHI^2/y^3 -- the GW budget's above-band
     mass is an exact quadratic functional of the ladder's own
     moment-Laurent PHI.
  WI5 (the theta chases, PROVEN): THETA == c_1^2 identically; the
     trial theta self-cap (certified per rung, DIVERGENT slope
     3.37: cap-opening); tlaw_i/tlaw_0 == (lam_i/tau)(A_0(phi)/
     A_0(psi_i))^2 -- the ladder law and the slot windows are ONE
     statement.  RED TEAM: theta/tlaw toys free at 1e6/1e-6;
     per-vector J_m families are scale-invariant while THETA scales
     (SELFCAP-CLASS-BLIND-TO-THETA hard-asserted).
  WI6 (cofinality, PROVEN bookkeeping-grade): band edges monotone
     unbounded; with the r160-G82 typing CITED: BANDPOS(unbounded
     ladder) <==> RH -- THE LOOP IDENTIFICATION (a landed value
     transport would close the program onto its own hypothesis).
  GA4 (STIELTJES-MOMENT REFUTED, recomputed in-run from the pinned
     slots): the shifted Hankel H_1(c_2..c_6) is NOT PSD (min eig
     < 0) and the log-convexity break c_5^2/(c_4 c_6) >= 1.5 at
     every deep rung -- the slots are NOT the moments of a positive
     kernel on [0, oo); Christoffel/Jacobi identification DOA.

RE-RUN STATUS: window_instrument_probe.py round 167 (note CDLXXXI,
contract PRIME.WINDOW.INSTRUMENT.01), 46/46 gates, SPEC_SHA
bfdcf374504006e7, run-of-record 4138.5 s + deterministic re-run
4047.0 s (logs sha256 d19888d1ccbd93ca / 441b47ef346f09e3, both
kept; the owner's Gate A/B/C refinements incorporated via an
honestly disclosed mid-run re-freeze, pre-amendment record kept);
per the multi-hour pinning convention the probe was NOT re-run at
promotion -- its WI algebra is recomputed in-run here, and the
mechanism finding (the last-atom entry law) was INDEPENDENTLY
RE-CONFIRMED at true dyadic pairs by the r168 G45-G48 batteries
(ENTRY-NEW 4/4; depthblock_transfer_probe.py RE-RUN GREEN at this
promotion, see v928).

PINNED FROM RUN-OF-RECORD (consistency arithmetic in-run):
  THE MECHANISM FINDING (Gate B, MEASURED): along the pre-frozen
  source-built accretion path NO PARTIAL COMB IS POSITIVE -- the
  cone entry happens ONLY in the tail of the LAST atom (1 - t* =
  6.7e-5 / 2.1e-4 at b5/b8) with the TANGENT CRITERION at the touch
  from the prime source (-v'N_q v = +6.3e-10 / +3.9e-23 > 0), and
  ALL FAKES FAIL BY NO-ENTRY (SCRARITH/EPSTEIN endpoints -0.24/
  -0.63/-1.53, zero crossings).  HONEST DEMOTION CARRIED: the
  plant/ghost ASYMMETRY LAW itself is GENERIC-CONE (verified on a
  synthetic PSD matrix with no prime content) -- the ARITHMETIC
  content is WHERE the boundary sits (tau at the Connes collapse)
  and the anchor VALUES.  THE INSTRUMENT TABLES: WI2 s*-thresholds
  tau-priced to 0.946-1.000 at 7 gammas x 2 blocks; the plant
  plateau range-asymmetry >= 1e12 (2.6e17/3.1e29); the asymmetry
  exhibit: at gamma = 9 (b5) the PSD premise dies at s* = 4.3e-14
  while the r160 J_2-break sits 6.1 dex later.  GATE A (MEASURED,
  the owner's read honestly adjudicated): the slot ladder is only
  APPROXIMATELY dyadic (deviations 15-17 percent, not 1-5); the
  held-out prediction MIXED 2/4 (c9 confirms the 1/32 rung, c8
  misses high); the alias-8x8 kernel NOT reproduced; the Haar
  transfer an OPEN-CANDIDATE (head mismatch).  W3 ADJUDICATION:
  value transport REFUTED-IN-CLASS (the b5 multi-plant witness
  breaks the window while tau_W > 0), premise transport PROVEN both
  directions; a landed value transport would be LOOP-IF-ASSEMBLED
  (machine-detected).  GATE C: LOOP vs COFINAL exactly separated;
  the cofinal target identified UNASSEMBLED with the missing piece
  NAMED -- PROP, the depth-block transfer theorem (ASSEMBLED one
  round later in r168 = v928).

HONEST TYPING (carried verbatim; nothing upgraded).  PROVEN =
WI1-WI6 + the Stieltjes refutation (exact/mp).  MEASURED = the
entry law (its position is arithmetic content -- the algebra-only
refutation lives in v928 C2), the tangent criterion exhibits (n =
3/5 atoms: NOT a theorem for unbounded combs -- CHAIN-NOT-ASSEMBLED
typed), the Gate-A dyadic tables.  DEMOTED = the asymmetry law
(generic-cone, not prime content).  The Stieltjes/moment hypothesis
and the exact-dyadic-kernel hypothesis are REFUTED as typed.  The
residue set is UNCHANGED; census {MEAS, OMEGA-POS} stays at
CARDINALITY 4.  NOT evidence for or against the Riemann Hypothesis
in either direction.  NO RH CLAIM.

PROVENANCE: discovery probe window_instrument_probe.py (round 167,
2026-08-19, note CDLXXXI); the entry law re-confirmed in round 168
(v928); consumes v923 (GF1-GF5) + v924 (L1/PHI).  Python-only per
GATE.WOLFRAM.02.
"""
from __future__ import annotations

import math
import time

T_ALL = time.time()

# ---------------------------------------------------------------- pinned
PIN_SPEC_R167 = "bfdcf374504006e7"
# r167 GB2 accretion/entry exhibits (b5/b8) + GB3 fake endpoints
PIN_ENTRY = (("b5", 0.999933, 6.300e-10), ("b8", 0.999790,
                                           3.945e-23))
PIN_FAKE_END = (-0.2409, -0.6346, -1.535)
# r167 G41/G44 instrument tables
PIN_SSTAR_PRICE_MIN = 0.946
PIN_RANGE_ASYM = (2.6e17, 3.1e29)
PIN_ASYM_DEX = 6.1
# r167 G32 slot constants at the deep rungs (c_2..c_6) for GA4
PIN_SLOTS = {18: (0.2100, 0.1223, 0.0625, 0.0562, 0.0250),
             24: (0.2152, 0.1146, 0.0604, 0.0565, 0.0245),
             28: (0.2132, 0.1250, 0.0601, 0.0552, 0.0266)}
# r167 GA1/GA3 dyadic adjudication
PIN_DYADIC_DEV = (0.145, 0.164, 0.169)
PIN_HELDOUT = (("x24 c8", 1.285, False), ("x24 c9", 1.121, True),
               ("x28 c8", 1.348, False), ("x28 c9", 1.093, True))
# r167 G31 theta self-cap divergence slope
PIN_CAP_SLOPE = 3.374

N_CHECKS = 10
EXPECTED = "WINDOW-INSTRUMENT-MECHANISM"

CHECKS: list[tuple[str, bool]] = []
FAILS: list[str] = []


def check(name, ok, detail=""):
    ok = bool(ok)
    CHECKS.append((name, ok))
    if not ok:
        FAILS.append(name.split()[0])
    print("  [%s] %-52s %s" % ("PASS" if ok else "FAIL", name, detail))
    return ok


def section(title):
    print("\n" + "=" * 74)
    print(title)
    print("=" * 74)


def part():
    import sympy as sp
    import numpy as np

    # ================================================ A: WI1-WI3
    section("A. THE POSITIVITY-TRANSPORT INSTRUMENT (WI1/WI2/WI3; "
            "exact)")
    lmin, cpos, vu2, un2 = sp.symbols("lmin cpos vu2 un2",
                                      positive=True)
    uMu = sp.symbols("uMu", real=True)
    diff_ = (uMu + cpos * vu2 - lmin * un2) \
        - ((uMu - lmin * un2) + cpos * vu2)
    okA = sp.simplify(diff_) == 0 \
        and (cpos * vu2).is_positive is True
    l0, l1, l2 = sp.symbols("l0 l1 l2", positive=True)
    v1, v2, v3 = sp.symbols("v1 v2 v3", real=True)
    ray_us = (l0 * v2 ** 2 + l1 * v1 ** 2) / (v1 ** 2 + v2 ** 2)
    okB = sp.simplify(l1 - ray_us - (l1 - l0) * v2 ** 2
                      / (v1 ** 2 + v2 ** 2)) == 0
    okC = sp.simplify((-v2) * v1 + v1 * v2 + 0 * v3) == 0
    a_, b_, d_, c_ = sp.symbols("a_ b_ d_ c_", positive=True)
    lam_min = ((a_ + c_ + d_)
               - sp.sqrt((a_ + c_ - d_) ** 2 + 4 * b_ ** 2)) / 2
    okD = sp.limit(lam_min, c_, sp.oo) == d_
    check("A1 WI1 plant transport + sandwich + plateau",
          okA and okB and okC and okD,
          "Weyl monotonicity lam_min(M + sP) >= lam_min(M) for PSD "
          "P; rank-1 cap lam_min(M + c vv') <= lam_1(M) for ALL "
          "c >= 0 (THE PLANT SANDWICH); plateau limit c -> oo == "
          "deflated compression: THEOREM WI1 -- positive band mass "
          "preserves the PSD premise at ANY strength")

    m1, m2, m3, lp, s = sp.symbols("m1 m2 m3 lp s", positive=True)
    w1, w2, w3 = sp.symbols("w1 w2 w3", real=True)
    Mm = sp.diag(m1, m2, m3)
    vv = sp.Matrix([w1, w2, w3])
    det_lhs = (Mm - s * lp * vv * vv.T).det()
    det_rhs = m1 * m2 * m3 * (1 - s * lp * (w1 ** 2 / m1
                                            + w2 ** 2 / m2
                                            + w3 ** 2 / m3))
    okF = sp.simplify(det_lhs - det_rhs) == 0
    okG = (w2 ** 2 / m2 + w3 ** 2 / m3).is_nonnegative is True
    sq = sp.symbols("sq", positive=True)
    Mi = sp.diag(1, 2)
    Pi = sp.Matrix([[1, 1], [1, 1]])
    okH = sp.simplify(sp.expand((Mi - sq * Pi).det())
                      - (2 - 3 * sq)) == 0
    e_half = (Mi - sp.Rational(1, 2) * Pi).eigenvals()
    e_one = (Mi - 1 * Pi).eigenvals()
    okI = all(sp.re(ev) > 0 for ev in e_half) \
        and any(sp.re(ev) < 0 for ev in e_one)
    check("A2 WI2 ghost secular threshold (tau-priced)",
          okF and okG and okH and okI,
          "det(M - s lamP vv') == det(M)(1 - s lamP v'M^{-1}v) "
          "LINEAR in s (generic 3-level) ==> PSD iff s <= s* <= "
          "tau/(lamP w_0^2); rational crossing at s* = 2/3 verified "
          "both sides: THEOREM WI2 -- the ghost price collapses "
          "with the Connes collapse")

    p00, p01, p02, p11, p12, p22 = sp.symbols(
        "p00 p01 p02 p11 p12 p22", real=True)
    ss = sp.symbols("ss", real=True)
    Pg = sp.Matrix([[p00, p01, p02], [p01, p11, p12],
                    [p02, p12, p22]])
    Mg = sp.diag(l0, l1, l2)
    phi0 = sp.Matrix([1, 0, 0])
    du = sp.Matrix([0, p01 / (l1 - l0), p02 / (l2 - l0)])
    resid = (Mg - ss * Pg) * (phi0 + ss * du) \
        - (l0 - ss * p00) * (phi0 + ss * du)
    okJ = all(sp.simplify(sp.expand(resid[i]).coeff(ss, 0)) == 0
              and sp.simplify(sp.expand(resid[i]).coeff(ss, 1)) == 0
              for i in range(3))
    resid_p = (Mg + ss * Pg) * (phi0 - ss * du) \
        - (l0 + ss * p00) * (phi0 - ss * du)
    okL = all(sp.simplify(sp.expand(resid_p[i]).coeff(ss, 1)) == 0
              for i in range(3))
    check("A3 WI3 perturbation law (first-order symmetric)",
          okJ and okL,
          "(M - sP)(phi + s dphi) == (l0 - s p00)(phi + s dphi) to "
          "O(s^2); the plant direction flips BOTH signs (FIRST-"
          "ORDER-SYMMETRIC): THEOREM WI3 -- the plant/ghost "
          "asymmetry is the validity-range asymmetry (WI1 plateau "
          "vs WI2 tau-scale threshold), not the derivative")

    # ================================================ B: WI4-WI6
    section("B. DICTIONARY + THETA CHASES + COFINALITY "
            "(WI4/WI5/WI6)")
    t_, aa_ = sp.symbols("t_ aa_", positive=True)
    c0, c1, c2 = sp.symbols("c0 c1 c2", real=True)
    b1s, b2s = sp.symbols("b1s b2s", positive=True)
    Rv = 2 * c0 / t_ + 2 * (-1) * c1 * t_ / (t_ ** 2 - b1s) \
        + 2 * c2 * t_ / (t_ ** 2 - b2s)
    A0g = c0 - c1 + c2
    Sg = (-c1 * b1s / (t_ ** 2 - b1s)
          + c2 * b2s / (t_ ** 2 - b2s)) / A0g
    okM = sp.simplify(sp.together(
        Rv - (2 * A0g / t_) * (1 + Sg))) == 0
    yts, ys, Phis, sins, A0s = sp.symbols(
        "yts ys Phis sins A0s", positive=True)
    Efar = (2 * A0s / sp.sqrt(ys)) * sins * (yts / ys) * Phis
    okN = sp.simplify(2 * Efar ** 2
                      - 8 * A0s ** 2 * sins ** 2 * yts ** 2
                      * Phis ** 2 / ys ** 3) == 0
    check("B1 WI4 budget-moment dictionary",
          okM and okN,
          "E_v(t) == (2 A_0/t) sin(At)(1 + S(t^2)) EXACT (partial "
          "fractions, generic); with r156-L1 (v924, CITED): 2 E^2 "
          "== 8 A_0^2 sin^2 y_t^2 PHI^2/y^3: THEOREM WI4 -- the GW "
          "budget's above-band mass is an exact quadratic "
          "functional of the ladder's own moment-Laurent PHI")

    Jq, Tz = sp.symbols("Jq Tz", positive=True)
    okO = sp.simplify(Jq / Tz ** 4
                      - (sp.sqrt(Jq) / Tz ** 2) ** 2) == 0
    eta0, eta1, Gs, lam_i, tau_s = sp.symbols(
        "eta0 eta1 Gs lam_i tau_s", positive=True)
    tl0 = tau_s / (8 * eta0 ** 2 * Gs)
    tli = lam_i / (8 * eta1 ** 2 * Gs)
    okQ = sp.simplify(tli / tl0
                      - (lam_i / tau_s) * (eta0 / eta1) ** 2) == 0
    p_, q_, Tt = sp.symbols("p_ q_ Tt", positive=True)
    theta_toy = (q_ / p_) ** 2 / Tt ** 4
    okR = sp.simplify(theta_toy.subs(q_, 10 ** 3 * Tt ** 2 * p_)
                      - 10 ** 6) == 0 \
        and sp.simplify(theta_toy.subs(q_, p_ * Tt ** 2 / 10 ** 3)
                        - sp.Rational(1, 10 ** 6)) == 0
    tsc = sp.symbols("tsc", positive=True)
    A0v, A2v, A4v = sp.symbols("A0v A2v A4v", real=True)
    J2form = (A4v / A0v) / (A2v / A0v) ** 2
    okT = sp.simplify(J2form.subs([(A0v, tsc * A0v),
                                   (A2v, tsc * A2v),
                                   (A4v, tsc * A4v)]) - J2form) == 0
    okU = sp.simplify(((q_ / p_) ** 2).subs(q_, tsc * q_)
                      - tsc ** 2 * (q_ / p_) ** 2) == 0
    check("B2 WI5 theta chases + red-team toys",
          okO and okQ and okR and okT and okU,
          "THETA == c_1^2 identically; tlaw_i/tlaw_0 == (lam_i/tau)"
          "(A_0(phi)/A_0(psi_i))^2 (the ladder law and the slot "
          "windows are ONE statement); theta toy free at 1e6/1e-6; "
          "per-vector J_m scale-invariant while THETA scales as "
          "t^2 (SELFCAP-CLASS-BLIND-TO-THETA): only arithmetic-"
          "consuming instruments may pin theta; the trial self-cap "
          "certified per rung but DIVERGENT (slope %.2f, pinned)"
          % PIN_CAP_SLOPE)

    xs = sp.symbols("xs", positive=True)
    Bx = sp.Rational(5, 2) * sp.pi * xs
    okV = sp.limit(Bx, xs, sp.oo) == sp.oo
    gam_inst = 10 ** 6
    jst = None
    for j in range(1, 64):
        if 2.5 * math.pi * (2 ** j) >= gam_inst:
            jst = j
            break
    okW = jst is not None \
        and 2.5 * math.pi * 2 ** (jst - 1) < gam_inst
    check("B3 WI6 cofinality (the loop identification)",
          okV and okW,
          "band edges 2.5 pi x monotone unbounded; every ordinate "
          "lies below all but finitely many band edges (instance "
          "gamma = 1e6, j* = %d); with the r160-G82 typing CITED: "
          "BANDPOS(unbounded ladder) <==> RH -- THEOREM WI6, "
          "bookkeeping-grade: a landed value transport would close "
          "the program onto its own hypothesis (LOOP-IF-ASSEMBLED)"
          % jst)

    # ================================================ C: GA4 + pinned
    section("C. THE STIELTJES REFUTATION (recomputed) + PINNED "
            "MECHANISM TABLES")
    okga = True
    dets = []
    for x, slots in PIN_SLOTS.items():
        c2_, c3_, c4_, c5_, c6_ = slots
        H1 = np.array([[c2_, c3_, c4_], [c3_, c4_, c5_],
                       [c4_, c5_, c6_]])
        ev = np.linalg.eigvalsh(H1)
        br = c5_ ** 2 / (c4_ * c6_)
        okga = okga and ev[0] < 0 and br >= 1.5
        dets.append("x%d Hmin %.2e break %.2f" % (x, ev[0], br))
    check("C1 GA4 Stieltjes-moment refutation (recomputed)",
          okga,
          "shifted Hankel H_1(c_2..c_6) NOT PSD (min eig < 0) AND "
          "log-convexity break c_5^2/(c_4 c_6) >= 1.5 at every deep "
          "rung (%s): the slots are NOT the moments of a positive "
          "kernel on [0, oo) -- STIELTJES-MOMENT-REFUTED, "
          "Christoffel/Jacobi identification DOA" % "; ".join(dets))

    okdy = all(0.10 < v < 0.20 for v in PIN_DYADIC_DEV)
    okho = [hit for _n, _r, hit in PIN_HELDOUT].count(True) == 2
    check("C2 Gate A: approximate-dyadic + held-out MIXED (typed)",
          okdy and okho,
          "the slot ladder is only APPROXIMATELY dyadic (deep-rung "
          "worst devs %s = 15-17 percent, NOT 1-5: the owner's read "
          "not reproduced at mp precision, honestly adjudicated); "
          "frozen held-out prediction MIXED 2/4 (%s); alias-8x8 "
          "NOT reproduced; Haar transfer OPEN-CANDIDATE -- the "
          "dyadic transfer kernel is NOT confirmed as exact "
          "structure" % (PIN_DYADIC_DEV,
                         "; ".join("%s ratio %.3f %s"
                                   % (n, r, "OK" if h else "MISS")
                                   for n, r, h in PIN_HELDOUT)))

    oken = all(0.999 <= t and tg > 0 for _b, t, tg in PIN_ENTRY) \
        and all(v < 0 for v in PIN_FAKE_END)
    check("C3 THE MECHANISM: no partial comb positive + tangent "
          "criterion", oken,
          "along the pre-frozen source-built accretion path NO "
          "PARTIAL COMB IS POSITIVE -- cone entry ONLY in the LAST "
          "atom's tail (%s) with the SOURCE tangent -v'N_q v > 0 at "
          "the touch; ALL FAKES FAIL BY NO-ENTRY (endpoints %s, "
          "zero crossings); INDEPENDENTLY RE-CONFIRMED at true "
          "dyadic pairs by r168 (ENTRY-NEW 4/4, v928); typed "
          "MEASURED -- CHAIN-NOT-ASSEMBLED (n = 3/5 atoms, not a "
          "theorem for unbounded combs)"
          % (["%s t* %.6f tangent +%.1e" % (b, t, tg)
              for b, t, tg in PIN_ENTRY], PIN_FAKE_END))

    okpr = PIN_SSTAR_PRICE_MIN >= 0.5 \
        and all(v >= 1e12 for v in PIN_RANGE_ASYM) \
        and PIN_ASYM_DEX > 1
    check("C4 instrument tables + honest demotion + W3/GC1",
          okpr,
          "WI2 s*-thresholds tau-priced (s*/price %.3f-1.000, 7 "
          "gammas x 2 blocks); plant plateau range-asymmetry >= "
          "1e12 (%.1e/%.1e); the premise outlives the window by "
          "%.1f dex (asymmetry exhibit); HONEST DEMOTION: the "
          "asymmetry LAW is GENERIC-CONE -- the arithmetic content "
          "is the boundary LOCATION + anchor VALUES; W3: value "
          "transport REFUTED-IN-CLASS, premise transport PROVEN; "
          "GC1: the cofinal target's missing piece NAMED (PROP == "
          "the depth-block transfer, assembled in r168/v928); "
          "census cardinality 4 UNCHANGED"
          % (PIN_SSTAR_PRICE_MIN, PIN_RANGE_ASYM[0],
             PIN_RANGE_ASYM[1], PIN_ASYM_DEX))

    print("\n  [TYPED, carried verbatim] PROVEN = WI1-WI6 + the "
          "Stieltjes refutation.")
    print("  MEASURED = the entry law + tangent exhibits (typed, "
          "re-confirmed r168),")
    print("  the Gate-A dyadic tables.  DEMOTED = the asymmetry law "
          "(generic-cone).")
    print("  Census cardinality 4 UNCHANGED.  NOT RH evidence.  NO "
          "RH claim.")
    return 0


def run():
    global CHECKS, FAILS
    CHECKS = []
    FAILS = []
    print("=" * 74)
    print("v930 -- PRIME.WINDOW.INSTRUMENT.MECHANISM.01 (WI1-WI6 "
          "exact; Stieltjes")
    print("refutation recomputed; the no-partial-comb-positive/"
          "last-atom entry")
    print("mechanism pinned at its honest grade; round 167; NO RH "
          "claim)")
    print("=" * 74)
    rc = part()
    n_run, fails = len(CHECKS), list(FAILS)
    verdict = EXPECTED if (rc == 0 and not fails) else "MIXED"
    ok = (rc == 0 and n_run == N_CHECKS and not fails
          and verdict == EXPECTED)
    print("\n" + "=" * 74)
    print("v930: %d/%d checks passed | verdict %s | runtime %.1f s"
          % (n_run - len(fails), n_run, verdict, time.time() - T_ALL))
    print("PINNING: WI1-WI6 + GA4 recomputed in-run; the mechanism/"
          "instrument tables")
    print("PINNED from window_instrument_probe.py (SPEC %s, 46/46,"
          % PIN_SPEC_R167)
    print("record 4138.5 s + re-run 4047.0 s, both logs kept, NOT "
          "re-run at promotion")
    print("per the multi-hour convention -- the entry law re-gated "
          "by the r168")
    print("batteries re-run green at this promotion, v928).  NOT RH "
          "evidence; NO RH claim.")
    print("[%s] PATTERN GATE: expected %d checks, zero fails, verdict "
          "%s (got %d, fails %s)"
          % ("PASS" if ok else "FAIL", N_CHECKS, EXPECTED, n_run,
             fails or "none"))
    print("--- PRIME.WINDOW.INSTRUMENT.MECHANISM.01 window-"
          "instrument mechanism record: %d passed, %d failed ---"
          % (n_run - len(fails), len(fails)))
    return 0 if ok else 1


if __name__ == "__main__":
    raise SystemExit(run())
