Skip to main content

greencheck

tests PyPI licence: MIT dependencies: none

Your validator passes inputs it should reject. This finds them.

$ pip install greencheck

Zero runtime dependencies. Python 3.9+.

What it does

greencheck tests whether a validator, metric, guard, or quality gate can actually distinguish the cases it claims to distinguish.

The core rule is simple:

A check is not evidence until it has been observed to react differently to inputs that are known to differ in the dimension it claims to measure.

It supports two broad uses:

  • Mutation testing for gates and validators — deliberately damage an artefact, then re-run the gate and report mutations that escape.
  • Discriminability checks for metrics — detect constant outputs, bare-zero ambiguity, single-bit liveness proxies, and checks that react to the wrong dimension.

30-second mutation demo

From a checkout of this repository:

$ python -m greencheck.cli mutate --gate "python examples/mutate-demo/gate.py {target}/config.json" --target examples/mutate-demo/input

The bundled example intentionally contains a weak gate. It catches most mutations but lets one bad configuration through, showing the difference between “the check ran” and “the check can reject the right thing.”

Metric demo

$ python -m greencheck.cli demo

The demo uses synthetic inputs only. It shows three patterns:

  • a metric that genuinely separates the claimed dimension;
  • a metric that reacts only to presence/absence rather than content;
  • a constant control that carries no information.

For your own JSONL ledger, point audit at the field you want to test:

python -m greencheck.cli audit my_ledger.jsonl --field metrics.score

Optional count and freshness fields can be supplied when the meaning of zero or a liveness proxy needs to be tested.

Gate audit

If you already have aggregate gate counts, the library API can distinguish a gate that has been observed to fire from one that merely exists in code.

The important distinction is not “green versus red.” It is:

Has the rejection path ever been exercised by a known-positive control?

What it can flag

verdict meaning
CONSTANT The reported value never varies over the observed window
IDENTITY The instrument reacts to a different dimension from the one it claims to measure
BARE_ZERO “nothing examined” and “examined, zero hits” collapse to the same value
LIVENESS_BIT Nearly all variance is explained by a single freshness/health boolean
DEAD_GATE A rejection path exists but has never been observed to fire
NO_DATA There is not enough evidence to issue a pass/fail conclusion

These are diagnostic signatures, not automatic defect verdicts. A human still decides whether a surviving mutation or flagged metric matters.

Skills

The package also ships small agent-readable review skills:

$ python -m greencheck.cli skills

Read one in full:

$ python -m greencheck.cli skills positive-control

Included skills cover:

  • measurement vs. decoration;
  • positive controls;
  • dead checks;
  • dimension-scoped discriminability;
  • ambiguous zero values.

Third-party example

case_study/third_party/ contains a self-contained example using public third-party artefacts. It is retained to show how the mutation/triage loop works without publishing private datasets or internal system material.

Install / verify

$ python -m unittest discover -s tests

The library can also be driven directly:

from greencheck import ProbePair, discriminate

discriminate(
    my_metric,
    [
        ProbePair("rich vs degenerate", rich_text, "aaaa", dimension="content"),
        ProbePair("present vs absent", "hello", "", dimension="presence"),
    ],
    subject="my_metric",
    claimed_dimensions=["content"],
)

Public-scope boundary

This repository intentionally contains only the generic tool, synthetic examples, and public third-party demonstration material.

It does not publish private datasets, internal measurements, operator-specific identifiers, unpublished research, or product engineering.

Standing on

Dimension-scoped discriminability and falsification-first verification were adapted in part from obra/superpowers (MIT).

Limits

  • A surviving mutation is a question, not automatically a bug.
  • Passing the audit does not prove the measured system is good; it only says the instrument can distinguish the tested cases.
  • The tool only sees what you record.
  • Positive controls are part of the validation procedure, not an optional extra.

License

MIT — see LICENSE.

Simin Yuan, 2026.

Metadata

Release files for greencheck 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for greencheck 0.3.1
File Size Uploaded
greencheck-0.3.1.tar.gz 48.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for greencheck 0.3.1
File Interpreter ABI Platform
greencheck-0.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 81.0 kB

Release files / greencheck-0.3.1.tar.gz

Download URL greencheck-0.3.1.tar.gz
Size 48.5 kB
Tags Source
SHA-256 checksum
How to use checksums
0e1e28dba64063da4f5950a39777c02d76c2f0333e04411f92afca4e4be5c7a5
BLAKE2b-256 checksum
How to use checksums
415754a3d5828c27fcfba0c96be06526eb33ef430a674168004ba751a73e9d5b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.

Transparency log

Release files / greencheck-0.3.1-py3-none-any.whl

Download URL greencheck-0.3.1-py3-none-any.whl
Size 32.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cb37a9ff80761608ca2f3b6d07b9f9aa2b821d054873657221bf03a034db77e1
BLAKE2b-256 checksum
How to use checksums
abc1763fa3e1bd6d0a1da631d792e05c9decc37ac5c5ae735c14dc67d0064e14
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 release files

0.3.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page