← Back to Pull requests

fix: remove a Grafana dashboard that plotted metrics this app never emits #76

Closed
unknown closed this pull request without merging on Oct 07, 2026 12:15 UTC
View on GitHub
unknown unknown commented on Oct 07, 2026 11:51 UTC
Author

Problem

deploy/grafana/ held a second, unwired Grafana dashboard (rag-cosmetics-overview, 12 panels) whose panels plotted metrics no exporter in this repository produces:

| Panel family | Series referenced | Emitted by this app |
|---|---|---|
| Latency distribution | rag_latency_p50/p95/p99 | no — only the rag_http_request_duration_seconds histogram |
| KV cache pressure | rag_kv_pressure | no |
| Cache hit rates | rag_cache_l1_hit_rate, rag_cache_l2_hit_rate | no — only raw counters rag_cache_hit_L1 / rag_cache_total |
| Evidence gate | rag_evidence_score_avg, rag_evidence_gate_pass_rate | no |
| Rewrite degradation | rag_rewrite_fallback_rate | no — only rag_rewrite_fallback |
| NLI | rag_nli_contradiction_rate | no — and it is a documented placeholder gauge |
| Degradation / admission | rag_degradation_count, rag_admission_rejected_total | no |
| GPU memory | nvidia_gpu_memory_used_bytes (DCGM) | no — this deployment runs no DCGM exporter |

It was cited by no document and mounted by no compose file (docker-compose.observability.yml mounts monitoring/grafana/), yet it was tracked, sat under the canonical deploy/ path, and shipped as loadable JSON.

Why this is P0

docs/evidence-map.md already names "citing a rag_ series the exporter does not emit" as a known claim risk, and docs/evidence-map.md:178 / docs/repository-truth-audit.md:138 assert the dashboard contract is "10 panels, emitted metrics only". This file was the one place in the repository where the forbidden claim actually existed as shipped configuration.

It survived because test_dashboard_only_references_emitted_metrics was scoped to a single hard-coded DASHBOARD_PATH — a guard that knows one location cannot police the tree.

Fix

  • Delete the three files under deploy/grafana/. No metric was added and no capability changed.

  • Widen the guard to the class of defect rather than the instance:

  • - test_no_second_dashboard_json_exists — the canonical directory is the only dashboard contract
    - test_every_dashboard_json_only_references_emitted_metrics — tree-wide, not single-path
    - test_no_dashboard_json_plots_non_rag_exporter_metrics — catches DCGM-style series, which are
    real* Prometheus series and therefore read as legitimate to a reviewer who does not know this deployment has no DCGM

    Verification

    The guard was validated against the defect, not just the fix — restoring the file fails all three:

    FAILED test_no_second_dashboard_json_exists
    FAILED test_every_dashboard_json_only_references_emitted_metrics
    FAILED test_no_dashboard_json_plots_non_rag_exporter_metrics
      AssertionError: deploy/grafana/dashboards/rag-overview.json: panel 'GPU0 显存使用'
      plots 'nvidia_gpu_memory_used_bytes', which no exporter in this repository produces
    

    With the removal: 72 passed in tests/monitoring/, 671 passed across tests/monitoring/ + tests/test_check_repo_consistency.py, scripts/check_repo_consistency.py passes, ruff check . clean.

    The canonical dashboard is untouched.

    🤖 Generated with opencode

    Diff: 391 lines (+293 / -98) across 4 files Reviewer: Xander-Xai Review duration: 24m
    All Vouch review confidence checks passed
    Residual risk 0.17 = Change Risk (0.43) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.43 · 391 lines diff across 4 files
    0.43
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.357
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #76"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 43.1% (MEDIUM) · Higher = larger blast radius
    43.1%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 17% · Safe to merge
    17%