Skip to content

Migrate build system to owlmake - #2768

Merged
jamesamcl merged 6 commits into
masterfrom
owlmake-migration
Aug 26, 2026
Merged

jamesamcl merged 6 commits into
masterfrom
owlmake-migration

Conversation

@jamesamcl

Copy link
Copy Markdown
Member

No description provided.

Copy link
Copy Markdown
Member Author

Review — owlmake migration (head eaa923f)

Advisory review of the migration, checked against the deleted src/ontology/Makefile, the plan (owlmake.yaml), the rewritten workflows/docs, and the owlmake executor source. Ontology content is untouched: src/ontology/efo-edit.owl and src/ontology/imports/ are byte-identical to master. Findings below are from static reading of the plan, the old Makefile, and owlmake's source — no om binary was run against this branch, so command-level claims cite the code paths they were read from.

What's solid

  • No frozen run inputs. Zero hardcoded dates in the plan; version: 3.93.0 appears once as a recorded default with version_file: src/ontology/version.txt read at run time, and every version IRI uses {version}/{clock} placeholders. The MIR/IMP parameter space is declared via refresh_groups.
  • Target parity is nearly complete. Every release artefact, the full QC surface (11 SPARQL verify checks, 7 reports, label-synonym-dup and mondo-obsolete checks), all 14 imports with their per-ontology quirks (mondo HGNC auto-exclude, oba RO:0000052, pr rename/exclude, hancestro exclude), components, diffs, trait reports and allocate-definitive-ids are encoded, with reasoner flags matching the old recipes.
  • Clean tree. No live references remain to odk.sh, bin/robot, jars, owltools, bubastis, migration2019/, validation_flags.owl, ols/, src/metadata/, Docker/Travis/GitLab files. Docs and agent specs were rewritten to om commands.
  • Temp-ID allocation is intact. om allocate-definitive-ids in the workflow is valid even though it looks like a nonexistent subcommand: an unknown first token routes to om make <token> (default_to_make, owlmake src/cli.rs), landing on the plan's allocate-definitive-ids target, whose mint step pins EFO_099, the Automation range and src/ontology/efo-idranges.owl. The grep EFO_099 guard and push step are preserved. Spelling it om make allocate-definitive-ids would make this self-evident.

Major — plan gaps that break the plan-only acceptance criterion

  1. mirror/hpoa.owl and mirror/mondo-owl.owl have no producer in the plan. components/d2p_hpoa.ttl and d2p_mondo-owl.ttl (owlmake.yaml:1420–1439) name them as inputs, but the plan's 14 mirror_from entries cover only the import mirrors. The old build fetched these two via get_mirrors.sh (retained in the tree but never named by the plan). On a fresh clone the D2P/disease_to_phenotype surface cannot be built from the plan alone, and since both ttls sit in the IMP refresh group, om refresh-imports fails with no in-plan remedy.
  2. Two inert targets reference SPARQL files that don't exist on this branch or on master: build/fbbt-self-xref.txt → src/sparql/remove-self-xrefs.sparql (owlmake.yaml:1411) and remove-fbbt-self-xref → src/sparql/remove-fbbt-xrefs.ru (owlmake.yaml:1816). These were dead Makefile rules (old Makefile ~465–469) that ingest copied; the plan now claims work it can never do. Drop them (or restore the files).
  3. The dump_% / preserve-axioms pipeline is absent from the plan (old Makefile 112–141: filtered-%-mirror.owl, efo-edit-without-%.owl, remaining-%.ofn, preserve-axioms-%). It is instantiable today — preserve_{chebi,cl,fbbt,hp,obi}_axioms.sparql all exist in src/sparql/ — so five previously runnable dump_X targets can no longer be named. If the pipeline is deliberately retired, the preserve SPARQL files should go with it; carrying the queries without the rules leaves it half-deleted.

Important — the import docs contradict each other about -B

The PR rewrites the import procedure two different ways:

  • .github/copilot-instructions.md and .github/agents/EFO-importer.md: refresh the mirror explicitly (om make mirror/<x>.owl -B), then regenerate the import.
  • .claude/agents/efo-importer.md and docs/Import_terms_from_another_ontology.md: a single om make imports/<x>_import.owl -B, claiming -B "refreshes the plan-named mirror prerequisite as well".

The one-step claim is wrong per the executor: when an import module is built, the mirror is acquired via ensure_mirror(repo, imp, repo.refresh_mirrors) — gated by the mirrors refresh group (default: keep), not by -B. A mirror already on disk is reused; it is fetched only when absent. To actually refresh a mirror you need the mirror target / --rebuild mirrors (MIR=true). All four docs should describe the same two-step procedure so the importer agent doesn't silently regenerate imports from a stale mirror.

