{% extends "base.html" %} {% from "partials/icons.html" import icon %} {% block title %}Sraosha — Compliance{% endblock %} {% block breadcrumbs %}

Compliance

Team validation health over the last 30 days

{% endblock %} {% block content %}
{% if show_estimated_banner %}
{% if snapshot_banner_soft %}{{ icon("clock", "w-5 h-5 flex-shrink-0 mt-0.5 text-sky-600 dark:text-sky-400") }}{% else %}{{ icon("exclamation-triangle", "w-5 h-5 flex-shrink-0 mt-0.5") }}{% endif %}

Scores are estimated from live validation runs

No snapshot row exists in compliance_scores yet. The Celery beat task compliance-compute-daily persists rolling 30-day snapshots for auditing. This banner clears after the first successful write.

{% elif snapshot_stale %}
{{ icon("clock", "w-5 h-5 flex-shrink-0 text-gray-500") }}

Compliance snapshots may be stale

Last computed {{ kpis.last_computed_rel or "—" }}. Ensure the periodic compliance job is running.

{% endif %}
{{ icon("chart-bar", "h-6 w-6") }}

Org average

{% if kpis.org_avg is not none %}{{ "%.1f" | format(kpis.org_avg) }}%{% else %}—{% endif %}

Mean score across teams with data

{{ icon("shield-check", "h-6 w-6") }}

Teams tracked

{{ kpis.teams_tracked }}

Registered in Sraosha

{{ icon("exclamation-triangle", "h-6 w-6") }}

Needs attention

{{ kpis.teams_needing_attention }}

Score < 70% or owned contracts with no runs

{{ icon("x-circle", "h-6 w-6") }}

Violations (30d)

{{ kpis.total_violations_30d }}

Failed + error validation runs

{{ icon("clock", "h-6 w-6") }}

Last snapshot

{{ kpis.last_computed_rel or "Never" }}

Latest Celery compliance write

{% if has_teams and contracts_unlinked > 0 %}
{{ icon("exclamation-triangle", "w-5 h-5 flex-shrink-0 mt-0.5") }}

Some contracts are not linked to a team

{{ contracts_unlinked }} contract(s) have no team_id and are excluded from the leaderboard. Edit each contract or set x-sraosha.team_id in YAML. Manage teams

{% endif %} {% if not has_teams %}
{{ icon("shield-check", "mx-auto h-12 w-12 text-gray-400") }}

No teams registered

{% if contracts_unlinked > 0 %}

You have {{ contracts_unlinked }} contract(s), but no teams yet. Create teams under Settings → Teams, then link each contract by setting x-sraosha.team_id to that team’s UUID (or open a contract and pick a team).

{% else %}

Create teams under Settings → Teams, then assign contracts by setting x-sraosha.team_id or choosing a team when editing a contract. Validation scores roll up only for linked contracts.

{% endif %} Browse contracts
{% else %}

Team leaderboard

Expand a row for per-contract pass rates (rolling 30d)

Rank Team Source Trend Score Contracts Violations (30d)
No teams match your filter.

{{ icon("document", "h-5 w-5 text-gray-500") }} How scoring works

  • Scores use validation runs from the last 30 days (UTC), scoped to contracts owned by each team.
  • Snapshot rows are written by the scheduled compliance job; Live is computed directly from the database if no snapshot exists yet.
  • Pass rate is passed runs ÷ total runs. Violations count failed and error outcomes.

Lowest pass-rate contracts

Rolling 30d, contracts with an owner team

{% if at_risk %} {% else %}

No contracts with runs in the last 30 days.

{% endif %}

Recent validation failures

Failed or error runs (30d)

{% if recent_failures %}
    {% for f in recent_failures %}
  • {{ icon("x-circle", "h-5 w-5 flex-shrink-0 text-rose-500 mt-0.5") }}
    {{ f.title }}

    {{ f.team or "—" }} · {{ f.status }} · {{ f.when }}

  • {% endfor %}
{% else %}

No failures in the last 30 days.

{% endif %}
{% if not has_any_runs %}

No validation activity yet

Trigger runs from CI, the CLI, or schedules to populate compliance metrics.

{% endif %}
{% endif %}
{% endblock %}