Skip to content

Community scouting + GTDB grounding + computational-provenance; 29 new community records #76

Community scouting + GTDB grounding + computational-provenance; 29 new community records

Community scouting + GTDB grounding + computational-provenance; 29 new community records #76

name: label-correspondence
# Phase 2 (enforcing): `just validate-products` is now a BLOCKING gate — an
# id↔label MISMATCH / ID_NOT_FOUND / UNKNOWN_PREFIX in the community YAMLs or
# KGX products fails the build. Curator-accepted residuals stay green via the
# `exceptions:` allow-list in conf/id_label_targets.yaml (OK_EXCEPTION; restored
# in issue #134). The drift report (reports/label_drift.tsv) is still generated
# and uploaded as an artifact for triage, even when the gate passes.
#
# NOT enabled here: `just validate-terms-all` (the LinkML-native binding gate).
# linkml-term-validator has no exceptions mechanism, so it fails on the 34
# curator-accepted residuals that `validate-products` accepts (e.g. obsolete
# GO:0055114, CHEBI mislabels needing minting, taxa absent from the OAK
# snapshot). Enabling it as blocking is deferred until those residuals are
# minted/cleaned (see NEXT_TASKS.md and the chebi-mislabels backlog) or the
# vendored validator grows a shared waiver the LinkML tool can consume.
on:
pull_request:
paths: &trigger_paths
- "kb/communities/**"
- "output/kgx/**"
- "src/communitymech/schema/**"
- "scripts/validate_id_label_correspondence.py"
- "conf/id_label_targets.yaml"
- ".github/workflows/label-correspondence.yaml"
push:
branches: [main]
paths: *trigger_paths
workflow_dispatch:
permissions:
contents: read
jobs:
# Cross-repo durability guard: the validator is vendored byte-identical across
# the Mech repos, so fail fast if this copy drifts from its pinned sha256.
# Fast and dependency-free (no uv / OAK), so it blocks even though the drift
# report below is non-blocking.
validator-pin:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Verify validator pin
run: sha256sum -c scripts/.validate_id_label_correspondence.sha256
label-correspondence:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: extractions/setup-just@v3
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: "latest"
enable-cache: true
- name: Install dependencies
run: uv sync --frozen
# Cache OAK sqlite ontologies (NCBITaxon/ENVO/CHEBI/GO) across runs.
- name: Cache OAK ontologies
uses: actions/cache@v4
with:
path: ~/.data/oaklib
key: oaklib-${{ runner.os }}-v1
# Always generate + upload the drift report first, so the triage artifact
# exists even when the enforce step below fails the build.
- name: Generate id↔label drift report
run: just report-label-drift
- name: Upload drift report
if: always()
uses: actions/upload-artifact@v4
with:
name: label-drift-report-${{ github.run_id }}
path: reports/label_drift.tsv
if-no-files-found: warn
# Phase 2 blocking gate: fail on any id↔label error-class verdict
# (MISMATCH / ID_NOT_FOUND / UNKNOWN_PREFIX / ADAPTER_ERROR /
# MISSING_COLUMN). Curator-accepted residuals pass as OK_EXCEPTION.
- name: Enforce id↔label correspondence
run: just validate-products