Minor

  • CI pinning is inconsistent: qc.yml/allocate-definitive-ids.yml use the floating ghcr.io/ebispot/owlmake:0.2-python tag (no digest; a repush changes CI silently, and nothing verifies it satisfies the plan's min_owlmake_version: 0.2.2), while copilot-setup-steps.yml downloads releases/latest — even less pinned.
  • HGNC auto-exclude echo bug: owlmake.yaml:40/:636 — $(wc -l < imports/mondo_import.owl.hgnc.txt ...) inside the echo wasn't path-rewritten to src/ontology/... like the rest of the step chain, so the reported count is always empty (cosmetic; the exclusion itself uses the correct path).
  • Default goal drift: the Makefile's all included all_imports; the plan's default_targets omits it (the explicit all target still has it). Presumably deliberate now that imports are behind the IMP group, but worth stating in the PR description. default_targets also lists the four build/ artefacts release already needs.
  • Leftovers: src/ontology/neoplasm.Makefile is retained but unrepresented in the plan (decide: delete or plan it); docs/odk-workflows/components.md still documents ODK Makefile machinery; qc.yml still says # Basic ODK workflow and exports an unused DEFAULT_BRANCH.

Verdict

The hard parts — run-input hygiene, target parity for the release/QC/import surfaces, workflow rewiring, temp-ID allocation — are done right. The three major items are the gap to "builds from owlmake.yaml alone": two unproducible mirror inputs, two inert targets, and one dropped-but-instantiable pipeline. Fix or explicitly retire those (deleting their remnant files with them), reconcile the -B docs, and this looks ready to come out of draft.


Generated by Claude Code

jamesamcl pushed a commit that referenced this pull request Aug 26, 2026
…s,imports

Validating the previous commit's two-step procedure against om 0.2.2 showed
it does not work: mirrors AND imports are refresh groups the plan keeps by
default, and a kept target is reused even when named explicitly with -B
(om make mirror/hancestro.owl -B and om make imports/hancestro_import.owl -B
both no-op with "pinned (MIR=false)" / "pinned (IMP=false)"). The .github
docs' two-step spelling had the same defect, so all five documents now
describe the one verified command:

    om make imports/<ontology>_import.owl --rebuild mirrors,imports

which re-downloads the plan-named mirror and regenerates the import, touching
only the requested target's closure (verified: re-fetches hancestro.owl and
rewrites hancestro_import.owl byte-identically on an unchanged seed list).
The full-set spelling becomes om make all_imports --rebuild mirrors,imports.

Files: CLAUDE.md, .claude/agents/efo-importer.md,
.github/agents/EFO-importer.md, .github/copilot-instructions.md,
docs/Import_terms_from_another_ontology.md.

Refs #2768.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RMkT6NpLSiwerUD773q8V1
jamesamcl pushed a commit that referenced this pull request Aug 26, 2026
EFO and owlmake are developed together, so no environment pins an exact
owlmake release and no two environments follow different lines: the QC and
ID-allocation containers move from the 0.2-python image tag to latest-python,
and the copilot-setup binary download returns to releases/latest, matching
the README's editor install. owlmake.yaml's min_owlmake_version stays as the
floor that fails a build outright if an environment lags it.

Refs #2768.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RMkT6NpLSiwerUD773q8V1

Copy link
Copy Markdown
Member Author

Fixes for all the findings above are in #2769, targeted at this PR's branch — merging it folds them in here. Highlights beyond the review: the import-refresh procedure in every doc (both prior spellings) turned out not to work — -B doesn't override the kept mirrors/imports groups; the verified command is om make imports/<x>_import.owl --rebuild mirrors,imports. All environments now track one owlmake version line (latest/latest-python, floor-guarded by min_owlmake_version). One item needs an author decision: the hpoa mirror URL from get_mirrors.sh (data.monarchinitiative.org/ttl/hpoa.ttl) 404s upstream, so the d2p refresh needs a replacement source.


Generated by Claude Code

jamesamcl pushed a commit that referenced this pull request Aug 26, 2026
The disease-to-phenotype component's hpoa half was built from Monarch's
dipper RDF (data.monarchinitiative.org/ttl/hpoa.ttl), which no longer
exists — the URL 404s and no current Monarch product publishes the OBAN
association model the d2p-hpoa.ru query consumed. Rebuild that half from
the maintained upstream instead: the plan fetches
purl.obolibrary.org/obo/hp/hpoa/phenotype.hpoa (already the IRI the
component stamps as dc:source) into the mirrors group, and a new
stdlib-only repo script, src/scripts/hpoa_to_d2p.py, converts it to the
same Turtle shape the MONDO half produces: disease skos:related
phenotype with a reified axiom per pair. ORPHA ids map to ORDO IRIs
(the form EFO's disease branch carries, matching the 77k Orphanet
axioms in the committed component); OMIM and DECIPHER map to their
entry URLs; NOT-qualified rows are excluded; all aspects are kept,
matching the inheritance terms present in the committed component.
d2p-hpoa.ru is deleted with the OBAN model it queried, and
get_mirrors.sh goes too — every fetch it performed is now a plan rule,
and its hpoa line was the dead URL.

