Skip to content

test: fold cross-file twin test bodies into parametrized tests - #24648

Merged
chenmingwei23 merged 2 commits into
mainfrom
test-cleanup/twins-cross-file
Oct 27, 2026
Merged

chenmingwei23 merged 2 commits into
mainfrom
test-cleanup/twins-cross-file

Conversation

@iamwhatever

@iamwhatever iamwhatever commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Fold test functions whose bodies are identical across two or three files of the same module into one parametrized test each, so scripts/find_duplicate_test_bodies.py drops from 225 to 210 groups with every case still collected and checked.

Fifteen groups of tests repeat one body word for word in sibling files that test the same module, so the same check lives in two or three places and drifts when one copy is edited.

Why it matters

A check that lives in several files is edited in one and forgotten in the others. This is batch 2 of the twin-body cleanup (target: 170 or fewer groups); batch 1 is #24626.

Not a goal

  • Look-alike groups, whose copies read different per-file or per-class data: left alone (listed below).
  • Groups whose copies test a copy of a helper that lives in each file (_class_only_constructs, _shipped_builtin_manifests, _answer_calls_in, _logs_under_own_name): those copies are separate code, so each file keeps its own check.
  • Folding per-module contract tests into shared helpers.
  • Any change under src/kiro_crew.

What changed (motivation → approach → change)

Stacked on #24626. This branch's first commit is #24626's commit, which adds test/named_cases_helpers.py. The second commit is this batch. It rebases to one commit once #24626 merges.

Same body in sibling files → each copy only feeds the body different data → one test in the file closest to the module, holding every copy's cases.

  • Each group's copies become one test in a home file, using named_cases so each case keeps the id <old test name>-<old param id>. The other copies are removed from their files.
  • A copy's module pytestmark and class marks that the home lacks travel with its cases as per-case marks. test_socketsec_cov80.py's skipif(pc.IS_WINDOWS) now rides on its moved case, so that case still skips on Windows exactly as before.
  • test_agent_discovery_pathres.py and test_artifacts_pathres.py both had TestTheTwoGatesAgree::test_fenced_canonical_controls_are_refused_by_both. The moved case's id carries its old file stem (test_artifacts_pathres-…) so the two ids stay distinct.

Before moving a copy, its file's setup was compared with the home's: autouse fixtures (module, class and imported), pytestmark, class marks and the data its decorator reads. These groups looked like twins but were left alone because the setup differs, and they move to the look-alike list:

  • test_find_ui*.py no-match group (5 files): test_find_ui.py's autouse _fresh_cache also pins guide_catalog's auto-index path, and the others do not. The browse copy's data is built from its own CORPUS.
  • test_source_providers_{bitbucket_server,gerrit,github_enterprise}.py look-alike URL group: each uses its own file's listed / ghe_listed fixture.
  • test_hooks_coverage*.py escaping-file group: the WithoutDirFd class has an autouse _no_dir_fd fixture, so it runs a different branch.
  • test_session_usage*.py no-kiro-bin group: each class has its own autouse _reset.
  • The four per-file helper groups named under "Not a goal".

Backwards compatibility

Compatible: test-only change; every collected case still runs with the same marks.

