Repository navigation
test(arch-lint): never walk the Hypothesis cache in the repository inventory - #4388
Merged
Daniel Meppiel (danielmeppiel) merged 1 commit intoNov 20, 2026
Conversation
…ventory Windows units 3/3 on main (b9ba827) failed test_architecture_skills_root_guard with "cannot inventory repository: [WinError 3] ... .hypothesis\tmp": Hypothesis removed its temp dir while the architecture inventory walked the checkout. .hypothesis is a generated test-tool cache like .pytest_cache, so it joins the anywhere-excluded names and is never descended into. Walk errors on source directories stay fail-closed (accb621): a new test pins that a WinError 3 on src/ still aborts the inventory, and another proves a vanishing .hypothesis cache no longer can. Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel)
requested a review
from Sergio Sisternes (sergio-sisternes-epam)
as a code owner
November 20, 2026 15:53
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Both new Windows regression tests lack pytest.mark.windows_compat, so the PR-time Windows Compatibility Gate skips their cache-exclusion and source-error checks.
1 open issue
What changed in this PR
This PR fixes a Windows race in the architecture linter's repository inventory by preventing traversal of Hypothesis caches, while preserving failures for missing source directories.
Changes:
- Exclude
.hypothesisdirectories at any depth. - Add regression tests for cache traversal and source-directory errors.
- Update the frozen exclusion-list assertion.
| File | Description |
|---|---|
| tests/unit/scripts/test_architecture_inventory.py | Adds regression coverage and updates the expected exclusions. |
| scripts/architecture_linter/inventory.py | Excludes Hypothesis caches from repository traversal. |
Review effort: Balanced
| return error | ||
|
|
||
|
|
||
| def test_tool_cache_vanishing_mid_walk_is_never_walked(tmp_path, monkeypatch) -> None: |
Daniel Meppiel (danielmeppiel)
deleted the
danielmeppiel-inventory-vanish-winerror
branch
November 20, 2026 16:10
3 of 10 tasks
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.

Description
Fix-forward for red main. Main push b9ba827, Windows units 3/3:
tests/unit/scripts/test_architecture_skills_root_guard.py::test_open_coded_skills_root_is_flagged[...]failed withcannot inventory repository: [WinError 3] The system cannot find the path specified: '...\.hypothesis\tmp'. Hypothesis deleted its temp dir while the architecture inventory was walking the checkout.Fix (
scripts/architecture_linter/inventory.py):.hypothesisjoins the generated tool caches (.pytest_cache,.ruff_cache,.mypy_cache, which were already excluded) as an anywhere-excluded name, so the walk never descends into it.Walk errors on real source directories stay fail-closed, unchanged from accb621's Copilot-review fold: a vanished source subtree is never silently dropped from the architecture linter. I deliberately did not add a blanket ENOENT/WinError 3 tolerance, since that would reopen that hole. Excluding the cache removes the race at its source.
Tests (
tests/unit/scripts/test_architecture_inventory.py):test_tool_cache_vanishing_mid_walk_is_never_walked: mocksos.scandirto raise the Windows path-not-found OSError (errno ENOENT,winerror=3) for.hypothesisat the root and nested. The inventory succeeds and lists nothing under it. Mutation break: without the exclusion, this test fails.test_windows_path_not_found_in_source_still_fails_closed: the same OSError onsrc/still aborts the inventory.EXCLUDED_ROOTStuple is updated.Issue and approved scope
Issue: Refs #3983
Human scope-approval comment: delivery-manager-directed fix-forward for red main (0.37 release mechanics); test tooling only.
Does this PR complete the issue, or what remains? It clears this Windows inventory race only.
Type of change
Testing
Tested locally
All existing tests pass
Added tests for new functionality (if applicable)
Via the host guard
local-test.sh:pytest -p no:xdist tests/unit/scripts/test_architecture_inventory.pypassed (24 passed).Mutation: with
.hypothesisremoved from the exclusion,-k tool_cachegives 1 failed.ruff check/ruff format --check(0.15.12) onscripts/architecture_linter/,scripts/lint_architecture_boundaries.pyand the changed test: clean.Changelog
## [Unreleased]inCHANGELOG.md.Spec conformance (OpenAPM v0.1)