Repository navigation
[0.38] test(mutation): owner kill-rate floors and the 0.37 owners, wave A - #4585
Merged
Daniel Meppiel (danielmeppiel) merged 10 commits intoNov 22, 2026
Merged
Conversation
Daniel Meppiel (danielmeppiel)
force-pushed
the
danielmeppiel-4121-owner-mutation
branch
from
November 21, 2026 10:15
8f3e1d1 to
0da5172
Compare
Merged
4 of 8 tasks
Daniel Meppiel (danielmeppiel)
force-pushed
the
danielmeppiel-4121-owner-mutation
branch
from
November 21, 2026 11:06
0594690 to
118347a
Compare
Daniel Meppiel (danielmeppiel)
marked this pull request as ready for review
November 21, 2026 11:32
Daniel Meppiel (danielmeppiel)
requested a review
from Sergio Sisternes (sergio-sisternes-epam)
as a code owner
November 21, 2026 11:32
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved mutation-pilot defects can misreport acceptance, discard equivalence decisions, and ignore owner test seams, while misclassified filesystem-backed tests bypass component assertion checks.
5 open issues
Preserve legacy equivalence reasons when updating the baseline · New Honor custom owners’ test seams when configuring mutmut · New Calculate negative-control status before writing the report · New Classify lockfile I/O tests as component tests · New Keep metadata and report tests classified as component tests · New
What changed in this PR
This PR delivers wave A of #4121, expanding APM's mutation pilot to 13 owner modules with scheduled per-owner enforcement. It adds behavioral tests and repairs stale test selections without changing product behavior.
Changes:
- Introduces per-owner kill-rate floors, documented equivalent survivors, owner selection and negative controls.
- Replaces the shared-cache workflow with independent owner shards and report artifacts.
- Adds eight owner-focused test modules, runner/topology coverage and contributor documentation.
| File | Description |
|---|---|
tests/unit/test_dep_targets_persistence.py |
Adds canonical-target and exact-error assertions. |
tests/unit/security/test_exec_trust_context.py |
Adds executable-trust and approval coverage. |
tests/unit/scripts/test_run_mutation_pilot.py |
Tests floors, baselines, controls and owner selection. |
tests/unit/policy/test_outcome_routing.py |
Tests policy classification and trust-reader routing. |
tests/unit/install/test_pipeline_entry.py |
Tests preview behavior and option forwarding. |
tests/unit/install/test_commit_gate.py |
Tests pre-commit checks and MCP policy handling. |
tests/unit/deps/test_lockfile_write_authority.py |
Tests staged writes, commit decisions and restoration. |
tests/unit/deps/test_egress_route.py |
Tests outbound routing decisions. |
tests/unit/core/test_remediation.py |
Tests remediation message composition. |
tests/unit/core/test_apm_home_resolution.py |
Tests scope paths and APM home resolution. |
tests/quality/test_taxonomy_baseline.json |
Removes the runner's taxonomy allowance. |
tests/quality/test_ci_topology.py |
Guards scheduled owner-shard enforcement. |
tests/quality/promise-catalog.json |
Registers four owner promises. |
tests/quality/assertion_quality_baseline.json |
Removes the runner's assertion allowance. |
tests/mutation/baseline.json |
Records schema-2 floors and survivor decisions. |
scripts/run_mutation_pilot.py |
Adds per-owner execution and baseline enforcement. |
pyproject.toml |
Expands mutation sources and repairs test selections. |
docs/src/content/docs/contributing/development-guide.md |
Documents mutation execution and survivor review. |
CHANGELOG.md |
Notes expanded nightly mutation testing. |
.github/workflows/mutation-pilot.yml |
Runs independent owner shards with negative controls. |
Review effort: Balanced
Daniel Meppiel (danielmeppiel)
force-pushed
the
danielmeppiel-4121-owner-mutation
branch
from
November 21, 2026 11:48
1a4d0fa to
56bd291
Compare
5 of 12 tasks
…4121) The mutation pilot becomes per-owner mutation testing: - tests/mutation/baseline.json (schema 2) records each owner's kill-rate floor and its survivors. equivalent_survivors carry a reason; only the five original pilot owners keep an unexplained legacy allowlist. - A run fails on an unrecorded survivor, a kill rate below its floor, or an incomplete outcome. --owner runs one owner, --list-owners feeds the scheduled matrix, and --negative-control proves that losing one killed mutant fails the floor. run_owners() is the reusable entry point for other fault-injection harnesses (#4514). - mutation-pilot.yml runs one nightly shard per owner with the negative control; tests/quality/test_ci_topology.py pins that topology. Wave A adds eight owners from the 0.37 owner moves, each with a unit seam that kills its mutants: policy-outcome-routing, executable-trust-context, install-entry-routing, install-commit-order, lockfile-write-authority, apm-home-resolution, egress-route-policy and remediation-advice. Every survivor is killed or recorded as equivalent with its reason. The nightly pilot had failed since a test consolidation removed test_link_resolver_phase3.py and moved the policy serializer tests; the seams now point at the surviving modules and a unit test fails when a seam file is missing. Co-authored-by: copilot-swe-agent[bot] <[email protected]>
…wner runs (#4121) Co-authored-by: copilot-swe-agent[bot] <[email protected]>
…nt lockfile key test (#4121) AQ004: the new owner seams replaced symbols of modules they import. Collaborators are now replaced at their own module, the owners' own chains run for real, and import-time or warn-once state comes from a fresh module import. The staged-key test no longer takes a relpath across Windows drives. Co-authored-by: Copilot App <[email protected]>
…4121) mutmut's stats pass resolves its source paths through os.getcwd, so a faked getcwd failed every owner shard. A fresh import captures the real starting directory; the removed-directory run sets it on its own copy. Co-authored-by: Copilot App <[email protected]>
…eport the negative control (#4121) Review follow-ups on the runner: - --update-baseline keeps recorded equivalent reasons for legacy owners and allowlists only the remaining survivors. - run_owners refuses an owner missing from OWNERS: mutmut reads its sources and tests from [tool.mutmut], which lists only registered owners. - A failed negative control is written to the report and makes its status a regression. Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel)
force-pushed
the
danielmeppiel-4121-owner-mutation
branch
from
November 21, 2026 12:33
3bae08a to
29d2a6b
Compare
This was referenced Nov 21, 2026
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 21, 2026
…e = intersection of both shrinks Co-authored-by: Copilot App <[email protected]>
…ersection of both shrinks Co-authored-by: Copilot App <[email protected]>
…4121) The train rebase dropped this module's promise_exempt_modules entry, so tm006 flagged it as a new module without pytest.mark.promise. It now declares P-LAW-transaction.failed_command_preserves_state, the promise its replay disposition row already names. Co-authored-by: Copilot App <[email protected]>
#4001 passes the fetch result's explicit flag to logger.policy_resolved. Assert it for both explicit and discovered sources. Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel)
deleted the
danielmeppiel-4121-owner-mutation
branch
November 22, 2026 09:00
Merged
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
TL;DR
Wave A of #4121.
tests/mutation/baseline.json.Kill-rate table (floors recorded in
tests/mutation/baseline.json)policy/outcome_routing.pysecurity/executables.pyinstall/pipeline_entry.pyinstall/commit_gate.pydeps/lockfile_write_authority.pycore/scope.pydeps/egress_route.pycore/remediation.pymodels/dependency/subsets.pyinstall/plan.pypolicy/discovery.pycompilation/link_resolver.pydeps/lockfile.pyEquivalent survivors (each recorded with this reason)
outcome_routing.classify_discovery_outcome__mutmut_15:getattrdefaultNoneversus"". Both are falsy, soor "unknown"gives the same source.outcome_routing._report_miss_neutrally__mutmut_6:getattrdefaultNoneversusFalse.bool()of both isFalse.scope.get_manifest_path__mutmut_5: the project branch runs only for a non-user scope, andget_source_roottreatsNoneexactly like any non-user scope.lockfile_write_authority._scope__mutmut_7:_WriteScope.writeris stored but never read.lockfile_write_authority._refused__mutmut_11:getattrdefaultNoneversusFalse. Both are falsy.lockfile_write_authority.remove_lockfile__mutmut_7: it only reorders a removal marker among pending writes._commitwrites nothing for a removal, so commit order and bytes are unchanged.lockfile_write_authority.restore_lockfile_bytes__mutmut_9:normalize_line_endings=NoneversusFalse.atomic_write_texttests truthiness.lockfile_write_authority.restore_lockfile_bytes__mutmut_15: codec names are case-insensitive.What changed
scripts/run_mutation_pilot.py(baseline schema 2):kill_rate_floor, rounded down to 4 decimals, andequivalent_survivorswith reasons.accepted_survivorsis allowed only for the five original pilot owners (LEGACY_OWNER_KEYS). Validation rejects it for any other owner.--update-baselinekeeps recorded reasons and refuses a new owner's survivor that has neither a test nor a reason.--owner KEY(repeatable),--list-owners,--negative-control.run_owners(owners, ...)is the reusable entry point for Test impact analysis S0: offline selector recall harness (replay plus fault injection) #4514's fault injection: anOwneris a source file, its functions and its seams. It accepts registered owners only, because mutmut reads[tool.mutmut]..github/workflows/mutation-pilot.yml:ownersjob lists the keys, then afail-fast: falsematrix runs--owner "$OWNER" --negative-controlper owner, each uploading its own report.tests/quality/test_ci_topology.pypins the topology: schedule, dynamic matrix, the negative control, no soft shard and no baseline writes. Five mutation cases fail it.Eight new unit seams, each marked
unitandpromise("P-OWN-<owner>"):tests/unit/policy/test_outcome_routing.pytests/unit/security/test_exec_trust_context.pytests/unit/install/test_pipeline_entry.pytests/unit/install/test_commit_gate.pytests/unit/deps/test_lockfile_write_authority.pytests/unit/core/test_apm_home_resolution.pytests/unit/deps/test_egress_route.pytests/unit/core/test_remediation.pyFour
P-OWNids for registered owners were added totests/quality/promise-catalog.json.The seams follow AQ004 with no new allowance:
atomic_write_text, integrity, MCP collection) is replaced at its own dotted path._STARTUP_CWD, theallowExecutablesnotice) comes from a fresh import of the owner module.Legacy pilot repair:
test_link_resolver_phase3.pywas consolidated away (011445b) and the policy-serializer tests moved totest_cache_merged_effective_logic.py, so the pilot's pytest selection failed at collection. Its nightly run has failed since 2026-11-20.test_every_owner_seam_existsfails on a missing seam.tests/unit/test_dep_targets_persistence.pykill new subset-selection survivors: an alias recorded as its canonical target, and the exact unknown-target message.tests/unit/scripts/test_run_mutation_pilot.py:run_owners,--list-owners, refusing a partial--update-baseline, and checked-in baseline validity.unit(in-process tests of a script). Its AQ003 allowance (10) and its unclassified taxonomy entry are pruned; both are shrinks.Findings for the owning lanes (not fixed here: product changes are out of this record's scope)
resolve_trust_policy(..., announce=True, raise_blocking_errors=False)would crash withAttributeError.route_discovery_outcomecallslogger.warning(...)to preview a block, and_TrustReaderLoghas nowarning. Every current dry-run caller passesannounce=False, so no command reaches it. Owner: policy-outcome-routing.build_update_planchanged on main while the pilot was red. Mutant IDs were renumbered and there are two more unexplained survivors (9 to 11):display_nameand sort-key mutants of the same kind already accepted. They stay in the legacy allowlist for the update-plan wave.staticmethod/classmethod. Solockfile_write_scope(a@contextmanager) is covered through_commitsand_commit, and theRemediationdataclass methods through the module-level renderers.chdiror fakeos.getcwd, because mutmut's stats pass resolvessrc/through the process working directory. The new seams patchPath.cwdandHOME.Trade-offs
Issue and approved scope
Issue: Refs #4121 (wave A of the staged plan in #4121 (comment); the issue stays open until the last wave).
Merge order: no dependency. The main-red generator-citation fix (#4590) is already on main, and this branch is rebased on top of it.
Human scope-approval comment: #4121 (comment). Wave staging was ruled by the 0.38 PM.
Does this PR complete the issue, or what remains? It completes wave A: the tooling plus the 0.37 owners. The remaining owners follow by blast radius; owners not landed by the 0.38 cut move to 0.39.
Type of change
Testing
Local results:
--report-only --negative-controlprinted: "[+] Negative control: losing one killed mutant fails every owner (13)."tests/quality, the runner tests, the new seams andtests/unit/{core,security}: 3543 passed. The 3 failures are environment-only and fail identically on main: a credential-helper test and two git-transport tests.kill_rateequal to itsfloor(table above) and "[+] Negative control: losing one killed mutant fails every owner (1)."test_staged_reads_are_keyed_by_absolute_path(no cross-driverelpath), rebased onto main5337f2fb:tests/quality/test_quality_baselines.py: 7 passed, with AQ004 clean.tests.quality.taxonomy --changedare clean.56bd291f: https://github.com/microsoft/apm/actions/runs/44900888009. All 13 shards are green, with the same counts and floors as the table and the negative control passing.scripts/run_mutation_pilot.py, with a test for each:--update-baselinekeeps legacy owners' recorded equivalents.run_ownersrefuses an unregistered owner.tests/quality/test_quality_baselines.py: 7 passed.e74759bcafter [0.38] feat(marketplace): root apm.yml marketplaces: map and marketplace.allow policy #4006 changedcore/remediation.py,security/executables.pyandpolicy/discovery.py. The regenerated baseline is byte-identical; policy-serialization now has 146 mutants, all killed.Changelog
## [Unreleased]inCHANGELOG.md(internal; required by the record).Spec conformance (OpenAPM v0.1)