Repository navigation
Add silent-fallback, BOUND-5 embedded-code, and cloned-family detectors - #647
Merged
Merged
Conversation
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
Adds four high-precision detectors (
PatternId60–63) closing the blind spots reported fromOpenHCSDev/personal-modelwhere real silent-failure and inline-asset slop sailed through NRA cleanly:EmbeddedCodeLiteralDetector(PatternId.EMBEDDED_CODE_LITERAL = 60,BOUND-5): flags non-docstring multiline string literals (>= 20lines or>= 1,500chars) embedding foreign source code (HTML/CSS/JS, JavaScript, Shell, SQL DDL) without requiring asubprocess/node -ecall site.SilentMissingPathFallbackDetector(PatternId.SILENT_MISSING_PATH_FALLBACK = 61): flags positive.is_file()/.exists()/.is_dir()comprehension filters over non-discovery iterables, existence-guarded call ternaries returning empty/sentinel defaults, and existence-guarded /orfallbacks toDefault*/Fallback*constructors. Excludes filesystem discovery iterables (iterdir,glob,rglob,parents,scandir,walk,os,glob) and negated existence checks (if not p.exists()).SilentExceptionFallbackDetector(PatternId.SILENT_EXCEPTION_FALLBACK = 62,BOUND-7EAFP bypass + broad silent swallow): flags single-statement silentexcepthandlers (pass,continue,return/assignof constant/empty/name != caught binding) catchingAttributeError(with non-I/O companionsTypeError/IndexError/KeyError/ValueError) or broadException/BaseException/bareexcept.ClonedDeclaredFamilyDetector(PatternId.CLONED_DECLARED_FAMILY = 63,MEMB-1/TIME-1): flags two or more unrelated modules declaring distinctDeclaredFamilyroots with the same class name.Live Precision & Recall
OpenHCSDev/personal-modelpre-fix (4ec38215c1):P60:serving/media_gallery.py:5171(2,199 lines / 127,203 chars HTML/CSS/JS)P61:train_offbox/compact_prune_stage.py:2217, 2294, 2361, 2830, 2924,serving/media_gallery.py:3950P62:train_offbox/sft.py:126, 275, 806,train_offbox/self_study_corpus.py:134, 420,serving/sft_row_inspector.py:396, 418, 458OpenHCSDev/personal-modelHEAD (a4364f95) — 23 live hits still present:P61(7):train_offbox/pipeline.py:701, 704, 844, 913, 995,train_offbox/probe_callback.py:1819,serving/media_gallery.py:4262P62(14):train_offbox/probe_callback.py:1013, 1086, 1892, 1896, 1905, 1916, 1924, 1971, 2040, 2050, 2157, 2239, 2264,train_offbox/sft.py:126P63(2):MediaArtifact(practice/captured_media.py:111vsserving/media_gallery.py:1461),PipelineStage(serving/media_gallery.py:3717vstrain_offbox/pipeline.py:1078)NominalRefactorAdvisor(300 modules):P60=0, P61=5, P62=4, P63=0agent-comms(955 modules):P60=0, P61=16, P62=0, P63=0REL_IMPORTS=0