diff --git a/openspec/changes/2176-use-mutation-to-merge-or-delete/.openspec.yaml b/openspec/changes/2176-use-mutation-to-merge-or-delete/.openspec.yaml new file mode 100644 index 0000000000..22ca07d756 --- /dev/null +++ b/openspec/changes/2176-use-mutation-to-merge-or-delete/.openspec.yaml @@ -0,0 +1,2 @@ +schema: spec-driven +created: 2026-11-13 diff --git a/openspec/changes/2176-use-mutation-to-merge-or-delete/design.md b/openspec/changes/2176-use-mutation-to-merge-or-delete/design.md new file mode 100644 index 0000000000..2d2b76dc9c --- /dev/null +++ b/openspec/changes/2176-use-mutation-to-merge-or-delete/design.md @@ -0,0 +1,77 @@ +# Design + +## Decisions + +- **Settle each of the 26 table rows against this tree before any campaign**: The table is the tree of b170358e. Commit 513bb31f2 moved each root-level file of the table into its package folder, and later commits deleted, split or renamed some of them, so the record gives each row the path that holds its tests now. +- **Campaign a split row at the paths that hold its tests now**: Commit 2475fa2cb split `tests/ai/agents/test_pydantic_ai_toolsets.py` into `tests/ai/toolsets/test_function_toolset.py`, `tests/ai/toolsets/test_toolset_authoring.py` and `tests/ai/toolsets/test_toolset_combinators.py`. That row still has tests, so it is a campaign row. The campaign leaves the three files out together, because together they hold the tests of the one table file. Commit b6af763bf renamed `tests/ai/rag/test_rag_loopback_policy.py` to `tests/ai/rag/test_example_config_loopback_rag.py` and put one case in `tests/ai/client/test_example_config_loopback_endpoints.py`. That row also has tests, but it is an invariant test, so it is `unjudged`. +- **Settle only the two rows whose tests no file holds**: Commit 5edd7a547 deleted `tests/ai/agents/test_agent.py` when it replaced `PydanticAgent` with the pydantic-ai `Agent`, and commit b6af763bf deleted `tests/ai/rag/test_rag_rrf.py` and put its fusion case into `tests/ai/rag/test_hybrid_search.py` (`test_fusion_keeps_documents_found_by_only_one_ranker`). +- **Do not decide a row or a case that no mutant can reach**: mutmut 3.8.1 mutates only the bodies of functions and methods: `mutmut/mutation/file_mutation.py:411` says "Else we keep the original node without modifications." A test whose distinct check reads module data, class data, an import, an option that a decorator builds, a committed file or the source text kills no mutant whatever it checks, so a count of 0 own mutants does not show that it adds no check. Such a test is `unjudged`: it gets no campaign and it stays. The seven unjudged rows are in `## Record rows`. Eight cases of campaign files are unjudged too and stay in their files. `test_each_error_class_declares_the_codes_of_its_catalog_row`, `test_one_error_code_maps_to_one_exit_status` and `test_no_error_class_has_an_init_that_only_forwards_to_its_base` of `tests/docs/test_exceptions.py` check class data, `docs/ERRORS.md` or the source text. `test_format_as_xml_reexport` of `tests/ai/test_pydantic_ai_format_prompt.py` checks an import. `test_the_style_request_asks_for_the_bottom_line_in_the_first_line` and `test_every_free_text_call_sends_the_callers_prompt_then_the_style_request` of `tests/ai/test_ai_client_style_request.py` check the text of the committed prompt `style_ste100.md`; the second checks it through its snapshot. `test_default_data_constants_and_settings` of `tests/ai/benchmark/test_data_dir_configuration.py` checks module constants and class data. `test_every_command_of_the_audit_check_has_a_reading` of `tests/commands/test_dependency_audit.py` stops a command with no reading, and that is a change of module data that no mutant makes. +- **Keep the invariant tests of the table**: `tests/core/test_third_party_telemetry.py` reads the manifests under `k8s/`, `tests/commands/test_openspec_scaffold.py` reads the committed OpenSpec files, and the two files of the loopback row send requests to the loopback endpoints of the committed `config.example.yaml`. A mutation run of `src/` cannot see a change of these files, and criterion 3 forbids the deletion of an invariant test, so the three rows are `unjudged` and `## Weakened checks` names none of their tests. +- **Keep the task loader row out of the delete rule**: `pyproject.toml:302:"--ignore=tests/test_ai_task_loader.py",` leaves the loader test out of each mutation run because it reads `src/` as data. Group 2 points that entry at `tests/ai/test_ai_task_loader.py`, so a campaign counts 0 killed mutants for it and the settle rule deletes it. The row is `unjudged` instead, and group 2 can run in any order before the campaigns. +- **Decide each campaign row in the group that campaigns it**: Group 1 writes the 26 rows with the decision `pending` on each of the 17 campaign rows, and its census test asserts only what stays true while groups 3 to 7 replace `pending`: a `pending`, `kept`, `trimmed` or `unjudged` row names files that exist, and a `deleted` or `moved` row names no file. Each campaign group asserts its own rows, and group 7 asserts that no row is `pending`. +- **Name each test that a group may remove in `## Weakened checks`**: The implement guard (`implement_test_names.lost_tests`) stops a step with `tests_lost` for each test that a file loses, a move included, unless the merged plan names it as `path::name`. The owner decided on 2026-11-14 that the plan may delete tests as needed, so the plan names the 106 judged tests of the 17 campaign rows, each with the mutation result that must hold before a task removes it. +- **Use seven decision words**: `pending` (campaign row before its group), `kept` (at least one own mutant, the file stays whole), `trimmed` (0 own mutants, the judged cases go and the unjudged cases stay), `deleted` (0 own mutants, the files of the row go), `moved` (0 own mutants, the files go and a case whose rule no target case holds moves unchanged into a named module), `settled` (no file holds the tests of the row) and `unjudged` (no mutant can reach the row). +- **Repair the mutation test selection and the copy list inside this change**: `pyproject.toml:298:"--ignore=tests/test_architectural_invariants.py",` names a path that no file of this tree holds, so the module that it meant to leave out runs against mutmut's generated code; `pyproject.toml:315:also_copy = [` holds no `openspec` entry, and `tests/openspec/test_openspec_new.py:243:real_spec = REPO_ROOT / CONST_OPENSPEC_SPECS_DIR / "roadmap-refine/selection/spec.md"` reads a real spec, so the stats run fails until both are repaired. +- **Check the selection in `tests/ci/test_ci_mutate.py`**: `tests/ci/test_ci_mutate.py:319:pytest_args = tomllib.loads((REPO_ROOT / "pyproject.toml").read_text(encoding="utf-8"))` already reads `[tool.mutmut]` and asserts its `pytest_add_cli_args`, so the selection check joins that module and adds no invariant file. +- **Attribute a mutant to a file with two runs of the same mutants**: mutmut 3.8.1 keeps no record of the test that killed a mutant, so a mutant that the whole suite kills and the run without the file leaves alive is the file's own. The record gives the mutants that the whole suite kills as a count, because one row can count hundreds and the command of the row lists them again with `mutmut results`, and it gives the mutants that survive without the file as their keys, which criterion 1 asks for and the settle rule reads. +- **Keep the record in `docs/TESTING.md`, with plain-text paths**: A task group may not write a path of the plan's own change folder, and the testing guide is already a page of the docs site. `tests/invariants/test_agents_md.py:623:def test_the_test_rules_name_only_test_files_that_exist` fails on a backticked `tests/` path of `docs/TESTING.md` that no file holds, and the record names the root-level paths of the table and the paths that the campaigns delete, so the record writes each path as plain text. +- **List the census file in the invariant list of `docs/TESTING.md`**: `tests/invariants/test_source_tree.py:741:def test_invariant_files_are_listed_in_testing_doc` fails on a file of `tests/invariants/` that the list at `docs/TESTING.md:95` does not name, so group 1 adds `test_mutation_decisions.py` to that list in the same change. +- **Move a configuration case only after the campaign decides**: Task 5.1 moves no case unless the record gives `tests/commands/test_config.py` 0 own mutants. Then a case whose rule no case of `tests/config/test_config_key_removal.py` or `tests/config/test_config_file_that_is_not_yaml.py` holds moves into that module unchanged, and the other cases go. +- **Move a configuration case into the mirror module of its subject, not into the audit's covering file**: `tests/telemetry/test_telemetry_collector_export.py:1:"""devops-cli telemetry reaches the cluster's collector, or says it does not (#547).` names the telemetry collector as its subject, and `tests/config/test_config_key_removal.py` holds the removal and dry-run cases of the configuration file. +- **Read the `Tests & Coverage` time with `devops ci job-time` and `devops gh api`**: `uv run devops ci job-time` gives the mean of the job on the last push runs of `main`, and `uv run devops gh api` reads the check runs of the head commit of the pull request, so group 9 runs no bare `gh`. +- **Take a new capability for the mutation selection**: The capability `ci-test-selection` covers the path arguments of `devops ci test` only, and no capability holds a rule for the tests that the mutation run selects. +- **Leave `docs/agent/archive/historical-phases-1-to-50.md` unchanged**: `references("test_pydantic_ai_toolsets")` names it, and it is a historical record of past phases that no test and no command reads. + +## Record rows + +The 26 rows that group 1 writes into `## Mutation decisions` of `docs/TESTING.md`, in the order of the issue table. "Group" is the group that campaigns a `pending` row. + +| Table path | Path now | Decision at group 1 | Reason, commit or group | +| :--- | :--- | :--- | :--- | +| tests/commands/test_config.py | tests/commands/test_config.py | pending | group 5 | +| tests/core/test_cleanup_fuzzing.py | tests/core/test_cleanup_fuzzing.py | pending | group 6 | +| tests/test_agent.py | none | settled | 513bb31f2 moved it to tests/ai/agents/test_agent.py, and 5edd7a547 deleted it | +| tests/test_ai_client_credentials.py | tests/ai/client/test_ai_client_credentials.py | pending | group 3 | +| tests/test_ai_client_style_request.py | tests/ai/test_ai_client_style_request.py | pending | group 3 | +| tests/test_ai_gateway_base_url.py | tests/ai/client/test_ai_gateway_base_url.py | pending | group 3 | +| tests/test_ai_init.py | tests/ai/analyze/test_ai_init.py | unjudged | it checks the export lists of two packages, module data that no mutant changes | +| tests/test_ai_spend_dispatch.py | tests/ai/spend/test_ai_spend_dispatch.py | pending | group 3 | +| tests/test_ai_task_loader.py | tests/ai/test_ai_task_loader.py | unjudged | the mutation selection leaves it out, because it reads src as data | +| tests/test_config_settings_cache.py | tests/config/test_settings_cache.py | pending | group 5 | +| tests/test_data_dir_configuration.py | tests/ai/benchmark/test_data_dir_configuration.py | pending | group 7 | +| tests/test_exceptions.py | tests/docs/test_exceptions.py | pending | group 7 | +| tests/test_headless_auth.py | tests/config/test_headless_auth.py | pending | group 5 | +| tests/test_http_async_client.py | tests/http/test_http_async_client.py | pending | group 6 | +| tests/test_language_catalogs.py | tests/lang/test_language_catalogs.py | unjudged | it checks catalog data, class data that no mutant changes | +| tests/test_pydantic_ai_format_prompt.py | tests/ai/test_pydantic_ai_format_prompt.py | pending | group 3 | +| tests/test_pydantic_ai_retries.py | tests/ai/retries/test_pydantic_ai_retries.py | pending | group 3 | +| tests/test_pydantic_ai_toolsets.py | tests/ai/toolsets/test_function_toolset.py, tests/ai/toolsets/test_toolset_authoring.py, tests/ai/toolsets/test_toolset_combinators.py | pending | group 4 | +| tests/test_rag_loopback_policy.py | tests/ai/rag/test_example_config_loopback_rag.py, tests/ai/client/test_example_config_loopback_endpoints.py | unjudged | an invariant test: it sends requests to the loopback endpoints of config.example.yaml | +| tests/test_rag_rrf.py | none | settled | 513bb31f2 moved it to tests/ai/rag/test_rag_rrf.py, and b6af763bf deleted it and put its case into tests/ai/rag/test_hybrid_search.py | +| tests/test_third_party_telemetry.py | tests/core/test_third_party_telemetry.py | unjudged | an invariant test: it reads the manifests under k8s/ | +| tests/test_valkey_cache_tier.py | tests/valkey/test_valkey_cache_tier.py | pending | group 6 | +| tests/test_openspec_scaffold.py | tests/commands/test_openspec_scaffold.py | unjudged | an invariant test: it reads the committed OpenSpec files | +| tests/test_cli_format_adoption.py | tests/commands/test_cli_format_adoption.py | unjudged | it checks the options that the command decorators build and a constant of the test file | +| tests/test_consolidation_binaries.py | tests/core/test_consolidation_binaries.py | pending | group 6 | +| tests/test_dependency_audit.py | tests/commands/test_dependency_audit.py | pending | group 7 | + +## Rejected alternatives + +- **Delete the files on the line-coverage audit alone**: The issue states that a file can cover a line and still assert what no other file asserts, so line coverage cannot show that a file adds no check. +- **Record only the mutation results now, and name the deletions in a later plan**: The vet of 2026-11-14 offered this option, and the owner decided on 2026-11-14 "yes, delete tests as needed", so this plan names the tests that its groups may remove. +- **Delete a file that the campaign cannot reach because it counts 0 own mutants**: A count of 0 is certain for a test that checks data that mutmut does not mutate, so it shows nothing about that test, and criterion 3 forbids the deletion of an invariant test. +- **Campaign the task loader row before group 2 repairs the selection**: The stats run fails before group 2 adds `openspec` to the copy list, so no campaign can run before group 2. +- **Run the campaign against the paths of the table**: `tests/test_agent.py` and `tests/test_ai_client_credentials.py` are no files of this commit, and commit 513bb31f2 moved them. +- **Add `tests/invariants/test_mutmut_selection.py`**: `tests/ci/test_ci_mutate.py` already reads `[tool.mutmut]`, so a new invariant file splits one subject over two files. +- **Move the configuration cases into `tests/telemetry/test_telemetry_collector_export.py`, the covering file of the audit**: Its first line names the telemetry collector as its subject, so a configuration case there sits in the wrong package. +- **Write the mutation record into the change folder of the item**: A task group may not change or create a path of the plan's own change folder under `openspec/changes/`, because the job writes that folder before the groups run. +- **Build a harness that records which test killed each mutant**: mutmut 3.8.1 is pinned and `devops ci mutate` runs it; a harness costs tokens to write, keep and fix, and copies the tool. +- **Leave the mutation selection as it is and run the campaigns**: The selection names modules of the old root-level tests folder, so the modules it meant to leave out run inside the mutants tree against mutmut's generated code and the stats run fails. + +## Unchanged references + +- `docs/agent/archive/historical-phases-1-to-50.md` (quoted target): A historical record of past phases that no test and no command reads, so the toolsets row changes no line of it. + +## Security + +The mutation run copies the repository into `mutants/` and runs the suite there, and this change adds `openspec` to that copy list, so the living specs enter the copy and nothing else does; the specs hold requirement text and no secret. A person must confirm that the copy list still holds no keyring file, no environment file and no installation token, and that no selection entry leaves the tree. The cases of `tests/ci/test_ci_mutate.py` fail if an entry names a path that no file of this tree holds or the copy list drops `openspec`. The deletions remove tests only: each removed test is named in `## Weakened checks` of `proposal.md`, and the implement guard stops a step that removes any other test. diff --git a/openspec/changes/2176-use-mutation-to-merge-or-delete/proposal.md b/openspec/changes/2176-use-mutation-to-merge-or-delete/proposal.md new file mode 100644 index 0000000000..8d8fdb3477 --- /dev/null +++ b/openspec/changes/2176-use-mutation-to-merge-or-delete/proposal.md @@ -0,0 +1,188 @@ +# Proposal + +## Why + +The 2026-10-24 coverage audit of #2176 found 26 test files that cover no line of `src/` that another file does not also cover, and line coverage cannot show that such a file adds no check, because a file can assert something that no other file asserts. Mutation runs decide each file: a file that kills no mutant of its own adds no check. The table is the tree of b170358e, so the plan settles every row against this tree before it campaigns, and it keeps each test that no mutant can reach. + +## What Changes + +- Add a `## Mutation decisions` section to `docs/TESTING.md` with one row for each of the 26 table rows: the table path, the path now, one decision, the reason or the commit, the campaign command, the duration, the killed count and the keys of the own mutants. +- Add `tests/invariants/test_mutation_decisions.py` as the census of the 26 rows, list it in the invariant files of `docs/TESTING.md`, and let each campaign group add the check of its own rows. +- Point the mutation test selection of `pyproject.toml` at the modules of this tree, add `openspec` to its copy list, and check both in `tests/ci/test_ci_mutate.py`. +- Campaign the six AI client rows with the whole suite and again with each file left out, fill their rows, and remove the tests of each row with no own mutant. +- Campaign the toolsets row at the three files that hold its tests now, with the three files left out together. +- Campaign the three configuration rows, and move a case of `tests/commands/test_config.py` into `tests/config/test_config_key_removal.py` or `tests/config/test_config_file_that_is_not_yaml.py` only when the campaign gives that file no own mutant and no case of the target holds its rule. +- Campaign the four core, HTTP and Valkey rows and the three docs, benchmark and audit rows, settle each of them, and fill their rows. +- Keep the seven rows and the eight cases that no mutant can reach, and give each row the decision `unjudged`. +- Record the gate result, the total line coverage and the `fail_under` value in the record. +- Record the `Tests & Coverage` time of the pull request beside the mean of the job on `main`. +- The change fits one pull request. + +## Capabilities + +### New Capabilities + +- `mutation-run-selection`: The mutation selection names test paths of this tree, The mutation run copies the living specs + +### Modified Capabilities + +None. + +## Impact + +- Code: `pyproject.toml` +- Documents: `docs/TESTING.md` +- Tests: `tests/invariants/test_mutation_decisions.py`, `tests/ci/test_ci_mutate.py`, `tests/ai/client/test_ai_client_credentials.py`, `tests/ai/client/test_ai_gateway_base_url.py`, `tests/ai/test_ai_client_style_request.py`, `tests/ai/test_pydantic_ai_format_prompt.py`, `tests/ai/spend/test_ai_spend_dispatch.py`, `tests/ai/retries/test_pydantic_ai_retries.py`, `tests/ai/toolsets/test_function_toolset.py`, `tests/ai/toolsets/test_toolset_authoring.py`, `tests/ai/toolsets/test_toolset_combinators.py`, `tests/config/test_settings_cache.py`, `tests/config/test_headless_auth.py`, `tests/commands/test_config.py`, `tests/config/test_config_key_removal.py`, `tests/config/test_config_file_that_is_not_yaml.py`, `tests/core/test_cleanup_fuzzing.py`, `tests/core/test_consolidation_binaries.py`, `tests/http/test_http_async_client.py`, `tests/valkey/test_valkey_cache_tier.py`, `tests/docs/test_exceptions.py`, `tests/ai/benchmark/test_data_dir_configuration.py`, `tests/commands/test_dependency_audit.py` +- Weakened checks: the owner decided on 2026-11-14: "yes, delete tests as needed". So `## Weakened checks` names each of the 106 tests that tasks 3.1, 4.1, 5.1, 6.1 and 7.1 may remove or move, with the mutation result that must hold first. A test that the section does not name stays, and the implement guard stops a step that removes it. The section leaves out the invariant tests of `tests/core/test_third_party_telemetry.py`, `tests/commands/test_openspec_scaffold.py`, `tests/ai/rag/test_example_config_loopback_rag.py` and `tests/ai/client/test_example_config_loopback_endpoints.py`, the other tests of the four `unjudged` rows, and the eight unjudged cases of campaign files that `design.md` names. The section holds only entries, because `plan_read.weakened_checks` refuses any other line in it. + +## Weakened checks + +- **`tests/ai/client/test_ai_client_credentials.py::test_rejected_credentials_name_the_key_sources_without_retrying`**: Stopped: a change that retries a 401 or 403 reply, or that gives an error which does not name the sources of the key. Safeguard: task 3.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills; the audit gives 94% of its lines to `tests/ai/client/test_ai_client_retries.py`. +- **`tests/ai/client/test_ai_client_credentials.py::test_streaming_reports_rejected_credentials`**: Stopped: a change after which a streamed request with no key reports a stream failure and not the missing key. Safeguard: task 3.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills; the audit gives 94% of its lines to `tests/ai/client/test_ai_client_retries.py`. +- **`tests/ai/client/test_ai_client_credentials.py::test_unset_key_sends_no_authorization_header`**: Stopped: a change that sends an empty bearer token when no key is set. Safeguard: task 3.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills; the audit gives 94% of its lines to `tests/ai/client/test_ai_client_retries.py`. +- **`tests/ai/client/test_ai_gateway_base_url.py::test_bridge_gateway_prefixes_use_their_configured_urls`**: Stopped: a change that sends a model with a gateway prefix to an address other than the URL of that gateway. Safeguard: task 3.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills. +- **`tests/ai/client/test_ai_gateway_base_url.py::test_gateway_task_api_base_url_overrides_gateway_url`**: Stopped: a change after which the `api_base_url` of a gateway task is not the gateway address of that task. Safeguard: task 3.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills. +- **`tests/ai/client/test_ai_gateway_base_url.py::test_gateway_task_ignores_global_api_base_url`**: Stopped: a change that sends a gateway task to the global OpenAI base URL and not to `gateway_url`. Safeguard: task 3.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills. +- **`tests/ai/client/test_ai_gateway_base_url.py::test_global_gateway_provider_ignores_global_api_base_url`**: Stopped: a change after which the gateway provider uses `api_base_url` when that setting is set beside `gateway_url`. Safeguard: task 3.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills. +- **`tests/ai/client/test_ai_gateway_base_url.py::test_task_switching_provider_does_not_inherit_global_api_base_url`**: Stopped: a change after which a task with a different provider gets the global `api_base_url`. Safeguard: task 3.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills. +- **`tests/ai/test_ai_client_style_request.py::test_a_call_that_sets_its_own_format_keeps_its_instruction_first_and_the_request_defers_to_it`**: Stopped: a change that moves or cuts the format instruction of a caller, or that removes the rule that a format of the task wins over the style request. Safeguard: task 3.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills; the audit gives 90% of its lines to `tests/ai/client/test_ai_client_providers_and_embeddings.py`, and the two cases of the file that no mutant can reach stay. +- **`tests/ai/test_ai_client_style_request.py::test_a_call_without_a_system_prompt_sends_the_style_request_alone`**: Stopped: a change after which a call with no system prompt does not send the style request as the system prompt. Safeguard: task 3.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills; the audit gives 90% of its lines to `tests/ai/client/test_ai_client_providers_and_embeddings.py`, and the two cases of the file that no mutant can reach stay. +- **`tests/ai/test_ai_client_style_request.py::test_a_repeated_call_is_served_from_the_cache_under_the_system_prompt_as_sent`**: Stopped: a change after which a second identical call reaches the provider and does not use the cache. Safeguard: task 3.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills; the audit gives 90% of its lines to `tests/ai/client/test_ai_client_providers_and_embeddings.py`, and the two cases of the file that no mutant can reach stay. +- **`tests/ai/test_ai_client_style_request.py::test_a_reply_cached_before_the_style_request_is_not_served`**: Stopped: a change that serves a reply that the cache keeps under the system prompt without the style request. Safeguard: task 3.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills; the audit gives 90% of its lines to `tests/ai/client/test_ai_client_providers_and_embeddings.py`, and the two cases of the file that no mutant can reach stay. +- **`tests/ai/test_ai_client_style_request.py::test_a_structured_call_gets_the_request_once_before_the_schema_instruction`**: Stopped: a change that puts the style request after the schema instruction, or that sends it more than one time. Safeguard: task 3.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills; the audit gives 90% of its lines to `tests/ai/client/test_ai_client_providers_and_embeddings.py`, and the two cases of the file that no mutant can reach stay. +- **`tests/ai/test_ai_client_style_request.py::test_the_token_estimate_of_a_request_counts_the_style_request`**: Stopped: a change after which the token estimate of a reply with no usage figures does not count the style request. Safeguard: task 3.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills; the audit gives 90% of its lines to `tests/ai/client/test_ai_client_providers_and_embeddings.py`, and the two cases of the file that no mutant can reach stay. +- **`tests/ai/test_pydantic_ai_format_prompt.py::test_format_as_xml_dataclass_metadata`**: Stopped: a change after which `format_as_xml` does not write the field metadata of a dataclass. Safeguard: `src/devops_cli/ai/format_prompt.py` holds no function, only the import of `format_as_xml` from `pydantic_ai.format_prompt`, so the record row counts 0 killed and 0 own mutants and this case checks `pydantic_ai`, not `src/`. Task 3.1 removes it, and `test_format_as_xml_reexport` stays and checks that the module gives the function of `pydantic_ai`. +- **`tests/ai/test_pydantic_ai_format_prompt.py::test_format_as_xml_list_once_field_info`**: Stopped: a change after which `include_field_info='once'` writes the descriptions on more than the first element. Safeguard: `src/devops_cli/ai/format_prompt.py` holds no function, only the import of `format_as_xml` from `pydantic_ai.format_prompt`, so the record row counts 0 killed and 0 own mutants and this case checks `pydantic_ai`, not `src/`. Task 3.1 removes it, and `test_format_as_xml_reexport` stays and checks that the module gives the function of `pydantic_ai`. +- **`tests/ai/test_pydantic_ai_format_prompt.py::test_format_as_xml_primitives_and_scalars`**: Stopped: a change of how `format_as_xml` writes a scalar value or a custom none value. Safeguard: `src/devops_cli/ai/format_prompt.py` holds no function, only the import of `format_as_xml` from `pydantic_ai.format_prompt`, so the record row counts 0 killed and 0 own mutants and this case checks `pydantic_ai`, not `src/`. Task 3.1 removes it, and `test_format_as_xml_reexport` stays and checks that the module gives the function of `pydantic_ai`. +- **`tests/ai/test_pydantic_ai_format_prompt.py::test_format_as_xml_pydantic_model_field_info`**: Stopped: a change after which `format_as_xml` does not write the field descriptions and titles of a Pydantic model. Safeguard: `src/devops_cli/ai/format_prompt.py` holds no function, only the import of `format_as_xml` from `pydantic_ai.format_prompt`, so the record row counts 0 killed and 0 own mutants and this case checks `pydantic_ai`, not `src/`. Task 3.1 removes it, and `test_format_as_xml_reexport` stays and checks that the module gives the function of `pydantic_ai`. +- **`tests/ai/spend/test_ai_spend_dispatch.py::test_a_cache_lookup_that_answers_nothing_is_recorded_once_as_a_dispatch`**: Stopped: a change that records a cached entry that the client refuses as a cache hit, or that records the call two times. Safeguard: task 3.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills; the audit gives 97% of its lines to `tests/ai/client/test_ai_client_providers_and_embeddings.py`. +- **`tests/ai/spend/test_ai_spend_dispatch.py::test_a_chat_call_on_the_deepseek_group_costs_its_cached_and_new_input_and_its_output`**: Stopped: a change of the cost of a chat call whose prompt tokens are part cached and part new. Safeguard: task 3.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills; the audit gives 97% of its lines to `tests/ai/client/test_ai_client_providers_and_embeddings.py`. +- **`tests/ai/spend/test_ai_spend_dispatch.py::test_a_chat_reply_reaches_observers_and_the_ledger_with_its_finish_reason`**: Stopped: a change after which `LLMClient.chat` does not give the finish reason of the reply to the observer and to the ledger row. Safeguard: task 3.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills; the audit gives 97% of its lines to `tests/ai/client/test_ai_client_providers_and_embeddings.py`. +- **`tests/ai/spend/test_ai_spend_dispatch.py::test_a_complete_stream_records_its_finish_reason`**: Stopped: a change after which a stream that gets to its final frame does not write one row with its finish reason. Safeguard: task 3.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills; the audit gives 97% of its lines to `tests/ai/client/test_ai_client_providers_and_embeddings.py`. +- **`tests/ai/spend/test_ai_spend_dispatch.py::test_a_failed_attempt_records_the_usage_and_model_that_its_error_body_names`**: Stopped: a change after which an error row does not hold the model and the usage that the error body names. Safeguard: task 3.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills; the audit gives 97% of its lines to `tests/ai/client/test_ai_client_providers_and_embeddings.py`. +- **`tests/ai/spend/test_ai_spend_dispatch.py::test_a_failed_attempt_whose_body_cannot_be_read_as_json_records_no_tokens`**: Stopped: a change after which a failed attempt with a body that is not JSON writes no error row, or writes tokens. Safeguard: task 3.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills; the audit gives 97% of its lines to `tests/ai/client/test_ai_client_providers_and_embeddings.py`. +- **`tests/ai/spend/test_ai_spend_dispatch.py::test_a_stream_failing_after_output_records_its_spend_as_an_error`**: Stopped: a change after which a stream that fails after some output does not record its tokens with the reason `error`, or does not raise. Safeguard: task 3.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills; the audit gives 97% of its lines to `tests/ai/client/test_ai_client_providers_and_embeddings.py`. +- **`tests/ai/spend/test_ai_spend_dispatch.py::test_a_stream_failing_before_its_first_chunk_with_server_error_records_each_attempt`**: Stopped: a change after which a stream that the server answers with 500 does not write one error row for each attempt. Safeguard: task 3.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills; the audit gives 97% of its lines to `tests/ai/client/test_ai_client_providers_and_embeddings.py`. +- **`tests/ai/spend/test_ai_spend_dispatch.py::test_a_stream_refused_before_its_first_chunk_records_nothing`**: Stopped: a change after which a stream that cannot open a connection writes a row or tells an observer. Safeguard: task 3.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills; the audit gives 97% of its lines to `tests/ai/client/test_ai_client_providers_and_embeddings.py`. +- **`tests/ai/spend/test_ai_spend_dispatch.py::test_chat_dispatch_records_served_by_and_resolved_model`**: Stopped: a change after which a chat dispatch does not record the `served_by` header and the model that the reply body names. Safeguard: task 3.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills; the audit gives 97% of its lines to `tests/ai/client/test_ai_client_providers_and_embeddings.py`. +- **`tests/ai/spend/test_ai_spend_dispatch.py::test_failed_attempt_records_served_by_and_served_model_when_error_names_them`**: Stopped: a change after which a failed attempt does not record the backend and the model that the error reply names. Safeguard: task 3.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills; the audit gives 97% of its lines to `tests/ai/client/test_ai_client_providers_and_embeddings.py`. +- **`tests/ai/spend/test_ai_spend_dispatch.py::test_failed_chat_dispatch_attempts_are_recorded_in_spend_ledger`**: Stopped: a change after which an attempt that gets to the gateway and fails writes no error row. Safeguard: task 3.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills; the audit gives 97% of its lines to `tests/ai/client/test_ai_client_providers_and_embeddings.py`. +- **`tests/ai/spend/test_ai_spend_dispatch.py::test_llm_client_dispatch_records_spend`**: Stopped: a change after which a chat dispatch of `LLMClient` does not call `track_request_spend` with the prompt and completion tokens. Safeguard: task 3.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills; the audit gives 97% of its lines to `tests/ai/client/test_ai_client_providers_and_embeddings.py`. +- **`tests/ai/spend/test_ai_spend_dispatch.py::test_llm_client_streaming_records_spend`**: Stopped: a change after which a streamed chat of `LLMClient` does not record its spend. Safeguard: task 3.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills; the audit gives 97% of its lines to `tests/ai/client/test_ai_client_providers_and_embeddings.py`. +- **`tests/ai/spend/test_ai_spend_dispatch.py::test_stream_dispatch_records_served_by_and_resolved_model`**: Stopped: a change after which a stream dispatch does not record the `served_by` header and the model that the stream frames name. Safeguard: task 3.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills; the audit gives 97% of its lines to `tests/ai/client/test_ai_client_providers_and_embeddings.py`. +- **`tests/ai/retries/test_pydantic_ai_retries.py::TestPydanticAIRetriesSubsystem.test_create_retry_config_defaults`**: Stopped: a change of the default `RetryConfig`: its exponential backoff or its `wait_retry_after` wait. Safeguard: task 3.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills. +- **`tests/ai/retries/test_pydantic_ai_retries.py::TestPydanticAIRetriesSubsystem.test_httpx2_tenacity_transport_retries_on_http_524`**: Stopped: a change after which the sync transport does not retry a Cloudflare 524 reply. Safeguard: task 3.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills. +- **`tests/ai/retries/test_pydantic_ai_retries.py::TestPydanticAIRetriesSubsystem.test_httpx2_tenacity_transport_sync_retry`**: Stopped: a change after which the sync transport does not retry a 503 reply. Safeguard: task 3.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills. +- **`tests/ai/retries/test_pydantic_ai_retries.py::TestPydanticAIRetriesSubsystem.test_is_retryable_status_code`**: Stopped: a change of the set of HTTP status codes that the client retries, 524 included. Safeguard: task 3.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills. +- **`tests/ai/retries/test_pydantic_ai_retries.py::TestPydanticAIRetriesSubsystem.test_request_limited_json_rejects_4xx_and_5xx_responses`**: Stopped: a change after which `request_limited_json` parses a 4xx or 5xx reply and does not raise. Safeguard: task 3.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills. +- **`tests/ai/retries/test_pydantic_ai_retries.py::TestPydanticAIRetriesSubsystem.test_wait_retry_after_fallback_strategy`**: Stopped: a change after which `wait_retry_after` does not use the fallback wait when the reply has no `Retry-After` header. Safeguard: task 3.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills. +- **`tests/ai/retries/test_pydantic_ai_retries.py::TestPydanticAIRetriesSubsystem.test_wait_retry_after_http_date_header`**: Stopped: a change after which `wait_retry_after` does not read an HTTP date in `Retry-After`, or does not cap the wait at `max_wait`. Safeguard: task 3.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills. +- **`tests/ai/retries/test_pydantic_ai_retries.py::TestPydanticAIRetriesSubsystem.test_wait_retry_after_numeric_header`**: Stopped: a change after which `wait_retry_after` does not read the seconds of a numeric `Retry-After` header. Safeguard: task 3.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills. +- **`tests/ai/toolsets/test_function_toolset.py::test_function_toolset_add_tool_and_function`**: Stopped: a change after which `add_tool` or `add_function` of `FunctionToolset` does not add the tool. Safeguard: task 4.1 removes it only when the record row of the toolsets counts 0 own mutants for the three files of the row together, so the run without them kills each mutant that the whole suite kills. +- **`tests/ai/toolsets/test_function_toolset.py::test_function_toolset_call_tool`**: Stopped: a change after which `call_tool` does not run a registered tool. Safeguard: task 4.1 removes it only when the record row of the toolsets counts 0 own mutants for the three files of the row together, so the run without them kills each mutant that the whole suite kills. +- **`tests/ai/toolsets/test_function_toolset.py::test_function_toolset_instructions`**: Stopped: a change after which `get_instructions` does not give the instructions, sync or async. Safeguard: task 4.1 removes it only when the record row of the toolsets counts 0 own mutants for the three files of the row together, so the run without them kills each mutant that the whole suite kills. +- **`tests/ai/toolsets/test_function_toolset.py::test_function_toolset_sync_and_async_get_tools`**: Stopped: a change after which the sync `get_tools` does not give a list of `Tool`, or the async one does not give a dict of `ToolsetTool`. Safeguard: task 4.1 removes it only when the record row of the toolsets counts 0 own mutants for the three files of the row together, so the run without them kills each mutant that the whole suite kills. +- **`tests/ai/toolsets/test_function_toolset.py::test_function_toolset_tool_and_plain_decorators`**: Stopped: a change after which the `@tool` or the `@tool_plain` decorator does not register its tool. Safeguard: task 4.1 removes it only when the record row of the toolsets counts 0 own mutants for the three files of the row together, so the run without them kills each mutant that the whole suite kills. +- **`tests/ai/toolsets/test_toolset_authoring.py::test_abstract_custom_toolset_subclassing`**: Stopped: a change after which a subclass of `AbstractToolset` does not work with sync and async consumers. Safeguard: task 4.1 removes it only when the record row of the toolsets counts 0 own mutants for the three files of the row together, so the run without them kills each mutant that the whole suite kills. +- **`tests/ai/toolsets/test_toolset_authoring.py::test_domain_helper_factories`**: Stopped: a change of `create_function_toolset` or `extract_tools_from_toolset`. Safeguard: task 4.1 removes it only when the record row of the toolsets counts 0 own mutants for the three files of the row together, so the run without them kills each mutant that the whole suite kills. +- **`tests/ai/toolsets/test_toolset_combinators.py::test_approval_and_deferred_loading_combinators`**: Stopped: a change after which `approval_required` or `defer_loading` does not wrap a `FunctionToolset`. Safeguard: task 4.1 removes it only when the record row of the toolsets counts 0 own mutants for the three files of the row together, so the run without them kills each mutant that the whole suite kills. +- **`tests/ai/toolsets/test_toolset_combinators.py::test_combined_toolset_combinator`**: Stopped: a change after which `CombinedToolset` does not merge its toolsets. Safeguard: task 4.1 removes it only when the record row of the toolsets counts 0 own mutants for the three files of the row together, so the run without them kills each mutant that the whole suite kills. +- **`tests/ai/toolsets/test_toolset_combinators.py::test_filtered_toolset_combinator`**: Stopped: a change after which `.filtered()` does not remove the tools that its filter refuses. Safeguard: task 4.1 removes it only when the record row of the toolsets counts 0 own mutants for the three files of the row together, so the run without them kills each mutant that the whole suite kills. +- **`tests/ai/toolsets/test_toolset_combinators.py::test_prefixed_toolset_combinator`**: Stopped: a change after which `.prefixed()` does not put the prefix on the tool names. Safeguard: task 4.1 removes it only when the record row of the toolsets counts 0 own mutants for the three files of the row together, so the run without them kills each mutant that the whole suite kills. +- **`tests/ai/toolsets/test_toolset_combinators.py::test_renamed_toolset_combinator`**: Stopped: a change after which `.renamed()` does not rename the tools. Safeguard: task 4.1 removes it only when the record row of the toolsets counts 0 own mutants for the three files of the row together, so the run without them kills each mutant that the whole suite kills. +- **`tests/config/test_settings_cache.py::test_a_just_written_file_is_not_cached_until_it_settles`**: Stopped: a change after which the settings cache keeps a parse of a file that was written a moment before. Safeguard: task 5.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills. +- **`tests/config/test_settings_cache.py::test_a_merge_with_the_project_layer_is_not_reused_while_a_review_runs`**: Stopped: a change after which a review gets a cached merge that holds the project config layer. Safeguard: task 5.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills. +- **`tests/config/test_settings_cache.py::test_mutating_loaded_settings_does_not_poison_the_cache`**: Stopped: a change after which an edit of loaded settings changes the copy that the cache keeps. Safeguard: task 5.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills. +- **`tests/config/test_settings_cache.py::test_saving_settings_discards_the_parsed_copy`**: Stopped: a change after which a save of the settings keeps the old parsed copy in the cache. Safeguard: task 5.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills. +- **`tests/config/test_settings_cache.py::test_unchanged_file_is_reused_and_a_real_edit_is_not`**: Stopped: a change after which the cache parses an unchanged file again, or keeps a parse after a real edit. Safeguard: task 5.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills. +- **`tests/config/test_headless_auth.py::test_a_remembered_secret_is_read_before_the_keyring`**: Stopped: a change after which headless auth does not read a secret that it keeps before it reads the keyring. Safeguard: task 5.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills. +- **`tests/config/test_headless_auth.py::test_headless_auth_keeps_a_stored_secret_in_memory_only`**: Stopped: a change after which headless auth writes a stored secret to a place other than memory. Safeguard: task 5.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills. +- **`tests/commands/test_config.py::test_config_get_of_an_unknown_key_names_the_similar_keys`**: Stopped: a change after which `devops config get` of an unknown key does not name the similar keys. Safeguard: task 5.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills; the audit gives 95% of its lines to `tests/telemetry/test_telemetry_collector_export.py`. A case whose rule no case of `tests/config/test_config_key_removal.py` or `tests/config/test_config_file_that_is_not_yaml.py` holds moves into that module unchanged. +- **`tests/commands/test_config.py::test_config_get_reports_a_config_file_that_is_not_yaml_on_one_line_with_no_file_text`**: Stopped: a change after which `devops config get` shows the traceback or a line of a config file that is not YAML. Safeguard: task 5.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills; the audit gives 95% of its lines to `tests/telemetry/test_telemetry_collector_export.py`, and `test_a_config_file_that_is_not_yaml_names_its_file_line_and_column_and_quotes_no_text` of `tests/config/test_config_file_that_is_not_yaml.py` holds the same rule. A case whose rule no case of `tests/config/test_config_key_removal.py` or `tests/config/test_config_file_that_is_not_yaml.py` holds moves into that module unchanged. +- **`tests/commands/test_config.py::test_config_init_names_the_active_config_file_it_writes`**: Stopped: a change after which `devops config init` names a file other than the active config file, or writes keys that the answers do not change. Safeguard: task 5.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills; the audit gives 95% of its lines to `tests/telemetry/test_telemetry_collector_export.py`. A case whose rule no case of `tests/config/test_config_key_removal.py` or `tests/config/test_config_file_that_is_not_yaml.py` holds moves into that module unchanged. +- **`tests/commands/test_config.py::test_config_set_of_a_word_that_yaml_1_1_reads_as_a_bool_or_a_number_loads_back_as_set`**: Stopped: a change after which a value that YAML 1.1 reads as a bool or a number does not load back as the string that `devops config set` wrote. Safeguard: task 5.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills; the audit gives 95% of its lines to `tests/telemetry/test_telemetry_collector_export.py`. A case whose rule no case of `tests/config/test_config_key_removal.py` or `tests/config/test_config_file_that_is_not_yaml.py` holds moves into that module unchanged. +- **`tests/commands/test_config.py::test_config_set_of_an_unknown_key_exits_1_before_any_prompt_and_names_the_similar_keys`**: Stopped: a change after which `devops config set` of an unknown key prompts, exits with a status other than 1, or does not name the similar keys. Safeguard: task 5.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills; the audit gives 95% of its lines to `tests/telemetry/test_telemetry_collector_export.py`. A case whose rule no case of `tests/config/test_config_key_removal.py` or `tests/config/test_config_file_that_is_not_yaml.py` holds moves into that module unchanged. +- **`tests/commands/test_config.py::test_config_unset_dry_run_of_a_credential_prints_the_placeholder_not_the_value`**: Stopped: a change after which a dry run of `devops config unset` of a credential shows its value. Safeguard: task 5.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills; the audit gives 95% of its lines to `tests/telemetry/test_telemetry_collector_export.py`, and `test_a_dry_run_of_a_credential_removal_shows_the_placeholder_not_the_value` of `tests/config/test_config_key_removal.py` holds the same rule. A case whose rule no case of `tests/config/test_config_key_removal.py` or `tests/config/test_config_file_that_is_not_yaml.py` holds moves into that module unchanged. +- **`tests/commands/test_config.py::test_config_unset_dry_run_prints_the_removal_and_writes_nothing`**: Stopped: a change after which a dry run of `devops config unset` does not show the removal, or changes a file. Safeguard: task 5.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills; the audit gives 95% of its lines to `tests/telemetry/test_telemetry_collector_export.py`, and `test_a_dry_run_returns_the_removal_and_writes_nothing` of `tests/config/test_config_key_removal.py` holds the same rule. A case whose rule no case of `tests/config/test_config_key_removal.py` or `tests/config/test_config_file_that_is_not_yaml.py` holds moves into that module unchanged. +- **`tests/commands/test_config.py::test_config_unset_of_a_credential_leaves_no_file_that_holds_its_value`**: Stopped: a change after which `devops config unset` of a credential leaves its value in the copy of the file. Safeguard: task 5.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills; the audit gives 95% of its lines to `tests/telemetry/test_telemetry_collector_export.py`, and `test_a_removal_of_a_credential_leaves_no_file_that_holds_its_value` of `tests/config/test_config_key_removal.py` holds the same rule. A case whose rule no case of `tests/config/test_config_key_removal.py` or `tests/config/test_config_file_that_is_not_yaml.py` holds moves into that module unchanged. +- **`tests/commands/test_config.py::test_config_unset_of_a_key_that_the_file_does_not_hold_exits_1_and_changes_nothing`**: Stopped: a change after which `devops config unset` of a key that the file does not hold exits 0 or changes the file. Safeguard: task 5.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills; the audit gives 95% of its lines to `tests/telemetry/test_telemetry_collector_export.py`, and `test_a_removal_refuses_a_key_that_the_file_does_not_hold` of `tests/config/test_config_key_removal.py` holds the same rule. A case whose rule no case of `tests/config/test_config_key_removal.py` or `tests/config/test_config_file_that_is_not_yaml.py` holds moves into that module unchanged. +- **`tests/commands/test_config.py::test_config_unset_removes_a_key_that_stops_every_command_from_loading_the_settings`**: Stopped: a change after which `devops config unset` loads the settings, or does not keep the comments, when it removes a key that stops the load. Safeguard: task 5.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills; the audit gives 95% of its lines to `tests/telemetry/test_telemetry_collector_export.py`, and `test_a_removal_deletes_the_key_that_stops_the_load_and_keeps_every_other_line` of `tests/config/test_config_key_removal.py` holds the same rule. A case whose rule no case of `tests/config/test_config_key_removal.py` or `tests/config/test_config_file_that_is_not_yaml.py` holds moves into that module unchanged. +- **`tests/commands/test_config.py::test_the_unset_command_that_the_error_names_for_the_other_config_file_removes_the_key`**: Stopped: a change after which the command that the error names for a key of another config file does not remove that key. Safeguard: task 5.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills; the audit gives 95% of its lines to `tests/telemetry/test_telemetry_collector_export.py`. A case whose rule no case of `tests/config/test_config_key_removal.py` or `tests/config/test_config_file_that_is_not_yaml.py` holds moves into that module unchanged. +- **`tests/commands/test_config.py::test_validate_wizard_service_url_validation_branches`**: Stopped: a change of the checks that the config wizard does on a service URL. Safeguard: task 5.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills; the audit gives 95% of its lines to `tests/telemetry/test_telemetry_collector_export.py`. A case whose rule no case of `tests/config/test_config_key_removal.py` or `tests/config/test_config_file_that_is_not_yaml.py` holds moves into that module unchanged. +- **`tests/core/test_cleanup_fuzzing.py::test_git_worktree_porcelain_failure_specification`**: Stopped: a change after which a failed `git worktree list --porcelain` gives a list that is not empty. Safeguard: task 6.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills. +- **`tests/core/test_cleanup_fuzzing.py::test_git_worktree_porcelain_parsing_specification`**: Stopped: a change after which the parse of `git worktree list --porcelain` reads a line that is not a `worktree ` line as a worktree, or gives a wrong path. Safeguard: task 6.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills. +- **`tests/core/test_consolidation_binaries.py::test_check_binary_returns_boolean`**: Stopped: a change after which `check_binary` does not give `True` for a program on `PATH` and `False` for a missing program. Safeguard: task 6.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills. +- **`tests/core/test_consolidation_binaries.py::test_require_binary_found`**: Stopped: a change after which `require_binary` does not give the resolved path of a program on `PATH`. Safeguard: task 6.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills. +- **`tests/core/test_consolidation_binaries.py::test_require_binary_missing_raises_dependency_error`**: Stopped: a change after which `require_binary` of a missing program does not raise `DevOpsCLIError` with an install hint. Safeguard: task 6.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills. +- **`tests/http/test_http_async_client.py::test_async_http_client`**: Stopped: a change after which `async_http_client` does not set the read timeout that the caller gives. Safeguard: task 6.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills. +- **`tests/valkey/test_valkey_cache_tier.py::test_a_failed_trial_turns_the_cache_tier_off_for_one_more_cooldown`**: Stopped: a change after which a failed trial does not turn the Valkey tier off for one more cooldown. Safeguard: task 6.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills. +- **`tests/valkey/test_valkey_cache_tier.py::test_a_reply_error_leaves_the_cache_tier_on`**: Stopped: a change after which an error reply from Valkey turns the cache tier off. Safeguard: task 6.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills. +- **`tests/valkey/test_valkey_cache_tier.py::test_a_valkey_outage_turns_the_cache_tier_off_until_a_trial_after_the_cooldown`**: Stopped: a change of the breaker of the Valkey tier: closed, open, the cooldown, half-open and closed again. Safeguard: task 6.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills. +- **`tests/valkey/test_valkey_cache_tier.py::test_a_valkey_url_that_is_not_valid_turns_each_cache_off_with_one_warning`**: Stopped: a change after which a Valkey URL that is not valid does not turn the Valkey tier off, or logs a number of warnings other than one. Safeguard: task 6.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills. +- **`tests/valkey/test_valkey_cache_tier.py::test_the_caches_of_one_process_share_one_cache_tier`**: Stopped: a change after which two caches of one process use two Valkey tiers and two breakers. Safeguard: task 6.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills. +- **`tests/valkey/test_valkey_cache_tier.py::test_the_shared_tier_waits_a_short_time_for_a_connection`**: Stopped: a change after which a connection to Valkey waits longer than the short default or than `valkey.timeout`. Safeguard: task 6.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills. +- **`tests/valkey/test_valkey_cache_tier.py::test_while_valkey_refuses_a_second_cache_dials_nothing_in_the_cooldown`**: Stopped: a change after which a second cache dials a Valkey that refuses connections during the cooldown. Safeguard: task 6.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills. +- **`tests/docs/test_exceptions.py::test_an_error_built_without_an_override_carries_its_class_codes`**: Stopped: a change of an `__init__` of an error class that changes the error code or the exit status that its class declares. Safeguard: task 7.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills; the audit gives 96% of its lines to `tests/ai/agents/test_pydantic_ai_exceptions.py`, and the three cases of the file that no mutant can reach stay. +- **`tests/docs/test_exceptions.py::test_base_devops_cli_error`**: Stopped: a change after which an error does not take the codes of its class, or `exit_code=` does not set the exit status of one instance. Safeguard: task 7.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills; the audit gives 96% of its lines to `tests/ai/agents/test_pydantic_ai_exceptions.py`, and the three cases of the file that no mutant can reach stay. +- **`tests/docs/test_exceptions.py::test_config_exceptions`**: Stopped: a change of the message or the details of `ConfigurationError`. Safeguard: task 7.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills; the audit gives 96% of its lines to `tests/ai/agents/test_pydantic_ai_exceptions.py`, and the three cases of the file that no mutant can reach stay. +- **`tests/docs/test_exceptions.py::test_git_exceptions`**: Stopped: a change of the message or the details of `GitOperationError`. Safeguard: task 7.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills; the audit gives 96% of its lines to `tests/ai/agents/test_pydantic_ai_exceptions.py`, and the three cases of the file that no mutant can reach stay. +- **`tests/docs/test_exceptions.py::test_keyring_unavailable_error`**: Stopped: a change of the message or the details of `KeyringUnavailableError`. Safeguard: task 7.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills; the audit gives 96% of its lines to `tests/ai/agents/test_pydantic_ai_exceptions.py`, and the three cases of the file that no mutant can reach stay. +- **`tests/docs/test_exceptions.py::test_ssrf_blocked_error`**: Stopped: a change of the message or the details of `SSRFBlockedError`. Safeguard: task 7.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills; the audit gives 96% of its lines to `tests/ai/agents/test_pydantic_ai_exceptions.py`, and the three cases of the file that no mutant can reach stay. +- **`tests/docs/test_exceptions.py::test_ssrf_blocked_error_credentials_and_length_bounded`**: Stopped: a change after which `SSRFBlockedError` shows a credential of a URL, or holds details longer than 256 characters. Safeguard: task 7.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills; the audit gives 96% of its lines to `tests/ai/agents/test_pydantic_ai_exceptions.py`, and the three cases of the file that no mutant can reach stay. +- **`tests/docs/test_exceptions.py::test_tool_exceptions`**: Stopped: a change of the message or the details of `ToolExecutionError` or `ToolDownloadError`. Safeguard: task 7.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills; the audit gives 96% of its lines to `tests/ai/agents/test_pydantic_ai_exceptions.py`, and the three cases of the file that no mutant can reach stay. +- **`tests/docs/test_exceptions.py::test_validation_exceptions`**: Stopped: a change of the message or the details of `ValidationError`. Safeguard: task 7.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills; the audit gives 96% of its lines to `tests/ai/agents/test_pydantic_ai_exceptions.py`, and the three cases of the file that no mutant can reach stay. +- **`tests/ai/benchmark/test_data_dir_configuration.py::test_data_config_cascades_custom_base_dir`**: Stopped: a change after which a custom `data.dir` does not set the child folders that no setting overrides. Safeguard: task 7.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills; the case of the file that no mutant can reach stays. +- **`tests/ai/benchmark/test_data_dir_configuration.py::test_get_benchmarks_base_dir_isolation`**: Stopped: a change after which `_get_benchmarks_base_dir` does not give a folder in the isolated data folder. Safeguard: task 7.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills; the case of the file that no mutant can reach stays. +- **`tests/ai/benchmark/test_data_dir_configuration.py::test_load_settings_cascades_devops_cli_data_dir`**: Stopped: a change after which `DEVOPS_CLI_DATA_DIR` does not set the 10 child data paths. Safeguard: task 7.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills; the case of the file that no mutant can reach stays. +- **`tests/ai/benchmark/test_data_dir_configuration.py::test_load_settings_cascades_yaml_data_dir`**: Stopped: a change after which `data.dir` in the config file does not set the child data paths. Safeguard: task 7.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills; the case of the file that no mutant can reach stays. +- **`tests/ai/benchmark/test_data_dir_configuration.py::test_load_settings_defaults_when_data_section_omitted`**: Stopped: a change after which a config file with no `data` section does not get the 11 default paths. Safeguard: task 7.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills; the case of the file that no mutant can reach stays. +- **`tests/ai/benchmark/test_data_dir_configuration.py::test_load_settings_ignores_deprecated_devops_data_dir`**: Stopped: a change after which the old variable `DEVOPS_DATA_DIR` sets the data folder. Safeguard: task 7.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills; the case of the file that no mutant can reach stays. +- **`tests/ai/benchmark/test_data_dir_configuration.py::test_load_settings_preserves_explicit_child_env_overrides`**: Stopped: a change after which the variable of a child folder does not override the folder that the base cascade gives. Safeguard: task 7.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills; the case of the file that no mutant can reach stays. +- **`tests/ai/benchmark/test_data_dir_configuration.py::test_save_settings_omits_default_data_section`**: Stopped: a change after which `save_settings` writes the default data paths to the config file. Safeguard: task 7.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills; the case of the file that no mutant can reach stays. +- **`tests/commands/test_dependency_audit.py::test_npm_audit_failure_without_a_report_of_findings_is_an_audit_that_could_not_run`**: Stopped: a change after which a failed `npm audit` with no report of findings counts as a finding. Safeguard: task 7.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills; the case of the file that no mutant can reach stays. +- **`tests/commands/test_dependency_audit.py::test_npm_audit_missing_from_the_path_is_an_audit_that_could_not_run`**: Stopped: a change after which an `npm` that is not on `PATH` counts as a finding or as a pass. Safeguard: task 7.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills; the case of the file that no mutant can reach stays. +- **`tests/commands/test_dependency_audit.py::test_npm_audit_report_tells_a_finding_from_an_audit_that_could_not_run`**: Stopped: a change after which the reading of an `npm audit` report does not tell a finding from an audit that could not run. Safeguard: task 7.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills; the case of the file that no mutant can reach stays. +- **`tests/commands/test_dependency_audit.py::test_uv_audit_reads_its_exit_status_and_never_its_output`**: Stopped: a change after which the reading of `uv audit` uses its output and not its exit status. Safeguard: task 7.1 removes it only when the record row of its file counts 0 own mutants, so the run without the file kills each mutant that the whole suite kills; the case of the file that no mutant can reach stays. + +## Feasibility + +- Probes: "The path `tests/commands/test_config.py` is a file of the staging commit." and "The path `tests/core/test_cleanup_fuzzing.py` is a file of the staging commit." Those two table rows name files of this tree. +- Probes: "The path `tests/test_agent.py` is no file of the staging commit. Commit 513bb31f2 2026-10-30 test(cli): tests mirror package directories and trim root conftest (#2830) deleted or renamed it." So the table is the tree of b170358e, and the record gives each row the path that holds its tests now. +- `git show --name-status 513bb31f2` gives `R100 tests/test_agent.py tests/ai/agents/test_agent.py`, `R100 tests/test_pydantic_ai_toolsets.py tests/ai/agents/test_pydantic_ai_toolsets.py`, `R100 tests/test_rag_loopback_policy.py tests/ai/rag/test_rag_loopback_policy.py` and `R100 tests/test_rag_rrf.py tests/ai/rag/test_rag_rrf.py`: that commit moved the four rows and deleted none of them. +- `git show --name-status` of the later commits gives `5edd7a547 D tests/ai/agents/test_agent.py`, `2475fa2cb D tests/ai/agents/test_pydantic_ai_toolsets.py` with `A tests/ai/toolsets/test_function_toolset.py`, `A tests/ai/toolsets/test_toolset_authoring.py` and `A tests/ai/toolsets/test_toolset_combinators.py`, and `b6af763bf R082 tests/ai/rag/test_rag_loopback_policy.py tests/ai/rag/test_example_config_loopback_rag.py` with `A tests/ai/client/test_example_config_loopback_endpoints.py` and `D tests/ai/rag/test_rag_rrf.py`. `tests/ai/rag/test_hybrid_search.py:76:def test_fusion_keeps_documents_found_by_only_one_ranker() -> None:` holds the fusion case of the deleted RRF file. So two rows are settled, the toolsets row is a campaign row with 12 tests, and the loopback row holds 4 tests. +- `mutmut/mutation/file_mutation.py:409-411` of mutmut 3.8.1: "We now iterate through all top-level nodes. If they are a function or class method, we mutate and add trampolines. Else we keep the original node without modifications." So mutmut changes no module data, no class data, no import and no decorator, and a test that only checks such data kills no mutant. +- `src/devops_cli/ai/format_prompt.py` holds `from pydantic_ai.format_prompt import format_as_xml` and `__all__ = ("format_as_xml",)` and no function, so mutmut has no mutant for its row: `uv run devops ci mutate --help` says "If none of the selected functions gives mutmut a mutant, as when their bodies are only `...`, mutmut fails with 'nothing matches'". Task 3.1 writes `none` as the command of that row and 0 for both counts. +- `tests/ai/rag/test_example_config_loopback_rag.py:22:EXAMPLE_CONFIG = REPO_ROOT / "config.example.yaml"` and `tests/ai/client/test_example_config_loopback_endpoints.py:15:EXAMPLE_CONFIG = REPO_ROOT / "config.example.yaml"` load the committed example config. The other test modules that read `config.example.yaml` check its keys and its values, and none of them sends a request to its loopback endpoints. A mutant of `src/` cannot change that file, so the loopback row is an invariant test, and it is `unjudged`. +- `tests/ai/test_ai_client_style_request.py:110:assert _FIRST_LINE_RULE[rule] in with_style_request(_SYSTEM)` checks the text of the committed prompt `src/devops_cli/ai/tasks/style_ste100.md`, and `tests/ai/__snapshots__/test_ai_client_style_request.ambr` holds the whole text of that prompt for `test_every_free_text_call_sends_the_callers_prompt_then_the_style_request`. No mutant changes a prompt file, so these two cases are `unjudged`. +- `tests/ai/benchmark/test_data_dir_configuration.py:37:assert DEFAULT_DATA_DIR == Path(".data")` starts the checks of the module constants of `src/devops_cli/config/defaults.py`, and no other test module imports the constants of the child folders. `src/devops_cli/core/dependency_audit.py:66:_FAILURE_READERS: Final[Mapping[str, Callable[[int, str], AuditVerdict]]] = {` is module data, and `test_every_command_of_the_audit_check_has_a_reading` stops a command with no reading, which no mutant adds. So these two cases are `unjudged`. +- `pyproject.toml:302:"--ignore=tests/test_ai_task_loader.py",` leaves the task loader test out of each mutation run, so no campaign can count a mutant for it. +- #2164, which the issue names for a file whose subject is a committed file, is closed as completed on 2026-11-05, so an `unjudged` row stays in its file and the record gives the reason. +- No tool counted the 26 rows, so the count is unverified: `tests/invariants/test_mutation_decisions.py` is the census, it is the `verify` of group 1, and group 1 stops when it counts a number other than 26. The census holds at every later group, because it lets a `deleted` or `moved` row name a path that no file holds. +- `docs/TESTING.md:95` lists the invariant files one by one, and `tests/invariants/test_source_tree.py:741:def test_invariant_files_are_listed_in_testing_doc() -> None:` fails on a file that the list does not name, so group 1 adds the census file to the list and runs that test. +- `tests/invariants/test_agents_md.py:623:def test_the_test_rules_name_only_test_files_that_exist() -> None:` fails on each backticked `tests/` path of `docs/TESTING.md` that no file holds, so the record writes its paths as plain text. +- `tests/ci/test_ci_mutate.py:319:pytest_args = tomllib.loads((REPO_ROOT / "pyproject.toml").read_text(encoding="utf-8"))` and `tests/ci/test_ci_mutate.py:325:assert pytest_args["tool"]["mutmut"]["pytest_add_cli_args"] == ["-n", "0"]` read `[tool.mutmut]`, so the selection cases join that module. +- The constant `CONST_OPENSPEC_SPECS_DIR` is `openspec/specs`, from `src/devops_cli/config/constants.py:5394:CONST_OPENSPEC_DIR: Final[str] = "openspec"` and `src/devops_cli/config/constants.py:5402:CONST_OPENSPEC_SPECS_DIR: Final[str] = f"{CONST_OPENSPEC_DIR}/specs"`. `tests/openspec/test_openspec_new.py:243:real_spec = REPO_ROOT / CONST_OPENSPEC_SPECS_DIR / "roadmap-refine/selection/spec.md"` reads a real spec of that folder, and `pyproject.toml:315:also_copy = [` holds no `openspec` entry, so the stats run fails before group 2 adds it. +- `tests/invariants/test_living_specs.py:34:for path in sorted(_SPECS.rglob("spec.md"))` yields no path when the folder is absent, so that test passes without the copy; the test that needs the copy is `tests/openspec/test_openspec_new.py:243`. +- `pyproject.toml:298:"--ignore=tests/test_architectural_invariants.py",` names a module of the old root-level tests folder that no file of this tree holds, so the invariant module now runs inside the mutants tree against mutmut's generated code and fails; group 2 points each selection entry at the module that holds it at this commit, and each of the 12 entries has such a module. +- `pyproject.toml:265:fail_under = 85` is the floor that group 8 keeps, and `docs/TESTING.md` is the page that gains the record. +- `file_symbols("tests/config/test_config_key_removal.py")` lists `test_a_removal_of_a_credential_leaves_no_file_that_holds_its_value`, `test_a_dry_run_of_a_credential_removal_shows_the_placeholder_not_the_value`, `test_a_dry_run_returns_the_removal_and_writes_nothing` and `test_a_removal_refuses_a_key_that_the_file_does_not_hold`, and `tests/config/test_config_file_that_is_not_yaml.py:38:def test_a_config_file_that_is_not_yaml_names_its_file_line_and_column_and_quotes_no_text(` holds the config-file error case, so group 5 names both modules in `Changes:`. +- `read_file("tests/telemetry/test_telemetry_collector_export.py", 1, 45)` gives `tests/telemetry/test_telemetry_collector_export.py:1:"""devops-cli telemetry reaches the cluster's collector, or says it does not (#547).`, so its subject is the telemetry collector and no configuration case moves into the file that the audit names as the covering file. +- `src/devops_cli/roadmap/implement/implement_test_names.py:54` `lost_tests` counts a test that moves to another file as lost, and `src/devops_cli/roadmap/plan_read.py:321` `recorded_tests` takes the `path::name` of each entry of `## Weakened checks`, so each of the 106 entries names the test as its file defines it at this commit. +- The gate's own `uv audit`, `npm audit`, `uv tree --outdated` and `uv check` rows query the package indexes, so the plan states a network precondition for `uv run devops ci` and claims no offline run of the gate. +- Group 8 records only what the local gate shows, and group 9 reads the `Tests & Coverage` time with `uv run devops ci job-time` and `uv run devops gh api`, because `uv run devops pr checks` shows no time. +- Precondition of `uv run devops ci mutate `: a checkout of the repository and the `mutmut==3.8.1` pin that the dev group of `pyproject.toml` holds; it reaches no network and writes `mutants/` in the checkout. +- Precondition of `uv run devops ci test `: a checkout of the repository; the tests reach no network and no cluster. +- Precondition of `uv run devops ci`: a checkout of the repository and a network, because its audit rows query the package indexes. +- Precondition of `uv run devops ci job-time` and `uv run devops gh api` in the process of group 9: a GitHub token and a network. +- Programs: `devops` and `pytest` are runner tools of the image and `mutmut` comes from the dev group, so no program of a group is `NOT_IN_RUNNER`; pod setting `readOnlyRootFilesystem: true` applies to each verify, and a campaign writes only `mutants/` in the writable checkout. +- Failure classes: a campaign that does not end is `timeout`, a run whose tests fail is `test`, a step that removes a test that `## Weakened checks` does not name is `tests_lost`, and a row whose path no file holds is `premise_false`. +- First checks: `uv run devops ci test tests/invariants/test_mutation_decisions.py` fails before the record exists, `uv run devops ci test tests/ci/test_ci_mutate.py` fails on the first stale selection entry, and `uv run devops ci mutate src/devops_cli/core/coverage_index.py` completes a stats run before any campaign starts. +- The issue cannot be built as written for the two rows whose tests no file of this tree holds, and for the seven rows that no mutant can reach; the record settles or keeps each of them with its reason, and the plan re-creates no deleted path. + +## Existing Tool Considered + +mutmut 3.8.1 is the pinned mutation tool, and `uv run devops ci mutate` runs it over the `src/` files a command names, with `[tool.mutmut]` in `pyproject.toml` holding its source paths, its test selection and its copy list. The change adds no harness of its own. + +## Dependencies + +None. diff --git a/openspec/changes/2176-use-mutation-to-merge-or-delete/specs/mutation-run-selection/spec.md b/openspec/changes/2176-use-mutation-to-merge-or-delete/specs/mutation-run-selection/spec.md new file mode 100644 index 0000000000..50b85ffbc4 --- /dev/null +++ b/openspec/changes/2176-use-mutation-to-merge-or-delete/specs/mutation-run-selection/spec.md @@ -0,0 +1,30 @@ +## Purpose +How the mutation run selects the tests it runs inside its copy of the tree, so that a stats run completes on this tree and names only test paths that a file of this tree holds. + +## ADDED Requirements + +### Requirement: The mutation selection names test paths of this tree +The mutation run MUST select only test paths that a file of this tree holds, and MUST leave out only tests that those files define. + +#### Scenario: A selection path that no file holds +- **WHEN** the mutation test selection names a path that no file of this tree holds +- **THEN** the selection check fails and names that path + +#### Scenario: A left-out test that its module does not define +- **WHEN** the mutation test selection leaves out a test by name, and its module defines no test of that name +- **THEN** the selection check fails and names that entry + +#### Scenario: Every selection path holds a test +- **WHEN** every path of the mutation test selection is a file of this tree, and each test that the selection leaves out by name is a test of its module +- **THEN** the selection check passes with no finding + +### Requirement: The mutation run copies the living specs +The mutation run MUST copy the living specs folder into the tree that it runs the tests in, because a test of that tree reads a spec of the living specs. + +#### Scenario: A copy list that holds the living specs +- **WHEN** the mutation copy list of the project manifest names the living specs folder +- **THEN** the selection check reports no finding + +#### Scenario: A copy list that drops the living specs +- **WHEN** the mutation copy list holds no living specs folder +- **THEN** the selection check fails and names the copy list diff --git a/openspec/changes/2176-use-mutation-to-merge-or-delete/tasks.md b/openspec/changes/2176-use-mutation-to-merge-or-delete/tasks.md new file mode 100644 index 0000000000..086be24ad6 --- /dev/null +++ b/openspec/changes/2176-use-mutation-to-merge-or-delete/tasks.md @@ -0,0 +1,88 @@ +# Tasks + +## 1. Census the 26 table rows against this tree + +Kind: other. Reads: `docs/TESTING.md`, `tests/invariants/test_source_tree.py`, `tests/invariants/test_agents_md.py`. Changes: `docs/TESTING.md`, `tests/invariants/test_mutation_decisions.py` (new). + +- [ ] 1.1 Add a `## Mutation decisions` section to `docs/TESTING.md`. State the settle rule and the seven decision words of `design.md` once, and write one row for each of the 26 rows of `## Record rows` in `design.md`, in its order, with the columns table path, path now, decision, reason or commit, command, duration, killed, own mutants and killing test. Write each path as plain text and not as a code span, because `test_the_test_rules_name_only_test_files_that_exist` fails on a backticked `tests/` path that no file holds. Give the 17 campaign rows the decision `pending` and a dash in each campaign column, give the two `settled` rows their commits, and give the seven `unjudged` rows their reasons. Add `test_mutation_decisions.py` to the list of invariant files in the `tests/invariants/` rule of `docs/TESTING.md`. Add `tests/invariants/test_mutation_decisions.py` with `test_the_record_holds_one_row_for_each_table_row`, which parses the section and asserts that it holds 26 rows whose table paths are the 26 paths of the issue table, that each row holds one of the seven decision words, that each `settled` row names a commit, that each `unjudged` row names a reason, that each path now of a `pending`, `kept`, `trimmed` or `unjudged` row is a file of this tree, that no file holds a path now of a `deleted` or `moved` row, that a `moved` row names a target module that is a file, and that no path now is under `tests/invariants/`. These assertions stay true while groups 3 to 7 replace `pending` + - Verification: `$ uv run devops ci test tests/invariants/test_mutation_decisions.py tests/invariants/test_source_tree.py tests/invariants/test_agents_md.py` passes +- [ ] 1.2 Edit `docs/TESTING.md` with the 26-row mutation decisions section and the new entry of the invariant file list + - Verification: `$ uv run devops ci docs` passes + +## 2. Repair the mutation test selection and the copy list + +Kind: manifest. Reads: `pyproject.toml`, `tests/ci/test_ci_mutate.py`, `tests/openspec/test_openspec_new.py`. Changes: `pyproject.toml`, `tests/ci/test_ci_mutate.py`. + +- [ ] 2.1 The case `test_each_mutation_selection_entry_names_a_test_of_this_tree` in `tests/ci/test_ci_mutate.py` reads `[tool.mutmut]` of `pyproject.toml` with `tomllib`, as `test_mutate_runs_mutmut_serially_on_the_changed_function_globs` does, and asserts that each `--ignore` entry of `pytest_add_cli_args_test_selection` is a file of this tree and that each `--deselect` entry names a test that its module defines; it fails on the first `--ignore` entry, which names a module of the old root-level tests folder. The case `test_the_mutation_copy_list_holds_the_living_specs` asserts that `also_copy` holds `openspec`, and fails because it holds none + - Verification: `$ uv run devops ci test tests/ci/test_ci_mutate.py` fails on the base +- [ ] 2.2 Point each `--ignore` and `--deselect` entry of `pytest_add_cli_args_test_selection` in `pyproject.toml` at the module that holds that test at this commit: commit 513bb31f2 moved each of them into its package folder, so the entry for the task loader names `tests/ai/test_ai_task_loader.py`. Keep the comment of each entry. Add `openspec` to `also_copy`, because `tests/openspec/test_openspec_new.py` reads a spec of the checkout + - Verification: `$ uv run devops ci test tests/ci/test_ci_mutate.py` passes + +## 3. Campaign the six AI client rows + +Kind: other. Reads: `docs/TESTING.md`, `tests/invariants/test_mutation_decisions.py`, `tests/ai/client/test_ai_client_credentials.py`, `tests/ai/client/test_ai_gateway_base_url.py`, `tests/ai/test_ai_client_style_request.py`, `tests/ai/test_pydantic_ai_format_prompt.py`, `tests/ai/spend/test_ai_spend_dispatch.py`, `tests/ai/retries/test_pydantic_ai_retries.py`. Changes: `docs/TESTING.md`, `tests/invariants/test_mutation_decisions.py`, `tests/ai/client/test_ai_client_credentials.py`, `tests/ai/client/test_ai_gateway_base_url.py`, `tests/ai/test_ai_client_style_request.py`, `tests/ai/test_pydantic_ai_format_prompt.py`, `tests/ai/spend/test_ai_spend_dispatch.py`, `tests/ai/retries/test_pydantic_ai_retries.py`. + +- [ ] 3.1 Run the two campaigns of the six AI client rows: `tests/ai/client/test_ai_client_credentials.py`, `tests/ai/client/test_ai_gateway_base_url.py`, `tests/ai/test_ai_client_style_request.py`, `tests/ai/test_pydantic_ai_format_prompt.py`, `tests/ai/spend/test_ai_spend_dispatch.py` and `tests/ai/retries/test_pydantic_ai_retries.py`. For each row, mutate the `src/` files whose lines it covers once with the whole suite and once with the file left out of the selection, and write in its row the command, the duration, the killed count of the whole-suite run and the keys of its own mutants: the mutants that the whole suite kills and the run without the file leaves alive. The format-prompt row gets no run, because `src/devops_cli/ai/format_prompt.py` holds no function: write `none` as its command and 0 for both counts. Apply the settle rule: a row with an own mutant keeps its file whole and names one own mutant key and the test of the file that kills it (`kept`); a row with no own mutant loses each test of its file that `## Weakened checks` of `proposal.md` names, and its file goes (`deleted`) or keeps only its unjudged cases (`trimmed`). Remove no test that `## Weakened checks` does not name. Add `test_the_ai_client_rows_are_decided` to `tests/invariants/test_mutation_decisions.py`, which asserts that none of the six rows is `pending`, that each holds a command, a duration, a killed count and an own-mutant entry, that a `kept` row names a mutant key and a test, and that a `deleted` or `trimmed` row names no own mutant + - Verification: `$ uv run devops ci test tests/invariants/test_mutation_decisions.py tests/ai` passes +- [ ] 3.2 Edit `docs/TESTING.md` with the counts and the decisions of the six AI client rows + - Verification: `$ uv run devops ci docs` passes + +## 4. Campaign the toolsets row + +Kind: other. Reads: `docs/TESTING.md`, `tests/invariants/test_mutation_decisions.py`, `tests/ai/toolsets/test_function_toolset.py`, `tests/ai/toolsets/test_toolset_authoring.py`, `tests/ai/toolsets/test_toolset_combinators.py`. Changes: `docs/TESTING.md`, `tests/invariants/test_mutation_decisions.py`, `tests/ai/toolsets/test_function_toolset.py`, `tests/ai/toolsets/test_toolset_authoring.py`, `tests/ai/toolsets/test_toolset_combinators.py`. + +- [ ] 4.1 Run the two campaigns of the toolsets row, whose table file a later commit split into `tests/ai/toolsets/test_function_toolset.py`, `tests/ai/toolsets/test_toolset_authoring.py` and `tests/ai/toolsets/test_toolset_combinators.py`. Mutate the `src/` files whose lines the three files cover once with the whole suite and once with the three files left out together, and write the command, the duration, the killed count and the keys of the own mutants in its row. Apply the settle rule to the row as one unit: a row with an own mutant keeps the three files (`kept`), and a row with none loses the three files (`deleted`). Remove no test that `## Weakened checks` of `proposal.md` does not name. Add `test_the_toolsets_row_is_decided` to `tests/invariants/test_mutation_decisions.py` with the same assertions as the AI client rows + - Verification: `$ uv run devops ci test tests/invariants/test_mutation_decisions.py tests/ai` passes +- [ ] 4.2 Edit `docs/TESTING.md` with the counts and the decision of the toolsets row + - Verification: `$ uv run devops ci docs` passes + +## 5. Campaign the three configuration rows + +Kind: other. Reads: `docs/TESTING.md`, `tests/invariants/test_mutation_decisions.py`, `tests/config/test_settings_cache.py`, `tests/config/test_headless_auth.py`, `tests/commands/test_config.py`, `tests/config/test_config_key_removal.py`, `tests/config/test_config_file_that_is_not_yaml.py`. Changes: `docs/TESTING.md`, `tests/invariants/test_mutation_decisions.py`, `tests/config/test_settings_cache.py`, `tests/config/test_headless_auth.py`, `tests/commands/test_config.py`, `tests/config/test_config_key_removal.py`, `tests/config/test_config_file_that_is_not_yaml.py`. + +- [ ] 5.1 Run the two campaigns of the three configuration rows: `tests/config/test_settings_cache.py`, `tests/config/test_headless_auth.py` and `tests/commands/test_config.py`, and write the command, the duration, the killed count and the keys of the own mutants in each row. Decide each row only from its counts. A row with an own mutant keeps its file whole (`kept`). A row with none loses the tests of its file that `## Weakened checks` of `proposal.md` names. For `tests/commands/test_config.py` with no own mutant, a case whose rule no case of `tests/config/test_config_key_removal.py` or `tests/config/test_config_file_that_is_not_yaml.py` holds moves into that module unchanged, the row names that module (`moved`), and the file goes; with no such case the row is `deleted`. Move no case before the counts of its row are in the record. Add `test_the_config_rows_are_decided` to `tests/invariants/test_mutation_decisions.py` with the same assertions as the AI client rows, and that a `moved` row names no own mutant + - Verification: `$ uv run devops ci test tests/invariants/test_mutation_decisions.py tests/config tests/commands` passes +- [ ] 5.2 Edit `docs/TESTING.md` with the counts and the decisions of the three configuration rows + - Verification: `$ uv run devops ci docs` passes + +## 6. Campaign the core, HTTP and Valkey rows + +Kind: other. Reads: `docs/TESTING.md`, `tests/invariants/test_mutation_decisions.py`, `tests/core/test_cleanup_fuzzing.py`, `tests/core/test_consolidation_binaries.py`, `tests/http/test_http_async_client.py`, `tests/valkey/test_valkey_cache_tier.py`. Changes: `docs/TESTING.md`, `tests/invariants/test_mutation_decisions.py`, `tests/core/test_cleanup_fuzzing.py`, `tests/core/test_consolidation_binaries.py`, `tests/http/test_http_async_client.py`, `tests/valkey/test_valkey_cache_tier.py`. + +- [ ] 6.1 Run the two campaigns of the four core, HTTP and Valkey rows: `tests/core/test_cleanup_fuzzing.py`, `tests/core/test_consolidation_binaries.py`, `tests/http/test_http_async_client.py` and `tests/valkey/test_valkey_cache_tier.py`. Write the command, the duration, the killed count and the keys of the own mutants in each row, and apply the settle rule: a row with an own mutant keeps its file whole (`kept`), and a row with none loses its file (`deleted`). Remove no test that `## Weakened checks` of `proposal.md` does not name. Add `test_the_core_http_valkey_rows_are_decided` to `tests/invariants/test_mutation_decisions.py` with the same assertions as the AI client rows + - Verification: `$ uv run devops ci test tests/invariants/test_mutation_decisions.py tests/core tests/http tests/valkey` passes +- [ ] 6.2 Edit `docs/TESTING.md` with the counts and the decisions of the four core, HTTP and Valkey rows + - Verification: `$ uv run devops ci docs` passes + +## 7. Campaign the docs, benchmark and audit rows + +Kind: other. Reads: `docs/TESTING.md`, `tests/invariants/test_mutation_decisions.py`, `tests/docs/test_exceptions.py`, `tests/ai/benchmark/test_data_dir_configuration.py`, `tests/commands/test_dependency_audit.py`. Changes: `docs/TESTING.md`, `tests/invariants/test_mutation_decisions.py`, `tests/docs/test_exceptions.py`, `tests/ai/benchmark/test_data_dir_configuration.py`, `tests/commands/test_dependency_audit.py`. + +- [ ] 7.1 Run the two campaigns of the three docs, benchmark and audit rows: `tests/docs/test_exceptions.py`, `tests/ai/benchmark/test_data_dir_configuration.py` and `tests/commands/test_dependency_audit.py`. Write the command, the duration, the killed count and the keys of the own mutants in each row, and apply the settle rule: a row with an own mutant keeps its file whole (`kept`); a row with none loses the tests of its file that `## Weakened checks` of `proposal.md` names, and its file keeps only its unjudged cases (`trimmed`). Add `test_the_docs_benchmark_audit_rows_are_decided` to `tests/invariants/test_mutation_decisions.py` with the same assertions as the AI client rows, and add `test_no_row_is_pending`, which asserts that no row of the record is `pending` and that each of the 17 campaign rows holds a command, a killed count and an own-mutant entry + - Verification: `$ uv run devops ci test tests/invariants/test_mutation_decisions.py tests/docs tests/ai/benchmark tests/commands` passes +- [ ] 7.2 Edit `docs/TESTING.md` with the counts and the decisions of the three docs, benchmark and audit rows + - Verification: `$ uv run devops ci docs` passes + +## 8. Record the coverage total and the gate result + +Kind: other. Reads: `docs/TESTING.md`, `pyproject.toml`. Changes: `docs/TESTING.md`. + +- [ ] 8.1 Run `uv run devops ci`, write its result and the total line coverage beside the baseline in the record, and confirm that `fail_under` in `pyproject.toml` stays at 85 or higher. The record names the total that the run reports and the `fail_under` value that the file holds + - Verification: `$ uv run devops ci` passes +- [ ] 8.2 Edit `docs/TESTING.md` with the gate result and the total line coverage + - Verification: `$ uv run devops ci docs` passes + +## 9. Record the Tests and Coverage time of the pull request + +Kind: other. Reads: `docs/TESTING.md`. Changes: `docs/TESTING.md`. + +- [ ] 9.1 Write the mean time of the Tests and Coverage job on `main` and the time of that job on the pull request in the record beside the coverage total, and stop the pull request when its time is longer than the mean on `main`, and run this check by hand: Run `uv run devops ci job-time --runs 20` before the pull request merges, and take the mean that it prints as the time on `main`. Run `uv run devops gh api repos/{owner}/{repo}/commits//check-runs --jq '.check_runs[] | select(.name | startswith("Tests & Coverage")) | [.name, .started_at, .completed_at]'`, and take the time of the `Tests & Coverage` run plus the time of its slowest shard run, as `devops ci job-time` counts a job. Write both times in the record, and stop the pull request when its time is longer than the mean on `main`. +- [ ] 9.2 Edit `docs/TESTING.md` with the two times + - Verification: `$ uv run devops ci docs` passes + +## Criteria + +- Group 7: The pull request gives, for each file in the table, the mutants it killed with the whole suite and the mutants that survive without it. +- Group 8: Each file with no mutant of its own is deleted, or its distinct case moves into the file that covers its lines. The line coverage and `fail_under` stay as they are or rise. +- Group 1: No contract suite and no invariant test is deleted by this item. +- Group 9: `uv run devops ci` passes, and the `Tests & Coverage` job takes no longer than before.