topos.evaluation.policies.composable¶
Φ_COMPOSABLE — Policy translator for the COMPOSABLE generator.¶
Maps ModuleDependencyGraph metric observations (Martin instability,
fan-in, fan-out) into a ScoredDecision.
achieved is the AND of independent raw thresholds on each metric;
score is min(per-metric qualities) for reporting only.
- Quality functions:
- instability_quality = piecewise flat-top tent over [low, high]:
instability in band → 1.0 (optimal range) instability < low → linear from 0.0 to 1.0 instability > high → linear from 1.0 to 0.0
- fan_quality = 1 - min(fan / cap, 1.0)
Linear fall from 1.0 to 0.0 at the cap.
The COMPOSABLE badge is achieved if all three metrics pass their
independent thresholds (AND logic). Thresholds live in
topos.evaluation.policies.calibration.
- topos.evaluation.policies.composable.score_coupling(instability=None, fan_in=None, fan_out=None, priority=Priority.SECURE, threshold=None)[source]
Φ_COMPOSABLE — score the COMPOSABLE generator using independent raw thresholds.
- Parameters:
instability – Martin’s instability metric, in [0.0, 1.0].
fan_in – Number of unique modules that depend on this module.
fan_out – Number of unique modules this module depends on.
priority – Retained for API compatibility; not read by this Φᵢ.
threshold – Retained for API compatibility; not read by this Φᵢ.
- Returns:
A ScoredDecision;
achievedis the truth value of the COMPOSABLE generator for this program.