diff --git a/src/ouroboros/auto/safe_defaults.py b/src/ouroboros/auto/safe_defaults.py index c59d1a539..ab67e7646 100644 --- a/src/ouroboros/auto/safe_defaults.py +++ b/src/ouroboros/auto/safe_defaults.py @@ -104,6 +104,29 @@ def _is_valid_default_spec(spec: _DefaultSpec) -> bool: ), } + +# Line-anchored marker for a user-declared non-goal / exclusion section in +# a free-form goal string. Examples that match: +# ``non_goals: …`` ``non-goals: …`` ``Non Goals: …`` +# ``excludes: …`` ``Out-of-scope: …`` ``- non_goals:`` +# The trailing colon is required so that prose that merely mentions +# ``non-goals`` in a sentence is not mistaken for a section header. +_PROMPT_NON_GOAL_HEADER = re.compile( + r"^\s*(?:[-*•]\s+)?(?:non[ _-]?goals?|excludes?|out[ _-]?of[ _-]?scope)\s*:", + re.IGNORECASE, +) + +# Any other line-anchored ``