Skip to content

fix(arch): scope lockfile-read guard to the read-only resolver - #3568

Merged
Daniel Meppiel (danielmeppiel) merged 1 commit into
mainfrom
danielmeppiel-arch-mutation-anchors
Nov 11, 2026
Merged

Daniel Meppiel (danielmeppiel) merged 1 commit into
mainfrom
danielmeppiel-arch-mutation-anchors

Conversation

@danielmeppiel

Copy link
Copy Markdown
Collaborator

Description

Release dry run 43039615994 (Build & Validate (macOS arm64)) fails two
architecture mutation tests that only run in release / scheduled integration legs:

  1. Lockfile-read guard weakened by fix(lockfile): fail closed when apm.lock.yaml is a symlink #3532 (real fix). fix(lockfile): fail closed when apm.lock.yaml is a symlink #3532 added
    and not new_path.is_symlink() to migrate_lockfile_if_needed. The
    contracts-tooling-lockfile-read rule checked that fragment anywhere in
    src/apm_cli/deps/lockfile.py, so deleting it from the read-only resolver
    resolve_lockfile_path_for_read no longer tripped the guard
    (assert 2 == 1 in the mutation test). The rule now checks the two resolver
    fragments within the resolver's own body (same line-slice pattern as
    transport_auth_platform.py); the file-wide fragment for path is unchanged.
    The test mutation is anchored on the resolver's clause.
  2. Stale anchor from fix(install): do not treat an empty skill directory as an unmanaged collision #3449. if self.check_collision( became
    if target_existed and self.check_collision( in skill_integrator.py, turning the
    bypass mutation into a no-op (assert mutated != source). Anchored on the unique
    self.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

  • Bug fix
  • New feature
  • Documentation
  • Maintenance / refactor

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.sh on the CI-mirror paths -> clean. contracts_test_taxonomy.py is 1955 lines (< 2100).

Spec conformance (OpenAPM v0.1)

  • Spec edit: docs/src/content/docs/specs/openapm-v0.1.md updated
    (new/changed <a id="req-XXX"></a> anchor + prose + Appendix C
    row).
  • Manifest edit: docs/src/content/docs/specs/manifests/openapm-v0.1.requirements.yml
    updated.
  • Test edit: a @pytest.mark.req("req-XXX") test under
    tests/spec_conformance/ added or extended.
  • CONFORMANCE.{md,json} regenerated via
    uv run --extra dev python -m tests.spec_conformance.gen_statement
    and committed.
  • N/A -- this PR does not change OpenAPM-observable behaviour.

#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]>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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

@danielmeppiel
Daniel Meppiel (danielmeppiel) merged commit d2aca47 into main Nov 11, 2026
38 of 42 checks passed
@danielmeppiel
Daniel Meppiel (danielmeppiel) deleted the danielmeppiel-arch-mutation-anchors branch November 11, 2026 18:01
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.

CI: release dry run fails architecture mutation tests after #3449 and #3532

2 participants