Rectify: Mention Guard Prose-Zone Immunity#3358
Merged
Trecek merged 2 commits intoMay 31, 2026
Merged
Conversation
…n guard false positives Adds strip_markdown_code_regions() to tests/_helpers.py as a single shared utility for stripping fenced code blocks and inline code spans from markdown text before content scanning. - Replaces three independent duplicate implementations (_strip_examples in test_banned_phrases.py and test_glossary_spelling.py, and _strip_code_fences in test_investigate_design_intent_contracts.py) - Updates test_no_hardcoded_username_mentions_in_skill_mds to skip code zones via a line-by-line fence toggle with inline stripping per-line, preserving accurate line numbers in violation messages - Fixes the false positive bug where Python decorators (@DataClass, @pytest.mark.parametrize) in code fences would trigger the @-mention guard test - Corrects the misleading comment claiming the lookbehind prevents matching decorator patterns (it only prevents email local-parts) - Adds regression tests (decorators in fences = no violation, prose @-mention = violation) - Adds tests/arch/test_helpers_exports.py to guard against silent removal of the shared utility - Adds tests/test_helpers_strip.py with unit tests for the utility Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…gions fail-open contract Verifies that an unclosed fence is not consumed by strip_markdown_code_regions, preserving all prose before, inside, and after the unclosed fence. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2b292cd to
9b5bcbb
Compare
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
The plan consolidates three duplicate
_strip_examples/_strip_code_fencesimplementations (intests/docs/test_banned_phrases.py,tests/docs/test_glossary_spelling.py, andtests/skills/test_investigate_design_intent_contracts.py) into a single sharedstrip_markdown_code_regions()utility intests/_helpers.py. The mention-guard test (test_no_hardcoded_username_mentions_in_skill_mds) is updated to skip code zones, eliminating false positives from Python decorators in code examples. New regression tests and unit tests for the utility are added. The false-claim comment about decorator exclusion in the lookbehind is corrected.Requirements
Conflict Resolution Decisions
The following files had merge conflicts that were automatically resolved.
Changed Files
New (★):
Modified (●):
Closes #3330
Implementation Plan
Plan file:
/home/talon/projects/autoskillit-runs/remediation-20260530-152530-777371/.autoskillit/temp/rectify/rectify_mention_guard_prose_zone_immunity_2026-05-30_153500.md🤖 Generated with Claude Code via AutoSkillit
Token Usage Summary
* Step used a non-Anthropic provider; caching behavior may differ.
Token Efficiency
Model Usage Breakdown