Skip to content

fix(cut-photo): a GAF 2.1 header declares its GO release, in capitals - #1296

Merged
github-actions[bot] merged 2 commits into
developfrom
fix/gaf-2-1-header-keys
Nov 23, 2026
Merged

github-actions[bot] merged 2 commits into
developfrom
fix/gaf-2-1-header-keys

Conversation

@frapercan

Copy link
Copy Markdown
Owner

The bug

The photo build reads the GAF header with ^!([a-z][a-z-]*):, a lowercase-only key pattern. GOA's GAF 2.1 files capitalise their keys (!GO-version:, !Generated:). The 2.1 headers of cuts 160, 177 and 194 were therefore read as declaring no GO release, and their manifests record go_release_rule: cut_date with a header of {"gaf-version": "2.1"} only.

Read on 2026-11-23 from EBI's own files (byte-range read of each file's head), all three do declare one:

Cut Header line 7
160 !GO-version: http://purl.obolibrary.org/obo/go/releases/2016-10-29/go.owl
177 !GO-version: http://purl.obolibrary.org/obo/go/releases/2018-04-20/extensions/go-plus.owl
194 !GO-version: http://purl.obolibrary.org/obo/go/releases/2019-11-09/extensions/go-plus.owl

The production node found the disagreement: its pairing note (plans/GOA-ONTOLOGY-PAIRING.md in agent-farm) quoted the 160 header, which the photo manifest did not show.

The fix

  • The header reader. Keys are matched in any case and stored in lower case.
  • The generated date. A 2.1 file's Generated fills date_generated, as date-generated does in 2.2.
  • The go_release_rule docstring no longer says a GAF 2.1 declares nothing.
  • ADR-D59's paragraph on the rule is corrected in place, with the date.
  • A new test builds a photo from GOA 160's real header. It fails without the fix and passes with it.

What it changes

  • Graphs in the development store: none. Only one graph per cut is loaded, and it is the newest not after both the declared release and the cut's date.
  • The digests of the 160, 177 and 194 manifests change on a rebuild. The rule they name and the header they keep change; every count stays. The digests of 205, 211 and 227 do not change.
  • Where more graphs are loaded, as in production, the cut_date rule could have picked a graph newer than the declared one. The declared rule exists to prevent that.
  • Photos of 160, 177 and 194 should not be built in production before this is in.

Checks

  • The photo test files pass: test_cut_photo_build, test_cut_photo_formats and test_gaf_header_guard, 78 tests.
  • The lint gates pass: ruff format and check, smells, sets, and openapi refs.

The photo build read the GAF header with a lowercase-only key pattern.
GOA's GAF 2.1 files capitalise their keys (!GO-version:, !Generated:),
so the 2.1 headers of cuts 160, 177 and 194 were read as declaring no
GO release, and the photos recorded the cut_date rule. They all
declare one; read from EBI's files on 2026-11-23:
- 160: releases/2016-10-29
- 177: releases/2018-04-20
- 194: releases/2019-11-09

Keys are now matched in any case and stored in lower case, and a 2.1
file's Generated date fills date_generated as date-generated does in
2.2.

In the development store no graph changes: one graph per cut is loaded,
and it is the newest not after both the declared release and the cut's
date. The manifests of 160, 177 and 194 do change (the rule they name
and the header they keep), so their digests change on a rebuild while
every count stays. Where more graphs are loaded, the cut_date rule could
have picked a graph newer than the one the file declares, which is what
the declared rule exists to prevent.

ADR-D59's paragraph on the rule said a GAF 2.1 declares none; it is
corrected in place, with the date.

A new test builds a photo from GOA 160's real header and fails without
the fix.
@codecov

codecov Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.69%. Comparing base (3eca787) to head (7758b4a).
⚠️ Report is 1 commits behind head on develop.

❌ Your project check has failed because the head coverage (83.97%) is below the target coverage (85.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #1296   +/-   ##
========================================
  Coverage    85.69%   85.69%           
========================================
  Files          471      471           
  Lines        37374    37374           
========================================
  Hits         32026    32026           
  Misses        5348     5348           
Files with missing lines Coverage Δ
protea/core/cut_photo/build.py 94.17% <ø> (ø)
protea/core/cut_photo/photo_io.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Base automatically changed from integration/three-families to develop November 23, 2026 10:23
@frapercan
frapercan marked this pull request as ready for review November 23, 2026 12:12
github-actions Bot pushed a commit that referenced this pull request Nov 23, 2026
… the cut (#1297)

## The bug

`protein.sequence_id` and `protein.taxonomy_id` are today's UniProt
entry. Four readers used them on photo windows:

| Reader | Effect in development | Effect in production |
|---|---|---|
| Prediction: alignment and length inputs (batch and unified path) | 12
features silently null | today's sequence, published after the cut |
| Prediction: taxonomy inputs | 6 features silently null | today's
organism |
| Transitions export: the queries a window asks about | zero queries for
every photo window | today's sequence ids |
| Target FASTA and its declared query set entries | targets without a
sequence | today's sequences in the scored file |

## The fix

- On a run whose annotation set a photo loaded (`photo_of`), the readers
take the member's sequence (`cut_photo_member.sequence_md5`) and taxon
(`cut_photo_member.taxon_id`).
- They do it through two shared functions in `_photo_sequences.py`:
`photo_sequences` and `photo_taxa`.
- A run over a set no photo loaded reads today's entry, as before.
- Uploaded query sets keep their own sequences.

## Tests

- **New: `tests/test_a_photo_run_reads_the_cut_inputs.py`** (test
database).
- It gives a member a different sequence and taxon today than at the
cut, so a leaking reader returns the wrong values instead of nothing,
whatever the environment.
  - Three of its four tests fail without the fix.
- **Changed: the fake session of
`tests/test_the_queries_a_window_asks_about.py`** now answers the photo
lookup with none, since that universe has no photos.
- **Regression run:** 54 test files on prediction, export, transitions,
features, retrieval, queries and targets: 850 passed, 2 skipped. The
lint gates pass.

## Not in this change (next)

- **Other readers that still read today's entries:**
- the legacy training dump and the mini-job feature export
(`training_dump/_data_loaders.py`,
`export_minijobs/_export_features_batch.py`);
  - the InterProScan input (`run_interproscan_batch.py`).
- **The information accretion feature.** It needs
`information_accretion_set` as a dated reference first.
- **The taxonomy tree,** which waits for the author's choice. Until it
exists, the taxonomy distances stay empty even with the right taxon.
- **A re-scoring of the 211->227 ProtT5-XL set**, to record the coverage
of the 18 features per window.

This is part of the closure plan's first wave (dated inputs), together
with #1296.


## Verified in the development universe

The branch's readers were run against the development store, without
deploying it: 500 targets of 211->227 sampled with seed 0, the window's
start set 453f8cf5, photo b98ba58b.

| Reader | At the cut (this branch) | Today's entry (before) |
|---|---|---|
| Sequences | 500 of 500 | 0 of 500 |
| Taxa | 499 of 500 known | 0 of 500 known |
@github-actions
github-actions Bot merged commit 798210f into develop Nov 23, 2026
21 of 23 checks passed
frapercan added a commit that referenced this pull request Nov 24, 2026
The six photos were rebuilt at develop 798210f, which reads the GO
release a GAF 2.1 header declares (#1296), and they were loaded into the
clean store. Their data files are byte-identical to the earlier builds and
every count is unchanged, so the figures and the member and row tables do
not move. The manifest digests do, because each manifest records the
revision that built it and, for 160, 177 and 194, the GO release its GAF
declares.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant