Repository navigation
feat(detector): has_header_comment, the non-scored companion to is_documented - #8240
Merged
Merged
Conversation
…omment signals to function hit_vector
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…cumented 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]>
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]>
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]>
…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]>
# Conflicts: # gitgalaxy/core/detector.py # tests/core_engine/test_detector.py # tests/golden_master_audit/12_scan_output_snapshots/graph_sqlite.json # tests/golden_master_zero_dep_audit/12_scan_output_snapshots/graph_sqlite.json
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Nov 10, 2026
squid-protocol
marked this pull request as ready for review
November 11, 2026 00:03
Contributor
Contributor
|
No description provided. |
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-protocol
added a commit
that referenced
this pull request
Nov 11, 2026
#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]>
squid-protocol
added a commit
that referenced
this pull request
Nov 11, 2026
…t of #6454) Main's #8240 (has_header_comment) and #8245 (jcl positional comment surface) landed without a joint bless; JCL function rows now report Has Header Comment 1 where a header comment precedes them. No Haskell/Rust golden drift. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This was referenced Nov 11, 2026
squid-protocol
added a commit
that referenced
this pull request
Nov 11, 2026
…art of #4108) Co-Authored-By: Claude Sonnet 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-shepherd Bot
pushed a commit
that referenced
this pull request
Nov 11, 2026
…6454) (#8252) * Haskell calls_out: primed identifiers are not char literals (Part of #6454) Two names ending in a prime on one line (`Just (_, t') -> case T.unsnoc t' of`) were paired by the shared literal shield as a char literal, blanking the code between them. The rule now masks identifier primes before the shield and restores them after it. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> * Re-bless golden: JCL has_header_comment after #8245 prism change (Part of #6454) Main's #8240 (has_header_comment) and #8245 (jcl positional comment surface) landed without a joint bless; JCL function rows now report Has Header Comment 1 where a header comment precedes them. No Haskell/Rust golden drift. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> --------- Co-authored-by: Claude Sonnet 5.5 <[email protected]>
squid-shepherd Bot
pushed a commit
that referenced
this pull request
Nov 11, 2026
…t of #4108) (#8257) * Hidden text: U+180E outside Mongolian and lone interlinear marks fire (Part of #4108) Co-Authored-By: Claude Sonnet 5.5 <[email protected]> * Re-bless golden masters: Has Header Comment drift from #8240/#8245 (Part of #4108) Co-Authored-By: Claude Sonnet 5.5 <[email protected]> --------- Co-authored-by: Joe Esquibel <[email protected]> Co-authored-by: Claude Sonnet 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
Adds
has_header_comment, a per-function signal recorded besideis_documented: true when an explanatory comment block sits directly above the unit, Doxygen or plain. It is not arisk_documentationinput. The new contract sectiondocs/risk_documentation_contract.md§8 gives the definition and the reason.Was stacked on #8200, which has merged; this now targets
main.Why
is_documentedis anchored on thedocrule (Doxygen/**,///,@param). Traditional C (curl, nDPI, OpenSSL, the kernel) explains functions in plain/* Curl_foo() does X */blocks, so on that code nearly every unit reads undocumented. That leaves temporal-crucible's comment experiments with nothing to measure. The owner chose to record the second fact as its own field (option C) rather than loosenis_documented: the score keeps one meaning across languages, and the data can show later whether the two signals behave differently.Definition (
StructuralExtractor._has_header_comment)template<...>, decorator) and 1 blank line may sit between the comment and the unit. A line ending in;{}, or a preprocessor line, stops the walk.dead_coderule, has fewer than 2 words, or is under 60% letters and digits once comment markers are removed (dividers).Where it lands
function_data.has_header_comment(SQLite; healed onto older databases likeis_documented), the incremental-scan cache (state_rehydrator.py), and the audit report's per-functionHas Header Comment.Measured
Direct extraction over language-crucible:
is_documentedhas_header_commentA read of a sample of rejected comment-above cases found mostly correct rejections: DOOM's
// P_SpawnMobjbanners that only repeat the function name,/* ARGSUSED */. It also found one wrong rejection ("Prints a copyright notice ..." read as a license), which led to the tighter license filter and a test.Real-repo check: curl (
97cef84, 492 C source files, tests/docs excluded)mainbefore #8200is_documentedhas_header_comment#include/#if/#endif/#defineThe curl scan found two follow-ups, both fixed here:
#endif /* X */lines. They end in*/, so fix(comments): scope C-family docstrings, attribute function comment signals, and guard C/C++ doc banners #8200's prefix scope let them through. The C-family harvest now stops at any#line (PHP excluded)./* Compress 512 bits */). The minimum is now 2 words; one-word banners (// P_SpawnMobj,/* ARGSUSED */) still fail.Known limit, unchanged: C's
dead_coderule reads/* return the position after %time{} */as commented-out code (it ends in{}), so that unit gets no header.Golden master bless scope
Compared against
mainin both fixtures, leaf by leaf viagolden_store:Has Header Commentis added on all 52,763 units.c/cpython/dictobject.c,c/cpython/object.c,cobol/gnucobol_internals/numeric.cin the graph snapshot).Nothing else moves: no score, archetype or file-level value.
Size
7 source/test/doc files plus 2 golden parts. That is over the usual 5-file guideline, but it is one column end to end: detector, recorder, rehydrator, audit recorder, contract, and their tests.
Verification
pytest tests/core_engine/test_detector.py tests/tools_recorders/test_record_keeper.py tests/extraction/languages/test_c_strict.py tests/extraction/languages/test_cpp_strict.py tests/core_engine/test_signal_processor.py: 511 passed, plus 11 new header tests.ruff_audit.py --ci,doc_refs_audit.py --ci,dead_key_audit.py --ci: no new findings.ruff format --check: clean.golden-lock.sh python tests/tools/crucible_check.py --update --yes.Cross-repo
Consumer: temporal-crucible's comment experiments (the curl re-scan on melek). Merge order: #8200 (merged), then this PR, then the 13-language banner-guard PR, then the re-scan.
🤖 Generated with Claude Code