Skip to content

test: complete clone retry owner mutation coverage - #2841

Merged
Daniel Meppiel (danielmeppiel) merged 1 commit into
mainfrom
danielmeppiel-complete-guard-mutation-coverage
Sep 6, 2026
Merged

Daniel Meppiel (danielmeppiel) merged 1 commit into
mainfrom
danielmeppiel-complete-guard-mutation-coverage

Conversation

@danielmeppiel

Copy link
Copy Markdown
Collaborator

TL;DR

Add the missing load-bearing mutation for transport-platform-clone-connect-retry, repairing the exact-once owner matrix that failed release run 34015503962 after #2839. #2840 repaired the unit inventory but missed this independent integration contract.

Important

Eight added lines in one test file. No production, workflow, specification, version, or changelog changes. No specification waiver. Parent owns merge/tag/release actions.

Problem (WHY)

Reproduced test_matrix_covers_every_registry_guard_exactly_once failing with exactly one missing guard. Adding a name alone would not prove detection: the matrix requires surgical valid Python, a clean baseline, the actual owning rule, and a real attributed Violation.

Validation follows "do the work, run a validator (a script, a reference checklist, or a self-check), fix any issues, and repeat until validation passes."

Approach (WHAT)

Additive change -- see Implementation.

Implementation (HOW)

tests/integration/test_architecture_owner_rule_mutations.py gains one sorted row replacing _clone(url, _env_for(attempt, url), target_path) with clone_action(url, _env_for(attempt, url), target_path) in an in-memory source override. This bypasses canonical connection recovery while preserving the arguments and valid Python. Every existing invariant remains unchanged.

Diagrams

The new row drives the real selected rule through the existing mutation and baseline proofs (validated with mmdc).

flowchart LR
    subgraph Input["Source override"]
        M["NEW: replace _clone with clone_action"]
    end
    subgraph Guard["Selected real rule"]
        R["transport-platform-clone-connect-retry"]
    end
    subgraph Proof["Existing matrix assertions"]
        V["Attributed Violation"]
        B["Unmutated baseline is clean"]
    end
    M --> R --> V
    R --> B
    classDef new stroke-dasharray: 5 5;
    class M new;
Loading

Trade-offs

  • Keep one integration row per guard; the existing three unit mutations still cover all transport/auth branches. No equality relaxation or duplicate rows.
  • No production, docs, CI selection, or release metadata changes: this repairs test coverage, not public behavior.

Benefits

  1. Every registered owner guard again has exactly one mutation matrix row.
  2. A direct callback bypass produces the owning rule's Violation.
  3. Original source stays clean; injected mutations never touch disk.

Validation

Base: latest main 4b0efe2524319f91434d5fcc04cd1c1e86124d8a, including bc9f75704 and #2827. Hosted checks pending at creation; local results below.

Reproduction and full relevant contract suite

Before patch:

Extra items in the right set:
'transport-platform-clone-connect-retry'
1 failed in 1.33s

uv run --extra dev pytest -q tests/integration/test_architecture_*.py tests/unit/scripts/test_architecture_*.py tests/unit/install/test_architecture_invariants.py tests/unit/deps/test_clone_connect_retry.py tests/integration/test_resolution_staging_mcp_lifecycle.py

901 passed in 616.27s (0:10:16)

Includes the entire affected integration module, every architecture integration mutation/contract module, unit inventory/registry/runner contracts, retry behavior and all three unit bypass cases, and inherited staging MCP lifecycle coverage.

uv run --frozen --extra dev pytest -q tests/integration/test_architecture_owner_rule_mutations.py -k 'clone_connect_retry or clone-connect-retry or report_nothing or covers_every_registry'

5 passed, 320 deselected in 5.96s

Proves exact-once inventory, owning-rule attribution, surgical valid-source mutation, bypass rejection, and clean unmutated baseline.

Lint, quality, and inventory audit

Full canonical lint passed: Ruff, formatting, YAML safety, 2100-line limit, portable relative paths, pylint R0801, auth boundaries, and architecture boundaries.

