feat(sleep): add opt-in section_contains rule judge - #228
Merged
Yifan Yang (Yif-Yang) merged 2 commits intoAug 15, 2026
Conversation
Bogdan (Dan) Baciu (bogdanbaciu21)
marked this pull request as ready for review
August 15, 2026 12:17
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
Add an opt-in
section_containsrule-judge operator for permissive heading checks while preserving existing scoring behavior.section_presentunchangedsection_containsacross scoring, validation, mining, prompts, and backend guidanceContract
section_containsperforms a literal, Unicode case-insensitive substring match on ATX-heading-shaped lines: up to three leading spaces, one to six#markers, then whitespace or end of line.It accepts numbered, bilingual, and annotated headings such as
### 1. Key Risks (Риски) — overview, while ordinary body text, bold labels, Setext headings, and blockquoted lines do not match.Because
section_presentis unchanged, existing task sets retain their current scores.Attribution
This implements the additive, compatibility-preserving operator proposed by Koi Lee (@koi-lee) and accepted by maintainers in #175. Thank you, Koi Lee (@koi-lee), for defining the direction and expected behavior.
Validation
mainCopilot parser regression was deselected after reproducing it unchanged ata17de4epython -m mkdocs build --strictpassedbackend.pyretains seven pre-existing findings outside this two-line changeRelated to #175.