Repository navigation
tools: add direct-invocation tier-parity audit harness for epic #1056 - #1097
Merged
Merged
Conversation
Reusable, checked-in harness (mirrors audit_strict_coverage.py's pattern from epic #1069) for the systematic audit epic #1056 requests: sweeps LOC x signal-hit density x tier1/2/3 for each tier-aware _calc_*() risk equation in signal_processor.py, holding raw_signals identical across tiers per the same direct-invocation proof method that found #1055's systems_buffer bug. Two checks per (loc, hits) combo, not just a magnitude ratio: - DIRECTION: per the documented Universal Exposure Framework philosophy (Irc as an additive opacity baseline, Fc as defense-credit discount), tier1 should never score above tier2/tier3 for identical evidence in either a risk-only or defense-only scenario. A violation here is the #1055 shape specifically (tier ordering inverted), not just "moved a lot." - MAGNITUDE: flags any combo whose max/min tier ratio exceeds a threshold (default 5x, matching the epic's own stated bar). Also auto-classifies each in-scope equation via inspect.signature as tier-parameterized (fc/irc/ot present) or not -- an equation that never receives a tier constant cannot exhibit tier distortion by construction, so it's reported N/A rather than swept.
Contributor
5 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tests/tools/audit_risk_equations.py, a reusable harness for epic Epic: Systematically audit tier-aware risk equations in signal_processor.py #1056's audit of tier-aware_calc_*()risk equations insignal_processor.py, following the same direct-invocation methodology that found [BUG/METRICS] safety_score's tier2/tier3 systems_buffer flat subtraction wipes attack signal #1055'ssystems_bufferbug (syntheticraw_signalsheld identical across tier1/tier2/tier3, varying only the tier constants each equation actually receives).(loc, hits)combo, per the documented Universal Exposure Framework philosophy (Irc = additive opacity baseline, Fc = defense-credit discount for implicit languages):inspect.signatureas tier-parameterized (fc/irc/otpresent) or not — an equation that never receives a tier constant can't exhibit tier distortion by construction, so it's reported N/A instead of swept.Mirrors the reusable-tool pattern from epic #1069's
audit_strict_coverage.pyrather than one-off scratch scripts per equation.Findings from running it (posted separately)
cog_load,tech_debt,documentation,verification,concurrency,state_flux) pass the direction check — no [BUG/METRICS] safety_score's tier2/tier3 systems_buffer flat subtraction wipes attack signal #1055-shaped bug found elsewhere._calc_graveyard,_calc_api_exposure,_calc_spec_alignment,_calc_civil_war,_calc_secrets_risk) take nofc/irc/otat all — confirmed tier-blind by construction, not just by inspection of the epic's approximate scope table._calc_documentation's defense scenario found a real magnitude miscalibration (up to 8.38x at small files) — filed as a focused follow-up issue, linked from epic Epic: Systematically audit tier-aware risk equations in signal_processor.py #1056.Part of #1056.
Test plan
python tests/tools/audit_risk_equations.py— runs clean, no direction violationssignal_processor.py/language_standards.pyedits), so no golden-master/crucible re-verification needed🤖 Generated with Claude Code