# HOPTF Data Contracts This directory contains machine-facing contracts for the HOPTF project. The root [DATA_CONTRACT.md](../DATA_CONTRACT.md) is the human-readable source of truth for current data surfaces, controls, and response labels. Files in this directory should hold artifact schemas, registries, checksum slots, and validator inputs as those contracts become executable. ## Contract Fields Machine-facing HOPTF contracts declare: - producer script or library module - consumer component or stage - artifact path or logical artifact name - required keys, fields, shapes, and dtypes - row axis and split axis - admissible missing-data policy - provenance fields - validation command or validator module - checksum lifecycle The producer is the only stage allowed to write the artifact. Consumers must treat declared inputs as immutable and must not silently substitute a raw upstream format when a validated runtime surface exists. ## Layout | Path | Purpose | | --- | --- | | `artifacts/artifact_registry.yaml` | Logical artifact registry for HOPTF v1 TFAtlas, responder, metadata, and linear-probe artifacts | | `tf_atlas/` | TF Atlas raw, processed, control-surface, and ontology schemas | | `esm/` | Protein-embedding artifact schemas | | `alphagenome/alphagenome_k_contract.yaml` | Producer and consumer schema for AlphaGenome locus K matrices | | `hopfield/hopfield_component_contract.yaml` | Producer and consumer schema for TF query retrieval over AlphaGenome K | | `linear_probe/linear_probe_contract.yaml` | Producer and consumer schema for responder metadata and frozen protein-embedding probes | Checksum fields may remain pending until artifacts are generated or promoted. A promoted artifact is complete only when its provenance, shapes, dtypes, and source paths are recorded here or in an adjacent machine-readable manifest. ## Current Human Contracts | Path | Purpose | | --- | --- | | `tf_atlas/TF_ATLAS_ONTOLOGY_WHITEPAPER.md` | Project-wide white-paper treatment of the Joung TF Atlas ontology, raw shards, IDs, controls, embeddings, PCA surface, and v1 responder label contract | | `tf_atlas/EXTRACTION_PIPELINE_AUDIT.md` | Audit for `Sup_data_4.xlsx`, S01-S04 expression recovery, and control-mapping implications | | `tf_atlas/JOUNG_GEO_SYNC_REPORT.md` | Human-readable report for GEO source synchronization state | | `tf_atlas/H5AD_SHARD_CONTRACT.md` | Executable contract for the final TFAtlas H5AD surface: `X` is `log1p_cp10k`, raw counts are in `layers["counts"]`, and metadata lives in `obs`, `var`, and `uns` | | `tf_atlas/PREPROCESSING_CONTRACT.md` | Stage contract for TFAtlas H5AD, binary CSR cache, HVG5K, PCA50, and downstream responder-surface preprocessing | | `tf_atlas/H5AD_FROM_CSR_CONTRACT_VALIDATION_20260420.json` | Validation artifact for the realized 24-shard final H5AD surface built from the CSR cache | | `tf_atlas/TF_ATLAS_CSR_CACHE_STRUCTURAL_VALIDATION_20260420.json` | Structural validation artifact for the full 24-shard pre-sorted CSR binary cache | | `linear_probe/linear_probe_contract.yaml` | Executable producer/consumer contract for the completed responder score, metadata table, and linear-probe result |