{% extends "data_hub/base_data_hub.html" %} {% block data_hub_content %}

System QA & Import Readiness

{{ stats.ingredients|default(0) }} ingredients · {{ stats.aliases|default(0) }} aliases · {{ stats.products|default(0) }} products
{# Progress bar #}
Initializing...
{# Results #}
{% if last_job and last_job.results %} {% set r = last_job.results %} {# Import Readiness #}
Import Readiness {{ r.import_readiness.passed }}/{{ r.import_readiness.total }}
{% for chk in r.import_readiness.checks %} {% endfor %}
{% if chk.ok %} {% else %}{% endif %} {{ chk.name }} {{ chk.detail }}
{# Pipeline Accuracy #}
Pipeline Accuracy {{ r.pipeline.pct }}% {{ r.pipeline.passed }}/{{ r.pipeline.total }} cases
{% if r.pipeline.failures %}
{% for f in r.pipeline.failures[:100] %} {% endfor %} {% if r.pipeline.failures|length > 100 %} {% endif %}
InputExpectedGotType
{{ f.input }} {{ f.expected }} {{ f.got }} {{ f.type }}
... and {{ r.pipeline.failures|length - 100 }} more
{% else %}
All cases passed
{% endif %}
{# Integrity Checks — 3 columns #}
Duplicate Canonicals {{ r.duplicates.total }}
{% if r.duplicates.duplicates %}
    {% for d in r.duplicates.duplicates[:20] %}
  • {{ d.count }} {{ d.names|join(' / ') }}
  • {% endfor %}
{% else %}
None found
{% endif %}
Orphaned Aliases {{ r.orphans.total }}
{% if r.orphans.orphans %}
    {% for o in r.orphans.orphans[:20] %}
  • "{{ o.alias }}" → id {{ o.ingredient_id }} missing
  • {% endfor %}
{% else %}
None found
{% endif %}
Product Shadows {{ r.shadows.total }}
{% if r.shadows.shadows %}
    {% for s in r.shadows.shadows[:20] %}
  • {{ s.product_name }} {{ s.ingredient_name }}
  • {% endfor %}
{% else %}
None found
{% endif %}
Last run: {{ last_job.finished_at[:19].replace('T',' ') }} UTC
{% else %}
No QA results yet. Click Run Full Check to begin. The pipeline test will check every canonical and alias in the database — expect 60-90 seconds.
{% endif %}
{% endblock %}