hitlist 2.0.0__tar.gz → 2.0.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {hitlist-2.0.0/hitlist.egg-info → hitlist-2.0.2}/PKG-INFO +1 -1
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/context_evidence.py +7 -7
- hitlist-2.0.2/hitlist/evidence_snapshot.py +54 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/external_evidence.py +6 -6
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/mhc_evidence.py +2 -12
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/reference_evidence.py +6 -20
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/supporting_evidence.py +5 -5
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/supporting_numeric_evidence.py +3 -11
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/tcell_evidence.py +5 -5
- hitlist-2.0.2/hitlist/version.py +1 -0
- {hitlist-2.0.0 → hitlist-2.0.2/hitlist.egg-info}/PKG-INFO +1 -1
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist.egg-info/SOURCES.txt +2 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_context_evidence.py +30 -0
- hitlist-2.0.2/tests/test_evidence_snapshot.py +53 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_mhc_evidence.py +16 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_release_artifacts.py +137 -9
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_supporting_numeric_evidence.py +3 -2
- hitlist-2.0.0/hitlist/version.py +0 -1
- {hitlist-2.0.0 → hitlist-2.0.2}/LICENSE +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/MANIFEST.in +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/README.md +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/__init__.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/aggregate.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/apm.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/assays.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/atlas.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/builder.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/bulk_fractionation.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/bulk_proteomics.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/bulk_replicates.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/cache_inventory.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/canine_bulk.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/canine_ligands.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/canine_orfdata.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/cell_name_parser.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/cli.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/cli_evidence.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/cli_evidence_store.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/cli_help.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/cli_uniprot.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/condition_categories.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/conditions.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/cta_expression.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/curation.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/curation_yaml.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/data/__init__.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/data/atlas_community_crosswalk.yaml +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/data/bulk_proteomics/__init__.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/data/bulk_proteomics/detectability.yaml +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/data/bulk_proteomics/sources.yaml +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/data/canine_bulk.yaml +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/data/canine_ligands.yaml +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/data/cell_lines.yaml +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/data/condition_vocabulary.yaml +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/data/data_assets.yaml +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/data/evidence_revisions/pmid_overrides_1_78.yaml +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/data/evidence_revisions/pxd057588_assets.json +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/data/evidence_revisions/pxd057588_contract.json +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/data/evidence_revisions/pxd057588_retrieval_receipts.json +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/data/evidence_revisions/pxd057588_workbook_inventory.json +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/data/evidence_revisions/supporting_v4_assets.json +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/data/gene_sets.yaml +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/data/hla_ligand_atlas.yaml +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/data/line_expression/__init__.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/data/line_expression/apm_rna_build_report.yaml +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/data/line_expression/ensembl_gene_id_symbol.csv +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/data/line_expression/gm12878_encode_rnaseq_tpm.csv.gz +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/data/line_expression/hap1_depmap24q4_gene_tpm.csv.gz +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/data/line_expression/sources.yaml +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/data/line_expression_anchors.yaml +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/data/monoallelic_lines.yaml +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/data/peptide_attributions/connelley_2022_bola_a19.csv +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/data/peptide_attributions/sarkizova_2020_patient_cohort.csv +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/data/pmid_overrides.yaml +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/data/pxd013455.yaml +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/data/pxd013455_publication.yaml +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/data/species_contexts.yaml +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/data/specimen_lineage.yaml +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/data/supplementary/abelin_2019_dr_tissue.csv +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/data/supplementary/abelin_2019_maptac_class1.csv +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/data/supplementary/gomez_zepeda_2024_hela.csv +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/data/supplementary/gomez_zepeda_2024_jy.csv +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/data/supplementary/gomez_zepeda_2024_plasma.csv +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/data/supplementary/gomez_zepeda_2024_raji.csv +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/data/supplementary/gomez_zepeda_2024_skmel37.csv +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/data/supplementary/shapiro_2025_hap1_b2m_ko.csv +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/data/supplementary/shapiro_2025_hap1_calr_ko.csv +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/data/supplementary/shapiro_2025_hap1_canx_ko.csv +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/data/supplementary/shapiro_2025_hap1_erap1_ko.csv +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/data/supplementary/shapiro_2025_hap1_ganab_ko.csv +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/data/supplementary/shapiro_2025_hap1_irf2_ko.csv +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/data/supplementary/shapiro_2025_hap1_pdia3_ko.csv +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/data/supplementary/shapiro_2025_hap1_sppl3_ko.csv +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/data/supplementary/shapiro_2025_hap1_tap1_ko.csv +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/data/supplementary/shapiro_2025_hap1_tap2_ko.csv +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/data/supplementary/shapiro_2025_hap1_tapbp_ko.csv +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/data/supplementary/shapiro_2025_hap1_wildtype.csv +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/data/supplementary.yaml +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/data/tcell_audit_sources.yaml +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/data/tissue_blacklist.yaml +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/data/tissue_categories.yaml +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/data/uniprot_references.yaml +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/dataset.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/detectability.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/downloads.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/evidence_audit.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/evidence_bindings.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/evidence_bundle.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/evidence_catalog.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/evidence_recipe.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/evidence_store.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/export.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/expression_inputs.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/genes.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/indexer.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/line_expression.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/lineage.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/managed_assets.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/mappings.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/observations.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/pandas_utils.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/parquet_io.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/peptide_modifications.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/pmhc_query.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/predict.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/proteome.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/provenance.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/pxd013455.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/pxd013455_download.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/pxd013455_publication.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/pxd057588_evidence.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/qc.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/report.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/sample_identity.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/samples.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/scanner.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/species_contexts.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/species_evidence.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/species_expression.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/split_audit.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/supplement.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/tcell_assays.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/tcell_functional.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/tcell_multimer.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/tcell_peptides.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/tcell_training.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/tissue_blacklist.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/training_bundle.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist/uniprot.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist.egg-info/dependency_links.txt +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist.egg-info/entry_points.txt +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist.egg-info/requires.txt +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/hitlist.egg-info/top_level.txt +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/pyproject.toml +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/setup.cfg +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/setup.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/data/canine_orfdata/README.md +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/data/canine_orfdata/manifest.json +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/data/canine_orfdata/protein.tsv +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/data/canine_orfdata/search.fasta +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_aggregate.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_allele_candidate_audit.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_allele_candidates.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_allele_identity.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_apm.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_apm_host_expression.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_apply_winners_vectorized.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_arm_resolution.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_assays.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_atlas_crosswalk.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_atlas_lineage.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_attribution_query_context.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_build_smoke.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_build_uniprot_reference.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_builder.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_bulk_fractionation.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_bulk_proteomics.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_bulk_proteomics_unit.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_bulk_replicates.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_cache_current.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_cache_inventory.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_canine_bulk.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_canine_ligands.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_canine_orfdata.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_categorical_consumers.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_cell_name_parser.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_check_dev_install.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_ci_corpus.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_cli_build_group.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_cli_data_dirs.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_cli_export_cleanup.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_cli_help.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_cli_mhc_allele_split.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_cli_pmhc_samples.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_cli_version.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_compare_corpus_generations.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_condition_categories.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_conditions.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_corpus_qualification.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_corpus_v3_arm_contexts.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_cta_evidence_bundle.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_cta_expression.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_curated_erap2_lines.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_curated_study_sources.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_curation.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_curation_sanity_pass.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_curation_source_followup.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_curation_yaml.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_data_assets.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_data_dir_resolution.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_dataset_generations.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_deploy_script.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_depmap_expression_fetch.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_deposited_elution_conditions.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_detectability.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_download_http.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_download_to_file.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_downloads_timeout.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_evidence_catalog.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_evidence_store.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_exclude_from_ms.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_export.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_export_filter_parity.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_export_join_lifetime.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_export_species_filters.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_expression_source_provenance.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_external_evidence.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_genes.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_genotype_attribution.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_human_cohort_qualification.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_line_expression.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_lineage_audit.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_local_supplement.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_long_peptide_mapping.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_mapping_worker_cache.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_mappings.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_mhc_typing_contract.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_mhcgnomes_floor_check.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_multi_proteome_flanking.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_mutant_sample_genotypes.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_netmhcpan_invocation.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_observations.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_peptide_attribution_scope.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_peptide_modifications.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_pmhc_query.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_predict.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_proteome.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_proteome_cache_resolution.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_provenance.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_public_api.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_pxd013455.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_qc.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_reassign_genotypes.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_report.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_sample_attribution_audit.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_sample_group.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_sample_identity.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_sample_inventory.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_sample_override_and_note.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_samples.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_scanner.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_source_verification.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_species_contexts.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_species_evidence.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_study_identity_corrections.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_supplement.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_supplementary_build_e2e.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_supporting_evidence.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_tcell_assays.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_tcell_availability.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_tcell_evidence.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_test_script.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_tissue_blacklist.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_training_binding_filters.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_training_bundle.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_training_identity.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_training_preflight.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_training_qc_metadata.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_uniprot.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_unit_isolation.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_versioned_datasets.py +0 -0
- {hitlist-2.0.0 → hitlist-2.0.2}/tests/test_xdist_cache.py +0 -0
|
@@ -27,10 +27,10 @@ from .conditions import (
|
|
|
27
27
|
)
|
|
28
28
|
from .curation import MS_SAMPLE_FIELDS, PMID_ENTRY_FIELDS
|
|
29
29
|
from .curation_yaml import load_curation_yaml
|
|
30
|
+
from .evidence_snapshot import snapshot_file
|
|
30
31
|
from .lineage import lineage_path, validate_lineage
|
|
31
32
|
from .mhc_evidence import (
|
|
32
33
|
NATIVE_FIELDS,
|
|
33
|
-
_link_or_copy,
|
|
34
34
|
verify_mhc_evidence_package,
|
|
35
35
|
)
|
|
36
36
|
from .provenance import file_digest
|
|
@@ -1099,18 +1099,18 @@ def write_context_evidence_package(
|
|
|
1099
1099
|
for relative in parent_manifest["files"]:
|
|
1100
1100
|
target = staging / relative
|
|
1101
1101
|
target.parent.mkdir(parents=True, exist_ok=True)
|
|
1102
|
-
|
|
1102
|
+
snapshot_file(mhc_package / relative, target)
|
|
1103
1103
|
(staging / "manifests").mkdir()
|
|
1104
|
-
|
|
1104
|
+
snapshot_file(mhc_package / "manifest.json", staging / "manifests" / "mhc.json")
|
|
1105
1105
|
native = staging / "cohort_native"
|
|
1106
1106
|
native.mkdir()
|
|
1107
1107
|
for filename in (*COHORT_ARTIFACTS.values(), "manifest.json"):
|
|
1108
|
-
|
|
1108
|
+
snapshot_file(cohort_dir / filename, native / filename)
|
|
1109
1109
|
curation = staging / "curation"
|
|
1110
1110
|
curation.mkdir()
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1111
|
+
snapshot_file(historical_curation_path, curation / "pmid_overrides_1_78.yaml")
|
|
1112
|
+
snapshot_file(current_curation_path, curation / "pmid_overrides_current.yaml")
|
|
1113
|
+
snapshot_file(lineage_file, curation / "specimen_lineage.yaml")
|
|
1114
1114
|
typed = staging / "typed"
|
|
1115
1115
|
small = _write_small_tables(
|
|
1116
1116
|
typed,
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"""Independent byte snapshots for immutable evidence-package generations."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import shutil
|
|
6
|
+
import subprocess
|
|
7
|
+
import sys
|
|
8
|
+
from pathlib import Path
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def snapshot_file(source, target):
|
|
12
|
+
"""Copy verified source bytes to a new inode, preferring a filesystem clone.
|
|
13
|
+
|
|
14
|
+
Clone operations are copy-on-write where the filesystem supports them.
|
|
15
|
+
A full copy is the portable fallback. Neither path may hard-link a mutable
|
|
16
|
+
ingestion file or a predecessor package into a published generation.
|
|
17
|
+
"""
|
|
18
|
+
source = Path(source).resolve(strict=True)
|
|
19
|
+
target = Path(target)
|
|
20
|
+
if not source.is_file():
|
|
21
|
+
raise ValueError(f"Evidence snapshot source is not a file: {source}")
|
|
22
|
+
if target.exists() or target.is_symlink():
|
|
23
|
+
raise FileExistsError(f"Evidence snapshot target already exists: {target}")
|
|
24
|
+
target.parent.mkdir(parents=True, exist_ok=True)
|
|
25
|
+
|
|
26
|
+
command = None
|
|
27
|
+
if sys.platform == "darwin":
|
|
28
|
+
command = ["cp", "-c", "-p", str(source), str(target)]
|
|
29
|
+
elif sys.platform.startswith("linux"):
|
|
30
|
+
command = [
|
|
31
|
+
"cp",
|
|
32
|
+
"--reflink=auto",
|
|
33
|
+
"--preserve=mode,timestamps",
|
|
34
|
+
"--",
|
|
35
|
+
str(source),
|
|
36
|
+
str(target),
|
|
37
|
+
]
|
|
38
|
+
try:
|
|
39
|
+
if command is not None:
|
|
40
|
+
try:
|
|
41
|
+
subprocess.run(
|
|
42
|
+
command, check=True, stdout=subprocess.DEVNULL, stderr=subprocess.PIPE
|
|
43
|
+
)
|
|
44
|
+
except (OSError, subprocess.CalledProcessError):
|
|
45
|
+
target.unlink(missing_ok=True)
|
|
46
|
+
shutil.copy2(source, target)
|
|
47
|
+
else:
|
|
48
|
+
shutil.copy2(source, target)
|
|
49
|
+
source_stat, target_stat = source.stat(), target.stat()
|
|
50
|
+
if source_stat.st_dev == target_stat.st_dev and source_stat.st_ino == target_stat.st_ino:
|
|
51
|
+
raise ValueError(f"Evidence snapshot shares a source inode: {source}")
|
|
52
|
+
except Exception:
|
|
53
|
+
target.unlink(missing_ok=True)
|
|
54
|
+
raise
|
|
@@ -11,7 +11,7 @@ import shutil
|
|
|
11
11
|
import tempfile
|
|
12
12
|
from pathlib import Path
|
|
13
13
|
|
|
14
|
-
from .
|
|
14
|
+
from .evidence_snapshot import snapshot_file
|
|
15
15
|
from .provenance import file_digest
|
|
16
16
|
from .supporting_evidence import verify_supporting_evidence_package
|
|
17
17
|
|
|
@@ -58,13 +58,13 @@ def _copy_source(adapter, source_root, destination):
|
|
|
58
58
|
contract_dir = destination / "contracts"
|
|
59
59
|
asset_dir.mkdir(parents=True)
|
|
60
60
|
contract_dir.mkdir()
|
|
61
|
-
|
|
61
|
+
snapshot_file(adapter.asset_receipt_path, contract_dir / "source_assets.json")
|
|
62
62
|
for name, path in adapter.support_files.items():
|
|
63
|
-
|
|
63
|
+
snapshot_file(path, contract_dir / _safe_relative(name))
|
|
64
64
|
for relative, path in paths.items():
|
|
65
65
|
target = asset_dir / relative
|
|
66
66
|
target.parent.mkdir(parents=True, exist_ok=True)
|
|
67
|
-
|
|
67
|
+
snapshot_file(path, target)
|
|
68
68
|
return receipt
|
|
69
69
|
|
|
70
70
|
|
|
@@ -161,9 +161,9 @@ def write_external_evidence_package(
|
|
|
161
161
|
for relative in parent["files"]:
|
|
162
162
|
target = staging / _safe_relative(relative)
|
|
163
163
|
target.parent.mkdir(parents=True, exist_ok=True)
|
|
164
|
-
|
|
164
|
+
snapshot_file(supporting_package / relative, target)
|
|
165
165
|
(staging / "manifests").mkdir(exist_ok=True)
|
|
166
|
-
|
|
166
|
+
snapshot_file(
|
|
167
167
|
supporting_package / "manifest.json", staging / "manifests" / "supporting.json"
|
|
168
168
|
)
|
|
169
169
|
sources = {}
|
|
@@ -7,9 +7,7 @@ becomes the only surviving representation of an assay or source claim.
|
|
|
7
7
|
|
|
8
8
|
from __future__ import annotations
|
|
9
9
|
|
|
10
|
-
import errno
|
|
11
10
|
import json
|
|
12
|
-
import os
|
|
13
11
|
import shutil
|
|
14
12
|
import sqlite3
|
|
15
13
|
import tempfile
|
|
@@ -20,6 +18,7 @@ import pyarrow as pa
|
|
|
20
18
|
import pyarrow.compute as pc
|
|
21
19
|
import pyarrow.parquet as pq
|
|
22
20
|
|
|
21
|
+
from .evidence_snapshot import snapshot_file
|
|
23
22
|
from .provenance import CONTRIBUTOR_COLUMNS, file_digest
|
|
24
23
|
|
|
25
24
|
PACKAGE_SCHEMA_VERSION = 1
|
|
@@ -455,15 +454,6 @@ def _source_manifest(source_dir):
|
|
|
455
454
|
return manifest, file_digest(path)
|
|
456
455
|
|
|
457
456
|
|
|
458
|
-
def _link_or_copy(source, target):
|
|
459
|
-
try:
|
|
460
|
-
os.link(source, target)
|
|
461
|
-
except OSError as error:
|
|
462
|
-
if error.errno not in (errno.EXDEV, errno.ENOTSUP, errno.EOPNOTSUPP):
|
|
463
|
-
raise
|
|
464
|
-
shutil.copy2(source, target)
|
|
465
|
-
|
|
466
|
-
|
|
467
457
|
def _write_typed(source_dir, typed_dir, audit_path, known_sources):
|
|
468
458
|
typed_dir.mkdir()
|
|
469
459
|
counts = Counter()
|
|
@@ -659,7 +649,7 @@ def write_mhc_evidence_package(source_dir, destination):
|
|
|
659
649
|
native = staging / "native"
|
|
660
650
|
native.mkdir()
|
|
661
651
|
for name in (*source_manifest["files"], "observations_meta.json"):
|
|
662
|
-
|
|
652
|
+
snapshot_file(source_dir / name, native / name)
|
|
663
653
|
reconciliation = _write_typed(
|
|
664
654
|
native,
|
|
665
655
|
staging / "typed",
|
|
@@ -11,8 +11,6 @@ import csv
|
|
|
11
11
|
import gzip
|
|
12
12
|
import json
|
|
13
13
|
import shutil
|
|
14
|
-
import subprocess
|
|
15
|
-
import sys
|
|
16
14
|
import tempfile
|
|
17
15
|
from collections import Counter
|
|
18
16
|
from pathlib import Path
|
|
@@ -20,6 +18,7 @@ from pathlib import Path
|
|
|
20
18
|
import pyarrow as pa
|
|
21
19
|
import pyarrow.parquet as pq
|
|
22
20
|
|
|
21
|
+
from .evidence_snapshot import snapshot_file
|
|
23
22
|
from .provenance import file_digest
|
|
24
23
|
from .supporting_numeric_evidence import verify_supporting_numeric_evidence_package
|
|
25
24
|
|
|
@@ -144,19 +143,6 @@ SCHEMAS = {
|
|
|
144
143
|
}
|
|
145
144
|
|
|
146
145
|
|
|
147
|
-
def _copy(source, target):
|
|
148
|
-
target.parent.mkdir(parents=True, exist_ok=True)
|
|
149
|
-
if sys.platform == "darwin":
|
|
150
|
-
# APFS copy-on-write gives an independent inode and preserves the old
|
|
151
|
-
# byte stream when either generation is later edited.
|
|
152
|
-
subprocess.run(["cp", "-c", str(source), str(target)], check=True)
|
|
153
|
-
else:
|
|
154
|
-
shutil.copy2(source, target)
|
|
155
|
-
a, b = source.stat(), target.stat()
|
|
156
|
-
if a.st_dev == b.st_dev and a.st_ino == b.st_ino:
|
|
157
|
-
raise ValueError(f"Reference package shares an input inode: {source}")
|
|
158
|
-
|
|
159
|
-
|
|
160
146
|
def _jsonl(path):
|
|
161
147
|
with gzip.open(path, "rt") as stream:
|
|
162
148
|
for line in stream:
|
|
@@ -607,18 +593,18 @@ def write_reference_evidence_package(numeric_package, results_dir, reference_fas
|
|
|
607
593
|
staging = Path(tempfile.mkdtemp(prefix=f".{destination.name}-", dir=destination.parent))
|
|
608
594
|
try:
|
|
609
595
|
for relative in parent["files"]:
|
|
610
|
-
|
|
611
|
-
|
|
596
|
+
snapshot_file(numeric_package / _safe_relative(relative), staging / relative)
|
|
597
|
+
snapshot_file(numeric_package / "manifest.json", staging / "manifests/numeric.json")
|
|
612
598
|
if file_digest(results_dir / "output_hashes.json")["sha256"] != OUTPUT_RECEIPT_SHA256:
|
|
613
599
|
raise ValueError("Unrecognized shared-reference output receipt")
|
|
614
600
|
hashes = json.loads((results_dir / "output_hashes.json").read_text())
|
|
615
601
|
for name in (*hashes, "output_hashes.json"):
|
|
616
|
-
|
|
617
|
-
|
|
602
|
+
snapshot_file(results_dir / name, staging / ROOT / name)
|
|
603
|
+
snapshot_file(
|
|
618
604
|
results_dir / "independent-verification.json",
|
|
619
605
|
staging / ROOT / "independent-verification.json",
|
|
620
606
|
)
|
|
621
|
-
|
|
607
|
+
snapshot_file(reference_fasta, staging / ROOT / "reference.fasta")
|
|
622
608
|
_source_receipt(staging)
|
|
623
609
|
reconciliation = _build_typed(staging)
|
|
624
610
|
files = {
|
|
@@ -19,7 +19,7 @@ import pyarrow.parquet as pq
|
|
|
19
19
|
|
|
20
20
|
from .context_evidence import verify_context_evidence_package
|
|
21
21
|
from .curation_yaml import load_curation_yaml
|
|
22
|
-
from .
|
|
22
|
+
from .evidence_snapshot import snapshot_file
|
|
23
23
|
from .provenance import file_digest
|
|
24
24
|
|
|
25
25
|
PACKAGE_SCHEMA_VERSION = 3
|
|
@@ -1040,16 +1040,16 @@ def write_supporting_evidence_package(
|
|
|
1040
1040
|
for relative in parent["files"]:
|
|
1041
1041
|
target = staging / relative
|
|
1042
1042
|
target.parent.mkdir(parents=True, exist_ok=True)
|
|
1043
|
-
|
|
1043
|
+
snapshot_file(context_package / relative, target)
|
|
1044
1044
|
(staging / "manifests").mkdir(exist_ok=True)
|
|
1045
|
-
|
|
1045
|
+
snapshot_file(context_package / "manifest.json", staging / "manifests" / "context.json")
|
|
1046
1046
|
asset_dir = staging / "assets"
|
|
1047
1047
|
asset_dir.mkdir()
|
|
1048
|
-
|
|
1048
|
+
snapshot_file(source_asset_receipt, asset_dir / "receipt.json")
|
|
1049
1049
|
for relative in receipt["assets"]:
|
|
1050
1050
|
target = asset_dir / relative
|
|
1051
1051
|
target.parent.mkdir(parents=True, exist_ok=True)
|
|
1052
|
-
|
|
1052
|
+
snapshot_file(source_paths[relative], target)
|
|
1053
1053
|
typed = staging / "typed"
|
|
1054
1054
|
native = staging / "native"
|
|
1055
1055
|
expression, expression_counts, expression_profiles = _write_expression(native, typed)
|
|
@@ -19,6 +19,7 @@ from pathlib import Path
|
|
|
19
19
|
import pyarrow as pa
|
|
20
20
|
import pyarrow.parquet as pq
|
|
21
21
|
|
|
22
|
+
from .evidence_snapshot import snapshot_file
|
|
22
23
|
from .provenance import file_digest
|
|
23
24
|
from .tcell_evidence import verify_tcell_evidence_package
|
|
24
25
|
|
|
@@ -252,15 +253,6 @@ def _safe_relative(value):
|
|
|
252
253
|
return path
|
|
253
254
|
|
|
254
255
|
|
|
255
|
-
def _snapshot_file(source, target):
|
|
256
|
-
"""Copy a package byte stream without sharing the source inode."""
|
|
257
|
-
target.parent.mkdir(parents=True, exist_ok=True)
|
|
258
|
-
shutil.copy2(source, target)
|
|
259
|
-
source_stat, target_stat = source.stat(), target.stat()
|
|
260
|
-
if source_stat.st_dev == target_stat.st_dev and source_stat.st_ino == target_stat.st_ino:
|
|
261
|
-
raise ValueError(f"Supporting numeric snapshot shares source inode: {source}")
|
|
262
|
-
|
|
263
|
-
|
|
264
256
|
def verify_supporting_numeric_evidence_package(directory, *, manifest_path="manifest.json"):
|
|
265
257
|
"""Verify an appended numeric generation and its complete T-cell parent."""
|
|
266
258
|
directory = Path(directory)
|
|
@@ -318,8 +310,8 @@ def write_supporting_numeric_evidence_package(tcell_package, destination):
|
|
|
318
310
|
for relative in parent["files"]:
|
|
319
311
|
source = tcell_package / _safe_relative(relative)
|
|
320
312
|
target = staging / relative
|
|
321
|
-
|
|
322
|
-
|
|
313
|
+
snapshot_file(source, target)
|
|
314
|
+
snapshot_file(tcell_package / "manifest.json", staging / "manifests" / "tcell.json")
|
|
323
315
|
typed = staging / "typed"
|
|
324
316
|
reconciliation = {
|
|
325
317
|
"bulk": _write_one(
|
|
@@ -25,8 +25,8 @@ import pyarrow as pa
|
|
|
25
25
|
import pyarrow.parquet as pq
|
|
26
26
|
|
|
27
27
|
from .curation_yaml import load_curation_yaml
|
|
28
|
+
from .evidence_snapshot import snapshot_file
|
|
28
29
|
from .external_evidence import verify_external_evidence_package
|
|
29
|
-
from .mhc_evidence import _link_or_copy
|
|
30
30
|
from .provenance import file_digest
|
|
31
31
|
from .tcell_assays import (
|
|
32
32
|
CATALOG_PATH,
|
|
@@ -697,17 +697,17 @@ def write_tcell_evidence_package(external_package, destination, *, iedb_path, ce
|
|
|
697
697
|
for relative in parent["files"]:
|
|
698
698
|
target = staging / relative
|
|
699
699
|
target.parent.mkdir(parents=True, exist_ok=True)
|
|
700
|
-
|
|
700
|
+
snapshot_file(external_package / relative, target)
|
|
701
701
|
(staging / "manifests").mkdir(exist_ok=True)
|
|
702
|
-
|
|
702
|
+
snapshot_file(external_package / "manifest.json", staging / "manifests/external.json")
|
|
703
703
|
tcell = staging / "tcell"
|
|
704
704
|
assets = tcell / "assets"
|
|
705
705
|
typed = tcell / "typed"
|
|
706
706
|
assets.mkdir(parents=True)
|
|
707
707
|
typed.mkdir()
|
|
708
|
-
|
|
708
|
+
snapshot_file(CATALOG_PATH, tcell / "source_receipt.yaml")
|
|
709
709
|
for name, path in sources.items():
|
|
710
|
-
|
|
710
|
+
snapshot_file(path, assets / name)
|
|
711
711
|
reconciliation = _write_tcell_rows(assets, typed)
|
|
712
712
|
_validate_reconciliation(reconciliation)
|
|
713
713
|
_check_sources({name: assets / name for name in SOURCE_NAMES}, catalog)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "2.0.2"
|
|
@@ -36,6 +36,7 @@ hitlist/evidence_bindings.py
|
|
|
36
36
|
hitlist/evidence_bundle.py
|
|
37
37
|
hitlist/evidence_catalog.py
|
|
38
38
|
hitlist/evidence_recipe.py
|
|
39
|
+
hitlist/evidence_snapshot.py
|
|
39
40
|
hitlist/evidence_store.py
|
|
40
41
|
hitlist/export.py
|
|
41
42
|
hitlist/expression_inputs.py
|
|
@@ -205,6 +206,7 @@ tests/test_download_http.py
|
|
|
205
206
|
tests/test_download_to_file.py
|
|
206
207
|
tests/test_downloads_timeout.py
|
|
207
208
|
tests/test_evidence_catalog.py
|
|
209
|
+
tests/test_evidence_snapshot.py
|
|
208
210
|
tests/test_evidence_store.py
|
|
209
211
|
tests/test_exclude_from_ms.py
|
|
210
212
|
tests/test_export.py
|
|
@@ -219,6 +219,36 @@ def test_context_package_keeps_native_sources_and_separate_claim_roles(tmp_path)
|
|
|
219
219
|
assert not any(x["role"] == "peptide_mhc_restriction" for x in mhc_claims)
|
|
220
220
|
|
|
221
221
|
|
|
222
|
+
def test_context_package_survives_mutated_predecessor_and_cohort_inputs(tmp_path):
|
|
223
|
+
mhc, cohort, old, current, lineage = _cohort_fixture(tmp_path)
|
|
224
|
+
target = tmp_path / "context"
|
|
225
|
+
write_context_evidence_package(
|
|
226
|
+
mhc,
|
|
227
|
+
cohort,
|
|
228
|
+
target,
|
|
229
|
+
historical_curation_path=old,
|
|
230
|
+
current_curation_path=current,
|
|
231
|
+
lineage_file=lineage,
|
|
232
|
+
)
|
|
233
|
+
original_mhc = (target / "native" / "binding.parquet").read_bytes()
|
|
234
|
+
original_cohort = (target / "cohort_native" / "training.parquet").read_bytes()
|
|
235
|
+
|
|
236
|
+
with (mhc / "native" / "binding.parquet").open("ab") as stream:
|
|
237
|
+
stream.write(b"later predecessor edit")
|
|
238
|
+
with (cohort / "training.parquet").open("ab") as stream:
|
|
239
|
+
stream.write(b"later cohort edit")
|
|
240
|
+
|
|
241
|
+
assert (target / "native" / "binding.parquet").read_bytes() == original_mhc
|
|
242
|
+
assert (target / "cohort_native" / "training.parquet").read_bytes() == original_cohort
|
|
243
|
+
assert (target / "native" / "binding.parquet").stat().st_ino != (
|
|
244
|
+
mhc / "native" / "binding.parquet"
|
|
245
|
+
).stat().st_ino
|
|
246
|
+
assert (target / "cohort_native" / "training.parquet").stat().st_ino != (
|
|
247
|
+
cohort / "training.parquet"
|
|
248
|
+
).stat().st_ino
|
|
249
|
+
verify_context_evidence_package(target)
|
|
250
|
+
|
|
251
|
+
|
|
222
252
|
@pytest.mark.parametrize(
|
|
223
253
|
"variation, message",
|
|
224
254
|
[
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"""Evidence generations must own their file bytes after publication."""
|
|
2
|
+
|
|
3
|
+
import subprocess
|
|
4
|
+
from types import SimpleNamespace
|
|
5
|
+
|
|
6
|
+
import pytest
|
|
7
|
+
|
|
8
|
+
from hitlist import evidence_snapshot
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def test_snapshot_file_cleans_partial_clone_and_falls_back_to_copy(tmp_path, monkeypatch):
|
|
12
|
+
source = tmp_path / "source.txt"
|
|
13
|
+
source.write_bytes(b"original evidence")
|
|
14
|
+
target = tmp_path / "nested" / "target.txt"
|
|
15
|
+
monkeypatch.setattr(evidence_snapshot, "sys", SimpleNamespace(platform="darwin"))
|
|
16
|
+
|
|
17
|
+
def failed_clone(command, **_kwargs):
|
|
18
|
+
target.write_bytes(b"partial clone")
|
|
19
|
+
raise subprocess.CalledProcessError(1, command)
|
|
20
|
+
|
|
21
|
+
monkeypatch.setattr(evidence_snapshot.subprocess, "run", failed_clone)
|
|
22
|
+
evidence_snapshot.snapshot_file(source, target)
|
|
23
|
+
|
|
24
|
+
assert target.read_bytes() == b"original evidence"
|
|
25
|
+
assert target.stat().st_ino != source.stat().st_ino
|
|
26
|
+
source.write_bytes(b"later source edit")
|
|
27
|
+
assert target.read_bytes() == b"original evidence"
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def test_snapshot_file_refuses_existing_target_without_changing_it(tmp_path):
|
|
31
|
+
source = tmp_path / "source.txt"
|
|
32
|
+
target = tmp_path / "target.txt"
|
|
33
|
+
source.write_bytes(b"source")
|
|
34
|
+
target.write_bytes(b"existing")
|
|
35
|
+
|
|
36
|
+
with pytest.raises(FileExistsError, match="already exists"):
|
|
37
|
+
evidence_snapshot.snapshot_file(source, target)
|
|
38
|
+
|
|
39
|
+
assert target.read_bytes() == b"existing"
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def test_snapshot_file_resolves_source_symlink_to_independent_bytes(tmp_path):
|
|
43
|
+
source = tmp_path / "source.txt"
|
|
44
|
+
source.write_bytes(b"source bytes")
|
|
45
|
+
link = tmp_path / "source-link.txt"
|
|
46
|
+
link.symlink_to(source)
|
|
47
|
+
target = tmp_path / "target.txt"
|
|
48
|
+
|
|
49
|
+
evidence_snapshot.snapshot_file(link, target)
|
|
50
|
+
source.write_bytes(b"later edit")
|
|
51
|
+
|
|
52
|
+
assert target.read_bytes() == b"source bytes"
|
|
53
|
+
assert target.stat().st_ino != source.stat().st_ino
|
|
@@ -236,6 +236,22 @@ def test_mhc_package_verifier_detects_artifact_change(tmp_path):
|
|
|
236
236
|
verify_mhc_evidence_package(target)
|
|
237
237
|
|
|
238
238
|
|
|
239
|
+
def test_mhc_package_survives_mutated_ingestion_file(tmp_path):
|
|
240
|
+
source = _source(tmp_path)
|
|
241
|
+
target = tmp_path / "package"
|
|
242
|
+
write_mhc_evidence_package(source, target)
|
|
243
|
+
original = (target / "native" / "observations.parquet").read_bytes()
|
|
244
|
+
|
|
245
|
+
with (source / "observations.parquet").open("ab") as stream:
|
|
246
|
+
stream.write(b"later source edit")
|
|
247
|
+
|
|
248
|
+
assert (target / "native" / "observations.parquet").read_bytes() == original
|
|
249
|
+
assert (source / "observations.parquet").stat().st_ino != (
|
|
250
|
+
target / "native" / "observations.parquet"
|
|
251
|
+
).stat().st_ino
|
|
252
|
+
verify_mhc_evidence_package(target)
|
|
253
|
+
|
|
254
|
+
|
|
239
255
|
def test_mhc_package_manifest_remains_verifiable_inside_later_generation(tmp_path):
|
|
240
256
|
source = _source(tmp_path)
|
|
241
257
|
target = tmp_path / "package"
|
|
@@ -2,11 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
import importlib.util
|
|
4
4
|
import json
|
|
5
|
+
import shutil
|
|
5
6
|
import subprocess
|
|
6
|
-
from io import BytesIO
|
|
7
7
|
from pathlib import Path
|
|
8
8
|
from types import SimpleNamespace
|
|
9
|
-
from zipfile import ZipFile
|
|
10
9
|
|
|
11
10
|
import pytest
|
|
12
11
|
|
|
@@ -78,10 +77,7 @@ def release_bundle(tmp_path, monkeypatch):
|
|
|
78
77
|
monkeypatch.setenv("GITHUB_RUN_ID", "123")
|
|
79
78
|
write_manifest(dist, corpus, root)
|
|
80
79
|
manifest = json.loads((dist / "release.json").read_text())
|
|
81
|
-
|
|
82
|
-
with ZipFile(archive, "w") as bundle:
|
|
83
|
-
bundle.writestr("release.json", json.dumps(manifest))
|
|
84
|
-
archive_bytes = archive.getvalue()
|
|
80
|
+
trusted_files = {path.name: path.read_bytes() for path in dist.iterdir()}
|
|
85
81
|
run = {
|
|
86
82
|
"workflow_id": 456,
|
|
87
83
|
"event": "workflow_dispatch",
|
|
@@ -116,9 +112,15 @@ def release_bundle(tmp_path, monkeypatch):
|
|
|
116
112
|
original_run = subprocess.run
|
|
117
113
|
|
|
118
114
|
def run_command(command, **kwargs):
|
|
119
|
-
if command[:
|
|
120
|
-
assert command[
|
|
121
|
-
|
|
115
|
+
if command[:3] == ["gh", "run", "download"]:
|
|
116
|
+
assert command[3] == "123"
|
|
117
|
+
assert command[command.index("--name") + 1] == (
|
|
118
|
+
f"hitlist-release-{manifest['source_commit']}"
|
|
119
|
+
)
|
|
120
|
+
assert command[command.index("--repo") + 1] == "pirl-unc/hitlist"
|
|
121
|
+
destination = Path(command[command.index("--dir") + 1])
|
|
122
|
+
for name, data in trusted_files.items():
|
|
123
|
+
(destination / name).write_bytes(data)
|
|
122
124
|
return subprocess.CompletedProcess(command, 0)
|
|
123
125
|
return original_run(command, **kwargs)
|
|
124
126
|
|
|
@@ -131,6 +133,132 @@ def test_verified_main_release_matches_both_artifacts(release_bundle):
|
|
|
131
133
|
verify_manifest(dist, root)
|
|
132
134
|
|
|
133
135
|
|
|
136
|
+
def test_trusted_artifact_download_is_bounded_and_run_scoped(release_bundle, monkeypatch):
|
|
137
|
+
root, dist, _, _ = release_bundle
|
|
138
|
+
commit = json.loads((dist / "release.json").read_text())["source_commit"]
|
|
139
|
+
original_run = subprocess.run
|
|
140
|
+
|
|
141
|
+
def download(command, **kwargs):
|
|
142
|
+
if command[:2] == ["gh", "api"] and command[-1].endswith("/zip"):
|
|
143
|
+
pytest.fail("Direct artifact ZIP request has no bounded download contract")
|
|
144
|
+
if command[:3] == ["gh", "run", "download"]:
|
|
145
|
+
assert command[3] == "123"
|
|
146
|
+
assert command[command.index("--name") + 1] == f"hitlist-release-{commit}"
|
|
147
|
+
assert command[command.index("--repo") + 1] == "pirl-unc/hitlist"
|
|
148
|
+
assert kwargs["timeout"] == 120
|
|
149
|
+
target = Path(command[command.index("--dir") + 1])
|
|
150
|
+
for file in dist.iterdir():
|
|
151
|
+
shutil.copy2(file, target / file.name)
|
|
152
|
+
return subprocess.CompletedProcess(command, 0)
|
|
153
|
+
return original_run(command, **kwargs)
|
|
154
|
+
|
|
155
|
+
monkeypatch.setattr(subprocess, "run", download)
|
|
156
|
+
verify_manifest(dist, root)
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
def test_release_metadata_timeout_fails_closed(release_bundle, monkeypatch):
|
|
160
|
+
root, dist, _, _ = release_bundle
|
|
161
|
+
original_output = subprocess.check_output
|
|
162
|
+
|
|
163
|
+
def timed_out(command, **kwargs):
|
|
164
|
+
if command[:2] == ["gh", "api"]:
|
|
165
|
+
assert kwargs["timeout"] == 30
|
|
166
|
+
raise subprocess.TimeoutExpired(command, kwargs["timeout"])
|
|
167
|
+
return original_output(command, **kwargs)
|
|
168
|
+
|
|
169
|
+
monkeypatch.setattr(subprocess, "check_output", timed_out)
|
|
170
|
+
with pytest.raises(ValueError, match="Timed out querying GitHub release provenance"):
|
|
171
|
+
verify_manifest(dist, root)
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
def test_partial_download_timeout_fails_closed_and_cleans_up(release_bundle, monkeypatch):
|
|
175
|
+
root, dist, _, _ = release_bundle
|
|
176
|
+
original_run = subprocess.run
|
|
177
|
+
downloaded_to = []
|
|
178
|
+
|
|
179
|
+
def timed_out(command, **kwargs):
|
|
180
|
+
if command[:3] == ["gh", "run", "download"]:
|
|
181
|
+
destination = Path(command[command.index("--dir") + 1])
|
|
182
|
+
(destination / "release.json").write_text("partial")
|
|
183
|
+
downloaded_to.append(destination)
|
|
184
|
+
raise subprocess.TimeoutExpired(command, kwargs["timeout"])
|
|
185
|
+
return original_run(command, **kwargs)
|
|
186
|
+
|
|
187
|
+
monkeypatch.setattr(subprocess, "run", timed_out)
|
|
188
|
+
with pytest.raises(ValueError, match="Timed out downloading"):
|
|
189
|
+
verify_manifest(dist, root)
|
|
190
|
+
assert downloaded_to and not downloaded_to[0].exists()
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
def test_failed_artifact_download_fails_closed(release_bundle, monkeypatch):
|
|
194
|
+
root, dist, _, _ = release_bundle
|
|
195
|
+
original_run = subprocess.run
|
|
196
|
+
|
|
197
|
+
def failed(command, **kwargs):
|
|
198
|
+
if command[:3] == ["gh", "run", "download"]:
|
|
199
|
+
raise subprocess.CalledProcessError(1, command)
|
|
200
|
+
return original_run(command, **kwargs)
|
|
201
|
+
|
|
202
|
+
monkeypatch.setattr(subprocess, "run", failed)
|
|
203
|
+
with pytest.raises(ValueError, match="artifact download failed"):
|
|
204
|
+
verify_manifest(dist, root)
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
@pytest.mark.parametrize(
|
|
208
|
+
"change", ["missing_receipt", "corrupt_receipt", "modified_wheel", "symlinked_receipt"]
|
|
209
|
+
)
|
|
210
|
+
def test_incomplete_or_corrupt_artifact_fails_closed(release_bundle, monkeypatch, change):
|
|
211
|
+
root, dist, _, _ = release_bundle
|
|
212
|
+
original_run = subprocess.run
|
|
213
|
+
|
|
214
|
+
def changed_download(command, **kwargs):
|
|
215
|
+
result = original_run(command, **kwargs)
|
|
216
|
+
if command[:3] == ["gh", "run", "download"]:
|
|
217
|
+
destination = Path(command[command.index("--dir") + 1])
|
|
218
|
+
if change == "missing_receipt":
|
|
219
|
+
(destination / "release.json").unlink()
|
|
220
|
+
elif change == "corrupt_receipt":
|
|
221
|
+
(destination / "release.json").write_text("{invalid JSON")
|
|
222
|
+
elif change == "symlinked_receipt":
|
|
223
|
+
(destination / "release.json").unlink()
|
|
224
|
+
(destination / "release.json").symlink_to(dist / "release.json")
|
|
225
|
+
else:
|
|
226
|
+
(destination / "hitlist-1.2.3-py3-none-any.whl").write_bytes(b"changed bytes")
|
|
227
|
+
return result
|
|
228
|
+
|
|
229
|
+
monkeypatch.setattr(subprocess, "run", changed_download)
|
|
230
|
+
message = {
|
|
231
|
+
"missing_receipt": "missing or unexpected files",
|
|
232
|
+
"corrupt_receipt": "unreadable release manifest",
|
|
233
|
+
"modified_wheel": "distributions disagree with its manifest",
|
|
234
|
+
"symlinked_receipt": "missing or unexpected files",
|
|
235
|
+
}[change]
|
|
236
|
+
with pytest.raises(ValueError, match=message):
|
|
237
|
+
verify_manifest(dist, root)
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
def test_artifact_replacement_during_download_fails_closed(release_bundle, monkeypatch):
|
|
241
|
+
root, dist, _, _ = release_bundle
|
|
242
|
+
original_output = subprocess.check_output
|
|
243
|
+
inventory_calls = 0
|
|
244
|
+
|
|
245
|
+
def replaced(command, **kwargs):
|
|
246
|
+
nonlocal inventory_calls
|
|
247
|
+
response = original_output(command, **kwargs)
|
|
248
|
+
if command[:2] == ["gh", "api"] and command[-1].endswith("/runs/123/artifacts"):
|
|
249
|
+
inventory_calls += 1
|
|
250
|
+
if inventory_calls == 2:
|
|
251
|
+
inventory = json.loads(response)
|
|
252
|
+
inventory["artifacts"][0]["id"] = 790
|
|
253
|
+
return json.dumps(inventory)
|
|
254
|
+
return response
|
|
255
|
+
|
|
256
|
+
monkeypatch.setattr(subprocess, "check_output", replaced)
|
|
257
|
+
with pytest.raises(ValueError, match="artifact identity changed"):
|
|
258
|
+
verify_manifest(dist, root)
|
|
259
|
+
assert inventory_calls == 2
|
|
260
|
+
|
|
261
|
+
|
|
134
262
|
@pytest.mark.parametrize(
|
|
135
263
|
"field,value",
|
|
136
264
|
[
|