Repository navigation
fix(arch): scope lockfile-read guard to the read-only resolver - #3568
Merged
Daniel Meppiel (danielmeppiel) merged 1 commit intoNov 11, 2026
Merged
Conversation
#3532 added "and not new_path.is_symlink()" to migrate_lockfile_if_needed. The contracts-tooling-lockfile-read rule checked that fragment anywhere in lockfile.py, so removing it from resolve_lockfile_path_for_read no longer tripped the guard; the mutation test failed with "assert 2 == 1" in the release dry run (43039615994, macOS arm64). Check the resolver fragments within the resolver's own body and anchor the mutation on its clause. #3449 changed "if self.check_collision(" to "if target_existed and self.check_collision(", turning the native skill collision mutation into a no-op. Anchor it on "self.check_collision(". Refs #3567 Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel)
requested a review
from Sergio Sisternes (sergio-sisternes-epam)
as a code owner
November 11, 2026 16:01
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the architecture-tooling and mutation-test updates.
No open issues 🎉
What changed in this PR
This PR addresses the architecture mutation-test failures in #3567 by tightening the lockfile-read guard and repairing stale mutation anchors. It changes only architecture tooling and tests, with no production src/ changes.
Changes:
- Limits resolver-specific symlink checks to
resolve_lockfile_path_for_read, preventing migration code from masking a missing guard. - Updates lockfile and skill-collision mutation anchors to target the intended code after #3532 and #3449.
| File | Description |
|---|---|
tests/integration/test_architecture_pack_lockfile_read.py |
Anchors the symlink mutation to the read-only resolver clause. |
tests/integration/test_architecture_native_skill_collision.py |
Updates the collision-check mutation to match the current call site. |
scripts/architecture_linter/checks/contracts_test_taxonomy.py |
Scopes resolver checks to the function body while retaining the existing file-wide path check. |
Review effort: Balanced
Daniel Meppiel (danielmeppiel)
deleted the
danielmeppiel-arch-mutation-anchors
branch
November 11, 2026 18:01
This was referenced Nov 11, 2026
Merged
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
Release dry run 43039615994 (
Build & Validate (macOS arm64)) fails twoarchitecture mutation tests that only run in release / scheduled integration legs:
and not new_path.is_symlink()tomigrate_lockfile_if_needed. Thecontracts-tooling-lockfile-readrule checked that fragment anywhere insrc/apm_cli/deps/lockfile.py, so deleting it from the read-only resolverresolve_lockfile_path_for_readno longer tripped the guard(
assert 2 == 1in the mutation test). The rule now checks the two resolverfragments within the resolver's own body (same line-slice pattern as
transport_auth_platform.py); the file-wide fragment forpathis unchanged.The test mutation is anchored on the resolver's clause.
if self.check_collision(becameif target_existed and self.check_collision(inskill_integrator.py, turning thebypass mutation into a no-op (
assert mutated != source). Anchored on the uniqueself.check_collision(.No
src/change.Issue and approved scope
Issue: Fixes #3567
Human scope-approval comment: scope approved by Daniel Meppiel (@danielmeppiel)'s explicit
session mandate ("loop until the CI pipelines in main are fixed, and that the
release pipeline is passing on a dry run"), recorded in #3567. Review contact:
Daniel Meppiel (@danielmeppiel).
Does this PR complete the issue, or what remains? Completes it.
Type of change
Testing
Tested locally
All existing tests pass
Added tests for new functionality (if applicable)
Before (main):
.venv/bin/pytest tests/integration/test_architecture_native_skill_collision.py tests/integration/test_architecture_pack_lockfile_read.py -q-> 2 failed, 13 passed (same failures as CI).With only the test re-anchored (rule unchanged), the lockfile mutation test still fails (
any(...)is False): confirms the rule was blind to the resolver clause.After: same command -> 15 passed.
.venv/bin/pytest tests/unit/integration/test_skill_integrator.py tests/unit/scripts/test_architecture_runner.py tests/integration/test_architecture_pack_lockfile_read.py tests/integration/test_architecture_owner_rule_mutations.py -q -n 4-> 850 passed.python scripts/lint_architecture_boundaries.py --root .-> exit 0.Lint contract:
ruff check,ruff format --check,pylint R0801,scripts/lint-auth-signals.shon the CI-mirror paths -> clean.contracts_test_taxonomy.pyis 1955 lines (< 2100).Spec conformance (OpenAPM v0.1)
docs/src/content/docs/specs/openapm-v0.1.mdupdated(new/changed
<a id="req-XXX"></a>anchor + prose + Appendix Crow).
docs/src/content/docs/specs/manifests/openapm-v0.1.requirements.ymlupdated.
@pytest.mark.req("req-XXX")test undertests/spec_conformance/added or extended.CONFORMANCE.{md,json}regenerated viauv run --extra dev python -m tests.spec_conformance.gen_statementand committed.