Skip to main content

Tamper-evident, append-only forward pre-registration ledger for auditable, leakage-resistant research (the Forward-QPOP protocol).

Project description

forward-qpop

A tamper-evident, append-only forward pre-registration ledger for auditable, leakage-resistant research.

Register a hypothesis — a claim, dated evidence, measurable exit triggers, and a prior — before the evaluation window opens. Each entry is content-hashed over its frozen fields and chained to its predecessor, so the record proves what was predicted and that no entry was later edited, inserted, deleted, or reordered. Proving it was registered before an outcome (wall-clock time) needs an external anchor — see anchor / verify-anchor.

This is the domain-agnostic core of the Forward-QPOP protocol from the methods paper Forward-Registered, Auditable LLM-Assisted Research — useful for any pre-registered work (ML experiments, forecasts, studies), not only the finance testbed in the paper.

  • Zero dependencies — pure Python standard library.
  • entry_hash = sha256(content_hash ‖ prev_hash) — a real hash chain, not just a set of independently-hashed rows.
  • CI-friendlyforward-qpop verify ledger.jsonl exits non-zero on tampering.

Install

# from source (not yet on PyPI):
pip install "git+https://github.com/yixingz3/qpop"
# a PyPI release of `forward-qpop` is planned

Quickstart

from forward_qpop import Ledger

led = Ledger("ledger.jsonl")

# 1. Pre-register BEFORE the evaluation window:
led.register(
    "H-AI-01",
    claim="Method X reduces silent production-ML failures vs the ungated baseline.",
    mechanism="Deterministic gates reject low-evidence candidates before the expensive step.",
    prior=0.5,
    evidence=[{"summary": "pilot result", "tier": "primary", "date": "2026-06-24"}],
    exit_triggers=[{"id": "no_effect", "metric": "failure-rate delta", "op": "~0",
                    "data_source": {"tier": "primary"}}],
    fields={"domain": "ai-reliability"},   # any domain-specific payload, also hashed
)

# 2. Record belief updates as evidence arrives (tertiary-only is blocked by default):
led.update("H-AI-01", evidence=[{"summary": "replication", "tier": "secondary",
                                 "date": "2026-09-01"}])

# 3. Close with a pre-committed outcome (supported / weakened / falsified):
led.close("H-AI-01", "supported", observed={"failure_rate_delta": -0.31})

# 4. Verify integrity at any time:
res = led.verify()
print(res.ok, res.n_entries, res.problems)

CLI

forward-qpop verify ledger.jsonl          # exit 0 if intact, 1 (with details) if tampered
forward-qpop show   ledger.jsonl          # list entries
forward-qpop anchor ledger.jsonl          # manifest committing to the head (bind to a public commit / OpenTimestamps)
forward-qpop verify-anchor ledger.jsonl   # detect any drift since anchoring

Why forward, and why a chain

A backward test of an LLM-scored process is structurally invalid (the outcomes are already in the model's training data). Pre-registration replaces "fit the past" with "commit, then observe the future"; the hash chain makes that commitment auditable — an external reviewer can confirm that no past entry was silently changed. Proving the entry existed before its outcome additionally requires binding the ledger head to an external, publicly-dated record (a pushed Git commit, or OpenTimestamps) via anchor / verify-anchor.

License

MIT. Part of https://github.com/yixingz3/qpop.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

forward_qpop-0.1.1.tar.gz (22.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

forward_qpop-0.1.1-py3-none-any.whl (15.1 kB view details)

Uploaded Python 3

File details

Details for the file forward_qpop-0.1.1.tar.gz.

File metadata

  • Download URL: forward_qpop-0.1.1.tar.gz
  • Upload date:
  • Size: 22.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for forward_qpop-0.1.1.tar.gz
Algorithm Hash digest
SHA256 76a9a0acbc2d538c9f0c5f687aa0ebbbbd200929299b873e82b8cf2bad568a72
MD5 13b0b047ad407e37870ab29cb8d3150c
BLAKE2b-256 c7d102390eca2988af58d5208c226b2c418cb612a3135eba734f6bfdc6167ee6

See more details on using hashes here.

Provenance

The following attestation bundles were made for forward_qpop-0.1.1.tar.gz:

Publisher: publish.yml on yixingz3/qpop

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file forward_qpop-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: forward_qpop-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 15.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for forward_qpop-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 eee65faa5665ce078b8c281ad303eb30471be82acb0623ebb9a83fe5dd6bf6c6
MD5 ef22e6aa828e3343f2f24ff8e1d21651
BLAKE2b-256 ff9b3e3a50a165ee24fdd35e8599b88ab49dadf3b4a895c4d80162c1bd47fe1f

See more details on using hashes here.

Provenance

The following attestation bundles were made for forward_qpop-0.1.1-py3-none-any.whl:

Publisher: publish.yml on yixingz3/qpop

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page