Skip to content

Fix CI: track widened augment matcher in hook config tests#782

Merged
RaghavChamadiya merged 1 commit into
mainfrom
fix/mcp-config-hook-matcher-tests
Jul 11, 2026
Merged

Fix CI: track widened augment matcher in hook config tests#782
RaghavChamadiya merged 1 commit into
mainfrom
fix/mcp-config-hook-matcher-tests

Conversation

@RaghavChamadiya

Copy link
Copy Markdown
Member

Problem

CI's Python 3.12 tests job has been red on main across the last several commits (#778, #779, #780). Every run fails on the same 8 tests in tests/unit/cli/test_mcp_config.py:

AssertionError: assert [('Bash|PowerShell|Grep|Glob|Read|Edit|Write|mcp__.*[Rr]epowise.*__.*', 'repowise-augment')]
                    == [('Bash|PowerShell|Grep|Glob|Read|Edit|Write', 'repowise-augment')]

Root cause

The augment PostToolUse matcher in claude_config.py was widened to append mcp__.*[Rr]epowise.*__.* (feeding the read-after-served ledger), and the old value was demoted into _LEGACY_AUGMENT_MATCHERS so existing installs migrate in place. The hook install/migrate tests still pinned the pre-widening literal as their expected output, and the "noop when already current" test still fed the old literal as its already-current input, so both drifted from the source.

Fix

Assert against claude_config._AUGMENT_MATCHER instead of a hardcoded string for the expected-output rows, and point the noop test's already-current input at the same constant. Legacy-input matchers (the values migration is meant to widen) are left untouched. Test-only change.

tests/unit/cli/test_mcp_config.py | 14 +++++++-------

All 46 tests in the file pass locally.

The augment PostToolUse matcher gained the mcp__.*[Rr]epowise.*__.* pattern
and the old value was demoted to a legacy matcher that migration widens.
The hook install/migrate tests still pinned the pre-widening literal, so
every run on main failed. Assert against claude_config._AUGMENT_MATCHER so
the expected-output rows can't drift from the source again, and set the
noop test's already-current input to the same constant.
@repowise-bot

repowise-bot Bot commented Jul 11, 2026

Copy link
Copy Markdown

✅ Health: 7.6 (unchanged)

📋 At a glance
1 hotspot touched · 5 co-change pairs left out · 1 file with recent fix history. Scoped to tests.

🩹 Review priority (files here with the most recent bug-fix history — defects cluster, so review these first)

🔎 More signals (2)

🔥 Hotspot touched (1)

  • .../cli/test_mcp_config.py — 10 commits/90d, 4 dependents · primary owner: Raghav Chamadiya (70%)

🔗 Hidden coupling (1 file)

  • .../cli/test_mcp_config.py co-changes with these files (not in this PR):
    • .../cli/mcp_config.py (4× — 🟢 routine)
    • .../editor_integrations/claude_config.py (4× — 🟢 routine)
    • docs/USER_GUIDE.md (3× — 🟢 routine)
    • .../cli/main.py (3× — 🟢 routine)
    • docs/DISTILL.md (2× — 🟢 routine)

📊 Full report · ⭐ Star Repowise · 📥 Install bot · Last updated 2026-07-11 13:44 UTC
Silence on a single PR with [skip repowise] in the title · Per-repo toggle on repowise.dev/settings?tab=bot

@RaghavChamadiya RaghavChamadiya merged commit 78022da into main Jul 11, 2026
7 checks passed
@RaghavChamadiya RaghavChamadiya deleted the fix/mcp-config-hook-matcher-tests branch July 11, 2026 14:00
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