Verified with om 0.2.2: om make components/d2p_hpoa.ttl fetches
phenotype.hpoa (35 MB) and writes 284,267 distinct disease-phenotype
pairs (128 MB Turtle), which om convert parses and maps to axioms
cleanly in 26s.

Refs #2768.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RMkT6NpLSiwerUD773q8V1
claude added 4 commits August 26, 2026 16:54
Plan (owlmake.yaml):
- Add fetch rules for mirror/hpoa.owl and mirror/mondo-owl.owl (the two
  non-import fetches from get_mirrors.sh that had no producer in the plan)
  and register them in the mirrors refresh group, so the d2p components
  build on a fresh clone.
- Delete the two inert rules referencing SPARQL files that do not exist
  (build/fbbt-self-xref.txt, remove-fbbt-self-xref).
- Encode the merged-ontology-removal pipeline for its five instantiable
  ontologies (chebi, cl, fbbt, hp, obi): filtered-X-mirror.owl,
  efo-edit-without-X.owl, remaining-X.ofn, preserve-axioms-X.{ttl,owl}
  and phony dump_X, translated from the deleted Makefile lines 112-141.
- Fix the HGNC auto-exclude echo to read the terms file by its
  root-relative path, so the reported count is no longer empty.

Docs: make .claude/agents/efo-importer.md and
docs/Import_terms_from_another_ontology.md describe the same two-step
import refresh as the .github variants (refresh the mirror explicitly,
then rebuild the import): mirrors are kept by default, so -B on the
import target reuses the on-disk mirror rather than re-fetching it.
Rewrite docs/odk-workflows/components.md for the owlmake build.

Workflows: spell the ID-allocation step om make allocate-definitive-ids;
pin the copilot-setup owlmake download to v0.2.2 instead of latest; drop
qc.yml's stale ODK header and unused DEFAULT_BRANCH.

Refs #2768.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RMkT6NpLSiwerUD773q8V1
…s,imports

Validating the previous commit's two-step procedure against om 0.2.2 showed
it does not work: mirrors AND imports are refresh groups the plan keeps by
default, and a kept target is reused even when named explicitly with -B
(om make mirror/hancestro.owl -B and om make imports/hancestro_import.owl -B
both no-op with "pinned (MIR=false)" / "pinned (IMP=false)"). The .github
docs' two-step spelling had the same defect, so all five documents now
describe the one verified command:

    om make imports/<ontology>_import.owl --rebuild mirrors,imports

which re-downloads the plan-named mirror and regenerates the import, touching
only the requested target's closure (verified: re-fetches hancestro.owl and
rewrites hancestro_import.owl byte-identically on an unchanged seed list).
The full-set spelling becomes om make all_imports --rebuild mirrors,imports.

Files: CLAUDE.md, .claude/agents/efo-importer.md,
.github/agents/EFO-importer.md, .github/copilot-instructions.md,
docs/Import_terms_from_another_ontology.md.

Refs #2768.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RMkT6NpLSiwerUD773q8V1
EFO and owlmake are developed together, so no environment pins an exact
owlmake release and no two environments follow different lines: the QC and
ID-allocation containers move from the 0.2-python image tag to latest-python,
and the copilot-setup binary download returns to releases/latest, matching
the README's editor install. owlmake.yaml's min_owlmake_version stays as the
floor that fails a build outright if an environment lags it.

Refs #2768.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RMkT6NpLSiwerUD773q8V1
The disease-to-phenotype component's hpoa half was built from Monarch's
dipper RDF (data.monarchinitiative.org/ttl/hpoa.ttl), which no longer
exists — the URL 404s and no current Monarch product publishes the OBAN
association model the d2p-hpoa.ru query consumed. Rebuild that half from
the maintained upstream instead: the plan fetches
purl.obolibrary.org/obo/hp/hpoa/phenotype.hpoa (already the IRI the
component stamps as dc:source) into the mirrors group, and a new
stdlib-only repo script, src/scripts/hpoa_to_d2p.py, converts it to the
same Turtle shape the MONDO half produces: disease skos:related
phenotype with a reified axiom per pair. ORPHA ids map to ORDO IRIs
(the form EFO's disease branch carries, matching the 77k Orphanet
axioms in the committed component); OMIM and DECIPHER map to their
entry URLs; NOT-qualified rows are excluded; all aspects are kept,
matching the inheritance terms present in the committed component.
d2p-hpoa.ru is deleted with the OBAN model it queried, and
get_mirrors.sh goes too — every fetch it performed is now a plan rule,
and its hpoa line was the dead URL.