Reader: test/windows-expected-failures.txt:node ids -- release -- lists none of the 27 touched files
Reader: docs, setup.cfg and .github/*:test names -- release -- git grep -w over every old name outside test/test_*.py finds nothing

Tests

Proof: not provable -- test-only change

Evidence on the 27 touched files, base = #24626, rebased onto main 8a518e121b:

  • Collected ids: 1,622 before and 1,622 after. 117 ids changed, and all map one to one. A moved id becomes home_file::[Class::]new_name[old_name-p]. The one test_artifacts_pathres case becomes …[test_artifacts_pathres-test_fenced_canonical_controls_are_refused_by_both].
  • Marks and active fixtures per id: a collection plugin dumped every item's marks with their arguments, plus its fixturenames. Old id vs mapped new id for all 1,622: the marks never differ. Fixtures differ for exactly one case. test_kas_hooks_acp.py::…::test_the_settings_channel_is_still_open now runs under test_kas_spawn.py's autouse _fast_no_report_ceiling instead of _no_global_store. Its body only reads the constant KAS_CLIENT_CAPABILITIES, which neither fixture touches.
  • Runs: 3 runs with -n 4: 1,616 passed and 6 skipped each time. The base gives the same.
  • Coverage of kiro_crew, union of 2 runs per side: lines 89,329 vs 89,329, 0 lost. Branches 6,275 vs 6,275, 0 lost.
  • Planted failure: making _rejected_model_from_error return None fails the merged is_matched tests for both former files' cases (test_matches_invalid_model_id_in_data and test_matches_invalid_model_id from test_run_bg_oneliner.py, and the two auto variants).
  • Twin groups: 225 → 210 (771 → 597 tests in groups since main).
  • Gates: flake8, isort, black, check_comment_history, check_brand_name, check_file_line_cap, test_flake_pattern_ratchet.py, test_wait_discipline_ratchet.py, test_file_line_cap.py, test_conftest_parts_reach.py, test_leaf_test_scope.py: all green.

No timed waits, caplog reads or shared state were added. The merged bodies are the original bodies.

Manual verification

N/A — unit coverage sufficient: test-only refactor, verified by the id, mark, fixture and coverage comparisons above.

Related Issues

Follows #24626.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

Contributions are accepted under the project's Apache-2.0 license.

Old tests → new test, per group (15 groups)
Group Old tests New test
65 test/test_find_ui_composer.py::test_unrelated_questions_are_no_match
test/test_find_ui_heldout.py::test_unrelated_and_vague_questions_stay_no_match
test/test_find_ui_shell.py::test_unrelated_phrasings_are_no_match
test/test_find_ui_composer.py::test_an_unrelated_question_is_no_match
79 test/test_source_providers_issues.py::test_parse_source_url_rejects_untrusted_issue_shapes
test/test_source_providers_issues.py::test_parse_source_url_rejects_untrusted_jira_shapes
test/test_source_providers_payloads.py::test_parse_source_url_rejects_untrusted_shapes
test/test_source_providers_issues.py::test_parse_source_url_rejects_an_untrusted_shape
84 test/test_agent_discovery_pathres.py::TestTheTwoGatesAgree::test_fenced_canonical_controls_are_refused_by_both
test/test_artifacts_pathres.py::TestTheTwoGatesAgree::test_fenced_canonical_controls_are_refused_by_both
test/test_agent_discovery_pathres.py::TestTheTwoGatesAgree::test_a_fenced_canonical_control_is_refused_by_both
107 test/test_change_cards.py::test_setting_risk_is_computed_from_the_diff
test/test_change_card_setting_classes.py::test_newly_classified_paths_read_their_class_on_the_card
test/test_change_cards.py::test_a_setting_reads_its_risk_from_the_diff
162 test/test_official_editorial.py::TestRefusals::test_a_failed_fetch_yields_the_default
test/test_editorial_sections.py::TestRefusalsAndCaps::test_a_failed_fetch_yields_nothing
test/test_official_editorial.py::TestRefusals::test_a_failed_fetch_yields_no_section
200 test/test_tool_names.py::TestExpand::test_is_pure_and_order_preserving
test/test_kas_agents.py::TestTheSpecIsSpelledInKasToolIds::test_expand_is_pure_and_order_preserving
test/test_tool_names.py::TestExpand::test_expand_is_pure_and_keeps_order
201 test/test_kas_spawn.py::TestCapabilities::test_kas_adds_the_kiro_settings_channel
test/test_kas_hooks_acp.py::TestTheCapabilityIsNotAnnounced::test_the_settings_channel_is_still_open
test/test_kas_spawn.py::TestCapabilities::test_the_kiro_settings_channel_is_announced
215 test/test_model_selection_scenarios.py::TestRejectionClassifier::test_matches_invalid_model_id_in_data
test/test_run_bg_oneliner.py::TestRejectedModelClassifier::test_matches_invalid_model_id
test/test_model_selection_scenarios.py::TestRejectionClassifier::test_an_invalid_model_id_in_data_is_matched
216 test/test_model_selection_scenarios.py::TestRejectionClassifier::test_matches_invalid_model_id_for_auto_in_message
test/test_run_bg_oneliner.py::TestRejectedModelClassifier::test_matches_invalid_model_id_auto_in_message
test/test_model_selection_scenarios.py::TestRejectionClassifier::test_an_invalid_auto_model_id_in_message_is_matched
217 test/test_model_selection_scenarios.py::TestRejectionClassifier::test_unrelated_error_returns_none
test/test_run_bg_oneliner.py::TestRejectedModelClassifier::test_returns_none_for_unrelated_error
test/test_model_selection_scenarios.py::TestRejectionClassifier::test_an_unrelated_error_is_not_matched
221 test/test_options_marker_terminator.py::TestAnUnterminatedMarkerDoesNotEatItsLine::test_the_separator_tail_form_is_refused_rather_than_truncated
test/test_options_marker_label_closers.py::TestAcceptedCosts::test_the_separator_tail_form_is_declined_rather_than_truncated
test/test_options_marker_terminator.py::TestAnUnterminatedMarkerDoesNotEatItsLine::test_the_separator_tail_form_is_not_truncated
227 test/test_pipeline_conductor_claim_preflight.py::TestClosureNeedsAnIssueAsItsObject::test_a_state_statement_still_closes
test/test_pipeline_conductor_claim_preflight_check_detectors.py::TestTechnicalProseIsNotClosure::test_the_item_scoped_forms_still_close
test/test_pipeline_conductor_claim_preflight.py::TestClosureNeedsAnIssueAsItsObject::test_an_item_scoped_state_statement_closes
229 test/test_platform_compat_listening_ports.py::TestFindListeningPidsErrors::test_linux_process_listener_probe_matches_the_child_socket_inode
test/test_platform_compat.py::TestFindListeningPids::test_linux_per_process_probe_runs_on_every_runner
test/test_platform_compat_listening_ports.py::TestFindListeningPidsErrors::test_the_linux_listener_probe_matches_the_child_socket
240 test/test_readonly_bash_common_filters.py::test_write_or_exec_form_still_prompts
test/test_readonly_bash_assigning_expansions.py::test_assigning_expansion_prompts
test/test_readonly_bash_common_filters.py::test_the_command_still_prompts
264 test/test_socketsec.py::test_get_peer_pid_returns_none_without_a_socket
test/test_socketsec_cov80.py::TestGetPeerPid::test_an_object_with_no_socket_at_all
test/test_socketsec.py::test_get_peer_pid_is_none_without_a_socket
Look-alike groups left alone (the list in #24626, plus the 8 groups reclassified above)

Each group's copies share the body text but read different data or run under different setup per file or class.

  • test_out_of_scope_questions_never_hit (+4 names) x5: test_find_ui.py, test_find_ui_browse.py, test_find_ui_members.py, test_find_ui_schedule.py, test_find_ui_sessions.py (reclassified here)
  • test_the_class_only_scan_sees_each_shape x4: test_gate_bindings.py, test_store_parts_bindings.py, test_store_taskq_bindings.py, test_taskq_bridge_bindings.py (reclassified here)
  • test_the_builtin_census_is_not_empty x2: test_app_signing_payload_executed_fields.py, test_app_signing_payload_resource_and_ui_fields.py (reclassified here)
  • test_the_answer_scan_flags_the_wire_ports_own_answers x2: test_eval_subagent_deny_notice.py, test_taskrunner_deny_notice.py (reclassified here)
  • test_the_own_name_logger_detector_answers_both_ways x2: test_history_projection_facade.py, test_history_search_bindings.py (reclassified here)
  • test_lookalike_and_malformed_urls_are_refused (+1 names) x3: test_source_providers_bitbucket_server.py, test_source_providers_gerrit.py, test_source_providers_github_enterprise.py (reclassified here)
  • test_within_root_refuses_an_escaping_file (+1 names) x2: test_hooks_coverage.py, test_hooks_coverage_file_branches.py (reclassified here)
  • test_no_kiro_bin_caches_unavailable (+1 names) x2: test_session_usage.py, test_session_usage_scrape.py (reclassified here)
  • test_the_class_only_scan_can_fail x13: test_acp_bindings.py, test_backend_bindings.py, test_client_bindings.py, test_cron_service_bindings.py, test_history_bindings.py, test_runtime_bindings.py, test_session_bindings.py, test_session_handle_bindings.py, test_session_lifecycle_bindings.py, test_ssh_tunnel_manager_bindings.py, test_taskrunner_bindings.py, test_transport_dispatch_composition.py, test_transport_dispatch_webex_composition.py
  • test_no_owner_imports_the_facade_at_run_time x13: test_acp_bindings.py, test_artifacts_bindings.py, test_backend_bindings.py, test_client_bindings.py, test_history_bindings.py, test_runtime_bindings.py, test_sel_bindings.py, test_session_bindings.py, test_session_handle_bindings.py, test_session_lifecycle_bindings.py, test_session_map_bindings.py, test_ssh_tunnel_manager_bindings.py, test_taskrunner_bindings.py
  • test_no_owner_keeps_an_unbound_self_function x11: test_acp_bindings.py, test_artifacts_bindings.py, test_client_bindings.py, test_driver_owner_bindings.py, test_history_bindings.py, test_session_allocation_bindings.py, test_session_handle_bindings.py, test_session_lifecycle_bindings.py, test_skills_bindings.py, test_ssh_tunnel_manager_bindings.py, test_taskrunner_bindings.py
  • test_no_bound_function_needs_its_class_body x9: test_acp_bindings.py, test_client_bindings.py, test_history_bindings.py, test_runtime_bindings.py, test_session_bindings.py, test_session_handle_bindings.py, test_session_lifecycle_bindings.py, test_ssh_tunnel_manager_bindings.py, test_taskrunner_bindings.py
  • test_each_owner_names_the_fields_it_writes_and_reads x9: test_acp_bindings.py, test_client_bindings.py, test_runtime_bindings.py, test_session_bindings.py, test_session_handle_bindings.py, test_session_lifecycle_bindings.py, test_skills_bindings.py, test_ssh_tunnel_manager_bindings.py, test_taskrunner_bindings.py
  • test_the_field_scan_counts_every_read_and_write_shape x8: test_acp_bindings.py, test_client_bindings.py, test_runtime_bindings.py, test_session_bindings.py, test_session_handle_bindings.py, test_session_lifecycle_bindings.py, test_ssh_tunnel_manager_bindings.py, test_taskrunner_bindings.py
  • test_the_detector_answers_both_ways x7: test_acp_refactor_create_guard.py, test_agent_refactor_create_guard.py, test_artifacts_refactor_create_guard.py, test_cli_doctor_refactor_create_guard.py, test_pod_runtime_refactor_create_guard.py, test_sandbox_refactor_create_guard.py, test_source_providers_refactor_create_guard.py
  • test_the_owner_edge_check_sees_every_spelling x6: test_chat_handlers_composition_contract.py, test_dashboard_agents_composition_contract.py, test_dashboard_files_composition_contract.py, test_dashboard_server_composition_contract.py, test_handlers_messaging_composition_contract.py, test_hooks_composition_contract.py
  • test_the_class_body_scan_can_fail x6: test_client_discord_composition_contract.py, test_client_telegram_composition_contract.py, test_renderer_discord_composition_contract.py, test_renderer_telegram_composition_contract.py, test_session_tree_projection_facade.py, test_telegram_transport_dispatch_composition_contract.py
  • test_leaf_test_scope_derives_this_file_as_a_corpus_gate x6: test_cron_script_facade.py, test_routes_parts_sage_composition_contract.py, test_security_posture_facade.py, test_security_split_patch_reach.py, test_session_storage_parts.py, test_warm_runtime_patch_reach.py
  • test_it_reads_the_hosts_own_field_bag x6: test_dashboard_template_flow.py, test_dashboard_template_office.py, test_dashboard_template_pr-watch.py, test_dashboard_template_roadmap.py, test_dashboard_template_standup.py, test_dashboard_template_swimlane.py
  • test_inert_mention_allowed (+5 names) x6: test_denied_commands_security_cost.py, test_denied_commands_security_kill.py, test_denied_commands_security_mentions.py, test_denied_commands_security_mint.py
  • test_argument_does_not_break_the_match (+4 names) x6: test_discord_app_commands.py, test_telegram_parity_commands.py, test_webex_dispatch.py, test_wecom_commands_and_ingest.py
  • test_the_test_tree_walk_reaches_every_collected_tree x6: test_gate_bindings.py, test_run_bindings.py, test_runner_facade.py, test_store_parts_bindings.py, test_store_taskq_bindings.py, test_taskq_bridge_bindings.py
  • test_leaf_test_scope_derives_this_file_as_a_corpus_gate x6: test_gate_bindings.py, test_run_bindings.py, test_runner_facade.py, test_store_parts_bindings.py, test_store_taskq_bindings.py, test_taskq_bridge_bindings.py
  • test_a_block_comment_refuses_the_line (+5 names) x6: test_name_grant.py, test_name_grant_windows.py
  • test_the_facade_installs_its_mirror_when_run_as_a_script x5: test_client_discord_composition_contract.py, test_client_telegram_composition_contract.py, test_renderer_discord_composition_contract.py, test_renderer_telegram_composition_contract.py, test_session_tree_projection_facade.py
  • test_the_shared_loader_accepts_it x5: test_dashboard_template_flow.py, test_dashboard_template_office.py, test_dashboard_template_roadmap.py, test_dashboard_template_standup.py, test_dashboard_template_swimlane.py
  • test_each_path_is_present x5: test_dashboard_template_flow.py, test_dashboard_template_office.py, test_dashboard_template_roadmap.py, test_dashboard_template_standup.py, test_dashboard_template_swimlane.py
  • test_it_renders_on_load_and_on_every_message x5: test_dashboard_template_flow.py, test_dashboard_template_office.py, test_dashboard_template_roadmap.py, test_dashboard_template_standup.py, test_dashboard_template_swimlane.py
  • test_data_consumer_exemption_does_not_cover_a_real_run (+4 names) x5: test_denied_commands_security_cost.py, test_denied_commands_security_kill.py, test_denied_commands_security_mentions.py, test_denied_commands_security_mint.py
  • test_the_member_set_is_the_frozen_inventory x5: test_gate_bindings.py, test_run_bindings.py, test_store_parts_bindings.py, test_store_taskq_bindings.py, test_taskq_bridge_bindings.py
  • test_the_sweep_reports_a_global_the_namespace_does_not_bind x4: test_agent_parts.py, test_cli_doctor_parts.py, test_sandbox_launcher_program_parts.py, test_subagent_parts_composition_contract.py
  • test_the_class_only_scan_can_fail x4: test_artifacts_bindings.py, test_context_assembly_bindings.py, test_driver_owner_bindings.py, test_skills_bindings.py
  • test_no_name_of_the_family_is_excluded_from_the_mirror x4: test_artifacts_parts_contract.py, test_control_parts_contract.py, test_session_control_parts_contract.py, test_spawn_parts_contract.py
  • test_owners_import_only_owners_listed_before_them x4: test_artifacts_parts_contract.py, test_control_parts_contract.py, test_session_control_parts_contract.py, test_spawn_parts_contract.py
  • test_every_owner_logs_under_the_facades_name x4: test_client_discord_composition_contract.py, test_client_telegram_composition_contract.py, test_renderer_discord_composition_contract.py, test_renderer_telegram_composition_contract.py
  • test_a_moved_member_is_its_owners_function x4: test_client_discord_composition_contract.py, test_client_telegram_composition_contract.py, test_renderer_discord_composition_contract.py, test_renderer_telegram_composition_contract.py
  • test_every_owner_function_of_self_is_bound_on_the_class x4: test_client_discord_composition_contract.py, test_client_telegram_composition_contract.py, test_renderer_discord_composition_contract.py, test_renderer_telegram_composition_contract.py
  • test_no_bound_function_needs_the_class_body x4: test_client_discord_composition_contract.py, test_client_telegram_composition_contract.py, test_renderer_discord_composition_contract.py, test_renderer_telegram_composition_contract.py
  • test_each_guarded_construct_stays_in_the_facade x4: test_client_discord_composition_contract.py, test_client_telegram_composition_contract.py, test_renderer_discord_composition_contract.py, test_renderer_telegram_composition_contract.py
  • test_the_globstar_matcher_reads_patterns_as_the_reviewers_do x4: test_dashboard_agents_composition_contract.py, test_dashboard_files_composition_contract.py, test_dashboard_server_composition_contract_guards.py, test_handlers_messaging_composition_contract.py
  • test_each_resolved_value_has_the_declared_type x4: test_dashboard_template_flow.py, test_dashboard_template_roadmap.py, test_dashboard_template_standup.py, test_dashboard_template_swimlane.py
  • test_it_reaches_no_network x4: test_dashboard_template_office.py, test_dashboard_template_roadmap.py, test_dashboard_template_standup.py, test_dashboard_template_swimlane.py
  • test_agent_resolves_to_kirocrew_when_unset x4: test_feishu_dispatch.py, test_teams_dispatch.py, test_webex_dispatch.py, test_wecom_dispatch.py
  • test_compact_none_capability_preserves_dispatch x4: test_feishu_dispatch.py, test_teams_dispatch.py, test_webex_dispatch.py, test_wecom_dispatch.py
  • test_no_name_patched_through_run_is_read_by_an_owner (+2 names) x4: test_gate_bindings.py, test_run_bindings.py, test_runner_facade.py, test_store_taskq_bindings.py
  • test_agent_reply (+3 names) x4: test_slack_handler_coverage.py
  • test_no_test_patches_a_forwarded_name_that_it_may_create x3: test_acp_refactor_create_guard.py, test_agent_refactor_create_guard.py, test_pod_runtime_refactor_create_guard.py
  • test_leaf_test_scope_derives_this_file_as_a_corpus_gate x3: test_agent_parts.py, test_cli_doctor_parts.py, test_sandbox_launcher_program_parts.py
  • test_the_patch_scan_reads_every_spelling_and_nothing_else x3: test_agent_parts.py, test_cli_doctor_parts.py, test_sandbox_launcher_program_parts.py
  • test_the_patch_scan_finds_every_known_seam x3: test_agent_parts.py, test_cli_doctor_parts.py, test_sandbox_launcher_program_parts.py
  • test_the_owner_import_check_sees_every_spelling x3: test_agent_parts.py, test_cli_doctor_parts.py, test_subagent_parts_composition_contract.py
  • test_the_package_init_defines_nothing x3: test_agent_parts.py, test_cli_doctor_parts.py, test_sandbox_launcher_program_parts.py
  • test_the_importer_check_sees_every_spelling x3: test_agent_parts.py, test_cli_doctor_parts.py, test_subagent_parts_composition_contract.py
  • test_the_frozen_inventory_is_not_empty x3: test_app_backend_composition_contract.py, test_apps_registry_composition_contract.py, test_aws_control_backup_composition_contract.py
  • test_every_module_holding_a_name_holds_the_same_object x3: test_app_backend_composition_contract.py, test_apps_registry_composition_contract.py, test_aws_control_backup_composition_contract.py
  • test_the_reader_flags_every_spelling_and_only_those x3: test_app_backend_composition_contract_patch_spellings.py, test_apps_registry_composition_contract_patch_spellings.py, test_aws_control_backup_composition_contract_patch_guards.py
  • test_each_owner_names_the_fields_it_writes_and_reads x3: test_backend_bindings.py, test_sel_bindings.py, test_session_map_bindings.py
  • test_self_test_passes x3: test_check_comment_history.py, test_subprocess_encoding_gate.py, test_sync_io_in_async_gate.py
  • test_prompt_does_not_carry_the_retired_verbosity_token x3: test_conductor_agent.py, test_pipeline_conductor_agent.py, test_security_conductor_agent.py
  • test_the_sibling_import_scan_catches_a_planted_import x3: test_context_composition_contract_facade.py, test_skills_composition_contract.py, test_vector_memory_composition_contract.py
  • test_the_patch_scan_finds_every_known_seam x3: test_cron_script_facade.py, test_security_posture_facade.py, test_session_storage_parts.py
  • test_leaf_test_scope_derives_this_file_as_a_corpus_gate x3: test_fleet_probe_owners.py, test_pr_status_owners.py, test_push_guard_owners.py
  • test_every_name_the_one_file_script_bound_is_still_bound_on_the_facade (+1 names) x3: test_fleet_probe_owners.py, test_pr_status_owners.py, test_push_guard_owners.py
  • test_no_owner_imports_the_facade_at_run_time x3: test_runner_facade.py, test_store_parts_bindings.py, test_store_taskq_bindings.py
  • test_each_class_an_owner_defines_carries_its_frozen_module x3: test_runner_facade.py, test_store_parts_bindings.py, test_store_taskq_bindings.py
  • test_leaf_test_scope_derives_this_file_as_a_corpus_gate x3: test_runtime_bindings.py, test_session_allocation_bindings.py, test_session_handle_bindings.py
  • test_the_placement_scan_finds_each_construct_it_pins x3: test_telegram_transport_dispatch_composition_contract.py, test_transport_dispatch_composition.py, test_transport_dispatch_webex_composition.py
  • test_an_owner_imports_the_facade_only_for_type_checking_and_no_project_module x2: test_agent_parts.py, test_cli_doctor_parts.py
  • test_the_facade_helper_is_only_ever_called_in_place x2: test_app_backend_composition_contract.py, test_apps_registry_composition_contract.py
  • test_the_reader_follows_a_production_re_export x2: test_app_backend_composition_contract_patch_spellings.py, test_apps_registry_composition_contract_patch_spellings.py
  • test_leaf_test_scope_derives_this_file_as_a_corpus_gate x2: test_app_backend_composition_contract_patch_spellings.py, test_apps_registry_composition_contract_patch_spellings.py
  • test_precondition_a_declaring_manifest_is_admitted_when_untampered x2: test_app_signing_payload_executed_fields.py, test_app_signing_payload_resource_and_ui_fields.py
  • test_delete_missing_404 (+1 names) x2: test_artifact_comment_handlers.py, test_artifacts_handlers_coverage.py
  • test_edit_missing_404 (+1 names) x2: test_artifact_comment_handlers.py, test_artifacts_handlers_coverage.py
  • test_the_scan_reads_every_file_that_names_the_facade (+1 names) x2: test_artifacts_refactor_create_guard.py, test_source_providers_refactor_create_guard.py
  • test_no_owner_keeps_an_unbound_self_function x2: test_backend_bindings.py, test_sel_bindings.py
  • test_the_owner_set_is_the_package x2: test_chat_handlers_composition_contract.py, test_chat_runner_base_surface.py
  • test_the_package_holds_exactly_the_composed_modules x2: test_chat_persistence_composition_contract.py, test_context_composition_contract_facade.py
  • test_the_package_init_imports_nothing x2: test_chat_persistence_composition_contract.py, test_context_composition_contract_facade.py
  • test_no_owner_anchors_a_path_on_its_own_file x2: test_chat_persistence_composition_contract.py, test_context_composition_contract_facade.py
  • test_the_package_holds_exactly_the_composed_parts x2: test_chat_persistence_parts_composition_contract.py, test_routes_parts_sage_composition_contract.py
  • test_the_package_init_holds_only_its_docstring x2: test_chat_persistence_parts_composition_contract.py, test_routes_parts_sage_composition_contract.py
  • test_the_owners_are_every_sibling_module_in_layer_order x2: test_client_discord_composition_contract.py, test_renderer_discord_composition_contract.py
  • test_an_owner_imports_only_owners_below_it_and_never_its_facade x2: test_client_discord_composition_contract.py, test_renderer_discord_composition_contract.py
  • test_the_class_keeps_every_base_member x2: test_client_discord_composition_contract.py, test_renderer_discord_composition_contract.py
  • test_every_base_member_keeps_its_kind_and_signature x2: test_client_discord_composition_contract.py, test_renderer_discord_composition_contract.py
  • test_only_the_family_imports_an_owner x2: test_client_discord_composition_contract.py, test_renderer_discord_composition_contract.py
  • test_the_owner_import_scan_finds_an_outside_importer x2: test_client_discord_composition_contract.py, test_renderer_discord_composition_contract.py
  • test_each_moved_class_is_served_whole_from_its_owner x2: test_client_discord_composition_contract.py, test_renderer_discord_composition_contract.py
  • test_the_owners_are_every_sibling_module_in_layer_order x2: test_client_telegram_composition_contract.py, test_renderer_telegram_composition_contract.py
  • test_an_owner_imports_only_owners_below_it_and_never_its_facade x2: test_client_telegram_composition_contract.py, test_renderer_telegram_composition_contract.py
  • test_the_class_keeps_every_base_member_and_gains_none x2: test_client_telegram_composition_contract.py, test_renderer_telegram_composition_contract.py
  • test_every_base_member_keeps_its_kind_and_signature x2: test_client_telegram_composition_contract.py, test_renderer_telegram_composition_contract.py
  • test_the_sibling_import_scan_allows_a_module_import x2: test_context_composition_contract_facade.py, test_skills_composition_contract.py
  • test_both_exempted_caller_classes_are_fenced (+1 names) x2: test_cron_session_control.py, test_session_control_lineage_fence.py
  • test_missing_testpaths_exits_rather_than_scanning_nothing (+1 names) x2: test_cwd_relative_repo_reads_gate.py, test_testpaths_coverage_gate.py
  • test_the_owner_set_is_the_package x2: test_dashboard_agents_composition_contract.py, test_slack_handler_composition_contract.py
  • test_the_owner_set_is_the_package x2: test_dashboard_files_composition_contract.py, test_handlers_messaging_composition_contract.py
  • test_it_reads_only_the_work_fold x2: test_dashboard_template_flow.py, test_dashboard_template_roadmap.py
  • test_assert_floor_passes_default_authority (+1 names) x2: test_denied_commands_authority.py, test_platform_context.py
  • test_assert_floor_rejects_non_authority (+1 names) x2: test_denied_commands_authority.py, test_platform_context.py
  • test_a_quoted_literal_construct_pattern_stays_denied (+1 names) x2: test_denied_commands_security_kill.py
  • test_function_not_forwarding_to_a_protected_program_allowed (+1 names) x2: test_denied_commands_security_kill.py, test_denied_commands_security_mint.py
  • test_mint_spellings_still_blocked (+1 names) x2: test_denied_commands_security_kill.py, test_denied_commands_security_mint.py
  • test_quote_aware_window_still_sees_the_kill (+1 names) x2: test_denied_commands_security_kill.py
  • test_payload_without_a_protected_command_allowed (+1 names) x2: test_denied_commands_security_kill.py, test_denied_commands_security_mint.py
  • test_interpreter_argv_literal_blocked (+1 names) x2: test_denied_commands_security_mint.py, test_denied_commands_security_ssh_self.py
  • test_a_genuine_netcat_exec_is_denied_by_this_row (+1 names) x2: test_denied_commands_security_rows.py, test_denied_commands_security_ssh_self.py
  • test_sso_plus_profile_passes x2: test_deploy_script_validation.py
  • test_unterminated_options_tag_is_not_redos x2: test_discord.py, test_telegram.py
  • test_save_rejects_non_numeric_user_ids x2: test_discord_config_handlers.py, test_telegram_config_handlers.py
  • test_soft_threshold_bounds x2: test_discord_config_handlers.py, test_telegram_config_handlers.py
  • test_every_host_deny_is_preceded_by_the_shared_steer x2: test_eval_subagent_deny_notice.py, test_taskrunner_deny_notice.py
  • test_every_reject_audits_before_the_steer x2: test_eval_subagent_deny_notice.py, test_taskrunner_deny_notice.py
  • test_every_steer_names_its_cause_explicitly x2: test_eval_subagent_deny_notice.py, test_taskrunner_deny_notice.py
  • test_each_owner_imports_on_its_own_before_the_facade x2: test_events_facade.py, test_interactions_facade.py
  • test_save_rejects_whitespace_credentials x2: test_feishu_config_handlers.py, test_wecom_config_handlers.py
  • test_strict_guard_is_actually_armed x2: test_folder_watcher_off_loop_guard.py, test_knowledge_agent_sync_off_loop.py
  • test_the_resolution_scan_can_fail x2: test_gate_bindings.py, test_run_bindings.py
  • test_nothing_else_in_src_imports_an_owner x2: test_gate_bindings.py, test_run_bindings.py
  • test_a_foreign_child_may_read_it x2: test_gateway_id_sandbox_seal.py, test_skill_projection_sandbox_seal.py
  • test_macos_denies_writes_but_not_reads x2: test_gateway_id_sandbox_seal.py, test_skill_projection_sandbox_seal.py
  • test_a_named_port_is_still_used_as_the_fallback (+1 names) x2: test_instance_credential_pairing.py
  • test_a_404_still_reads_as_feature_absent (+1 names) x2: test_issue_radar_deps.py
  • test_a_parenthetical_citation_is_removed_as_one_unit x2: test_issue_radar_routes_ai_coverage.py, test_issue_radar_routes_coverage.py
  • test_a_non_string_does_not_raise (+1 names) x2: test_issue_radar_routes_ai_coverage.py, test_issue_radar_routes_coverage.py
  • test_absent_and_empty_default_to_issue x2: test_issue_radar_routes_ai_coverage_lists_and_investigation.py, test_issue_radar_routes_coverage.py
  • test_missing_params_is_400 x2: test_issue_radar_routes_coverage.py
  • test_an_unconnected_repo_is_404 x2: test_issue_radar_routes_coverage.py
  • test_missing_params_is_400 x2: test_issue_radar_routes_coverage.py
  • test_a_malformed_or_non_object_payload_is_400 x2: test_issue_radar_routes_coverage.py, test_issue_radar_routes_coverage_label_and_issue_writes.py
  • test_an_unconnected_repo_is_404 x2: test_issue_radar_routes_coverage.py
  • test_missing_params_is_400 x2: test_issue_radar_routes_coverage.py
  • test_an_unconnected_repo_is_404_before_the_permission_gate x2: test_issue_radar_routes_coverage_label_and_issue_writes.py
  • test_the_watcher_fires_only_on_completion x2: test_main_macos_failure_watch.py, test_scheduled_failure_watch.py
  • test_the_declared_set_matches_what_is_advertised x2: test_mcp_crew_log.py, test_mcp_debug.py
  • test_non_member_session_is_untouched x2: test_member_dispatch_mount.py, test_member_panel_mount.py
  • test_kiro_backend_is_untouched x2: test_member_dispatch_mount.py, test_member_panel_mount.py
  • test_returns_none_when_nothing_is_installed (+1 names) x2: test_papyrus_latex.py, test_papyrus_tectonic.py
  • test_prompt_drives_patrol_with_monitor_start_not_wait x2: test_pipeline_conductor_agent.py, test_security_conductor_agent.py
  • test_a_siblings_clean_check_run_does_not_pass_this_pr x2: test_pr_readiness_evaluate.py
  • test_a_previous_attempts_clean_check_run_does_not_pass_a_rerun x2: test_pr_readiness_evaluate.py
  • test_the_template_origin_keeps_auto_maintenance_off x2: test_preflight_write_permission.py, test_push_guard.py
  • test_ships_in_warn_mode x2: test_proof_line_check.py, test_sibling_list_check.py
  • test_enforcement_applies_to_pull_requests_opened_on_or_after_the_date x2: test_proof_line_check.py, test_sibling_list_check.py
  • test_the_signature_digest_ignores_an_object_address_in_either_spelling x2: test_runtime_bindings.py, test_session_handle_bindings.py
  • test_the_bound_function_scans_include_every_static_method x2: test_runtime_bindings.py, test_session_handle_bindings.py
  • test_sandbox_exec_not_found_returns_false (+1 names) x2: test_sandbox_probe.py
  • test_operator_extension_corpus_default_config_rejects (+1 names) x2: test_security_oauth_urls.py
  • test_the_field_scan_counts_every_read_and_write_shape x2: test_sel_bindings.py, test_session_map_bindings.py
  • test_no_bound_function_needs_its_class_body x2: test_session_allocation_bindings.py, test_skills_bindings.py
  • test_the_bound_function_scans_include_every_static_method x2: test_session_lifecycle_bindings.py, test_taskrunner_bindings.py
  • test_the_runtime_package_holds_exactly_the_composed_modules x2: test_skills_composition_contract.py, test_vector_memory_composition_contract.py
  • test_the_package_ships_with_the_wheel x2: test_skills_composition_contract.py, test_vector_memory_composition_contract.py
  • test_the_package_init_imports_nothing x2: test_skills_composition_contract.py, test_vector_memory_composition_contract.py
  • test_no_runtime_module_reads_a_seam_as_a_bare_global x2: test_skills_composition_contract.py, test_vector_memory_composition_contract.py
  • test_no_runtime_module_defines_an_async_function x2: test_skills_composition_contract.py, test_vector_memory_composition_contract.py
  • test_a_construct_a_guard_reads_stays_where_the_guard_reads_it x2: test_slack_gateway_composition_contract.py, test_slack_handler_composition_contract.py
  • test_a_refused_subdirectory_is_skipped_and_recorded (+1 names) x2: test_snapshot_unreadable_entries.py
  • test_a_refused_subdirectory_is_skipped_on_the_by_name_walk (+1 names) x2: test_snapshot_unreadable_entries.py
  • test_row_is_registered_as_a_default_on_capability x2: test_social_share_governance.py, test_tailnet_governance.py
  • test_the_budget_alone_hands_the_reader_the_key x2: test_split_credential_boundary_channel_delivery.py, test_split_credential_boundary_rotation_and_tally.py
  • test_the_kind_reader_tells_a_coroutine_from_a_function x2: test_store_parts_bindings.py, test_store_taskq_bindings.py
  • test_each_member_keeps_its_kind_signature_and_owner x2: test_store_parts_bindings.py, test_store_taskq_bindings.py
  • test_each_owner_imports_only_owners_listed_before_it x2: test_store_parts_bindings.py, test_store_taskq_bindings.py
  • test_each_owner_names_the_fields_it_writes_and_reads x2: test_store_parts_bindings.py, test_store_taskq_bindings.py
  • test_help_command x2: test_teams_dispatch.py, test_webex_dispatch.py
  • test_every_base_name_still_resolves x2: test_transport_dispatch_composition.py, test_transport_dispatch_webex_composition.py
  • test_a_moved_name_is_its_owners_object x2: test_transport_dispatch_composition.py, test_transport_dispatch_webex_composition.py
  • test_the_mirror_serves_exactly_the_moved_names_the_facade_does_not_bind x2: test_transport_dispatch_composition.py, test_transport_dispatch_webex_composition.py
  • test_the_owner_list_is_the_layer_order_and_names_every_owner_on_disk x2: test_transport_dispatch_composition.py, test_transport_dispatch_webex_composition.py
  • test_no_owner_takes_a_sync_io_module_through_a_from_import x2: test_transport_dispatch_composition.py, test_transport_dispatch_webex_composition.py
  • test_the_sync_io_gate_reports_a_blocking_call_planted_in_each_coroutine_owner x2: test_transport_dispatch_composition.py, test_transport_dispatch_webex_composition.py
  • test_no_owner_holds_what_the_facade_guards_read_by_path x2: test_transport_dispatch_composition.py, test_transport_dispatch_webex_composition.py
  • test_conversation_state x2: test_webex_dispatch.py, test_wecom_dispatch.py
  • test_parse_mid_turn_override x2: test_webex_dispatch.py, test_wecom_commands_and_ingest.py
  • test_a_bare_override_is_recognized (+1 names) x2: test_webex_dispatch.py, test_wecom_commands_and_ingest.py
  • test_a_complete_or_unrelated_message_is_not_a_bare_override (+1 names) x2: test_webex_dispatch.py, test_wecom_commands_and_ingest.py

@iamwhatever
iamwhatever requested review from a team and KiroCrewCaptain as code owners October 26, 2026 23:31
@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision 7ca491cb2bdc5da7095446f3e410be6ce6465d82 touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Does not block merge.

@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 26, 2026
@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ⏭️ skipped

Revision 7ca491cb2bdc5da7095446f3e410be6ce6465d82 ships no reviewable capability (docs, tests or generated files only), so there is nothing to inventory. Does not block merge.

@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 7ca491cb2bdc5da7095446f3e410be6ce6465d82 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

This is a test-only consolidation. It keeps every collected case and its marks and adds no new surface, and nothing outside test/ still reads the removed test names.

Notes

[DESIGN-REVIEWED] 7ca491c

Description read

[DESCRIPTION-READ] 05900eb5dedbb4e2629dac5b5d9c5a652e6624c4d4c98397df6dffdcf988625c

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 7ca491cb2bdc5da7095446f3e410be6ce6465d82 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 7ca491c

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 7ca491cb2bdc5da7095446f3e410be6ce6465d82 false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 7ca491cb2bdc5da7095446f3e410be6ce6465d82 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 7ca491c

Verdict parsed from the review's SHA-scoped output markers for commit 7ca491cb2bdc5da7095446f3e410be6ce6465d82.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 7ca491cb2bdc5da7095446f3e410be6ce6465d82 false-positive: <reason, 20 to 500 characters>

@bolichen97 bolichen97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to ship. This review leaves a comment only, because the PR changes 75 files and is stacked on #24626, so a maintainer must merge it after #24626 lands.

Head reviewed: 0fbb516. I read the batch 2 commit only (8ca6b53a865e..0fbb51667d9c, 27 files). The first commit belongs to #24626 and gets its review there.

What I checked:

  • Each folded body matches the removed copy line for line, and each removed case appears again in its home test through named_cases with the old test name in its id.
  • Setup parity between the source file and the home file for the groups I could verify: the three test_find_ui_* files have the same autouse _fresh_cache, the two test_source_providers_* files import the same three autouse fixtures, and the two test_platform_compat* files share the same pytestmark.
  • The test_socketsec_cov80.py case keeps its Windows skip as a per case mark.
  • Every home file that uses named_cases imports it.
  • The test_kas_hooks_acp.py case now runs under a different autouse fixture. Its body reads only KAS_CLIENT_CAPABILITIES, so the change in fixture does not change what it checks.

CI on this head: the AI review lanes report no blocking findings. Readiness is still checking. One macOS shard failed on test_windows_logs_and_diagnostics.py::test_follow_allows_real_writer_rollover with a 180 s timeout. This PR does not touch that file.

Remaining before merge: #24626 merges, this branch rebases to one commit, and readiness reaches passed on the new head.

@iamwhatever

Copy link
Copy Markdown
Contributor Author

CI dispositions

zejiangg added 2 commits October 27, 2026 01:19
Sixty-one groups of tests in one file share a body word for word and
differ only in parametrize data. Each group becomes one parametrized
test; named_cases keeps every case and ids it <old name>-<old param id>,
so all 899 changed ids map one to one and keep their marks. Duplicate
body groups drop from 286 to 225.
Fifteen groups of tests repeat one body word for word in sibling files
that test the same module. Each group becomes one parametrized test in
the file closest to the module; named_cases keeps every case with its
old name in the id, and a moved case carries its file's marks, so all
117 changed ids map one to one. Duplicate body groups drop from 225 to
210.
@iamwhatever
iamwhatever force-pushed the test-cleanup/twins-cross-file branch from 0fbb516 to 7ca491c Compare October 27, 2026 01:23
@iamwhatever

Copy link
Copy Markdown
Contributor Author

Restacked on #24626's rebased head 967e57e652 (main 8a518e121b, which carries the #24609 Windows fix). New head 7ca491cb2b. Main did not touch any of this PR's files in between. The touched files rerun green locally (1,616 passed, 6 skipped), and CI is re-running.

@bolichen97 bolichen97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Re-review at head 7ca491c.

This push is a clean rebase onto newer main. A range-diff against the previously reviewed head (0fbb516) shows both commits carry the same patch, so every fold reviewed before is unchanged: each parametrized body still matches the copies it replaces, and the fixtures and pytestmark of each home file still match the files the copies came from. Main did not touch any of the 75 files between the two bases, so no twin drifted while the branch sat.

No new findings. Two things still keep this a comment rather than an approval:

  • The branch is still stacked on #24626, which is open. That PR has to merge first, and this one should then show only its own commit.
  • 75 files changed, so a maintainer should give the final approval. CI and readiness are still running on this head.

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Oct 27, 2026
@chenmingwei23
chenmingwei23 merged commit 55a8a8a into main Oct 27, 2026
115 of 123 checks passed
@chenmingwei23
chenmingwei23 deleted the test-cleanup/twins-cross-file branch October 27, 2026 06:03
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants