diff --git a/AGENTS.md b/AGENTS.md index e3fc539..3d99a4a 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -40,6 +40,7 @@ Do not tell the user you are "done" or that changes are "complete" until both pa - If something goes sideways, STOP and re-plan immediately — don't keep pushing - Use planning/verification steps, not just building - Write detailed specs upfront to reduce ambiguity +- Per-issue plans kept under `tasks/` are removed in the PR that closes the issue; only `tasks/lessons.md` stays ### 2. Self-Improvement Loop - After ANY correction from the user: capture the pattern (in Claude Code memory or `tasks/lessons.md`) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 5a64ce3..1c2fc4b 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -3,6 +3,16 @@ Changes in each published version, newest first. These notes start at 2.27.2; earlier versions are available as [Git tags](https://github.com/openvax/pyensembl/tags). +## 2.34.7 + +Maintenance only; no behaviour change for supported use. Removes the unused +`EnsemblRelease.normalize_init_values` classmethod, which had no callers +in PyEnsembl or the packages that depend on it (#522), and stops +pinning pickle protocol 2 (a Python 2 leftover) when writing cache files; +existing cache files still load. Also deletes the finished implementation +plans under `tasks/` and the one-off `scripts/benchmark_gtf_indexing.py` +(#513). + ## 2.34.6 `pyensembl list` no longer reports the HGNC alias snapshot cached by diff --git a/pyensembl/common.py b/pyensembl/common.py index 2442ccf..5165b97 100644 --- a/pyensembl/common.py +++ b/pyensembl/common.py @@ -85,8 +85,7 @@ def _read_progress(raw, description, enabled): def dump_pickle(obj, filepath): # Atomic, so an interrupted write never leaves a truncated index behind. with _atomic_output(filepath) as f: - # use lower protocol for compatibility between Python 2 and Python 3 - pickle.dump(obj, file=f, protocol=2) + pickle.dump(obj, file=f) def load_pickle(filepath): diff --git a/pyensembl/ensembl_release.py b/pyensembl/ensembl_release.py index ebaea07..fff2f03 100644 --- a/pyensembl/ensembl_release.py +++ b/pyensembl/ensembl_release.py @@ -95,24 +95,6 @@ class EnsemblRelease(Genome): cache layouts remain independent of the new assembly metadata. """ - @classmethod - def normalize_init_values(cls, release, species, server): - """ - Normalizes the arguments which uniquely specify an EnsemblRelease - genome. - """ - release = normalize_release(release) - species = check_species_object(species) - if is_dated_release(release): - # Neither legacy server hosts dated releases. - if server in (None, ENSEMBL_FTP_SERVER, ENSEMBL_GENOMES_FTP_SERVER): - server = ENSEMBL_PLATFORM_FTP_SERVER - elif server is None or server == ENSEMBL_FTP_SERVER: - # Promote to the Ensembl Genomes server when the species lives - # there; otherwise keep the main Ensembl server. - server = _default_server_for_species(species) - return (release, species, server) - # Using a WeakValueDictionary instead of an ordinary dict to prevent a # memory leak in cases where we test many different releases in sequence. # When all the references to a particular EnsemblRelease die then that diff --git a/pyensembl/version.py b/pyensembl/version.py index f6fe527..b83c073 100644 --- a/pyensembl/version.py +++ b/pyensembl/version.py @@ -1,4 +1,4 @@ -__version__ = "2.34.6" +__version__ = "2.34.7" def print_version(): print(f"v{__version__}") diff --git a/scripts/benchmark_gtf_indexing.py b/scripts/benchmark_gtf_indexing.py deleted file mode 100644 index e3f2f2c..0000000 --- a/scripts/benchmark_gtf_indexing.py +++ /dev/null @@ -1,50 +0,0 @@ -"""Compare complete fresh SQLite indexing with pandas and Polars parsing. - -Run from the checkout: python scripts/benchmark_gtf_indexing.py /path/to/file.gtf.gz -Each result includes parsing, feature synthesis, SQL loading and indexing. -""" - -import argparse -import json -import logging -from statistics import median -from tempfile import TemporaryDirectory -from time import perf_counter -from unittest.mock import patch - -import gtfparse -from pyensembl.database import Database - - -def main(): - parser = argparse.ArgumentParser(description=__doc__) - parser.add_argument("gtf") - parser.add_argument("--runs", type=int, default=2) - args = parser.parse_args() - if args.runs < 1: - parser.error("--runs must be positive") - logging.getLogger().setLevel(logging.WARNING) - reader = gtfparse.read_gtf - timings = {"polars": [], "pandas": []} - for run in range(args.runs): - order = ("polars", "pandas") if run % 2 == 0 else ("pandas", "polars") - for result_type in order: - def read(*a, **kw): - return reader(*a, **{**kw, "result_type": result_type}) - - with TemporaryDirectory(prefix="pyensembl-index-benchmark-") as directory: - with patch.object(gtfparse, "read_gtf", read), Database( - args.gtf, cache_directory_path=directory - ) as database: - start = perf_counter() - database.create() - seconds = perf_counter() - start - timings[result_type].append(seconds) - print(json.dumps({"run": run + 1, "result_type": result_type, - "seconds": seconds}), flush=True) - print(json.dumps({"median_seconds": {name: median(values) - for name, values in timings.items()}})) - - -if __name__ == "__main__": - main() diff --git a/tasks/cli-error-handling-plan.md b/tasks/cli-error-handling-plan.md deleted file mode 100644 index 4c4067f..0000000 --- a/tasks/cli-error-handling-plan.md +++ /dev/null @@ -1,61 +0,0 @@ -# Rebase and finish CLI error handling (#387) - -## Current relevance - -Current main already uses concise help and argparse errors (exit 2) for pure -selection errors, supports transcript-only FASTA input, and safely handles -explicit deletion of uninstalled genomes. Preserve those behaviors rather -than restoring obsolete branches from the old PR. - -Still relevant: missing local annotation files produce tracebacks, and explicit -empty source arguments can fall through to default Ensembl selection. Keep -real parser, database and integrity failures visible with tracebacks. - -## Implementation - -- Rebase the existing cli/one-line-errors branch onto the newly shipped 2.32.0 - main. Resolve conflicts in favor of current release/assembly/integrity/cache - behavior, retaining the old PR's narrow missing-data exception concept. -- Add MissingGenomeDataFile as a ValueError subclass only at the existing - missing-remote-data conversion. Preserve library exception compatibility. -- Handle MissingLocalFile and MissingGenomeDataFile narrowly around CLI actions, - printing `pyensembl: error: ...` and exiting 1. Missing local paths use a - clear `file not found` message. Do not catch generic runtime ValueError, - filesystem errors, GTF parser failures, SQL errors, or integrity errors. -- Reject explicitly empty --gtf, --transcript-fasta, --protein-fasta and - --genome-fasta-path values during selection, before filesystem/network work. - Keep whitespace in legitimate file paths and retain omitted optional sources. -- Pure argument errors continue to use argparse.error (exit 2). No duplicate - CommandLineError wrapper is needed now that selection already has a narrow - parser-error boundary. Preserve the new available/verify/latest actions. -- Close confirmed empty-source fallback issue #494 from #387. Check - the historical corrupt-DB review claim before filing anything new; do not - broaden this PR into parser/index recovery. -- Bump to 2.32.1; update release notes and rewrite the existing PR title/body - around the final relevant behavior and modern exit-code convention. - -## Verification and release - -Use subprocesses running the real pyensembl console entrypoint to exercise -missing GTF/FASTA/DNA, unknown releases/species, invalid combinations, empty -arguments, transcript-only installs, and the current deletion behavior. Prove -empty args never reach selection/download, and malformed GTF/DB/checksum errors -retain their diagnostics. In-process CLI tests stub logging configuration. - -Run targeted tests serially as well as mandatory ./lint.sh and ./test.sh, source -archive checks and docs. Preserve existing cached files exactly. Push the rebased -branch with force-with-lease against the observed remote head, pass CI, merge -PR #387, deploy from clean main, and verify the public PyPI artifacts. Read the -remaining issue queue after shipping; do not start unrelated changes. - -## Verified results - -- Empty GTF and mirror values selected EnsemblRelease 116 in published 2.31.2; - confirmed with selection only and no cache creation. Fixed in this PR (#494). -- Thirty serial CLI tests pass; full lint/test suite passes 1,056 tests. -- Documentation checks pass for 26 pages / 2,187 links and 16 examples. -- The historical corrupt-DB overwrite report remains reproducible directly in - datacache 1.29.2. Filed openvax/datacache#132; no cache-unlink workaround is - included here. Malformed data and integrity failures retain tracebacks. -- Initial rebase used #493's final tested branch while its CI was running. - Before pushing #387, rebase onto #493's actual merged main and publish 2.32.0. diff --git a/tasks/data-management.md b/tasks/data-management.md deleted file mode 100644 index bc767dd..0000000 --- a/tasks/data-management.md +++ /dev/null @@ -1,76 +0,0 @@ -# Data management through released datacache APIs - -## Problem and scope - -PyEnsembl delegates remote transfers and SQLite publication to datacache, but -still performs its own existence-only source checks and non-atomic local copies. -Those paths disagree: empty sources and directories may count as installed, -copied files require an original source even after import, and new downloads -have no visible provenance. Users cannot inspect the exact files and indexes -behind a selected genome without reaching into implementation details. - -Use released datacache 1.16.1 (APIs available at the existing 1.14 floor). Preserve -cache paths, domain exceptions for missing files, index ownership, and shared -DNA identity/reference/pruning. Do not depend on the unrelated in-progress -datacache checkout or pending bundle enhancements. - -## Design - -1. Give DownloadCache a side-effect-free local-path resolver and inspection - adapter. Delegate readability, regular-file checks, structured errors and - provenance to datacache.inspect_file. Add the PyEnsembl requirement that data - files are nonempty. Keep an explicit empty-files-ok option for the existing - required_local_files_exist compatibility contract. -2. Delegate cache-hit validation to inspect_file and forced replacement to fetch_file, - with explicit raw/decompression settings and provenance recording. Missing - offline data retains the existing install hints; corrupt/inaccessible data - raises its structured cause and requires explicit overwrite to repair. -3. Import local files through the same atomic fetch_file path using a file URI. - Reuse a cached imported file offline even after the original is removed. - Apply requested decompression consistently to copied and remote inputs; - preserve attached sources and permit copying a file already at its target. -4. Centralize annotation source/index inventories in Genome. Route readiness, - required-file checks and release selection through readable, nonempty file - inspection. Keep the complete SQLite/schema check. Distinguish missing, - incomplete, invalid and inaccessible sources; incomplete indexes remain - 'not indexed'. Never parse FASTA dictionaries just to inspect readiness. -5. Add Genome.inspect_data(): annotation/DNA readiness plus a role-keyed mapping - of datacache FileInspection objects for configured sources and indexes. - Represent a database with wrong completion metadata as an invalid index. - DNA index status still uses its source fingerprint and existing DNA contract. -6. Add pyensembl inspect using existing genome selection flags, with a readable - file table and --json for scripts. JSON serializes structured filesystem - errors to messages and includes sizes, timestamps and recorded provenance. - Inspection is offline and never creates/copies/downloads/indexes/repairs. - Existing list output stays compact and gains accurate source states. -7. Update usage docs and bump 2.19.0 to 2.20.0. File discovered defects as an - upstream issue and link it from the PR. - -## Verification and delivery - -- Reproduce existing empty/directory-source readiness, non-atomic copy, - compressed-local-copy and deleted-original reuse failures with small fixtures. -- Verify real datacache gzip/plain acquisition, atomic preservation after a - failed overwrite, read-only/offline reuse, provenance and stale/malformed - receipts; prohibit writes/network during inspection tests. -- Exercise installed/list/reference selection against invalid/inaccessible - sources and incomplete indexes; cover custom, Ensembl and reference-DNA data. -- Exercise human/JSON CLI inspection, absence, legacy files and selection flags. -- Run ./lint.sh and the full ./test.sh. Use an isolated environment with the - released datacache wheel and isolated test outputs; keep real Ensembl fixtures - available without modifying the user's cache. Check wheel/sdist artifacts and - review the diff before submitting. -- Open a PR, wait for required CI, merge, deploy with ./deploy.sh from a clean - main checkout, verify PyPI, then review the next dependency/urgency group. - -## Verification results - -- Filed the acquisition/readiness defects as openvax/pyensembl#425. -- The four initial regressions fail on 2.19.0 and pass after the changes. -- Released datacache 1.16.1: full ./test.sh passes (492 passed, 1 skipped; - 92% coverage), and ./lint.sh passes. HTTP-resume tests require an unsandboxed - localhost bind; fixture data lives in an isolated copy-on-write cache. -- Minimum supported datacache 1.14.0: all 29 focused data-management/readiness - tests pass, so the dependency floor need not change. -- Equality fixtures now use a nonempty annotation header. The cache-location - test restores the caller's environment instead of deleting it (related #422). diff --git a/tasks/datacache-recovery-integration-plan.md b/tasks/datacache-recovery-integration-plan.md deleted file mode 100644 index cda9baf..0000000 --- a/tasks/datacache-recovery-integration-plan.md +++ /dev/null @@ -1,41 +0,0 @@ -# Adopt published datacache recovery in PyEnsembl - -## Scope and compatibility - -Require datacache 1.29.3, the first published version containing the recovery -fix in openvax/datacache#133. An existing installation must receive that version -when PyEnsembl is upgraded. PyEnsembl must delegate recovery to datacache rather -than delete a user's SQLite cache or invent a second recovery mechanism. - -Normal opens and installs retain their current behavior. Only explicit -`--overwrite` may recover a corrupt annotation database. Preserve healthy cache -reuse, source files, indexes, paths, permissions, links, ownership and rollback -semantics. Use disposable data in tests, never corrupt an installed user cache. - -## Implementation and evidence - -- Add a CLI integration regression using an actual tiny GTF and database. - Corrupt the temporary database, verify normal installation reports the - existing error without rewriting it, then invoke `install --overwrite` and - query the reconstructed gene. Confirm the database inode and permissions - survive and annotation source bytes are unchanged. -- Exercise recovery failure with malformed source data; preserve the old - database and source when rebuilding cannot complete. Existing healthy-cache - reopen snapshots continue to prove no new writes during normal reuse. -- Demonstrate the recovery regression against datacache 1.29.2 in a separate - temporary environment, and success against published 1.29.3. Do not assert a - hardcoded copy of the dependency declaration in a test. -- Raise the dependency floor, bump PyEnsembl to 2.32.2, and document the explicit - recovery behavior and the upstream runtime requirements without suggesting - migration or automatic repair. -- File the integration gap as a PyEnsembl issue and link it and datacache#132 / - #133 in the PR. Run mandatory lint/full tests, serial CLI tests, extracted - source-archive tests, docs and package checks. All environments and test data - remain separate from the shared virtual environment and user checkout. - -## Shipping and subsequent authorized work - -Wait for Python 3.11–3.14 CI, merge and run deploy.sh from a clean main clone. -Verify public artifacts and the release tag. Then implement OncoRef #609, -finish the existing Vaxrank #665 for #662, and finally PyEnsembl #456. Each -stage gets its own versioned PR, repository-required validation and release. diff --git a/tasks/dated-dna-sharing-plan.md b/tasks/dated-dna-sharing-plan.md deleted file mode 100644 index 414607a..0000000 --- a/tasks/dated-dna-sharing-plan.md +++ /dev/null @@ -1,44 +0,0 @@ -# Dated reference DNA sharing (#454) - -## Findings and contract - -Official dated DNA has a genome/md5sum.txt manifest (not the dataset root). -Verified on 2026-10-19: human GRCh38 2025_12 and 2026_04 publish the same -three compressed DNA hashes; unmasked MD5 30d2f26286e2053454a74c723e70e701, -847651000 bytes. Accession alone is insufficient: masking, provider and -upstream file revisions must remain distinct. Numbered and dated formats -have different metadata and are not assumed interchangeable. - -Existing release-private dated files, indexes and manifests must stay usable -in place, including read-only/offline reuse and repeated download/index calls. -No automatic migration, copy, rename, reindex, deletion or metadata rewrite. -Existing numbered shared identities and paths remain unchanged. - -## Implementation - -- Recognize only official HTTPS ftp.ebi.ac.uk ensemblorganisms URLs with - versioned GCA/GCF accession, provider, date and standard masked DNA filenames. -- For new dated installs, share by accession + provider + mask + MD5 + exact - compressed size. Fetch small metadata only during explicit acquisition; - verify downloaded bytes against MD5 before decompression/publication. - Missing, malformed or conflicting metadata isolates by full URL instead. -- Reuse existing SharedGenomeFasta locks, atomic writes, references, indexes - and conservative pruning. Validate metadata-derived directory components. -- Prefer an existing dated release-private materialized file if it has no - shared reference, preserving its current directory and implementation. - New installs through EnsemblRelease and EnsemblAnnotation share equally. -- Clarify the API: ordinary date selection needs only EnsemblRelease; - EnsemblAnnotation exists for explicit older/unregistered accessions, - providers and annotation coverage. Retain compatible constructors. -- Patch version bump, release notes and cache/platform documentation. - -## Verification and delivery - -Use tiny local DNA with simulated official metadata to cover equal dates, -changed hashes/size, masks, providers, accession versions/GCF, malformed or -missing manifests, download checksum mismatch, offline read-only reuse, -legacy-private snapshots, concurrency, pruning and both constructors. Run -focused tests, ./lint.sh, ./test.sh, ./docs.sh, pip check and saved legacy -snapshot verification. Open a separate PR closing #454, pass CI, merge and -run ./deploy.sh from clean main; verify published artifacts. Never touch -actual user caches or the shared environment. diff --git a/tasks/genetic-code-metadata-plan.md b/tasks/genetic-code-metadata-plan.md deleted file mode 100644 index cb16c58..0000000 --- a/tasks/genetic-code-metadata-plan.md +++ /dev/null @@ -1,119 +0,0 @@ -# Offline source and taxonomy genetic-code metadata (#481) - -Policy correction in 2.31.1: the arbitrary-contig unknown behavior below is -superseded by [the species-default plan](species-genetic-code-default-plan.md). -Unplaced scaffolds and no-contig lookups now use the species' nuclear code. -The original Varcode #623 scaffold example was intended fallback behavior; -that issue now covers only explicitly unset reference tables. - -## Scope and invariants - -Expose translation-table assignments and provenance from PyEnsembl, without -implementing translation, modifying sequence data, or guessing a code from -an organelle name alone. Preserve old cache paths, source URLs, database -schema compatibility, serialized objects and installed indexes. All runtime -lookups are offline. Use isolated development/release environments. - -## Public contract - -- `Genome.reference_metadata`: a copy of a serializable pinned metadata - record. One optional constructor argument with that name allows custom - references to supply taxon identity, compartment assignments, and explicit - translation-table overrides. EnsemblRelease infers the record normally. -- `Genome.taxon_id`, `species_taxon_id`, `nuclear_translation_table`, - `mitochondrial_translation_table`, `plastid_translation_table`, and - `contig_compartments` expose the resolved reference metadata. -- `Genome.genetic_code(contig=None, *, compartment=None)` returns one immutable - provenance record: table_id, compartment, source, taxon_id, source_url and - an explicit reason when unresolved. A compartment can be requested without - a contig. Supplied inconsistent constraints raise instead of guessing. -- `Transcript.source_translation_table` exposes only annotation declarations; - `Transcript.genetic_code` resolves the source declaration before the - reference defaults; `Transcript.translation_table` exposes the resulting - table ID or None. Conflicting declarations on transcript/CDS rows raise. - -## Taxonomy and provenance - -Capture official Ensembl species/taxonomy mappings and NCBI Taxonomy XML with -lineage/parent records, synonyms, nuclear/mitochondrial IDs, and plastid pgcode. -Capture NCBI gc.prt solely to validate table IDs/names; do not duplicate a -translation engine. Generate and package a small reviewed JSON snapshot, -with retrieval date, source URLs and content digests. Generation consumes -captured files and is deterministic; capture is a separate explicit command. - -Resolve registered species and exact assembly selections, including dog -breeds and mouse strains, from verified mappings. Distinguish source taxon -from its species ancestor. Accept a parent/child relationship only with -captured lineage evidence; unrelated supplied identities are errors. Unknown -taxa and unavailable code assignments remain explicit. Retain actual and -species taxon IDs from new Ensembl API responses and validate their agreement. - -## Compartment resolution - -Explicit per-contig reference metadata takes precedence over documented -aliases. Recognize mitochondrial/plastid aliases and a conservative set of -nuclear chromosome names; an arbitrary remaining contig is unknown, not -automatically nuclear. A taxon/compartment assignment still must exist before -returning a default code. Do not infer taxonomy from filename fragments or -custom display labels. Exact registered reference labels retain legacy use. - -## Annotation and cache compatibility - -New annotation databases retain optional transl_table/translation_table -columns, including an empty value when absent, without changing the schema -version or rebuilding existing databases. For old indexes lacking those -columns, lazily inspect the already installed local GTF and cache its sparse -declarations only in memory. No network, database migration, new sidecar, or -reindex on lookup. A missing required local annotation source must be reported, -not treated as proof that there was no source override. Source fingerprint -changes invalidate any in-memory metadata. Preserve ordinary index/query -behavior and keep the new lookup separate from download-triggering db access. - -Review refinement: new indexes also record the GTF stat fingerprint for these -optional attributes. Use indexed declarations only when that fingerprint -still matches and both transcript/CDS features were examined. Otherwise read -the installed GTF. This prevents a modified remote-source file or a restricted -custom index from falsely reporting no override. Existing indexes are never -changed to add the fingerprint. Accept the same quoted/repeated attribute -forms as the main GTF parser, including quoted semicolons in unrelated fields. - -Pin metadata through Genome/EnsemblRelease JSON, pickle and mirrors. Old -saved objects gain inferred metadata in memory only. Metadata must not alter -source or cache identities; supplied semantic overrides must remain distinct -in in-memory object caching. - -## Acceptance and release - -Test actual GTF/CDS overrides, absent attributes, invalid IDs and conflicting -rows; human/mouse mitochondrial 2, yeast 3, fly/worm 5, Candida nuclear 12, -plant plastid 11, parent/strain resolution and conflicting taxa. Test unknown -contigs/taxa, explicit compartment overrides, API taxon propagation, mirrors, -serialization and snapshot preservation across catalogue changes. Reopen -old cached databases read-only and prove no downloads, writes or rebuilds. -Use source-derived examples independently of generated config, and verify -the snapshot generator against captured NCBI metadata. - -Run lint.sh/test.sh, strict docs/tutorial and installed-wheel tests, plus a -focused read-only consumer smoke test against Varcode. File any consumer -integration defects; this task changes only PyEnsembl. Ship a separate 2.31.0 -PR after #453, pass Python 3.11–3.14 CI, merge, run deploy.sh from clean main, -and verify public artifacts and the release tag. - -## Implementation verification - -- `./lint.sh` passed; `./test.sh` passed 983 tests, with 93% coverage. -- Strict documentation build, 26-page/2,159-link audit, and all 16 executable - documentation examples passed. Wheel and sdist build successfully. -- The installed wheel passed 167 metadata, source-declaration, tomato and - release/cache combination tests, imported from an isolated target directory. -- An actual 2.30.1 index fixture recovers a formerly unindexed source override; - actual 2.30.0 tomato indexes recover absent declarations and taxonomy defaults. - Read-only before/after snapshots preserve all files, bytes, modes, inodes and - timestamps. The existing release/cache argument matrix also passes. -- Independent primary captures reproduce all 43 mappings and 42 NCBI records. -- Published Varcode 10.18.2 consumes the expected human/mouse, yeast, fly/worm, - Candida and plant assignments and a GTF override. It still falls back to - nuclear table 1 after an explicit unknown compartment; filed downstream - [Varcode #623](https://github.com/openvax/varcode/issues/623). No Varcode or - shared-environment files were changed. -- All work, caches, builds and environments are isolated under `/private/tmp`. diff --git a/tasks/local-fasta-identity-plan.md b/tasks/local-fasta-identity-plan.md deleted file mode 100644 index 9f34983..0000000 --- a/tasks/local-fasta-identity-plan.md +++ /dev/null @@ -1,47 +0,0 @@ -# Local FASTA identity (#467) - -## Contract - -New indexes must belong to the configured local source and its actual bytes. -Different source paths, changed bytes (including equal-length changes with a -restored mtime), transcript/protein roles, and copied sources must not reuse -another file's sequence dictionary. Existing legacy sources and indexes remain -usable in place, including read-only caches; no migration, metadata rewrite, -renaming, reinstall, or automatic deletion. Unknown legacy provenance retains -the historical assumptions, as in the remote-cache compatibility correction. - -## Implementation - -- Centralize FASTA index selection for SequenceData and Genome inspection. - For new local entries, use a namespace derived from the original absolute - source path and a SHA-256 of the actual indexed file. Keep a readable filename. - Memoize byte hashes only within a process, keyed by complete stat identity; - detect changes during hashing/parsing before publishing any index. -- Reuse a legacy basename index unchanged if no source-specific generation has - been created for that source. New remote indexes keep their existing download - filename identity, and existing remote caches remain unchanged. -- Refresh loaded local sequence dictionaries when their selected source - generation changes. Permission-only changes must reuse identical bytes/indexes. -- Give new copied local sources their own original-path/mode-specific download - destination. Reuse existing legacy copies in place; if an explicit refresh or - changed local input needs new bytes, write a new destination and retain the - old legacy files. Copies remain usable after the original disappears. -- Index readiness, inspection and deletion must agree with sequence lookup. - Explicit deletion can find this source's generations even when the original - has disappeared, without deleting another source's indexes or any FASTA. -- Document the new identity and the legacy compatibility boundary; patch bump. - -## Verification - -Reproduce the published 2.28.1 collision before the fix. Cover transcript and -protein collisions, separate instances and offline reuse, changed content with -unchanged size/mtime, loaded readers, compressed/plain and copied/attached -sources, decompressed copies, missing originals, deletion isolation, interrupted/changed inputs, -long names and read-only legacy/current caches. Snapshot legacy bytes, names, -permissions, inodes and timestamps, forbidding acquisition/rebuild on reuse. -Keep full legacy fixtures independent of the new path selection code. - -Run focused tests serially, ./lint.sh, ./test.sh and pip check in an isolated -repository environment with temporary data. Open a PR closing #467; merge only -after review/checks, then ./deploy.sh from clean main, verify PyPI artifacts. -Never change the shared environment or actual user caches. diff --git a/tasks/mirror-release-plan.md b/tasks/mirror-release-plan.md deleted file mode 100644 index 9d3494e..0000000 --- a/tasks/mirror-release-plan.md +++ /dev/null @@ -1,39 +0,0 @@ -# PyEnsembl #470: reuse a mirror installation from Python - -## Problem and boundary - -Since 2.27.5 new downloads are keyed by their complete source URLs. The CLI -already builds a custom Genome for a flat-directory mirror; ordinary -EnsemblRelease constructs canonical URLs. They intentionally have different -cache identities. Existing basename-only installations are addressed separately -by #474; this change must preserve that compatibility contract and new-source -isolation. No copying, relabeling, or implicit registration of mirror indexes. - -## API and implementation - -Add `EnsemblRelease(...).with_mirror(mirror)` returning a source-explicit Genome. -Use the release's existing filename selection for GTF, transcript and protein -FASTA, and reference DNA when requested. Retain explicit local DNA; support -the CLI's existing explicit DNA override. Route `--custom-mirror` through this -same method and remove the duplicated URL rewriting from the CLI. The returned -Genome uses its existing serialization and identity contracts. - -Document a complete install/reopen example, including passing the returned -Genome explicitly to Varcode. Explain that default EnsemblRelease/Varcode release -numbers require canonical installation for new caches. Mirror-aware CLI queries -must repeat the same mirror. Existing mirror downloads do not need migration: -construct the same source URLs. Include these distinctions in CLI help and -cache documentation. Do not change default acquisition or existing files. - -## Verification - -Use a local HTTP server serving tiny real GTF/FASTA data under independently -specified Ensembl filenames. Run the actual install CLI in a subprocess with -a fresh cache. Stop the server, then reopen/query through the Python API in -another process. Check canonical and a second mirror do not claim this install; -snapshot installed files to rule out rebuilding/copying. Exercise pickling/JSON, -mirror CLI selection, local/remote reference-DNA overrides and numbered/dated -file selection. Run existing cache isolation and CLI regressions, lint, and the -full suite. Bump the version after refreshing main to avoid conflicting with -the active #474 release. Ship only after green CI, merge, clean-main deployment -and live PyPI verification; refresh the shared installed package normally. diff --git a/tasks/python-311.md b/tasks/python-311.md deleted file mode 100644 index bbb27bf..0000000 --- a/tasks/python-311.md +++ /dev/null @@ -1,34 +0,0 @@ -# Python 3.11 support floor (#463) - -## Specification - -Require Python 3.11 or newer without an upper bound. Keep CI coverage through -3.14 and drop 3.9/3.10 jobs. Align classifiers, docs, and repository guidance. -Remove the obsolete pre-3.10 filelock branch and keep the supported filelock -constraint. Preserve genome/cache behavior and other dependency bounds. Bump -the patch version for release. - -## Plan - -- [x] Read the issue, package metadata, CI, release script, and guidance. -- [x] Check plan before implementation: this is a support-policy change; tests - must still exercise the reference-backed suite using a writable copy of - existing Ensembl caches. -- [x] Update metadata, CI, docs, version, and obsolete dependency marker. -- [x] Build isolated Python 3.11 and 3.14 environments; verify dependency - resolution against released foundation packages. -- [x] Run `./lint.sh`, `./test.sh`, and documented example checks with a - writable reference cache; review the diff. -- [ ] Open PR, pass CI, merge, deploy from clean main, verify PyPI and tag. - -## Review - -`./lint.sh` passed. `./test.sh -q` passed 711 tests on Python 3.11.12 and -711 tests on Python 3.14.6 (94% coverage); the three 3.14 resource warnings -come from existing SQLite connections. The first 3.11 run under the restricted -sandbox denied loopback sockets for 15 local HTTP tests; rerunning with local -socket access passed all 711 tests. All 16 documented examples passed on both -versions using a writable copy-on-write cache of the Ensembl reference data. -Both isolated environments resolved typechecks 0.1.2, serializable 1.3.2, -gtfparse 3.0.5, and datacache 1.28.0; dependency checks passed. Installed -metadata reports version 2.28.1 and `Requires-Python: >=3.11`. diff --git a/tasks/remove-ensembl-annotation-plan.md b/tasks/remove-ensembl-annotation-plan.md deleted file mode 100644 index b33914b..0000000 --- a/tasks/remove-ensembl-annotation-plan.md +++ /dev/null @@ -1,105 +0,0 @@ -# Remove the unused constructor and exercise installed cache selections - -## Intent and authorization - -The user explicitly approved removing EnsemblAnnotation in the next version, -superseding #482's indefinite compatibility-shim requirement. They also asked -for real locally cached data created with different EnsemblRelease argument -combinations. Keep the existing file-cache preservation requirement unchanged. - -Ship this as 2.30.0 through a feature PR, then merge and run deploy.sh from clean -main. Keep the original user checkout and shared Python environment untouched. - -## Product changes - -- Delete the EnsemblAnnotation implementation/module, package export, and - constructor-only branches in EnsemblRelease. Do not add an alias, hidden - compatibility class, warning wrapper, or serialized-object adapter. -- Keep EnsemblRelease's numbered and dated behavior, explicit accession cache - layout, reference names, URL spelling, provider/coverage selection, and - metadata serialization unchanged. -- Keep old EnsemblRelease JSON/pickle loading. Old EnsemblAnnotation imports and - serialized class paths intentionally cease to work; explain the replacement - in one short removal note. Existing cache files remain reusable by an - equivalent EnsemblRelease call, with no rewriting or regeneration. -- Update live documentation and move the actual assembly/date integration tests - to the unified constructor. Preserve historical fixtures as independent - evidence instead of regenerating them with the implementation under test. - -## Installed-data matrix - -Use a new isolated temporary cache and tiny real GTF/FASTA data. Exercise actual -acquisition, decompression, database creation, sequence indexing, and queries; -assert resulting file paths and contents, not just constructor attributes. -Transport fixtures must not contact Ensembl or affect users' installed files. - -Cover: - -1. Numbered human release 75 via default species, common/Latin names, build, - exact patch name, and accession assertions: same installed annotation. -2. Dated human default via inferred species, broad/exact names, and explicit - default coverage: same species-layout data including alternate loci. -3. Explicit accession via either keyword, normalized spelling, optional species - and provider: same accession-layout primary data; preserve the intentional - distinction from the species default. -4. Historical dated GRCh37 inference versus build/name/accession selection: - identical selected data in the explicit layout, with the existing mirror - and previously installed-selection preservation rules respected. -5. Dog reference and breed selections: synonyms and exact selectors reuse the - intended cache; dog/breed assemblies and providers do not cross-contaminate. -6. Different dates, providers, coverage, and assembly accessions: cache choices - remain separate even when source basenames match. Use distinct synthetic - gene/transcript/protein/DNA contents to catch wrong-cache reuse. -7. Custom labels/directories, remote versus local DNA, and masked DNA: reopen - the same installed data through constructor, JSON, pickle and install CLI - arguments where applicable. Keep DNA attachment independent of annotation. -8. Invalid/mismatched species, patch/accession, and ambiguous breed dates: fail - without writes. Repeat installations and read-only/offline reopening must - not download, parse, rewrite, or change existing cache bytes, permissions, - inodes or modification/change timestamps. -9. Published 2.28.3 fixture caches: retain old Release deserialization and reopen - old Annotation-created data using the equivalent EnsemblRelease arguments. - -Keep the matrix understandable by grouping equivalent selections and checking -cross-group differences. Extend existing DNA-sharing tests rather than -reimplementing the shared DNA cache. Keep fixtures small and deterministic. - -## Audit and validation - -Search live downstream source/tests for removed imports, excluding vendored -copies of PyEnsembl itself. File concrete discovered defects in their owning -repository and link them from the PR; fix cache defects within this scope. - -Run focused installed-data tests, serial CLI tests, lint.sh, test.sh, strict docs -and tutorial examples. Build wheel/sdist, verify the removed module is absent, -and run the new matrix against the installed wheel. Check final CI on Python -3.11–3.14, merge, run deploy.sh, verify public artifacts and release tag, then -review the next relevant dependency block without starting unrelated changes. - -## Matrix finding and revised implementation - -The local/remote/masked DNA matrix reproduced mutation of genome_fasta.json -when an older indexed local source is reopened. Recognize existing private -source artifacts or an existing matching manifest without writing migration -metadata. Record source-specific evidence only for a new download-only local -attachment with no owned cached artifacts, so subsequent reopening can avoid -changing the advisory manifest after other attachments are installed. Expand -regressions to two local inputs, compressed local DNA, download-only attachment -recording, and read-only reuse, then rerun the full validation gates. - -## Local verification - -- Filed removal/matrix issue #484 and the discovered manifest defect as #485. -- All 67 constructor combinations across 17 selections create fresh caches, - then reopen through equivalent arguments, cached(), JSON, pickle and CLI - selection without changes. Additional tests cover coexistence, six optional - DNA attachments, invalid constraints, and API accession/UUID discovery for - human and dog. -- Historical 2.28.3 fixture files remain unchanged and reopen through the - supported constructor; old EnsemblRelease saved objects still load. -- lint.sh passes; test.sh passes all 889 tests (93% coverage). Serial CLI/matrix - checks passed, as did 195 installed-wheel checks, strict documentation/link - validation, 16 real-data tutorial examples, and pip check. -- Both build artifacts include the assembly catalogue and omit the removed - module. Downstream search found no live imports in the relevant consumers. -- CI, merge, deployment, and public-artifact verification remain release gates. diff --git a/tasks/sdist-test-fixtures-plan.md b/tasks/sdist-test-fixtures-plan.md deleted file mode 100644 index 91d4135..0000000 --- a/tasks/sdist-test-fixtures-plan.md +++ /dev/null @@ -1,41 +0,0 @@ -# Self-contained source-distribution tests (#489) - -The published sdist includes test modules but omits their supporting Python -modules and all 48 tracked fixtures. Ship the required test package, fixtures, -and lint/test entry points so an extracted source archive can run its suite. -Ordinary wheel contents and runtime/cache behavior remain unchanged. - -The archive also needs the root contributor/release documents referenced by -its included documentation pages, including the new artifact-test instructions. - -Use explicit fixture paths in MANIFEST.in: recursive inclusion would pick up -untracked developer data and generated indexes. Keep archived legacy-cache -fixtures, whose gzip archives are intentional test inputs, while excluding -loose generated databases, pickles and indexes. New fixtures must be added to -the manifest; verification compares the resulting archive with tracked source -fixtures independently of the manifest's implementation. - -Add an artifact verifier that extracts a built sdist into a temporary directory -and executes offline tests covering FASTA/GTF parsing, assembly metadata, -genetic-code captures and old cache fixtures. Assert imports come from the -extracted package and use temporary cache roots. When run from a Git checkout, -also compare tracked fixture names and bytes with the archive, rejecting extra -fixture files. It must remain usable without Git in an extracted sdist. - -Run the verifier in a separate CI job and before upload in deploy.sh. Document -the command. First demonstrate failure on the existing public 2.31.1 archive; -then build with sentinel generated/local files present, verify their exclusion, -and run the full lint/test suite from both checkout and extracted archive. -Bump to 2.31.2, merge through a PR, deploy from clean main and verify public -artifacts. Preserve the user's checkout, installed caches and shared environment. - -## Verification - -- The verifier rejected public 2.31.1: 48 missing fixtures and three missing - helper modules. The corrected archive matches all 125 tracked test inputs. -- Six untracked sentinel files (GTF, JSON, SQLite, pickle, FAI and GZI) were - excluded from the archive despite being present at build time. -- Extracted-archive offline checks: 226 passed, importing the extracted package. -- `./lint.sh` and `./test.sh`: 991 passed in the checkout and independently in - the extracted source archive, using isolated copies of required genome data. -- Strict documentation build and 2,159-link audit passed. diff --git a/tasks/species-genetic-code-default-plan.md b/tasks/species-genetic-code-default-plan.md deleted file mode 100644 index 7bd5f19..0000000 --- a/tasks/species-genetic-code-default-plan.md +++ /dev/null @@ -1,69 +0,0 @@ -# Default to the species' main genetic code (#490) - -## Correction and contract - -The 2.31.0 implementation unnecessarily returns an unresolved assignment for -an unrecognized contig name, even when the species' nuclear code is known. -An unplaced scaffold is an ordinary input and should use the species' main -(nuclear) table unless an organelle assignment or annotation says otherwise. -This corrects the unknown-contig policy in `genetic-code-metadata-plan.md`. - -Selection order: - -1. A transcript/CDS `transl_table` or `translation_table` declaration wins. -2. An explicit requested compartment or reference contig mapping selects the - compartment. Retain validation of conflicts with established mappings and - recognized chromosome/organelle aliases. -3. Recognized mitochondrial/plastid aliases select their respective tables. -4. Otherwise select the nuclear table, including arbitrary scaffold names and - `genome.genetic_code()` without a contig. This is a species-specific default, - not an unconditional table 1 fallback. For example Candida uses table 12. - -Keep compartment identification separate from the final nuclear default so -`genetic_code("scaffold_42", compartment="mitochondrial")` stays valid. -`GeneticCodeAssignment.compartment` describes the selected compartment, -including the nuclear default; it does not prove assembly localization. -Retain existing table provenance. No additional API field or schema is needed. - -Unknown species/tables and explicit `translation_tables={"nuclear": None}` -still produce a reasoned unresolved result. An identified organelle with a -missing table must not fall through to the nuclear table. Existing source -declaration validation and missing-GTF behavior remain unchanged. - -## Implementation and compatibility - -- Apply the default in the common assignment resolver used by Genome and - Transcript; update API docstrings, the guide, and release notes. -- Preserve metadata records, serialized formats, source URLs, reference names, - cache keys and database schema. Read existing indexes in place, unchanged. -- Add a project lesson reflecting the user's correction. -- File the PyEnsembl regression and narrow Varcode #623: its human scaffold - table 1 fallback is intended behavior; the only remaining report concerns - bypassing explicitly unset reference codes. Do not change Varcode here. -- Bump to 2.31.1; use a feature branch, PR, and clean-main deploy. - -## Verification - -- Demonstrate the new fallback tests fail against 2.31.0 before fixing code. -- Cover omitted contigs, arbitrary names, standard and nonstandard species - codes, requested compartments, organelle aliases/mappings, source overrides, - unresolved taxonomy, explicitly unset codes, JSON/pickle/mirrors, and both - existing-index and GTF-stream transcript lookup. -- Run `./lint.sh` and the complete `./test.sh`, including actual read-only old - cache fixtures and the release/cache argument matrix, in temporary storage. -- Check docs and a published Varcode consumer smoke test in the isolated env. -- Merge after required checks, run `./deploy.sh` from clean main, and verify - the public wheel's behavior. Preserve the user's checkout, shared Python - environment, and installed caches throughout. - -## Verification results - -- Before the resolver correction, the targeted regressions produced 23 failures - against 2.31.0; after it, all 93 genetic-code tests passed. -- `./lint.sh` and `./test.sh` pass: 991 tests, 93% coverage, including installed - read-only legacy caches, source overrides and the release/cache argument matrix. -- Published Varcode 10.18.2 selects the same scaffold and mitochondrial codes - for human, dog, yeast, Candida and fly. Its remaining explicit-None override - case was reproduced independently and retained as the narrower #623 report. -- Strict documentation build, 26-page/2,159-link validation, 16 existing - executable examples and both offline genetic-code guide examples pass. diff --git a/tasks/tomato-sl4-plan.md b/tasks/tomato-sl4-plan.md deleted file mode 100644 index c14d279..0000000 --- a/tasks/tomato-sl4-plan.md +++ /dev/null @@ -1,57 +0,0 @@ -# Tomato SL4.0 without a separate ncRNA FASTA (#453) - -## Contract - -Add numbered Ensembl Genomes 63 tomato selection using the renamed species -directory and SL4.0. Declare absent ncRNA files in species/assembly metadata; -never turn arbitrary HTTP 404 errors into a successful partial installation. -Keep all previously supported source URLs, labels, serialization and cache -paths unchanged. In particular, the registered dated tomato dataset still -uses SL3.0; adding SL4.0 to numbered releases cannot relabel that dataset. - -## Implementation - -1. Verify upstream GTF, cDNA, peptide and DNA listings and capture a small real - tomato annotation/sequence fixture, including independent header metadata. -2. Add an optional assemblies_without_ncrna setting to Species and consult it - when assembling numbered transcript sources. Include it in Species equality - and hashing so custom source selections cannot collide in cached(). -3. Add a separately pinned dated_reference_name setting, defaulting to the - latest numbered label for unchanged species. Use it for dated selections, - installed-cache discovery, available output and catalogue generation. Pin - tomato's existing dated label to SL3.0 without changing its accession/provider. -4. Register SL4.0 at release 63 and its renamed directory; append its verified - assembly metadata without regenerating or changing prior catalogue entries. -5. Test real tiny installation/index/query with no ncRNA request; aliases, - assembly assertions, CLI selection, mirror URLs, JSON/pickle and cached() - identity; retain failure on a genuinely missing required file. Compare all - existing selections with a pre-change snapshot and reopen old installed - tomato fixtures offline/read-only with unchanged files and timestamps. -6. Verify the complete upstream GTF/CDNA transcript match and real installation - in an isolated temporary cache. Existing user installations are untouched. - -## Delivery - -Document the declared optional source and dated/numbered distinction, bump to -2.30.1, run lint.sh and test.sh, strict docs and package checks, and open a PR -closing #453. After CI succeeds on Python 3.11–3.14, merge and run deploy.sh -from clean main. Verify the public artifacts and release tag. - -## Verification results - -- Full upstream installation: 33,562 genes/transcripts; every GTF transcript - ID exactly matches a cDNA header, and every transcript sequence resolves. -- Compared 1,359 pre-change numbered/dated selections: source URLs and labels - are unchanged. Captured old 2.30.0 tomato caches reopen offline/read-only. -- lint.sh and all 898 tests pass; strict documentation build/link checks pass. - -## Separate follow-up (#481) - -Build offline, provenance-bearing genetic-code metadata from captured NCBI -taxonomy. Source transcript/CDS translation tables take precedence; validated -species/strain taxonomy supplies nuclear, mitochondrial and plastid defaults. -Explicit reference compartment metadata overrides documented contig aliases; -unknown compartments and assignments remain unresolved. Preserve existing -annotation databases and serialized objects. Write a detailed API/data/test -specification after inspecting the source attributes and downstream contract, -before changing that implementation. Deliver it in its own minor-version PR. diff --git a/tasks/typechecks-removal-plan.md b/tasks/typechecks-removal-plan.md deleted file mode 100644 index 5ad0820..0000000 --- a/tasks/typechecks-removal-plan.md +++ /dev/null @@ -1,41 +0,0 @@ -# PyEnsembl #456: remove typechecks and establish focused static checking - -## Compatibility contract - -Replace the three database typechecks calls and chromosome predicates with plain -isinstance checks. Keep invalid-type TypeError and empty-column ValueError. -Builtin int subclasses (including bool) remain accepted and numpy integers stay -unsupported. Keep all accepted chromosome normalization, locus SQL query behavior, -return values, defaults, optional coordinates, source metadata, file paths and -cache reuse. Do not migrate, reinstall, rename, write or reindex user caches. - -A separately filed bug discovered during baseline review allows invalid numeric -chromosomes through a warm memoization cache. Validate type before lookup, making -rejection independent of call history; retain memoization for accepted inputs. - -## Implementation - -Remove the runtime dependency and imports. Annotate normalize_chromosome, -normalize_strand and the guarded locus query methods plus a small directly -supporting surface. SQLite result cells are dynamic, so return annotations must -not falsely claim every queried column is text. Preserve arbitrary column values. -Keep the typing effort bounded: start mypy with the changed modules, annotate -state required for real checking, and skip unrelated imported modules rather -than blanket-disable errors. Don't add another runtime validation package. - -Ship py.typed with wheel/sdist and document the partial annotation scope. Add -mypy as a development dependency, invoked by lint.sh, which CI already runs. -Test typing with a real small consumer and reveal/assert types; prove an invalid -consumer is rejected. Add runtime regressions against a tiny temporary GTF/DB -for str/int subclasses, bool, invalid types, None, floats, numpy values, empty -columns, and successful string/numeric-column locus queries. Include cold/warm -normalization behavior and unchanged installed-cache snapshots. - -## Verification and release - -Work from fresh main after the earlier authorized releases, bump the next patch -version, update release notes and add new offline tests to check_sdist.py. Run -lint.sh (ruff+mypy), test.sh, focused serial checks, extracted archive tests, -artifact/marker checks, docs, pip check and Python 3.11–3.14 CI. Merge through PR, -run deploy.sh from clean main and verify the public artifacts. Shared environment -and the user's modified pyproject.toml/tasks/lessons.md are left intact. diff --git a/tasks/unified-release-catalogue-plan.md b/tasks/unified-release-catalogue-plan.md deleted file mode 100644 index 2db222b..0000000 --- a/tasks/unified-release-catalogue-plan.md +++ /dev/null @@ -1,115 +0,0 @@ -# Finish the unified release view (#447) - -## Already shipped - -Numbered and dated EnsemblRelease construction, inferred/explicit assembly -identity, dated discovery, API UUID/accession selection, old-assembly dated -selection, installed dated listings, and shared dated DNA are implemented. -EnsemblAnnotation has been removed. Retain all those APIs and cache contracts. -The remaining work concerns ordering/evidence, selection, and integrity. - -## One release catalogue and explicit latest policy - -- Expose one metadata view of numbered and dated releases per species/assembly, - reusing the existing assembly catalogue and dated listing cache. It must show - release, accession, provider, coverage, relationship evidence and selection - status without introducing another genome/annotation constructor. -- Compare actual upstream GTFs for human numbered/dated pairs (110, 114 subset, - 115, 116 and GRCh37/75), mouse, dog, yeast, fly and Arabidopsis. Capture source - digests, headers, gene/transcript ID.version sets and order-independent GTF - fingerprints. Label matching identifiers separately from matching annotation - contents. Prove subset relationships rather than inferring them from counts. -- Keep provenance and a reproducible capture/comparison tool. Tiny independent - source excerpts exercise parsing offline; full-capture summaries describe - precisely the evidence obtained from the complete source files. -- Add `EnsemblRelease("latest", ...)` and CLI `--release latest` as opt-in - selection. Resolve to the latest verified selection for the requested scope, - prefer frozen numbered data for verified ties, and serialize only the concrete - resolved release plus selection evidence. Ordinary construction stays offline. -- Never order a date against an integer or treat every dated dataset as newer. - Newly discovered, unranked datasets are visible and explicitly selectable, - but cannot silently replace a verified selection. Explain the distinction - between latest verified and the current platform dataset selected explicitly - through the existing new-API discovery method. -- Unknown/custom assemblies can select their known dated timeline; ambiguous - providers/assemblies need an explicit choice. Species defaults keep their - current assembly, so tomato SL4.0 cannot roll back to dated SL3.0. Scope - comparisons by accession, provider and annotation coverage. -- Filtered `pyensembl available` shows the unified view; keep the existing - all-species overview. Refresh is explicit, and cached/bundled information - works offline. Add JSON output for this metadata view if it improves the - shared Python/CLI implementation. -- Let reference-name lookup consider installed dated releases without - downloading or rewriting anything. Preserve preference for existing numbered - installations unless an explicit latest policy selects otherwise. A dated-only - installation should be reusable, including older assemblies and known explicit - accession/provider cache layouts. - -## Integrity and annotation coverage - -- For new canonical dated annotation downloads, fetch the provider's md5sum.txt - and verify each GTF/cDNA/peptide before publication. Persist the source MD5, - manifest identity and provenance for newly acquired sources. Use datacache's - atomic validation/publication; preserve existing source-key paths. -- Existing complete caches take their old offline, read-only fast path: no - manifest requests, metadata migration, sidecar writes, reindex or reinstall. - Existing mirror behavior stays valid. Legacy sources lacking acquisition - digests must be described as unrecorded, not corrupt or silently rewritten. -- Add an explicit read-only verification API/CLI for local file integrity and - optional comparison with current upstream manifests. Distinguish local - corruption, missing files and changed upstream checksums. No automatic repair. - Serialize pinned checksums so a later download cannot silently change a pinned - dataset. Caller-requested overwrite remains explicit. -- Warn clearly for known subset annotations and expose that fact in discovery - metadata. Keep source declarations and source coverage authoritative. -- Add a real GTF regression with coordinate-sorted/interleaved feature rows, - including exon/CDS rows before transcript/gene rows, verifying query results - against grouped input. Do not write a test that only checks configuration. - -## Compatibility and verification - -- Keep all existing reference labels, paths, files, indexes and schema versions. - Do not alias or merge numbered and dated caches even when contents agree. -- Exercise numbered/dated selection across species, older assemblies, patched - names and accessions; scoped latest choices; unranked/subset/mismatched - coverage; updated listing metadata; API records; offline/read-only caches; - JSON/pickle pinning; CLI argument combinations; and installed dated lookup. -- Use a local HTTP fixture for checksum success, missing/ambiguous manifests, - corrupt transfers, upstream revisions and retry/concurrency behavior. Prove - failures preserve already installed files and indexes byte-for-byte. -- Capture real source comparisons and install/query tiny data through the new - selection and integrity routes. Re-run actual old-cache fixtures and the - existing argument/cache matrix. -- Add any new fixtures to MANIFEST.in, run lint/full tests, source-distribution - checks, strict docs/link/example checks, and Python 3.11–3.14 CI. -- Reconcile #447's stale description with the implementation and link existing - downstream tracking issues; file any newly confirmed problems separately. - Optional website-release-label aliases remain outside this scope. -- Bump to 2.32.0, merge the elaborated PR after validation, deploy from clean - main, verify public artifacts, then rebase and finish PR #387. - -## Evidence and verification results - -- Complete-source comparison: human 110/115/116, mouse 116, and yeast 116 have - identical normalized GTF records to the scoped dated counterparts. Dog 116 - and Arabidopsis 63 match identifier sets but differ in GTF records. Human 114 - dated data omit 158,710 transcript IDs; fly differs. GRCh37/75 also differs, - and missing numbered ID versions are explicitly distinguished from bare IDs. -- All 60 dated datasets in the 52-record bundled catalogue publish checksums - for the selected GTF, cDNA and peptide filenames (live audit 2026-10-23). -- Normal latest selection prefers the newest frozen numbered release. Explicit - provider/coverage options restrict selection to the dated platform; within - one accession/provider the newest known non-subset date is selected. A new - uncompared listing cannot displace a frozen numbered release. -- 1,034 full-suite tests pass. The source archive independently checks all 133 - tracked test inputs and passes 269 offline tests, including real localhost - transfers. Strict docs check 26 pages/2,184 links; 16 tutorial examples pass. -- Integrity tests cover concurrent acquisition, corrupt transfers, changed - upstream/local bytes, explicit refresh, serialized pins, and exact legacy - cache preservation. Sorted-GTF tests compare real multi-isoform queries. -- No cache schema, source path, reference label, or existing default changes. - Numbered and mirror acquisition retain existing behavior. MD5 verification - is for accidental corruption, and never claims sequence equivalence from GTFs. -- Varcode's dated reference-string issue openvax/varcode#616 is closed. - Vaxrank dated CTA provenance remains tracked in openvax/vaxrank#662; it is - downstream work, not a reason to keep two PyEnsembl constructors.