Skip to content

fix: ngram-repetition leaves the phrase each named entry of a specification carries - #3001

Open
isamu wants to merge 1 commit into
mainfrom
fix/ngram-repetition-named-entry-sections
Open

isamu wants to merge 1 commit into
mainfrom
fix/ngram-repetition-named-entry-sections

Conversation

@isamu

@isamu isamu commented Nov 30, 2026

Copy link
Copy Markdown
Owner

Summary

A specification that defines one named item per section (2.5.3. Contact / The "Contact" field indicates …) fills one template per item, so a phrase each item's section carries once or twice (If this field indicates a web URI, …) is the template, not the writer repeating themselves. ngram-repetition already leaves such phrases in sections of a repeated form (the same field heading, or the same sub-headings); this adds a third form: sibling sections that each quote their own heading in one of the first sentences after the heading line.

The sections are read from the structure tree (doc.structure: headed section, chapter and article nodes with their heading), so plain-text specifications with numbered headings, which have no Markdown sections, are covered as well as Markdown ones. As before, a phrase repeated more than twice in one section, or used outside the group past the limit, is still counted.

Items to Confirm / Review

  • A section qualifies only when its own heading appears in straight or curly double quotes in one of the first two sentences after the heading line; at least three such siblings under one parent are needed (the existing MIN_SIBLINGS).
  • Tests cover a Markdown specification, a plain-text one with numbered headings, and the same text where the sections do not quote their names (still reported).
  • Judged corpus (all documents): the false positive is gone, no correct finding lost, no new ngram-repetition finding. yarn corpus and yarn planted unchanged.

Closes #2965

🤖 Generated with Claude Code
work in lab

…cation carries

Sibling sections that each quote their own heading in their first sentence (2.5.3.  Contact / The "Contact" field
indicates …) define one named item each and fill one template per item (If this field indicates …). They join the
repeated forms whose phrase, carried once or twice per section, is not counted; plain-text numbered sections are read
from the structure tree. Uses outside those sections still count against the limit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chaff-corpus: rfc9116-security-txt — ngram-repetition

1 participant