Skip to content

feat(sleep): add opt-in section_contains rule judge - #228

Merged
Yifan Yang (Yif-Yang) merged 2 commits into
microsoft:mainfrom
bogdanbaciu21:agent/section-contains
Aug 15, 2026
Merged

feat(sleep): add opt-in section_contains rule judge#228
Yifan Yang (Yif-Yang) merged 2 commits into
microsoft:mainfrom
bogdanbaciu21:agent/section-contains

Conversation

@bogdanbaciu21

Copy link
Copy Markdown
Contributor

Summary

Add an opt-in section_contains rule-judge operator for permissive heading checks while preserving existing scoring behavior.

  • keeps section_present unchanged
  • registers section_contains across scoring, validation, mining, prompts, and backend guidance
  • classifies it as a shape-only operator
  • documents and tests the strict/permissive distinction

Contract

section_contains performs 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_present is 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

  • 97 focused judge/miner tests passed
  • 1,054 suite tests and 130 subtests passed; 12 skipped
  • one current-main Copilot parser regression was deselected after reproducing it unchanged at a17de4e
  • python -m mkdocs build --strict passed
  • Ruff passed on the focused files; backend.py retains seven pre-existing findings outside this two-line change

Related to #175.

@bogdanbaciu21
Bogdan (Dan) Baciu (bogdanbaciu21) marked this pull request as ready for review August 15, 2026 12:17
@Yif-Yang
Yifan Yang (Yif-Yang) merged commit 5830713 into microsoft:main Aug 15, 2026
1 check passed
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.

2 participants