Repository navigation
fix(metrics): control_flow_ratio divides by coding LOC — closes #2770 - #2927
Merged
Merged
Conversation
…ary vocabulary (#2770) The file-level ratio divided branch hits by branch + structural_boundaries. structural_boundaries is an ungoverned per-language vocabulary tally (45 words in solidity, 16 in shell, 0 in markdown), so identical decision density read wildly differently per language -- the corpus's worst metric at 33% consistency. The denominator is now line_count: the non-blank lines of the comment-stripped code stream, i.e. coding-LOC semantics. Chosen over total lines because comment culture varies per language and must not skew a cross-language density metric. This also brings the file-level ratio into agreement with two existing siblings: the per-FUNCTION Control Flow Ratio (already branches/LOC) and logic_density (same line_count, two lines below), plus record_keeper's dependency_density (moved onto coding_loc by this issue's earlier phase, #2801). structural_boundaries stays: it is the relocation target the branch contract (#2822/#2832) depends on; it simply no longer prices a ratio. logic_loc downstream shifts with the corrected ratio; it is an input to the pre-trained security_auditor model, which has already drifted and has a retrain tracked on #96 -- the retrain absorbs the new semantics. Golden masters re-blessed (both modes); CI-equivalent verification PASS/PASS. Closes #2770 Co-Authored-By: Claude Opus 4.8 <[email protected]> Claude-Session: https://claude.ai/code/session_01QBL6TAMVXRUY7iQyy9Ysvi
Contributor
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.
The file-level ratio divided branch hits by branch + structural_boundaries.
structural_boundaries is an ungoverned per-language vocabulary tally (45 words
in solidity, 16 in shell, 0 in markdown), so identical decision density read
wildly differently per language -- the corpus's worst metric at 33% consistency.
The denominator is now line_count: the non-blank lines of the comment-stripped
code stream, i.e. coding-LOC semantics. Chosen over total lines because comment
culture varies per language and must not skew a cross-language density metric.
This also brings the file-level ratio into agreement with two existing siblings:
the per-FUNCTION Control Flow Ratio (already branches/LOC) and logic_density
(same line_count, two lines below), plus record_keeper's dependency_density
(moved onto coding_loc by this issue's earlier phase, #2801).
structural_boundaries stays: it is the relocation target the branch contract
(#2822/#2832) depends on; it simply no longer prices a ratio.
logic_loc downstream shifts with the corrected ratio; it is an input to the
pre-trained security_auditor model, which has already drifted and has a retrain
tracked on #96 -- the retrain absorbs the new semantics.
Golden masters re-blessed (both modes); CI-equivalent verification PASS/PASS.
Closes #2770
Co-Authored-By: Claude Opus 4.8 [email protected]
Claude-Session: https://claude.ai/code/session_01QBL6TAMVXRUY7iQyy9Ysvi
🤖 Generated with Claude Code
https://claude.ai/code/session_01QBL6TAMVXRUY7iQyy9Ysvi