What does Utility, Truth and the Dual Ledger conclude, in numbers, about “Field Tools and Checker Specifications: the Dual-Ledger Records, Red-Flag Rules and a Pre-Registered Test”?

Answer: Chapter 8 gives field tools and checker specifications, ledger fields and a pre-registered test. Marked boxes separate published evidence, runnable calculations (22 programs), classical sources and the author's hypotheses.

Scope of the numbers: Its parameters and data are illustrative or synthetic, and every calculation is generated by its programs. The book is not medical advice, offers no clinical psychological service, is not personal investment advice and makes no promise of returns; functional beliefs are for one's own action frame and never for deceiving others.

中文版

Data table

The numbers below are printed verbatim by the chapter's Python program and can be reproduced by running it. standard-library Python only

history 60, calibration gap +0.0850, Brier 0.2165, ledger AMBER
idp_calKelly capstake/capruingraderules
D10.5150.19170.100.0000GREEN-
D20.6150.35830.080.0000REDR1
D30.4650.19750.100.0000REDR4
D40.5350.07003.570.4136REDR2 R5
D50.4950.15830.190.0000REDR3
D60.4150.12250.410.0025AMBERR3
D70.5750.29170.550.0114AMBERR2 R5
D80.5350.22500.090.0000GREEN-
Show the full program
# Chapter 8. p81: the dual-ledger and hard-boundary checker, demo run
# Same core as distill/tool.py; its no-argument demo prints these lines.
# History: 60 resolved forecasts from a synthetic ledger that states
# probabilities 0.06 above what happens (fixed seed). Calibration gap =
# mean stated minus observed frequency; Brier score of the history.
# Each open decision is checked:
#   R1 frame rewrote the ledger: p raised over p_before, no new evidence
#   R2 stake against the Kelly cap on the CALIBRATED p (p minus the gap)
#   R3 a hard boundary broken (feasibility, runway, single loss) while
#      the decision is marked to execute; on hold it is only flagged
#   R4 a forecast with no due date
#   R5 ruin chance of repeating the stake with the calibrated p: the
#      chance that wealth hits 0.2 of its start before it doubles, by
#      the drift-diffusion barrier formula on log wealth
# Grades: RED if any red rule fires, else AMBER if any amber, else GREEN.
import math
import random

GAP_AMBER, RUIN_RED, RUIN_AMBER, FLOOR = 0.05, 0.05, 0.01, 0.2
DEMO = [  # id, p_before, p, evidence, due, stake, odds,
    # feasible, runway, min_runway, loss_share, loss_cap, execute
    ("D1", 0.60, 0.60, 0, 30, 0.02, 1.5, 1, 240, 90, 0.02, 0.10, 1),
    ("D2", 0.45, 0.70, 0, 45, 0.03, 1.5, 1, 240, 90, 0.03, 0.10, 1),
    ("D3", 0.55, 0.55, 0, 0, 0.02, 2.0, 1, 240, 90, 0.02, 0.10, 1),
    ("D4", 0.62, 0.62, 0, 60, 0.25, 1.0, 1, 240, 90, 0.25, 0.30, 1),
    ("D5", 0.58, 0.58, 0, 30, 0.03, 1.5, 1, 60, 90, 0.03, 0.10, 1),
    ("D6", 0.50, 0.50, 0, 90, 0.05, 2.0, 0, 240, 90, 0.05, 0.10, 0),
    ("D7", 0.66, 0.66, 0, 30, 0.16, 1.5, 1, 240, 90, 0.16, 0.20, 1),
    ("D8", 0.50, 0.62, 1, 30, 0.02, 1.5, 1, 240, 90, 0.02, 0.10, 1),
]


def demo_history():
    rng = random.Random(42781)
    hist = []
    for _ in range(60):
        p = rng.choice((0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9))
        hist.append((p, 1 if rng.random() < p - 0.06 else 0))
    return hist


def calibration(hist):
    gap = (math.fsum(p for p, _ in hist)
           - len([1 for _, o in hist if o])) / len(hist)
    brier = math.fsum((p - o) ** 2 for p, o in hist) / len(hist)
    return gap, brier


def kelly(p, odds):
    return max(0.0, (p * (odds + 1) - 1) / odds)


def ruin(p, stake, odds):
    up, down = math.log(1 + odds * stake), math.log(1 - stake)
    mu = p * up + (1 - p) * down
    var = p * (1 - p) * (up - down) ** 2
    lo, hi = math.log(FLOOR), math.log(2.0)
    if abs(mu) < 1e-12:
        return hi / (hi - lo)
    th = 2 * mu / var
    return (1 - math.exp(-th * hi)) / (math.exp(-th * lo)
                                       - math.exp(-th * hi))


def check(d, gap):
    (did, p0, p, ev, due, stake, odds, feas, run, minrun,
     loss, cap, exe) = d
    red, amber = [], []
    if p > p0 and not ev:
        red.append("R1")
    pc = min(0.99, max(0.01, p - gap))
    k = kelly(pc, odds)
    ratio = stake / k if k > 0 else float("inf")
    if ratio > 1:
        red.append("R2")
    elif ratio > 0.5:
        amber.append("R2")
    bound = (not feas) or run < minrun or loss > cap
    if bound and exe:
        red.append("R3")
    elif bound:
        amber.append("R3")
    if due <= 0:
        red.append("R4")
    r = ruin(pc, stake, odds)
    if r > RUIN_RED:
        red.append("R5")
    elif r > RUIN_AMBER:
        amber.append("R5")
    grade = "RED" if red else ("AMBER" if amber else "GREEN")
    return did, pc, k, ratio, r, grade, red + amber


def report(decisions, hist):
    gap, brier = calibration(hist)
    lines = ["history %d, calibration gap %+.4f, Brier %.4f, ledger %s" % (
        len(hist), gap, brier, "AMBER" if abs(gap) > GAP_AMBER else "GREEN")]
    lines.append("id   p_cal  Kelly cap  stake/cap  ruin    grade  rules")
    for d in decisions:
        did, pc, k, ratio, r, grade, rules = check(d, gap)
        lines.append("%-3s  %5.3f  %9.4f  %9.2f  %6.4f  %-5s  %s" % (
            did, pc, k, min(ratio, 99.99), r, grade,
            " ".join(rules) or "-"))
    return lines


for line in report(DEMO, demo_history()):
    print(line)

Single source and citation

Fan, Y. (2026). When Utility Outperforms Literal Truth: Evolutionary Fitness-Payoff Games, Functional Belief Engineering and Physical Guardrails (Version 1.0.0), Chapter 8: Field Tools and Checker Specifications: the Dual-Ledger Records, Red-Flag Rules and a Pre-Registered Test. 5D Library. DOI pending

DOI pending · monograph page goes live after publication · 5DL-B-427 · v1.0.0 · CC-BY-NC-ND-4.0

BibTeX
@book{fan2026427,
  author    = {Fan, Yafu},
  title     = {When Utility Outperforms Literal Truth: Evolutionary Fitness-Payoff Games, Functional Belief Engineering and Physical Guardrails},
  year      = {2026},
  publisher = {5D Library},
  edition   = {1.0.0},
  note      = {DOI pending}
}

Other chapter answers in this book