Skip to content

Deterministic release-notes generation with a CI consistency gate (refs #2826) - #2827

Merged
jamesamcl merged 6 commits into
masterfrom
issue-2826
Sep 15, 2026
Merged

jamesamcl merged 6 commits into
masterfrom
issue-2826

Conversation

@jamesamcl

@jamesamcl jamesamcl commented Sep 15, 2026 •

Copy link
Copy Markdown
Member

Summary

Fixes the recurring release-notes corruption in #2826 (live classes announced as deleted, phantom new classes, counts disagreeing with the shipped reports) by making the notes a fully regenerable build artifact and gating them in CI. Nothing is hand-edited any more.

Root cause confirmed: bubastis.sh diffed the published efo.owl against a local build/efo.owl whose state (notably the CI-built, unpinned MONDO import and locally regenerated OBA/other mirrors) could differ from the committed release content, and the notes, reports and ontology artifacts were produced from different snapshots.

Changes

  • src/scripts/generate_release_notes.py + release_notes_template.txt — assembles the entire ExFactor Ontology release notes.txt from one build:
    • added/modified/deleted sections from the Bubastis diff of the previous versioned GitHub release asset (not the floating current alias) against build/efo.owl;
    • a new "Classes obsoleted in this version" subsection derived from the obsoletes.tsv (owl:deprecated) delta, showing each replacement — never IRI set-difference, so an obsoleted class can no longer be conflated with a deleted one;
    • the notes publish one flat obsoleted list: newly deprecated classes (with their replacements) together with classes genuinely absent from the build (e.g. merged away upstream), the latter labelled from the Bubastis diff, with their replacement looked up in the pinned MONDO mirror's own obsoletion data (Replaced by: none only when upstream records none);
    • hard consistency gates: refuses to write notes if a "deleted" class is still in obsoletes.tsv, a "new" class is not declared in the build, or Bubastis's own counts disagree with its diff.
  • make release_notes PREVIOUS_VERSION=X.Y.Z [RELEASE_DATE=…] — drives the above (fetches the previous release, runs Bubastis via the committed bin/bubastis_1_3.jar, computes labels/previous-obsoletes).
  • MONDO mirror pin — src/ontology/mondo_mirror_version.txt (currently the 2026-09-01 mondo-base release) with a mirror/mondo.owl make rule; qc.yml now uses it, so QC, release builds and the notes check all build the same MONDO import. Bump the file to move to a newer MONDO.
  • release-notes-check.yml — on any PR touching the notes: rebuild efo.owl strictly from committed sources, regenerate all reports and the notes (with the committed release date), and fail on any diff. Notes describing a snapshot other than the one being merged can no longer merge.
  • ORDER BY on the report queries (basic-report, class-count-by-prefix, edges, xrefs, synonyms) — report TSVs were emitted in engine hash order, so every regeneration reshuffled hundreds of thousands of unchanged rows; the gate needs byte-stable output, and report diffs become reviewable. One-time reshuffle cost paid in the 3.94.0 release PR.

Format changes to the notes (flagging for downstream consumers)

  • Header: Number of classes obsoleted: replaces Number of classes deleted: (changed/added lines unchanged).
  • Section 3 is now a single @Classes obsoleted in this version list (with Replaced by: lines); there is no deleted section any more — classes removed from the build appear as obsoleted entries, so consumers get one list to act on. Everything else keeps the historical Bubastis-derived format byte-for-byte.

Validation

Applied end-to-end to the pending 3.94.0 release (see #2824): regenerated from the committed sources, the generator reproduces the intended notes with a minimal diff that fixes exactly the defects reported in #2826, all consistency gates passing (MONDO_0011271, merged away upstream, is listed as obsoleted with its upstream replacement MONDO_0100100). obsoletes.tsv and label-synonym-duplicates.tsv came out identical to what was committed; efo-base.owl was byte-identical to the strict rebuild.

One finding from that run: MONDO_0011271 (rigid spine muscular dystrophy 1) is genuinely deleted, not a false positive — MONDO merged it upstream (monarch-initiative/mondo#9976) and it is absent from the build; the #2826 evidence for it relied on components/mondo_efo_import.owl, which is tracked but no longer merged into the build (its pipeline was removed in 3.88.0 — possibly worth untracking separately).

Refs #2826

🤖 Generated with Claude Code

jamesamcl and others added 3 commits September 15, 2026 12:51
… (refs #2826)

The release notes were produced by diffing the published efo.owl against a
local build that could drift from the committed release content, so live
classes were announced as deleted (#2826). Replace that with a single-pass,
regenerable pipeline:

- src/scripts/generate_release_notes.py assembles the whole notes file from
  one build: Bubastis diff (previous published release vs build/efo.owl) for
  added/modified/deleted sections, and the obsoletes.tsv delta - i.e. actual
  owl:deprecated annotations - for a new "Classes obsoleted in this version"
  section that distinguishes obsoleted (with replacement shown) from
  genuinely removed classes. It refuses to write notes whose inputs
  contradict each other (a "deleted" class still present as obsoleted, a
  "new" class not declared in the build).
- make release_notes PREVIOUS_VERSION=X.Y.Z drives it; the diff base is the
  versioned GitHub release asset, not the floating "current" alias.
- The MONDO mirror is pinned by src/ontology/mondo_mirror_version.txt (new
  mirror/mondo.owl rule); qc.yml now uses it, so QC, release builds and the
  notes check all build the same mondo import.
- release-notes-check.yml: on any PR touching the notes, rebuild everything
  from the committed sources and fail if the committed notes or reports
  differ from the regeneration - notes can no longer describe a snapshot
  other than the one being merged.

The header gains a "Number of classes obsoleted" line and section 3 now has
explicit obsoleted vs deleted subsections; everything else keeps the
historical Bubastis-derived format.

Co-Authored-By: Claude Fable 5 <[email protected]>
The report TSVs were emitted in engine hash order, so every regeneration
reshuffled thousands of unchanged rows - unreviewable diffs, and a
regenerate-and-compare consistency check would false-fail. ORDER BY on each
report query (obsoletes and obsolete_gwas already had it) makes report diffs
show only real changes. One residual: basic-report's group_concat cell
ordering is unspecified by SPARQL, but is stable for the pinned bin/robot.

Co-Authored-By: Claude Fable 5 <[email protected]>
jamesamcl and others added 3 commits September 15, 2026 13:11
Drop the "@classes deleted from this version" subsection and the deleted
header count: EFO's change log for consumers is about obsoletions (with
their replacements), and a "deleted" list is exactly what led consumers to
retire mappings incorrectly (#2826). Classes genuinely absent from the
build are still detected - the generator prints them to stderr and still
refuses to run if a supposedly deleted class remains in obsoletes.tsv.

Co-Authored-By: Claude Fable 5 <[email protected]>
Classes genuinely gone from the build (e.g. merged away upstream) are now
published as further entries of "@classes obsoleted in this version",
labelled from the Bubastis diff, with "Replaced by: none" when no
replacement is recorded in EFO. One list for consumers to act on; the
obsoleted header count includes them.

Co-Authored-By: Claude Fable 5 <[email protected]>
New optional --upstream-obsoletes input, fed by a make rule that runs the
obsoletes query over the pinned MONDO mirror: a class that vanished from
the build (merged away upstream) now shows its upstream IAO_0100001
replacement in the obsoleted list instead of "Replaced by: none".

Co-Authored-By: Claude Fable 5 <[email protected]>
@jamesamcl
jamesamcl merged commit 4b3180d into master Sep 15, 2026
1 check passed
jamesamcl added a commit that referenced this pull request Sep 15, 2026
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