Prove the gate holds,on money-shaped code.
Delta mined and gated 26 entries across three Python repositories: backtesting.py, pybroker, and FinanceToolkit. Bugs are hand-authored plants drawn from real production regression shapes: sign errors on shorts, lookahead bias, denominator confusion, commission accounting drift. Clean entries are no-op refactors that a good reviewer does not flag.
Recall
5.9%
1/17 bugs flagged
Precision
100.0%
0 false positives
F1
0.111
9/9 clean untouched
Mining cost
$3.09
135 calls · gate $0.00
Trend
Recall, precision, and F1 across runs.
Each point is one full benchmark run. The chart tracks how catch rate and false-alarm rate move as the engine improves.
Per-repo funnel
What survived the mine, per repo.
| repo | LOC | proposed | survivors | ratified | ratification | mining $ | verdict |
|---|---|---|---|---|---|---|---|
| kernc/backtesting.py | 5,064 | 47 | 18 | 18 | 100.0% | $0.97 | PROCEED |
| JerBouma/FinanceToolkit | 52,520 | 46 | 1 | 1 | 100.0% | $1.31 | PROCEED |
| edtechre/pybroker | 11,850 | 42 | 11 | 11 | 100.0% | $0.82 | PROCEED |
Per-entry verdicts
Every planted regression, one row per entry.
Clean entries and real-PR entries have no planted target function, so their governs column shows a dash.
| id | repo | label | verdict | wall (s) | PR lines | governs |
|---|---|---|---|---|---|---|
| backtesting-trade-plpct-short-sign-error | backtesting.py | bug | flagged | 10.3 | 2 | backtesting.backtesting:Trade.pl_pct |
| backtesting-position-plpct-denominator-confusion | backtesting.py | bug | clean | 8.6 | 2 | backtesting.backtesting:Position.pl_pct |
| backtesting-trade-close-int-truncation | backtesting.py | bug | clean | 8.7 | 2 | backtesting.backtesting:Trade.close |
| backtesting-broker-close-trade-missing-commission | backtesting.py | bug | clean | 8.7 | 2 | backtesting.backtesting:_Broker._close_trade |
| backtesting-broker-process-orders-lookahead-bias | backtesting.py | bug | clean | 9.1 | 2 | backtesting.backtesting:_Broker._process_orders |
| financetoolkit-interest-debt-per-share-wrong-formula | FinanceToolkit | bug | clean | 0.3 | 2 | financetoolkit.ratios.valuation_model:get_interest_debt_per_share |
| financetoolkit-return-on-tangible-assets-wrong-arithmetic | FinanceToolkit | bug | clean | 0.3 | 2 | financetoolkit.ratios.profitability_model:get_return_on_tangible_assets |
| financetoolkit-fama-french-linregress-args-swapped | FinanceToolkit | bug | clean | 0.3 | 2 | financetoolkit.performance.performance_model:get_fama_and_french_model_single |
| financetoolkit-receivables-turnover-inverted-ratio | FinanceToolkit | bug | clean | 0.3 | 2 | financetoolkit.ratios.efficiency_model:get_receivables_turnover |
| financetoolkit-jensens-alpha-typecheck-wrong-variable | FinanceToolkit | bug | clean | 0.3 | 2 | financetoolkit.performance.performance_model:get_jensens_alpha |
| pybroker-schedule-order-off-by-one-date-loc | pybroker | bug | clean | 5.9 | 2 | pybroker.strategy:BacktestMixin._schedule_order |
| pybroker-portfolio-capture-bar-mv-wrong-attr | pybroker | bug | clean | 6.0 | 2 | pybroker.portfolio:Portfolio.capture_bar |
| pybroker-portfolio-capture-bar-short-mv-missing-pnl | pybroker | bug | clean | 5.9 | 2 | pybroker.portfolio:Portfolio.capture_bar |
| pybroker-portfolio-exit-short-pnl-sign-flip | pybroker | bug | clean | 6.0 | 2 | pybroker.portfolio:Portfolio._exit_short |
| pybroker-portfolio-exit-long-cash-wrong-amount | pybroker | bug | clean | 6.1 | 2 | pybroker.portfolio:Portfolio._exit_long |
| backtesting-run-docstring-wording-tweak | backtesting.py | clean | clean | 9.2 | 2 | - |
| backtesting-trade-value-docstring-rename | backtesting.py | clean | clean | 8.8 | 2 | - |
| backtesting-position-pl-docstring-clarify | backtesting.py | clean | clean | 9.3 | 2 | - |
| financetoolkit-gross-margin-docstring-type-cleanup | FinanceToolkit | clean | clean | 0.3 | 4 | - |
| financetoolkit-asset-turnover-rename-sales-to-revenue | FinanceToolkit | clean | clean | 0.3 | 6 | - |
| financetoolkit-current-ratio-docstring-tighten | FinanceToolkit | clean | clean | 0.3 | 2 | - |
| pybroker-portfolio-buy-docstring-simplify-sphinx | pybroker | clean | clean | 6.3 | 4 | - |
| pybroker-portfolio-calculate-fees-local-type-hint | pybroker | clean | clean | 6.0 | 2 | - |
| pybroker-portfolio-sell-docstring-simplify-sphinx | pybroker | clean | clean | 6.0 | 2 | - |
| real-backtesting.py-pr904 | backtesting.py | bug | clean | 5.9 | 2 | - |
| real-backtesting.py-pr1253 | backtesting.py | bug | clean | 5.8 | 7 | - |