Verified with om 0.2.2: om make components/d2p_hpoa.ttl fetches
phenotype.hpoa (35 MB) and writes 284,267 distinct disease-phenotype
pairs (128 MB Turtle), which om convert parses and maps to axioms
cleanly in 26s.

Refs #2768.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RMkT6NpLSiwerUD773q8V1

Copy link
Copy Markdown
Member Author

All fixes are now on this branch directly (#2769 was merged in, rebased — five commits on top of eaa923f). Two updates on the open items above:

  • hpoa source resolved: the dipper RDF (data.monarchinitiative.org/ttl/hpoa.ttl) is gone upstream and nothing current publishes its OBAN model, so the hpoa half of the d2p component is now built from the maintained phenotype.hpoa (the IRI the component already stamps as dc:source): the plan fetches it into the mirrors group and a new stdlib-only script, src/scripts/hpoa_to_d2p.py, emits the same skos:related + reified-axiom Turtle the MONDO half produces, with ORPHA ids mapped to the ORDO IRIs EFO's disease branch carries. d2p-hpoa.ru and get_mirrors.sh are deleted (every fetch the script did is a plan rule now). Verified with om 0.2.2: 284,267 distinct disease–phenotype pairs, and the output parses and maps to axioms cleanly.
  • owlmake versioning: every environment now tracks one line — latest-python for the CI containers, releases/latest for the copilot-setup binary and README install — with min_owlmake_version as the floor.

Generated by Claude Code

@jamesamcl
jamesamcl marked this pull request as ready for review August 26, 2026 15:57
jamesamcl pushed a commit that referenced this pull request Aug 26, 2026
The previous fix rewrote the wc path inside the HGNC auto-exclude echo to
src/ontology/imports/mondo_import.owl.hgnc.txt on the reasoning that every
other plan path is repo-root-relative. Shell steps in the import pipeline
run from src/ontology, and text inside a command substitution is passed to
the shell verbatim, so the rewrite broke the very count it meant to fix.

Measured with om 0.2.2 on om make imports/mondo_import.owl: the rewritten
path prints "sh: cannot open src/ontology/imports/mondo_import.owl.hgnc.txt:
No such file" and an empty count (also observed in CI run 32986716429);
restored to imports/mondo_import.owl.hgnc.txt it prints "Auto-excluding
3606 HGNC terms from mondo import".

Refs #2768.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RMkT6NpLSiwerUD773q8V1
jamesamcl pushed a commit that referenced this pull request Aug 26, 2026
The previous fix rewrote the wc path inside the HGNC auto-exclude echo to
src/ontology/imports/mondo_import.owl.hgnc.txt on the reasoning that every
other plan path is repo-root-relative. Shell steps in the import pipeline
run from src/ontology, and text inside a command substitution is passed to
the shell verbatim, so the rewrite broke the very count it meant to fix.

Measured with om 0.2.2 on om make imports/mondo_import.owl: the rewritten
path prints "sh: cannot open src/ontology/imports/mondo_import.owl.hgnc.txt:
No such file" and an empty count (also observed in CI run 32986716429);
restored to imports/mondo_import.owl.hgnc.txt it prints "Auto-excluding
3606 HGNC terms from mondo import".

Refs #2768.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RMkT6NpLSiwerUD773q8V1
The previous fix rewrote the wc path inside the HGNC auto-exclude echo to
src/ontology/imports/mondo_import.owl.hgnc.txt on the reasoning that every
other plan path is repo-root-relative. Shell steps in the import pipeline
run from src/ontology, and text inside a command substitution is passed to
the shell verbatim, so the rewrite broke the very count it meant to fix.

Measured with om 0.2.2 on om make imports/mondo_import.owl: the rewritten
path prints "sh: cannot open src/ontology/imports/mondo_import.owl.hgnc.txt:
No such file" and an empty count (also observed in CI run 32986716429);
restored to imports/mondo_import.owl.hgnc.txt it prints "Auto-excluding
3606 HGNC terms from mondo import".

Refs #2768.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RMkT6NpLSiwerUD773q8V1

This branch was previously deployed

1 inactive deployment
github-pages — 14643b22 Deployed Sep 4, 2026 by jamesamcl via deploy #44
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.

2 participants