Files
PlantAI-dev/.superpowers/sdd/convergence-task-2-brief.md
2026-08-03 18:42:47 +08:00

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

  1. Copy the current green tests/unit/test_ppi_id_resolution.py exactly to: 项目记录/代码归档/2026-07-10_PPI_ID修订收敛前快照/test_ppi_id_resolution.full.py.txt
  2. 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_relationship
    • test_raw_xp_failure_falls_back_to_ncbi_geneid_and_selects_string_id
    • test_raw_and_geneid_mapping_to_same_string_id_is_not_ambiguous
    • test_one_input_mapping_to_two_distinct_string_ids_is_ambiguous
    • test_partial_resolution_continues_with_explicit_unresolved_rows
    • test_zero_resolved_ids_returns_id_resolution_failure
    • test_network_empty_list_is_success_empty_network
    • test_network_http_error_is_external_api_failure
    • test_get_string_ids_uses_query_index_not_response_position
    • test_24_origins_collapse_to_12_queries_without_losing_provenance
    • test_run_resolves_relationships_submits_selected_string_ids_and_writes_provenance
    • test_run_direct_target_raw_candidate_uses_canonical_member_evidence
    • test_run_counts_canonical_member_missing_ortholog_as_unresolved
    • test_many_canonical_targets_sharing_one_reference_keep_separate_rows
    • test_one_canonical_source_with_conflicting_references_is_excluded
    • test_mapping_404_and_200_empty_both_mean_zero_resolution
    • test_two_reference_queries_converging_on_one_string_id_are_both_resolved
    • test_request_throttle_uses_injected_clock_and_sleeper
    • test_interprocess_rate_gate_serializes_concurrent_clients
  3. Preserve test bodies/assertions. Remove only unused fixtures, helpers, imports, and non-listed tests.
  4. 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.