{# ── Judge / LLM status strip ─────────────────────────────────────────────── #}
LLM status:
{% if ollama_available %}
Ollama running — local inference, no egress
{% else %}
Ollama not detected
{% endif %}
{% if api_key_available %}
ANTHROPIC_API_KEY set — consent required before use
{% endif %}
CLI: tes patterns · tes ask "…"
{% if cache.get('legacy_rows_excluded') %}
{{ cache.legacy_rows_excluded }} legacy session{{ "s" if cache.legacy_rows_excluded != 1 }} left out of this
analysis (legacy: overcounted, not comparable; scored before 0.15).
tes rescore recovers those whose transcript still exists.
{% endif %}
{% if not cache.get('valid') %}
{# ── Below-floor / not enough sessions ────────────────────────────────────── #}
Not enough sessions for pattern analysis yet.
{{ cache.get('status', 'Pattern analysis requires at least 30 content sessions.') }}
Current: {{ cache.get('n_sessions', 0) }} content sessions —
need {{ cache.get('n_content_sessions_needed', 30) }} to activate clustering.
Descriptive only — not predictive, not quality labels.
{{ cache.get('domain_of_validity', '') }}
Archetypes reflect measured differences in session size, context-building stage, and waste presence
— they do not rate whether sessions were efficient or "good."
{{ cache.anomaly_count }} of {{ cache.n_sessions }} sessions ({{ "%.1f"|format(cache.anomaly_pct) }}%)
are statistical outliers for their cluster (Tukey outer fence on centroid distance).
Anomalies are sessions unusually far from their archetype centroid —
not failures, just statistically atypical. Run tes patterns in the CLI for per-session details.
{% endif %}{# end valid #}
{# ── Ask panel (shown in both valid and invalid states; floor enforced in backend) ── #}
Ask about your sessions
Answers are grounded in your measured metrics only.
{% if not cache.get('valid') %}
Pattern analysis not available yet (below 30-session floor) — corpus stats are still provided.
{% endif %}
{% if ollama_available %}
Using local Ollama — no data leaves your machine.
{% elif api_key_available %}
Ollama not detected. API path available below (sends metrics only — no session content).
{% else %}
No LLM detected. Start Ollama or set ANTHROPIC_API_KEY.
{% endif %}
{# API consent — only shown when Ollama is absent and an API key is available #}
{% if not ollama_available and api_key_available %}
What will be sent: corpus stats, cluster descriptions, anomaly counts.
What will NOT be sent: session content, code, tool outputs, file paths.