uv run --frozen --extra dev pytest -p no:cacheprovider -q tests/quality

56 passed in 84.89s (0:01:24)

uv run --frozen python scripts/check_test_assertions.py

[+] assertion-quality ratchet clean: AQ001=4, AQ002=12

uv run --frozen python scripts/check_exact_test_duplicates.py

[+] exact test duplicate ratchet clean: 1189 files, 0 allowed duplicate group(s)

Searched owner registry, registered analyzer, frozen unit runner inventory, integration matrix, unit bypass tests, and other architecture contracts. No additional authoritative inventory discrepancy found. Historical performance parity JSON is not a live guard catalog.

Scenario Evidence

# Scenario Principle Test Type
1 Release validation covers every registered guard DevX tests/integration/test_architecture_owner_rule_mutations.py::test_matrix_covers_every_registry_guard_exactly_once integration
2 Clone paths cannot silently bypass recovery DevX tests/integration/test_architecture_owner_rule_mutations.py::test_owner_rule_catches_its_guard_mutation[transport-platform-clone-connect-retry] integration
3 Recovery stays bounded inside original attempt DevX tests/unit/deps/test_clone_connect_retry.py component
4 MCP paths survive staging cleanup Portability tests/integration/test_resolution_staging_mcp_lifecycle.py integration

How to test

  • Run the comprehensive command above: all 901 selected cases pass.
  • Run the focused command: bypass rejection and clean baseline pass.
  • Inspect diff: exactly one new row, no invariant relaxation.

Co-authored-by: Copilot [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.

Copilot review overview

🟢 Approval recommended

The change is a minimal, correctly targeted test-only mutation entry that matches the current clone_engine.py call site and introduces no production or contract-surface risk.

Review tier: Lite
Findings: None

What changed in this PR

Adds the missing integration mutation row for the transport-platform-clone-connect-retry owner guard so the “exactly-once” mutation matrix again covers every registered guard and catches regressions like the release-run failure described in the PR body.

Changes:

  • Add a new MutationCase entry that mutates CloneEngine.execute() to call clone_action(...) directly instead of _clone(...), bypassing the canonical connect-retry wrapper for that one call site.
  • Preserve existing matrix invariants (single occurrence, parsable Python, ASCII-only fragments, and per-guard uniqueness) by using the exact clone_engine.py call-site fragment.
File Description
tests/​integration/​test_architecture_owner_rule_mutations.py Adds one new mutation-matrix row for the clone connect retry guard to restore exact-once coverage.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@danielmeppiel

Copy link
Copy Markdown
Collaborator Author

Docs sync advisory

Verdict: no_change * Pages affected: 0 * LLM calls: 1/15

High confidence, deterministic L0 path gate: the sole changed path matches tests/** and no user-surface path in .apm/docs-index.yml. No public CLI, schema, or runtime behavior changes; no docs edits needed. Classifier return schema validated. The delegated classifier lacked tools, so the orchestrator completed the deterministic gate directly.

Final validation handoff

All 15 reported hosted checks pass at head 752dddb00bc1b382cbb27b695f9948228644a233, including CI run 34017106822, CodeQL, NOTICE, CLA, and specification gate. Copilot review recommends approval with no findings and no inline comments.

Relevant local proof: 901 passed, including the full affected integration module, all architecture integration/registry/inventory/mutation contracts, clone retry behavior and its three bypass mutations, and resolution-staging MCP lifecycle. Additional focused mutation plus clean-baseline proof: 5 passed. Quality: 56 passed. Full canonical lint and assertion/duplicate ratchets clean.

No merge, tag, workflow dispatch, cancellation, or publishing action taken by this session. GitHub currently reports mergeStateStatus BLOCKED despite all reported checks passing; parent owns merge policy and release actions.

@danielmeppiel
Daniel Meppiel (danielmeppiel) merged commit 2551ff0 into main Sep 6, 2026
16 checks passed
@danielmeppiel
Daniel Meppiel (danielmeppiel) deleted the danielmeppiel-complete-guard-mutation-coverage branch September 6, 2026 06:45
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