Skip to content
@foolproof-labs

foolproof-labs

Foolproof Labs

We build infrastructure that makes self-deception structurally impossible.

中文说明

Foolproof Labs 是一组面向量化研究的开源小工具,重点是让数据、时间、统计结论和研究经验更容易检查。

其中 ashare-data-immunitypit-adjuster 直接面向 A 股常见的数据问题;其他工具也适用于 A 股量化研究流程。工具不荐股、不承诺收益,也不替代交易所规则、数据供应商说明或人工复核。

Open-source tools for making quantitative research easier to audit and harder to fool yourself about.

Why "Foolproof"?

Named after Feynman's first principle:

"You must not fool yourself — and you are the easiest person to fool." — Richard Feynman

Most tools attack the math of overfitting. We attack the process — because the hardest bug in quantitative research is not in the code, it is in the story we tell ourselves after the backtest looks good. We do not promise you can't fool yourself. We promise to make it harder: each tool turns one risk or assumption into something explicit, machine-checkable, and hard to revise after the fact.

Start here

All six tools are published on GitHub and PyPI as 0.1.1 alpha releases. You do not need to install the whole family. Pick the problem closest to your work:

If you want to...Start withFirst command
Check whether A-share daily data is safe to useashare-data-immunitypip install ashare-data-immunity
Check whether a backtest used information too earlylookahead-freepip install lookahead-free
Record a research claim before seeing the resultfalsification-ledgerpip install falsification-ledger

Every repository includes a synthetic demo, tests, and command-line help. The tools are local checks and records: they do not fetch market data, choose stocks, promise returns, or place trades.

The projects are small, composable utilities. They do not promise profitable strategies, replace domain review, or make an entire research process automatically correct. Each tool makes one risk or assumption explicit and testable.

Projects

ProjectPurpose
ashare-data-immunityQuality checks for A-share daily bars: OHLCV validation, board-aware price limits, suspension detection, listing and continuity audits, and snapshot manifests.
pit-adjusterPoint-in-time fixed-basis price reconstruction from corporate-action archives, with adjustment-convention drift checks.
lookahead-freeDeclarative checks that a time-annotated data pipeline does not give a decision data before it was available.
factor-qcA fail-closed backtest quality gate for DSR, PBO, multiple-testing haircuts, and minimum track record length.
falsification-ledgerA hash-chained record for pre-registering research claims, falsification evidence, adjudication, and hit-rate reports.
lesson-bookA local, deterministic mistake ledger that surfaces similar past situations before the next action.

Three real workflows

1. Clean an A-share data file before research

Use ashare-data-immunity when a daily-bar file may contain invalid prices, missing values, silent suspensions, limit moves, or incomplete history.

pip install ashare-data-immunity
# from a cloned ashare-data-immunity repository:
python examples/demo.py
# with your own JSON bars file:
imm clean --bars bars.json --out clean.json

The demo uses synthetic data. For real data, review the reported assumptions and the exchange rules for your market board before relying on the result.

2. Check the timing of a backtest pipeline

Use lookahead-free for a time-annotated pipeline, and pit-adjuster when historical prices depend on corporate-action records.

pip install lookahead-free pit-adjuster
# from a cloned lookahead-free repository:
python examples/demo.py
# with your own pipeline definition:
lf check --pipeline pipeline.json --json

The result is a timing check, not proof that the strategy is profitable. Data-vendor conventions and value-dependent availability still need human review.

3. Keep research conclusions auditable

Use falsification-ledger to write down a claim and what evidence would disprove it before looking at the result. Add factor-qc when a backtest also needs overfitting checks, and lesson-book when past mistakes should be surfaced before the next decision.

pip install falsification-ledger factor-qc lesson-book
# from a cloned falsification-ledger repository:
python examples/demo.py
# verify a ledger created in a state directory:
fl verify --state-dir ~/.research-ledger

These tools make the research process easier to inspect; they do not replace statistical judgment or independent review.

Shared principles

  • Small tools with explicit inputs, outputs, and limits.
  • Read-only checks wherever a check is all that is needed.
  • Reproducible local workflows and machine-readable results.
  • MIT-licensed code with tests and examples.
  • Honest boundaries: a warning or pass is evidence about a check, not proof of a profitable strategy.

Related — Metabolism Tools

We also build workspace-metabolism under the sister organization Metabolism Tools — policy-driven file lifecycle management for agentic workspaces (audit, recyclable clean, rollback, hash-chained journal). If Foolproof Labs keeps the research honest, Metabolism Tools keeps the workspace alive.

Contributing

Issues and pull requests are welcome. Please include a small reproducible example, the expected result, and the data or rule assumption involved. For A-share issues, state the market board, date range, data source, and the relevant exchange rule or vendor convention when available.

All repositories are MIT licensed. See each repository for installation, command examples, current status, and project-specific limitations.

Popular repositories Loading

  1. pit-adjuster pit-adjusterPublic

    PIT 前视无偏复权引擎:复权因子链、复权口径漂移检测、快照等价校验。Point-in-time fixed-basis back-adjustment for daily prices, with convention-drift detection.

    Python

  2. falsification-ledger falsification-ledgerPublic

    量化研究预注册与证伪账本:哈希链防篡改、一次性裁决、命中率统计。Hash-chained pre-registration ledger for research claims.

    Python

  3. factor-qc factor-qcPublic

    回测质量闸门:DSR、PBO、Harvey-Liu 多重检验折减与 MinTRL,P0/P1/P2 分级,默认不放行。Fail-closed quality gate for backtests in one NumPy engine.

    Python

  4. lesson-book lesson-bookPublic

    本地优先的交易经验记账本:记录错误代价,相似情境再现时提醒。Local-first tuition memory for traders.

    Python

  5. lookahead-free lookahead-freePublic

    时序无前视验证:声明式数据流程检查,线性时间证明决策未使用当时不可知的数据。Verifiable look-ahead-freedom for data pipelines.

    Python

  6. ashare-data-immunity ashare-data-immunityPublic

    A 股日线数据质量检查:OHLCV 清洗、按板块识别涨跌停/停牌、上市与连续性审计、SHA-256 快照。Data immunity for A-share daily bars: cleaning, board-aware price limits and suspensions, audits, snapshot manifests.

    Python

Repositories

Showing 7 of 7 repositories

People

This organization has no public members. You must be a member to see who’s a part of this organization.

Top languages

Loading…

Most used topics

Loading…