NullGreen
Latest: v1.0.15
1.0.15: clean-env token handshake + permissions declaration. The clean-env child now receives a one-shot token proving it is this parent's recursion; --skip-clean-env without the token is a bypass that records ran=True ok=False and blocks the verdict (fail-closed, never silent). A gate may be explicitly disabled, never silently. Frontmatter adds a permissions list (file_read, file_write, env, network, shell) - the scanner matches LP1 against permissions, not allowed-tools. Probes 12/12, gate 5/5, pytest 3 passed.
NullGreen
A green you cannot disprove is a null green. NullGreen is the external-correctness gate for self-improving agent loops — productize the judge that verifies the loop, not another agent, and make the judge prove it is able to say no.
Components
| File | Role |
|---|---|
verifier.py | Deterministic verifier. Exact comparison only, no floats, no LLM judge. Answer tasks: full-string exact match. Code tasks: subprocess solve(input) comparison. Fail-closed: any verifier surprise = FAIL. Emits machine-readable findings (verdict + evidence: ref vs got). Isolation model (disclosed, with residual risks named): untrusted submitted code runs in a subprocess with (1) a scrubbed secret-free environment — only PATH/TEMP/WINDIR-class variables survive, so no host API keys / tokens / shell rc state are inherited (verified by the host-env probe: a submission that prints a host-set variable gets EMPTY), (2) a throwaway working directory (mkdtemp, removed after the run) so relative file access lands in an isolated temp tree, (3) a 20 s wall timeout. Residual risks, stated plainly: this is environment + relative-path + time containment, NOT an OS filesystem jail — submitted code can still open absolute paths, make network connections, and spawn descendants. An OS-level sandbox was probed and is unavailable on the target host (CreateJobObject/SetInformationJobObject return ERROR_INVALID_PARAMETER under this VM); on a host that provides one (container, seccomp, job object), run the verifier inside it. The documented guarantee is therefore: no credential inheritance, no relative-path escape, bounded wall time; absolute-path and network exposure is the host's responsibility. |
tasks.py | Locked-protocol task registry. Pool A = classic algorithm families (known in training/canonical text, in-pool reference allowed); Pool B = exotic families (must pass contamination_audit: stem+instance input absent from workspace before admission). New seed makes each instance unique. References live only on the verifier side; the executor gets spec+input only. |
contamination_audit.py | Exact-substring contamination audit. R40 self-contamination lesson: memory/ is a model exposure surface — fix records leak the needle. Audits whether stem keywords / rendered instances appear verbatim in the workspace. Coverage is first-class (disclosed, blocking semantics stated): coverage_report() records every skip with a reason — size/depth/extension limits, read failures, os.walk errors, and declared corpus paths (extra_files) that are missing or un-auditable. Nothing is silently dropped. Blocking semantics: the release gate blocks publish on (a) any read failure (an unreadable file may hold a needle) and (b) any skip sitting on a model-exposure surface (memory/ docs/ skills/ extracted_skills/ self_improvement/ rsi/ AGENTS.md SOUL.md); other metadata skips (e.g., depth limits under non-exposure directories) are reported caveats, not blockers. A clean verdict with a blocking gap is impossible by construction. |
tests/test_external_gate_mutation.py | Mutation-testing CI gate: 12 plausible-but-wrong algorithms per registered code family, asserting the gate rejects every one (negative verification). R37 rule enforced: code-family count == mutant-coverage count. |
Tool scope (disclosed)
Scripts use only: local file reads/writes (temp workdirs and in-bundle files); one self-recursive subprocess re-exec of this same gate script with a fixed argv (the clean-env check — no shell, no external input); the submission-probe subprocess (env-scrubbed to PATH/TEMP/WINDIR-class keys, throwaway mkdtemp cwd, 20 s wall timeout); and one HTTP call to a localhost embeddings endpoint (default http://127.0.0.1:19432/v1/embeddings) for the semantic arm. The mutation-registry loader reads a pinned in-bundle test file via importlib. No remote code fetch, no persistence, no shell interpreter. |
| semantic_audit.py | Concept-level contamination audit (semantic analysis step). Embeds the task spec and scans workspace cognition text in overlapping windows, flagging a concept-leak at cosine >= 0.60 (threshold from measured separation: same-family paraphrase 0.839 vs across-family <= 0.318). Network dependency: requires a local embeddings endpoint (default http://127.0.0.1:19432/v1/embeddings); when unreachable it returns clean=None and the caller falls back to the exact-substring audit only — never a hard failure. |
Why this is a moat
99% of "agent commerce" has no external correctness gate. This one:
- Verdict is machine-readable (cloudflare-style findings) — feeds CI / billing / insurance inputs directly
- Ratchet signal uncontaminated (Pool B contamination-audit isolation, POOL_VERSION pinned)
- Prior audit is distribution-level (100 seeds x 6 families, not a single seed)
- Negative verification: a bad generator must be caught by the gate, otherwise the gate itself is unproven
Usage
import tasks, verifier
task = tasks.render(seed=20261129, family="B4_coin_change")
ok, evidence = verifier.verify(task, model_output)
Open-core / paid split
- Open-core: verifier + task pool (trust + inbound traffic)
- Paid layer: ratchet baselines, judge-stack tuning, contamination-audit policy
- Settlement rails: x402 (USDC on Base, per-call) / PayPal Orders v2 / Stripe MPP (Tempo) — per live activation status
- Weight-freeze iron law: this harness only verifies; it never modifies model weights
- Fail-closed semantics: all-endpoint failure → explicit FAIL-CLOSED, never silent empty findings
Getting the paid layer
Contact mcnlzg@gmail.com (reply carries pricing + delivery handshake terms).
