← Back to methodology

Methodology · full calibration report

Calibration
report.

Every value in topos/evaluation/policies/calibration.py is downstream of the evidence below. This report re-syncs the live leaderboard corpus, shows the distribution it produces, and derives the calibration values that distribution now recommends. Add more packages and languages and the picture — and the thresholds it justifies — sharpen.

Synced Aug 01, 2026 · 15:44 UTCTopos v0.4.3

  1. 1

    Experimental results

    Every file in the cohort is evaluated by Topos and recorded in the leaderboard corpus.

  2. 2

    Empirical distribution

    Per-metric histograms and per-dimension ECDFs reveal where typical code ends and outliers begin.

  3. 3

    Calibration values

    Elbows and percentiles recommend the gates & floors committed to calibration.py.

  4. 4

    Evaluations & medals

    Topos applies those values; generator achievements meet on the lattice to award a medal.

1 · The experimental corpus

This snapshot drives everything downstream. It grows along two axes — more packages and more languages — and each addition tightens the distribution.

303packages
29337files evaluated
3languages
3quality generators

Language coverage: python (34371), javascript (10473), rust (9779). Packages such as @babel/compat-data, @babel/core, @babel/helper-compilation-targets, @babel/helper-define-polyfill-provider, @babel/helper-globals, @babel/helper-module-imports, @babel/helper-module-transforms, @babel/helpers….

2 · The distribution it produces

Topos thresholds are tuned on multi-ecosystem leaderboard cohorts: each file is evaluated with Topos probes, ecosystems are equal-strata sampled so Python cannot dominate, raw metric gates are set from distribution percentiles, and normalized score floors are chosen from ECDF elbows and pass-rate analysis.

Simple

cyclomatic ≤ 15, max function complexity ≤ 10, entropy ∈ [0.2, 0.8]
median
55
elbow
0.97
≥ floor
64.15%
committed floor
Score ECDF — solid = committed floor, dashed = elbow, teal = recommended 0%25%50%75%100%floor 0.4elbow 0.97rec 0.95normalized score00.250.50.751
Floor sweep — % of corpus files passing each candidate 0.3 → 70.39%70.390.30.35 → 67.83%67.830.350.4 → 64.15%64.150.40.45 → 59.03%59.030.450.5 → 54.72%54.720.50.55 → 50.11%50.110.550.6 → 45.54%45.540.6candidate floor → % files passing
cfg.cyclomatic16922
ast.max_function_complexity052263
ast.entropy00.86

Composable

instability ∈ [0.3, 0.7], fan-in ≤ 15, fan-out ≤ 15
median
95
elbow
0.97
≥ floor
53.66%
committed floor
Score ECDF — solid = committed floor, dashed = elbow, teal = recommended 0%25%50%75%100%floor 0.8elbow 0.97rec 0.95normalized score00.250.50.751
Floor sweep — % of corpus files passing each candidate 0.5 → 57.09%57.090.50.6 → 56.02%56.020.60.7 → 54.29%54.290.70.75 → 53.89%53.890.750.8 → 53.66%53.660.80.85 → 50.68%50.680.850.9 → 50.49%50.490.9candidate floor → % files passing
mdg.instability01
mdg.fan_in00
mdg.fan_out084

Secure

dangerous_calls = 0, taint_flows = 0
median
100
elbow
0.97
≥ floor
94.87%
committed floor
Score ECDF — solid = committed floor, dashed = elbow, teal = recommended 0%25%50%75%100%floor 1elbow 0.97normalized score00.250.50.751
Floor sweep — % of corpus files passing each candidate 0.8 → 94.87%94.870.80.85 → 94.87%94.870.850.9 → 94.87%94.870.90.95 → 94.87%94.870.951 → 94.87%94.871candidate floor → % files passing
cpg.dangerous_calls0236
cpg.taint_flows06

3 · The calibration values it recommends

The distribution above is the input; these are the numbers it implies for calibration.py. The committed column is parsed live from the policy module so drift is visible at a glance.

Could not load committed values — showing recommendations only. Source: topos v0.4.3 · calibration.py ↗.

Normalized score floors (SCORE_FLOORS)

GeneratorRecommendedCommittedDriftBasis (from corpus)
Simple 0.95 no committed value ECDF elbow at 0.97 → rounded to 0.95.
Composable 0.95 no committed value ECDF elbow at 0.97 → rounded to 0.95.
Secure 1 no committed value Categorical security — held at 1.00 regardless of elbow.

Raw-metric gates — grounded in corpus percentiles

GateCommitted boundCorpus evidenceWhy
McCabe cyclomatic complexity
SIMPLE.max_cyclomatic
<= 15 median=—, p75=23 Upper bound near the corpus median — most files stay below it.
Max single-function complexity
SIMPLE.max_function_complexity
<= 10 median=—, p75=9 Caps the worst function around the corpus 75th percentile.
Kolmogorov AST entropy band
SIMPLE.min_entropy / max_entropy
[0.2, 0.8] p5=0.16, p95=0.67 Healthy band spans the bulk of the corpus (p5–p95).
Martin module instability band
COMPOSABLE.instability_low / instability_high
[0.3, 0.7] p25=0.5, p75=1 Centred on the corpus median (≈0.5) — balanced coupling.
Module fan-in
COMPOSABLE.max_fan_in
<= 15 p75=0, p95=0 Bound sits near the corpus 95th percentile.
Module fan-out
COMPOSABLE.max_fan_out
<= 15 p75=0, p95=1 Bound sits near the corpus 95th percentile.
Dangerous CPG calls
SECURE.max_dangerous_calls
== 0 median=—, p95=1 Categorical: the corpus median is 0 — any call fails.
Active taint flows
SECURE.max_taint_flows
== 0 median=—, p95=0 Categorical: zero-tolerance dataflow safety.

Recalibration trigger: Elbow = argmax of |d²P/ds²| on the file-level ECDF (per dimension). Re-pick a threshold when the elbow differs from the current floor by more than 0.05.

4 · How those values award medals

Topos applies the calibrated gates and floors to each file. The three generator results — Simple, Composable, Secure — meet on an 8-element lattice; the lattice element maps to a medal.

Lattice elementMedalFiles
IDEAL 🥇 GOLD 10390
COMPOSABLE_SECURE 🥈 SILVER 4363
SIMPLE_COMPOSABLE 🥈 SILVER 230
SIMPLE_SECURE 🥈 SILVER 9360
COMPOSABLE 🥉 BRONZE 413
SECURE 🥉 BRONZE 3719
SIMPLE 🥉 BRONZE 329
SLOP ❌ SLOP 533