Repository navigation
fix(comments): scope C-family docstrings, attribute function comment signals, and guard C/C++ doc banners - #8200
Merged
Conversation
…omment signals to function hit_vector
Co-Authored-By: Claude Opus 5.5 <[email protected]>
squid-protocol
force-pushed
the
fix/comment-extraction-pipeline
branch
from
November 10, 2026 21:40
c54e1f4 to
9f14ff4
Compare
squid-protocol
marked this pull request as ready for review
November 10, 2026 22:06
Contributor
The function-grain comment pass calls re.finditer on the stream outside the doc pass's try, so a stubbed Prism (test_galaxyscope's worker tests) crashed the whole splice. Fixes test_worker_amplifies_active_hemorrhage_post_hoc. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
|
No description provided. |
Contributor
|
No description provided. |
squid-protocol
added a commit
that referenced
this pull request
Nov 10, 2026
…comments count Found on a real curl scan: 93 C docstrings still carried '#endif /* X */' lines (they end in */, so the #8200 prefix scope let them through); now 0. A two-word explanation ('/* Compress 512 bits */') is a header comment; one-word banners still are not. Golden drift: 923 Has Header Comment flips and 3 C function docstrings (cpython dictobject.c/object.c, gnucobol numeric.c). Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Nov 10, 2026
squid-shepherd Bot
pushed a commit
that referenced
this pull request
Nov 11, 2026
jcl contributed a blank positional stream ('moot: no doc rule'), but the
stream now also feeds the function-grain comment rules (#8200) and header
comments (#8240): every jcl step read as uncommented. Keep each //* comment
statement at its line (JES3 verbs excluded, as _strip_jcl_comments does).
Co-authored-by: Joe Esquibel <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
squid-shepherd Bot
pushed a commit
that referenced
this pull request
Nov 11, 2026
…cumented (#8240) * fix(detector): scope docstring harvest-above prefixes and attribute comment signals to function hit_vector * fix(c): guard doc rule against ASCII star-banner and slash-divider false positives * fix(cpp): guard doc rule against ASCII star-banner and slash-divider false positives * test(golden): re-bless snapshots after rebase onto main Co-Authored-By: Claude Opus 5.5 <[email protected]> * feat(detector): has_header_comment, the non-scored companion to is_documented Traditional C documents functions with plain /* ... */ blocks, which is_documented (Doxygen-anchored, D3) never sees: on language-crucible's C files it marks 1 of 1,732 functions. has_header_comment records any explanatory comment block directly above a unit (license headers, dividers, one-word banners and commented-out code rejected) as its own function_data column. It is not a risk_documentation input; contract §8 says why and what it measures. Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(golden): bless the per-function Has Header Comment field Only change: the new key in 5. Function Analysis (both fixtures identical with it removed); true on 10,357 of 52,763 units. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(detector): read a non-str positional comment stream as empty The function-grain comment pass calls re.finditer on the stream outside the doc pass's try, so a stubbed Prism (test_galaxyscope's worker tests) crashed the whole splice. Fixes test_worker_amplifies_active_hemorrhage_post_hoc. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(detector): stop C docstring harvest at directives; 2-word header comments count Found on a real curl scan: 93 C docstrings still carried '#endif /* X */' lines (they end in */, so the #8200 prefix scope let them through); now 0. A two-word explanation ('/* Compress 512 bits */') is a header comment; one-word banners still are not. Golden drift: 923 Has Header Comment flips and 3 C function docstrings (cpython dictobject.c/object.c, gnucobol numeric.c). Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(golden): re-bless graph snapshot after merging main Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Joe Esquibel <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
squid-shepherd Bot
pushed a commit
that referenced
this pull request
Nov 11, 2026
…locks (#8244) * fix(doc): guard 13 languages' doc rule against star-banner and slash-divider false positives Same /**(?!\*) and (?<!/)///(?!/) guard #8200 put on c/cpp: apex, dart, groovy, java, javascript, kotlin, objective-c, php, scala, solidity, swift, typescript, yacc. A /***** box border or //// divider is not a doc block. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(doc): narrow the banner guard so /*** + newline docblocks still count (?!\*) also rejected Magento-style '/***' docblocks (found on the golden: Mysql.php's doc count went up as their @var tags counted alone). Reject only banner shapes: /**** (2+ extra stars) and one-line '/*** x ***/' boxes. Applied to all 15 /** languages, c/cpp included. Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(golden): bless the banner guard (threejs GLTFLoader.js: 67 -> 58 doc blocks) Co-Authored-By: Claude Opus 5.5 <[email protected]> * style: ruff format the widened doc rules (patterns unchanged) Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(golden): re-bless after merging main (#8240 + #8245 together) #8240 was blessed before #8245 merged, so main's goldens never had both: with jcl's positional comments, 119 jcl steps now read Has Header Comment 0 -> 1. Plus this PR's own GLTFLoader.js banner drift. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Joe Esquibel <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
squid-protocol
added a commit
that referenced
this pull request
Nov 11, 2026
…divider false positives Same /**(?!\*) and (?<!/)///(?!/) guard #8200 put on c/cpp: apex, dart, groovy, java, javascript, kotlin, objective-c, php, scala, solidity, swift, typescript, yacc. A /***** box border or //// divider is not a doc block. Co-Authored-By: Claude Opus 5.5 <[email protected]>
squid-shepherd Bot
pushed a commit
that referenced
this pull request
Nov 11, 2026
…t end in C-family (#8255) * fix(doc): guard 13 languages' doc rule against star-banner and slash-divider false positives Same /**(?!\*) and (?<!/)///(?!/) guard #8200 put on c/cpp: apex, dart, groovy, java, javascript, kotlin, objective-c, php, scala, solidity, swift, typescript, yacc. A /***** box border or //// divider is not a doc block. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(doc): narrow the banner guard so /*** + newline docblocks still count (?!\*) also rejected Magento-style '/***' docblocks (found on the golden: Mysql.php's doc count went up as their @var tags counted alone). Reject only banner shapes: /**** (2+ extra stars) and one-line '/*** x ***/' boxes. Applied to all 15 /** languages, c/cpp included. Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(golden): bless the banner guard (threejs GLTFLoader.js: 67 -> 58 doc blocks) Co-Authored-By: Claude Opus 5.5 <[email protected]> * style: ruff format the widened doc rules (patterns unchanged) Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(golden): re-bless after merging main (#8240 + #8245 together) #8240 was blessed before #8245 merged, so main's goldens never had both: with jcl's positional comments, 119 jcl steps now read Has Header Comment 0 -> 1. Plus this PR's own GLTFLoader.js banner drift. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(dead_code): control keywords need '(' and return needs a statement end in C-family On curl 39 of 48 dead_code hits were prose: '/* for offsetof() */', '/* if a request ... (on a file) */', '/* return the position after %time{} */'. In c/cpp/java/javascript/typescript, if/for/while must be followed by '(' (their conditions always are); in c/cpp/java a commented return must end in ';' or return a call directly (#7207's '// return foo(x)'). curl: 48 -> 9 hits, both real commented-out statements kept, the rest are commented prototypes. Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(golden): bless the dead_code shape fix (3 corpus files; plus main's stale jcl header drift) Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(golden): re-bless after merging #8244 (derived gpu digest only) Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Joe Esquibel <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
squid-shepherd Bot
pushed a commit
that referenced
this pull request
Nov 11, 2026
…; rejects trailing-comment tails (#8256) * fix(doc): guard 13 languages' doc rule against star-banner and slash-divider false positives Same /**(?!\*) and (?<!/)///(?!/) guard #8200 put on c/cpp: apex, dart, groovy, java, javascript, kotlin, objective-c, php, scala, solidity, swift, typescript, yacc. A /***** box border or //// divider is not a doc block. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(doc): narrow the banner guard so /*** + newline docblocks still count (?!\*) also rejected Magento-style '/***' docblocks (found on the golden: Mysql.php's doc count went up as their @var tags counted alone). Reject only banner shapes: /**** (2+ extra stars) and one-line '/*** x ***/' boxes. Applied to all 15 /** languages, c/cpp included. Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(golden): bless the banner guard (threejs GLTFLoader.js: 67 -> 58 doc blocks) Co-Authored-By: Claude Opus 5.5 <[email protected]> * style: ruff format the widened doc rules (patterns unchanged) Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(golden): re-bless after merging main (#8240 + #8245 together) #8240 was blessed before #8245 merged, so main's goldens never had both: with jcl's positional comments, 119 jcl steps now read Has Header Comment 0 -> 1. Plus this PR's own GLTFLoader.js banner drift. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(dead_code): control keywords need '(' and return needs a statement end in C-family On curl 39 of 48 dead_code hits were prose: '/* for offsetof() */', '/* if a request ... (on a file) */', '/* return the position after %time{} */'. In c/cpp/java/javascript/typescript, if/for/while must be followed by '(' (their conditions always are); in c/cpp/java a commented return must end in ';' or return a call directly (#7207's '// return foo(x)'). curl: 48 -> 9 hits, both real commented-out statements kept, the rest are commented prototypes. Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(golden): bless the dead_code shape fix (3 corpus files; plus main's stale jcl header drift) Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(detector): has_header_comment steps over the unit's own prototype; rejects trailing-comment tails From the curl hand audit (temporal-crucible#118): curl documents UNITTEST functions as comment, forward declaration, definition, and the walk stopped at the prototype's ';'; a blank line inside a /* */ block cut the block short; and the wrapped tail of a #define's trailing comment read as a header. curl C: 1,196 -> 1,223 header comments (29 gained, all the UNITTEST idiom; 2 lost, both trailing-comment tails). Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(golden): bless the header-comment fixes (29 corpus units gain a header; plus main's stale jcl drift) Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(golden): re-bless after merging #8244 (derived gpu digest only) Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Joe Esquibel <[email protected]> Co-authored-by: Claude Opus 5.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
This PR stacks three fixes addressing comment-extraction accuracy discovered during the
temporal-cruciblecomment-extraction assessment:fix(detector): scope docstring harvest-above prefixes and attribute comment signals to function hit_vector(1e6ae21a8)_extract_documentation_tether(gitgalaxy/core/detector.py), scope the harvest-above comment prefixes forstandard_blockandrecursive_blocklanguages to("//", "/*", "*", "///")(plus"#"forphp) andabove_suffixes = ("*/",). Previously,"#"was included globally, causing C/C++/Objective-C/C# preprocessor directives (#include,#ifdef,#endif,#define) immediately above a function signature to be harvested as itsdocstring.splice(gitgalaxy/core/detector.py), run the 6 comment-surface rules (dead_code,doc,ownership,planned_debt,fragile_debt,spec_exposure) againstpositional_comment_streamand attribute line-matched hits within[start_line, end_line](or[start_line - _DOC_ANCHOR_LINES_ABOVE, end_line]fordoc) into each function'shit_vectorafter_calculate_block_metricscomputeskeyword_density(preserving 100% function archetype neutrality).fix(c): guard doc rule against ASCII star-banner and slash-divider false positives(3295a1fa1)gitgalaxy/standards/language_standards/languages/c.py, tighten thedocrule pattern from/\*\*to/\*\*(?!\*)and///to(?<!/)///(?!/)so ASCII box borders (/***********...) and slash dividers (////...) do not register as Doxygen documentation comments.fix(cpp): guard doc rule against ASCII star-banner and slash-divider false positives(c54e1f498)gitgalaxy/standards/language_standards/languages/cpp.py, apply the same/\*\*(?!\*)and(?<!/)///(?!/)lookaround guards to the C++docrule.Golden Master Bless Scope
c(hit_vector[doc]): Removed 38 false-positivedochits across 6 files caused by/******...ASCII banner comments:c/sqlite/lemon.c:23 -> 0c/cpython/dictobject.c:5 -> 0c/cpython/gc.c:2 -> 0c/cpython/object.c:1 -> 0c/micropython/compile.c:2 -> 0c/micropython/objtype.c:5 -> 0cpp(hit_vector[doc]): Removed 52 false-positivedochits across 13cpp/godot/*.{cpp,h}files caused by/******...section banners:cpp/godot/editor_node.cpp:4 -> 0cpp/godot/editor_node.h:4 -> 0cpp/godot/gdscript_vm.cpp:4 -> 0cpp/godot/main.cpp:10 -> 6cpp/godot/main.h:4 -> 0cpp/godot/node.cpp:9 -> 1cpp/godot/node.h:8 -> 4cpp/godot/object.cpp:4 -> 0cpp/godot/object.h:10 -> 6cpp/godot/rendering_server_default.cpp:4 -> 0cpp/godot/rendering_server_default.h:4 -> 0cpp/godot/variant.cpp:4 -> 0cpp/godot/variant.h:4 -> 0function_data(graph_sqlite&gpu_json): Function-level comment signal columns (state_graveyard,def_doc,def_ownership,state_planned_debt,state_fragile_debt,def_spec_exposure) are now populated frompositional_comment_streaminstead of remaining unconditionally0, and C-familydocstringfields no longer include#include/#ifdef/#endiflines.Verification
pytest tests/core_engine/test_detector.py tests/extraction/languages/test_c_strict.py tests/extraction/languages/test_cpp_strict.pypython3 ../keyword-rosetta/tools/verify_language.py c(88/88 assertions passed)python3 ../keyword-rosetta/tools/verify_language.py cpp(88/88 assertions passed)python3 tests/tools/audit_check.py(all 5 gates passed:ruff,mypy,dead-key,doc-refs,ast-accuracy)python3 tests/tools/crucible_check.py(0 diffs)