Repository navigation
Fix remaining 33 findings in #473 (ARG001/ARG002/RUF012/B007/RUF059/F841) - #480
Merged
Merged
Conversation
…841) Closes the ARG/B007/RUF012/RUF059/F841 remainder of #473 (S110 was already closed out in #476). Three findings turned out to be real bugs where a parameter was accepted but never wired into an established sibling formula, confirmed with the user before fixing: - signal_processor.py: _calc_concurrency/_calc_state_flux ignored the tier risk floor `irc`, unlike 4 sibling _calc_* methods that fold it into their density formula. Wired it in identically. - language_lens.py: _tier_3_lexical_scan ignored `claimed_lang` while its sibling `gravity_lang` gets a 1.25x consensus boost. Gave claimed_lang the same boost. - cobol_jcl_forge.py: generate_zero_trust_jcl ignored `corporate_header` while its sibling forge_schemas (called two lines earlier by the same caller) prepends it as a comment block. Mirrored that for JCL output. Everything else was dead parameters removed outright (call sites and tests updated to match), genuine shared-interface params marked with `# noqa: ARG002 -- reason` (matching the repo's existing noqa convention), or mutable class-level constants annotated ClassVar. Baseline regenerated: 241 -> 152 findings in ruff_audit_baseline.json. Full test suite passes (866 passed, 1 pre-existing xfail). Closes #473 Co-Authored-By: Claude Sonnet 5 <[email protected]>
Contributor
… golden masters
CI's golden-crucible regression test caught a miscalibration in the irc
wiring from the previous commit: I mirrored _calc_cog_load's `irc/loc`
pattern, but concurrency/state_flux compute density on a pre-scaled
x100 percentage basis, so dividing irc by loc there blew up scores for
small files (e.g. one file jumped from 34.63% to 99.48%).
analysis_lens.py's tuning config already had an `irc_mult` key for both
categories (concurrency: 0.1, state_flux: 0.15), with threshold_base/
sigmoid_slope comments like "Lowered from 4.0" that only make sense if
irc_mult was meant to be consumed -- this was the actually-intended
formula, matching tech_debt's flat `irc * irc_weight` pattern rather
than cog_load's loc-divided one. Switched both to `density += irc *
tuning.get("irc_mult", ...)`, which produces the modest, proportional
deltas the tuning was calibrated for.
Verified locally against the language-crucible corpus in both
zero-dependency and full-precision mode (test_golden_crucible.py -m
golden_crucible), regenerated both golden masters, and reran the full
suite (866 passed, 1 pre-existing xfail).
Co-Authored-By: Claude Sonnet 5 <[email protected]>
The previous commit added two lines to signal_processor.py, shifting an already-baselined PERF401 finding from line 2457 to 2459 -- the known line-shift false-positive tests/ruff_audit.py's docstring describes, not a new finding. No other findings changed. Co-Authored-By: Claude Sonnet 5 <[email protected]>
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
Closes out the remainder of #473 (S110's 22 findings were already fixed in #476). This covers the last 33 findings across
ARG001,ARG002,RUF012,B007,RUF059, andF841.Three of these turned out to be real bugs, not just lint noise -- each one is a parameter that a real caller passes a genuine value for, but the function silently ignores it, while an established sibling in the same file shows exactly what it should be doing instead. Confirmed the approach with the repo owner before wiring each one in:
signal_processor.py:_calc_concurrency/_calc_state_fluxaccepted the tier risk floorircbut never used it, unlike 4 sibling_calc_*methods that fold it into their density formula ((x + irc) / loc). Wired it in the same way.language_lens.py:_tier_3_lexical_scanacceptedclaimed_langbut never used it, while its siblinggravity_langgets an explicitraw_score *= 1.25consensus boost right next to it. Gaveclaimed_langthe same boost.cobol_jcl_forge.py:generate_zero_trust_jclacceptedcorporate_headerbut never used it, while its siblingforge_schemas(called two lines earlier by the same caller) prepends it as a comment block. Mirrored that for JCL//*comment lines.Everything else was one of:
detector.py'sdeep_scan/family,security_lens.py'spolicy/loc(withlocremoved from every call site acrossgalaxyscope.py,sbom_recorder.py,binary_anomaly_detector.py,vault_sentinel.py, and their tests),gpu_recorder.py'sforensic_report/commit_hash/branch_name.# noqa: ARG002 -- reason(matching this repo's existing noqa-with-rationale convention) --sarif_recorder.py/sbom_recorder.py'sgenerate_report()andlanguage_lens.py'sinspect(**kwargs), both part of a shared call shape dispatched fromgalaxyscope.py's Phase 12 recorder fan-out.ClassVar(detector.py,security_auditor.py,analysis_lens.py).tests/ruff_audit_baseline.jsonregenerated: 241 -> 152 findings (all remaining findings are pre-existing, out of #473's scope, tracked under #474/#475).Closes #473
Test plan
ruff check --select ARG001,ARG002,RUF012,B007,RUF059,F841 gitgalaxy/-- all clearruff format --check gitgalaxy/-- all 79 files already formattedpython tests/ruff_audit.py --ci-- no new findings beyond the regenerated 152-finding baselinepytest tests/-- 866 passed, 1 pre-existing xfail🤖 Generated with Claude Code