feat(admin): add pipeline diagnostic script + extraction card UX improvements

- Add scripts/check_pipeline.py: read-only diagnostic for pricing pipeline
  row counts, date range analysis, HAVING filter impact, join coverage
- Add description field to all 12 workflows in workflows.toml
- Parse and display descriptions on extraction status cards
- Show spinner + "Running" state with blue-tinted card border
- Display start time with "running..." text for active extractions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Deeman
2026-03-05 15:40:12 +01:00
parent 0d8687859d
commit 6b7fa45bce
5 changed files with 239 additions and 3 deletions

View File

@@ -540,6 +540,7 @@ def _load_workflows() -> list[dict]:
"schedule": schedule,
"schedule_label": schedule_label,
"depends_on": config.get("depends_on", []),
"description": config.get("description", ""),
})
return workflows

View File

@@ -16,8 +16,9 @@
{% set wf = row.workflow %}
{% set run = row.run %}
{% set stale = row.stale %}
<div style="border:1px solid #E2E8F0;border-radius:10px;padding:0.875rem;background:#FAFAFA">
<div class="flex items-center gap-2 mb-2">
{% set is_running = run and run.status == 'running' and not stale %}
<div style="border:1px solid {% if is_running %}#93C5FD{% else %}#E2E8F0{% endif %};border-radius:10px;padding:0.875rem;background:{% if is_running %}#EFF6FF{% else %}#FAFAFA{% endif %}">
<div class="flex items-center gap-2 mb-1">
{% if not run %}
<span class="status-dot pending"></span>
{% elif stale %}
@@ -33,6 +34,15 @@
{% if stale %}
<span class="badge-warning" style="font-size:10px;padding:1px 6px;margin-left:auto">stale</span>
{% endif %}
{% if is_running %}
<span class="btn btn-sm ml-auto"
style="padding:2px 8px;font-size:11px;opacity:0.6;cursor:default;pointer-events:none">
<svg class="spinner-icon" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3">
<path d="M12 2a10 10 0 0 1 10 10" stroke-linecap="round"/>
</svg>
Running
</span>
{% else %}
<button type="button"
class="btn btn-sm ml-auto"
style="padding:2px 8px;font-size:11px"
@@ -41,9 +51,17 @@
hx-swap="outerHTML"
hx-vals='{"extractor": "{{ wf.name }}", "csrf_token": "{{ csrf_token() }}"}'
hx-confirm="Run {{ wf.name }} extractor?">Run</button>
{% endif %}
</div>
{% if wf.description %}
<p class="text-xs text-slate" style="margin-top:2px;margin-bottom:4px">{{ wf.description }}</p>
{% endif %}
<p class="text-xs text-slate">{{ wf.schedule_label }}</p>
{% if run %}
{% if is_running %}
<p class="text-xs mt-1" style="color:#2563EB">
Started {{ run.started_at[:16].replace('T', ' ') if run.started_at else '—' }} — running...
</p>
{% elif run %}
<p class="text-xs mono text-slate-dark mt-1">{{ run.started_at[:16].replace('T', ' ') if run.started_at else '—' }}</p>
{% if run.status == 'failed' and run.error_message %}
<p class="text-xs text-danger mt-1" style="font-family:monospace;word-break:break-all">