Repository navigation
fix(scripts): scan services/ for # MOCKED: markers in check_mocks - #8
Closed
rsanghvi21 wants to merge 1 commit into
Closed
rsanghvi21 wants to merge 1 commit into
rsanghvi21 wants to merge 1 commit into
Conversation
check_mocks.py only scanned src/ for # MOCKED: markers, so a marker placed anywhere under services/ was invisible to the make check mock-parity gate required by AGENTS.md §7.3. Add a second scan of services/, re-keying its markers with the services/ prefix so they match the dotted module names used in docs/MOCKS.md (e.g. services.auth_service.app). Also fixes a latent Windows bug uncovered while adding this: rel_path was built with str() instead of as_posix(), so backslash-separated paths never matched the forward-slash dotted module names produced by _module_matches_file. This was invisible until now because docs/MOCKS.md has been empty, but would have silently broken parity checking for any nested src/ marker on Windows. Discovered while investigating a code-review finding for PR #6; this fix unblocks registering the auth_service synthetic-token mock in a follow-up PR. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CzBeBUsZmE38K1kWeLMhNh
This was referenced Sep 11, 2026
Owner
|
Closed as integrated into main via PR #6. |
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.
Build-Plan Step Implemented
# MOCKED:marker parity gate established by AGENTS.md §7.3, surfaced by a/code-reviewpass against PR feat(deploy,services): implement rbac policies, twin network policy, and loadgen (A1.7-A1.8) #6.Checkpoint Execution & Output
ADRs Relied On
Mock Registry Disclosures
# MOCKED:marker; it fixes the checker itself so a future marker placed underservices/is actually enforced (currentlydocs/MOCKS.mdis empty, so nothing changes in practice yet).Documentation Updates
Definition of Done
make checkgreen (ruff, mypy --strict, import-linter, pytest)# MOCKED:marker without a row in docs/MOCKS.mdContext
/code-reviewwas run against PR #6 and flagged the auth-service synthetic-tokenacceptance as needing a
# MOCKED:marker +docs/MOCKS.mdrow (per AGENTS.md§2.3/§7). Investigating that finding surfaced that
scripts/check_mocks.pyonlyscans
src/for markers (src_dir = repo_root / "src"), so a marker placedunder
services/— a separate package tree fromsrc/understudy/— wouldnever be picked up by the
make checkparity gate. This PR fixes that gap soPR 9 in the follow-up sequence (auth mock registration) is actually enforced.
While adding test coverage for the
services/scan, also found and fixed alatent Windows bug:
scan_source_markersbuilt relative paths withstr()instead of
.as_posix(), so on Windows a nested marker's backslash-separatedpath would never match the forward-slash dotted module names produced by
_module_matches_file. This has been invisible becausedocs/MOCKS.mdiscurrently empty, but would have silently broken parity checking the moment a
nested
src/marker was registered on a Windows checkout.🤖 Generated with Claude Code
https://claude.ai/code/session_01CzBeBUsZmE38K1kWeLMhNh