Skip to content

fix(doc): banner guard for the 13 other /** languages; keep /*** docblocks - #8244

Merged
squid-shepherd[bot] merged 6 commits into
mainfrom
fix/doc-banner-guard-13
Nov 11, 2026
Merged

squid-shepherd[bot] merged 6 commits into
mainfrom
fix/doc-banner-guard-13

Conversation

@squid-protocol

@squid-protocol squid-protocol commented Nov 10, 2026 •

Copy link
Copy Markdown
Owner

Summary

Extends the doc-rule banner guard from #8200 (C/C++) to every other language whose doc rule opens with /**: apex, dart, groovy, java, javascript, kotlin, objective-c, php, scala, solidity, swift, typescript, yacc. It also narrows the guard for all 15, C/C++ included.

The guard. /\*\*(?!\*\*|\*[^\n]{0,200}\*\*/) rejects two banner shapes:

  • a /**** border (2+ extra stars), and
  • a one-line /*** title ***/ box.

A /*** + newline docblock still counts. Dart, Objective-C, Solidity and Swift (the languages with a /// doc form) also get (?<!/)///(?!/), so //// dividers don't count.

Why narrower than #8200's (?!\*). The first bless of this PR showed Magento's Mysql.php doc count going up (179 -> 181). Magento writes real docblocks as /*** + newline + * Get exact version of MySQL. (?!\*) dropped those blocks, so their @var tags counted one by one. The narrower guard keeps them. #8200's C/C++ guard had the same over-reach, so it is replaced here; the C/C++ golden does not move, because no corpus C/C++ file uses that style.

Golden master bless scope

Only javascript/threejs/GLTFLoader.js changes. Its 9 /***************...***/ and /********** EXTENSIONS ***********/ section-banner lines stop counting as doc blocks: Structured Documentation Blocks 67 -> 58. Everything else that moves is derived from that file: its function analysis and risk exposures, the threejs directory averages, health.avg_cognitive_load (20.03 -> 20.031), the hits/risks flats and the LLM brief. No file is newly parsed or excluded.

Also re-blessed here: #8240 + #8245 together

#8240 was blessed before #8245 (jcl positional comments) merged, so main's goldens never had both. With both on main, 119 jcl steps read Has Header Comment 0 -> 1 (all jcl, all 0 -> 1). Sampled cases are real //* comments above the step, e.g. //***** CSD definitions for stand-alone GENAPP above CSDDEFS. That drift belongs to #8240/#8245; it lands here because this is the next bless after both merged.

Verification

  • tests/extraction/languages/test_doc_banner_guard.py (new): 66 cases over the 15 languages. A star border, a one-line star box and a //// divider are rejected; /** ... */, /*** + newline and /// are accepted.
  • The 15 languages' test_<lang>.py + test_<lang>_strict.py, plus test_detector.py: 2,529 passed.
  • keyword-rosetta/tools/verify_language.py <lang> --engine <this worktree>: PASS for all 15.
  • Bless: golden-lock.sh python tests/tools/crucible_check.py --update --yes.

Size

15 language files and 1 test, plus golden parts: over the usual 5-file guideline. It is the same one-line regex change in each doc rule.

Cross-repo

None. Sibling of #8240; both touch the golden snapshots, so whichever merges second needs rebase_rebless.py (or a merge of main plus a re-bless).

🤖 Generated with Claude Code

squid-protocol and others added 3 commits November 10, 2026 17:46
…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]>
…ount

(?!\*) 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]>
@squid-protocol
squid-protocol marked this pull request as ready for review November 11, 2026 00:03
@squid-protocol squid-protocol added the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Nov 11, 2026
@squid-shepherd squid-shepherd Bot removed the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Nov 11, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

CI shepherd: the head of this PR (db3b29c) is not the one a maintainer labelled shepherd:merge on (new commits, or never approved), so the label was removed and nothing merges unreviewed code. Re-add the label when the new head is ready (shepherd:reapprove marks this PR until then). Until then it is a draft and runs the cheap audits only; re-adding the label marks it ready, which starts the full set on that head.

@squid-shepherd
squid-shepherd Bot marked this pull request as draft November 11, 2026 00:15
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd squid-shepherd Bot added the shepherd:reapprove Bot: new commits dropped shepherd:merge; re-add it to merge this head. Guide: docs/ci.md label Nov 11, 2026
squid-protocol and others added 2 commits November 10, 2026 19:49
#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-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot marked this pull request as ready for review November 11, 2026 02:34
@squid-shepherd squid-shepherd Bot removed the shepherd:reapprove Bot: new commits dropped shepherd:merge; re-add it to merge this head. Guide: docs/ci.md label Nov 11, 2026
@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) November 11, 2026 02:37
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot merged commit 930d804 into main Nov 11, 2026
124 checks passed
@squid-shepherd
squid-shepherd Bot deleted the fix/doc-banner-guard-13 branch November 11, 2026 03:16
squid-protocol added a commit that referenced this pull request Nov 11, 2026
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant