Files
2026-08-03 18:42:47 +08:00

2.7 KiB
Executable File

E2E Task 1 — Wire id_map_file through CLI and backend

Source: docs/superpowers/plans/2026-07-10-ppi-id-map-e2e-wiring.md, Task 1.

Binding constraints

  • Karpathy/YAGNI: no new helper framework for this deterministic path.
  • Modify only skills/ppi/run.py, apps/web/pipeline_backend.py, tests/unit/test_ppi_id_resolution.py, and tests/unit/test_pipeline_backend_execution_env.py.
  • Freeze resolver, STRING client, rate gate, Reset, frontend, contracts, and manifest schema.
  • Backend may resolve only <job.input_dir>/<ppi_species>/<ppi_species>.pep_cds_idmap.tsv.
  • Never scan another species/job/final/stale path.
  • Projected mode (mapping_file present) requires the same-species ID map and fails before launching skill when absent.
  • Direct-target mode may run without ID map; if exact current-species map exists it may be passed.
  • Preserve 72 existing convergence tests. Use test4py311. Git is unavailable.

Required TDD work

  1. Add a failing CLI test that replaces PpiSkill with a fake, invokes main() with --id-map /tmp/soe.pep_cds_idmap.tsv, and asserts captured id_map_file == Path(...). No network.
  2. Run the test and record RED.
  3. Add exactly:
parser.add_argument("--id-map", help="Species-matched local PEP/CDS ID evidence TSV")

and pass:

id_map_file=Path(args.id_map) if args.id_map else None,

to existing PpiSkill.run. 4. Add failing backend tests for:

  • projected soe with exact soe map: command includes exact --mapping and --id-map;
  • projected soe with only ath map: no subprocess, explicit soe missing-map failure, ath never selected;
  • projected soe with no map: no subprocess, explicit failure;
  • direct supported target without map: command omits both --mapping and --id-map.
  1. Add minimal inline backend lookup immediately before command construction:
id_map_file = Path(job.input_dir) / ppi_species / f"{ppi_species}.pep_cds_idmap.tsv"
if mapping_file and not id_map_file.is_file():
    return (
        f"❌ PPI projected analysis requires species-matched ID map: {id_map_file}",
        manifest,
    )

and after mapping argument:

if id_map_file.is_file():
    cmd.extend(["--id-map", str(id_map_file)])
  1. Run focused tests:
/home/xia-lab/miniconda3/envs/test4py311/bin/python -m pytest \
  tests/unit/test_ppi_id_resolution.py \
  tests/unit/test_pipeline_backend_execution_env.py \
  -k 'id_map or ppi' -q
  1. Run full convergence regression and py_compile. Expected: previous 72 plus new cases pass; compile exits 0.
  2. Self-review exact diff and scope.

Report

Write .superpowers/sdd/e2e-task-1-report.md with RED/GREEN evidence, exact active files/diff summary, test counts, compile result, concerns, and status contract.