Falsify Audit Skill
July 5, 2026 · View on GitHub
Audit quant backtests before deploying capital. Receipt anchored on X Layer.
Install
npx skills add chris/falsify-skill
Or pin to a specific version:
npx skills add chris/falsify-skill@0.1.0
Use
Tell your AI agent:
"audit my backtest at results/"
Or call the HTTP endpoint directly:
curl -X POST https://falsify.example.com/audit \
-F strategy_script=@strategy.py \
-F backtest_results=@backtest_results.csv \
-F contract=@risk_contract.yaml
For paid audits (production), the first request returns 402 Payment Required
with an accepts JSON describing the x402 payment challenge. Sign the payment
with your OKX Agentic Wallet and retry with the X-Payment header:
curl -X POST https://falsify.example.com/audit \
-H "X-Payment: <base64-encoded-payment-payload>" \
-F strategy_script=@strategy.py \
-F backtest_results=@backtest_results.csv
Output
{
"verdict": "BLOCK",
"reason": "PBO=0.81 (gate5); universe contaminated by glob(*_daily.csv)",
"receipts": [
{
"anchor": { "file": "strategy.py", "line": 42, "symbol": "build_universe" },
"artifact": { "json_path": "gates.gate5.pbo", "equals": "0.81" },
"refutation": "glob(*_daily.csv) includes strategies from other experiments"
}
],
"receipt_hash": "sha256:9a3f...e1c2",
"onchain_tx_hash": "0xabc123...def456",
"onchain_explorer": "https://www.oklink.com/xlayer/tx/0xabc123...def456"
}
Possible verdicts:
| Verdict | Meaning |
|---|---|
PASS | Gates passed; next action allowed within stated scope |
PASS_WITH_DEBT | Usable; debt cannot invalidate the next action; names owner + next check |
BLOCK | Must Fix closes before proceeding; next action is a concrete gate |
KILL | Thesis dead; do not rescue or retune on the same evidence window |
Verify the receipt
Receipt hash is anchored on X Layer. Anyone can verify:
python judge_verify.py --tx 0xabc123...def456 --expected-hash "sha256:9a3f...e1c2"
Or check on OKLink: paste the onchain_tx_hash into
https://www.oklink.com/xlayer/tx/<tx_hash> and compare the calldata
receipt_hash field against your local sha256(canonical_json).
5-Layer Audit Pipeline
- L1 Context — assemble audit context (contract + repo rules + manifest).
- L2 Red-Light — deterministic mini-Semgrep rules for known-bad patterns.
- L3 LLM Adversarial — Brooks-Lint + cutline verdict across normal / production / quant tiers.
- L4 Finding Ledger — append-only JSONL of all findings.
- L5 Output — verdict + receipt JSON + onchain tx hash.
See V1_ARCHITECTURE.md for full system view.
Examples
- examples/audit_basic.md — minimal end-to-end audit
- examples/quant_gate.md — full quant falsification with gate0–gate6
License
MIT — see LICENSE.