You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
meta['popularity'] is never set before calculate_risk_vector: the popularity terms in documentation, verification, api_exposure and the threat vector are dead #2909
bugUnintended behavior or logic failure in the enginecore-engineModifications to the central physics and parsing enginemetricsHeuristics, risk exposures, and topological math updates
SignalProcessor.calculate_risk_vector reads the file's import fan-in as popularity = meta.get("popularity", 0) (signal_processor.py L649) and hands it to four consumers:
Nothing ever writes meta["popularity"]. The fan-in lives at meta["telemetry"]["popularity"]: network_risk_sensor.py writes f["telemetry"]["popularity"] = in_d (L441, L580) and galaxyscope.py sets telemetry_payload["popularity"] = self.popularity_scores.get(rel_path, 0) at L2312 — thirty lines aftercalculate_risk_vector is called at L2282. So every formula above runs with popularity = 0 on every file, every scan.
Evidence
tests/tools/audit_documentation_inputs.py (epic #2908, Phase 0) reproduces every corpus file's recorded risk_documentation from its recorded inputs only with the multiplier off: on the 46-language keyword-rosetta scan, 0 files reproduce with popularity applied and every imported file (a/b/c, DB popularity = 1, score would be ×1.1) reproduces with it at 0. Direct check: data/cpp/a.cpp records 40.61; _calc_documentation with the DB's popularity 1 returns 44.67, with 0 returns 40.61.
_calc_api_exposure is the larger effect: its popularity == 0 branch is a dampener for unimported files, so today every file — imported or not — takes the dampening path, and the "massively popular API surface is amplified" behaviour the docstring describes never happens.
Decision D4 of the epic removes the popularity multiplier from the documentation formula (blast radius is reported beside the score, not folded into it). This issue means that removal is score-neutral today: the term was never live. For the other three consumers it is a real behaviour change waiting to happen the day someone "fixes" the plumbing, so the fix should be decided per formula, not applied blindly:
documentation: drop the term (D4).
api_exposure, verification, threat vector: decide whether the multiplier is wanted, then either plumb meta["popularity"] = self.popularity_scores.get(rel_path, 0)before L2282 or delete the dead code. Plumbing it as-is moves risk_api_exposure on every imported file in every golden master, so that is a rosetta:rebless-owed PR with a scoped bless, not a one-liner.
Found while decomposing risk_documentation for #2908; not blocking that epic.
bugUnintended behavior or logic failure in the enginecore-engineModifications to the central physics and parsing enginemetricsHeuristics, risk exposures, and topological math updates
Activity
risk_documentation score contract (draft) + per-file input decomposit…