2.9 KiB
Executable File
2.9 KiB
Executable File
Task 2 — Replace oversized PPI test module with a behavioral core
Source plan: docs/superpowers/plans/2026-07-10-ppi-code-convergence.md, Task 2.
Global constraints
- Apply Karpathy simplicity; this task changes tests only.
- Do not edit production code.
- Do not permanently delete tests: archive the exact green module before editing.
- Do not weaken assertions in retained tests merely to ease future refactoring.
- Keep tests offline; use
/home/xia-lab/miniconda3/envs/test4py311/bin/python -m pytest. - Git is unavailable; use file snapshots and test evidence.
Required work
- Copy the current green
tests/unit/test_ppi_id_resolution.pyexactly to:项目记录/代码归档/2026-07-10_PPI_ID修订收敛前快照/test_ppi_id_resolution.full.py.txt - Rewrite the active module to retain only fixtures/helpers needed by, and the exact behavior/assertions of, these tests:
test_parse_ortholog_mapping_preserves_every_exact_relationshiptest_raw_xp_failure_falls_back_to_ncbi_geneid_and_selects_string_idtest_raw_and_geneid_mapping_to_same_string_id_is_not_ambiguoustest_one_input_mapping_to_two_distinct_string_ids_is_ambiguoustest_partial_resolution_continues_with_explicit_unresolved_rowstest_zero_resolved_ids_returns_id_resolution_failuretest_network_empty_list_is_success_empty_networktest_network_http_error_is_external_api_failuretest_get_string_ids_uses_query_index_not_response_positiontest_24_origins_collapse_to_12_queries_without_losing_provenancetest_run_resolves_relationships_submits_selected_string_ids_and_writes_provenancetest_run_direct_target_raw_candidate_uses_canonical_member_evidencetest_run_counts_canonical_member_missing_ortholog_as_unresolvedtest_many_canonical_targets_sharing_one_reference_keep_separate_rowstest_one_canonical_source_with_conflicting_references_is_excludedtest_mapping_404_and_200_empty_both_mean_zero_resolutiontest_two_reference_queries_converging_on_one_string_id_are_both_resolvedtest_request_throttle_uses_injected_clock_and_sleepertest_interprocess_rate_gate_serializes_concurrent_clients
- Preserve test bodies/assertions. Remove only unused fixtures, helpers, imports, and non-listed tests.
- Run:
/home/xia-lab/miniconda3/envs/test4py311/bin/python -m pytest \
tests/unit/test_ppi_id_resolution.py \
tests/unit/test_id_resolution.py \
tests/unit/test_ppi_string_policy.py -q
Expected: all collected tests pass offline.
5. Run the four-file 177-test checkpoint command from Task 1. Expected: the only collection reduction comes from archived PPI tests; all collected tests pass.
6. Record before/after wc -l, collected counts, exact commands/results, and self-review.
Report
Write .superpowers/sdd/convergence-task-2-report.md with status, archive path, exact active diff scope, line counts, test results, and concerns.