"""Recompute disclosed arithmetic only; no access to historical experiment data."""
from decimal import Decimal as D, ROUND_CEILING
import json

# FIRST CVSS 3.1 section 7.1, scope unchanged, vector N/L/N/N/U/N/L/L.
iss = 1 - (1-D('0')) * (1-D('0.22')) * (1-D('0.22'))
impact = D('6.42') * iss
exploitability = D('8.22') * D('0.85') * D('0.77') * D('0.85') * D('0.85')
raw = min(impact + exploitability, D(10))
score = (raw * 10).to_integral_value(rounding=ROUND_CEILING) / 10
assert score == D('6.5')
rows = [93, 3, 2, 1, 1, 1]
assert sum(rows) == 101
assert 12 * 5 == 60
t1_dispersion = {"main_a_batched": D("1.824"), "main_a_per_dim": D("1.129"), "main_b_batched": D("0.548"), "main_b_per_dim": D("0.916")}
assert sum(v >= 1 for v in t1_dispersion.values()) == 2
print(json.dumps({
    'cvss': {'iss': str(iss), 'impact': str(impact),
             'exploitability': str(exploitability), 'raw': str(raw), 'score': str(score)},
    'metr_table': {'displayed_rows': rows, 'sum': sum(rows), 'stated_sample': 100,
                   'interpretation': 'Overlap plausible but unconfirmed; this is not a coverage falsification.'},
    'anthropic_rollouts': {'scenarios': 12, 'repeats': 5, 'product': 60},
    'rubric_t1_table': {k: str(v) for k, v in t1_dispersion.items()},
    'rubric_t1_below_one_in_every_cell': all(v < 1 for v in t1_dispersion.values()),
    'not_checked': ['Original monitor flags and denominators',
                    'Unique sampled METR message IDs', 'Historical CISA corpus scan',
                    'Human-label grader agreement', 'Recompute sigma from raw model runs', 'Generalization or causal subagent value']
}, indent=2))
