← 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 Oct 14, 2026 · 08:15 UTCTopos v0.10.2

  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.

358packages
25338files evaluated
6languages
4quality generators

Language coverage: cpp (84844), python (40835), javascript (10763), rust (9755), go (5697), typescript (5388). 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
60.9
elbow
0.97
≥ floor
72.19%
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 → 76.24%76.240.30.35 → 73.89%73.890.350.4 → 72.19%72.190.40.45 → 70.83%70.830.450.5 → 70.09%70.090.50.55 → 59.88%59.880.550.6 → 51.68%51.680.6candidate floor → % files passing
cfg.cyclomatic14947
ast.max_function_complexity010179
ast.entropy00.86

Composable

instability ∈ [0.3, 0.7], fan-in ≤ 15, fan-out ≤ 15
median
90.8
elbow
0.97
≥ floor
74.15%
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 → 95.95%95.950.50.6 → 93.21%93.210.60.7 → 87.09%87.090.70.75 → 81.83%81.830.750.8 → 74.15%74.150.80.85 → 64.76%64.760.850.9 → 54.08%54.080.9candidate floor → % files passing
mdg.instability01
mdg.fan_in0631
mdg.fan_out0152

Secure

dangerous_calls = 0, taint_flows = 0
median
100
elbow
0.97
≥ floor
97.59%
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 → 97.59%97.590.80.85 → 97.59%97.590.850.9 → 97.59%97.590.90.95 → 97.59%97.590.951 → 97.59%97.591candidate floor → % files passing
cpg.dangerous_calls0176
cpg.taint_flows02

Navigable

max function divergence ≤ 10.0
median
100
elbow
0.97
≥ floor
92.82%
committed floor
0.5
Score ECDF — solid = committed floor, dashed = elbow, teal = recommended 0%25%50%75%100%floor 0.5elbow 0.97normalized score00.250.50.751
Floor sweep — % of corpus files passing each candidate 0.3 → 95.08%95.080.30.4 → 94.16%94.160.40.5 → 92.82%92.820.50.6 → 90.75%90.750.60.7 → 87.98%87.980.70.8 → 82.88%82.880.80.9 → 72.47%72.470.9candidate floor → % files passing
nav.max_function_divergence010862.6

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.10.2 · 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.
Navigable 0.5 0.5 in sync Gate-anchored at 0.50 (max function divergence ≤ 10.0).

Raw-metric gates — grounded in corpus percentiles

GateCommitted boundCorpus evidenceWhy
McCabe cyclomatic complexity
SIMPLE.max_cyclomatic
<= 15 median=—, p75=24 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.15, p95=0.66 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=0.5 Centred on the corpus median (≈0.5) — balanced coupling.
Module fan-in
COMPOSABLE.max_fan_in
<= 15 p75=1, p95=14 Bound sits near the corpus 95th percentile.
Module fan-out
COMPOSABLE.max_fan_out
<= 15 p75=2, p95=9 Bound sits near the corpus 95th percentile.
Dangerous CPG calls
SECURE.max_dangerous_calls
== 0 median=—, p95=0 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.
Max function divergence (SCD)
NAVIGABLE.max_function_divergence
<= 10 p75=2.08, p95=13.81 Caps worst function scope-tree nesting between p75 and p95 (≤ 10.0).

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 four generator results — Simple, Composable, Secure, Navigable — meet on a 16-element lattice; the lattice element maps to a medal.

Lattice elementMedalFiles
IDEAL 🏆 PLATINUM 14149
COMPOSABLE_SECURE_NAVIGABLE 🥇 GOLD 4273
SIMPLE_COMPOSABLE_NAVIGABLE 🥇 GOLD 238
SIMPLE_COMPOSABLE_SECURE 🥇 GOLD 68
SIMPLE_SECURE_NAVIGABLE 🥇 GOLD 3262
COMPOSABLE_NAVIGABLE 🥈 SILVER 160
COMPOSABLE_SECURE 🥈 SILVER 994
SECURE_NAVIGABLE 🥈 SILVER 1366
SIMPLE_COMPOSABLE 🥈 SILVER 1
SIMPLE_NAVIGABLE 🥈 SILVER 31
SIMPLE_SECURE 🥈 SILVER 10
COMPOSABLE 🥉 BRONZE 112
NAVIGABLE 🥉 BRONZE 39
SECURE 🥉 BRONZE 605
SIMPLE 🥉 BRONZE 0
SLOP ❌ SLOP 30