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

1.8 KiB
Executable File

Task 2 — Reference-bundle ID evidence schema

Goal

Expose numeric NCBI GeneID as explicit reference-bundle evidence without changing the existing LOC-style gene_id meaning.

Allowed files

  • Modify apps/web/pipeline_backend.py only around _fasta_header_index() and _build_reference_bundle_id_map().
  • Modify tests/unit/test_pipeline_backend_execution_env.py for focused regression coverage.
  • Update .superpowers/sdd/task-2-report.md with RED/GREEN evidence.

Do not change PPI querying, ortholog logic, frontend behavior, canonical IDs, or other stages in this task.

Required behavior

  • Parse numeric GeneID from FASTA header metadata matching [db_xref=GeneID:<digits>].
  • Add ncbi_gene_id to _fasta_header_index() records.
  • Add ncbi_gene_id to the generated pep_cds_idmap.tsv schema.
  • Preserve existing gene_id=LOC... behavior and all existing column semantics.
  • Add manifest id_validation counts only if useful and directly covered by tests.
  • Missing numeric GeneID should be represented deterministically without breaking legacy bundles.

TDD evidence

  1. Add a test where CDS header contains both gene=LOC110806180 and db_xref=GeneID:110806180.
  2. Assert TSV retains gene_id == LOC110806180 and adds ncbi_gene_id == 110806180.
  3. Run the focused test before production edits and record the expected RED.
  4. Implement the smallest schema/parsing change.
  5. Run: /home/xia-lab/miniconda3/envs/test4py311/bin/python -m pytest tests/unit/test_pipeline_backend_execution_env.py -k 'reference_bundle or ppi' -q
  6. Run syntax compilation for the changed production file.

Review checkpoint

The workspace has no functional Git repository. Baseline copies are stored under /tmp/ppi-id-resolution-task2-baseline/; reviewers compare those copies with current files and inspect the full focused diff.