{% if domain %}{% endif %}
Triage Status Diff - Finite State Report
{% include "_design_system.html" %}
{% include "_console_shell.html" %}
{% endif %}
{% if render_mode != 'fragment' %}
{% endif %}
{% import "_console_macros.html" as fs with context %}
{# Defensive defaults #}
{% set summary = summary | default({}) %}
{% if summary is not mapping %}{% set summary = {} %}{% endif %}
{% set status_divergence = status_divergence | default([]) %}
{% set triaged_left_untriaged_right = triaged_left_untriaged_right | default([]) %}
{% set triaged_right_untriaged_left = triaged_right_untriaged_left | default([]) %}
{% set empty_side = empty_side | default(None) %}
{% set left_label = summary.get('left_label', 'Left') if summary is mapping else 'Left' %}
{% set right_label = summary.get('right_label', 'Right') if summary is mapping else 'Right' %}
{% set status_divergence_count = summary.get('status_divergence_count', 0) if summary is mapping else 0 %}
{% set triaged_left_untriaged_right_count = summary.get('triaged_left_untriaged_right_count', 0) if summary is mapping else 0 %}
{% set triaged_right_untriaged_left_count = summary.get('triaged_right_untriaged_left_count', 0) if summary is mapping else 0 %}
{# Leader direction — injected by the two-pass engine (§5.0). The PRIMARY
propagation is leader→laggard; the reverse is surfaced compactly. Defaults
keep the standalone path (no compound) rendering left→right. #}
{% set left_leads = left_leads | default(True) %}
{% set leader_label = leader_label | default(left_label) %}
{% set laggard_label = laggard_label | default(right_label) %}
{% set primary_triage = triaged_left_untriaged_right if left_leads else triaged_right_untriaged_left %}
{% set reverse_triage = triaged_right_untriaged_left if left_leads else triaged_left_untriaged_right %}
{% set primary_triage_count = (triaged_left_untriaged_right_count if left_leads else triaged_right_untriaged_left_count) %}
{% set reverse_triage_count = (triaged_right_untriaged_left_count if left_leads else triaged_left_untriaged_right_count) %}
{# The leader-direction status field on a primary row: left_status when the
left leads, right_status otherwise (mirror for the reverse worklist). #}
{% set primary_status_attr = 'left_status' if left_leads else 'right_status' %}
{% set reverse_status_attr = 'right_status' if left_leads else 'left_status' %}
{% if render_mode != 'fragment' %}
{{ fs.topbar(
crumbs=["Finite State", "Triage Status Diff"],
meta=[
{"label": "Left", "value": left_label},
{"label": "Right", "value": right_label},
{"label": "Generated", "value": generated_at or "—"},
],
controls=[],
) }}
{% endif %}
Triage Status Comparison
{{ left_label }} vs {{ right_label }}
{% if empty_side %}
{% if empty_side == 'both' %}
Both scopes had no findings data.
{% elif empty_side == 'left' %}
{{ left_label }} scope had no data — nothing to compare.
{% elif empty_side == 'right' %}
{{ right_label }} scope had no data — nothing to compare.
{% endif %}
{% else %}
{# Section intro: lede + scope tag #}
{{ status_divergence_count }} status conflicts ·
{{ triaged_left_untriaged_right_count }} triaged in {{ left_label }}, untriaged in {{ right_label }} ·
{{ triaged_right_untriaged_left_count }} the reverse.
{# "Safe to apply in bulk" strip when there are zero status conflicts; else
the conflict table FIRST (now with project_names owners). #}
{% if status_divergence_count == 0 %}
Safe to apply in bulk. {{ status_divergence_count }} status conflicts — wherever both sides triaged the same finding, their VEX decisions already agree, so copying {{ leader_label | short_scope }}'s dispositions can't overwrite a contradicting call.
Findings both sides triaged, but with different VEX statuses (including suppressed-vs-fixed divergence). Reconcile before bulk-applying.
Finding ID
Component
Severity
{{ left_label | short_scope }} Status
{{ right_label | short_scope }} Status
Project
{% for row in status_divergence %}
{% set sev_upper = (row.severity or '') | upper %}
{% set lstatus = (row.left_status or '') | upper %}
{% set rstatus = (row.right_status or '') | upper %}
{{ row.display_id or '—' }}
{{ row.component_name or '—' }}
{{ row.severity or '—' }}
{{ row.left_status or '—' }}
{{ row.right_status or '—' }}
{{ (row.project_names | join(', ')) if row.project_names else '—' }}
{% endfor %}
{% endif %}
{# PRIMARY propagation — "Sync N triage decisions to {laggard} — no
engineering". The WHOLE set is no-engineering (VEX, not code), so the
headline is framed as a SYNC, not a removal. But a propagation row's
leader status can be EXPLOITABLE (triaged but still actionable) — copying
that decision does NOT clear the finding from the laggard's queue. So the
"removable" claim is scoped to the removable subset only (Fix H / M2-4),
computed via selectattr over a FIXED removable status set. Distinct from
§02's code remediations: this ports triage DECISIONS from this transform's
own rows, so the two never double-count. #}
{% if primary_triage and primary_triage | length > 0 %}
{% set removable_statuses = ['RESOLVED', 'RESOLVED_WITH_PEDIGREE', 'NOT_AFFECTED', 'FALSE_POSITIVE'] %}
{% set removable_count = primary_triage | selectattr(primary_status_attr, 'in', removable_statuses) | list | length %}
Sync {{ primary_triage | length }} triage decision{{ '' if primary_triage | length == 1 else 's' }} to {{ laggard_label | short_scope }} — no engineering
Findings {{ leader_label | short_scope }} already assessed that {{ laggard_label | short_scope }} has not yet recorded — copy the decision, no re-analysis.{% if removable_count > 0 %} {{ removable_count }} of them clear the finding from {{ laggard_label | short_scope }}'s queue (a resolved or not-affected decision); the rest sync the assessment without closing it.{% endif %}
{% for component, rows in primary_triage | groupby('component_name') %}
{% set group_name = component or 'Unspecified component' %}
{% set crit = rows | selectattr('severity', 'eq', 'CRITICAL') | list | length %}
{% set high = rows | selectattr('severity', 'eq', 'HIGH') | list | length %}
{% set med = rows | selectattr('severity', 'eq', 'MEDIUM') | list | length %}
{% set low = rows | selectattr('severity', 'eq', 'LOW') | list | length %}
{# Group header counts ALL propagation decisions, not exact RESOLVED only
(Fix 4 / M2-3 / M2-4): a group of NOT_AFFECTED / FALSE_POSITIVE /
EXPLOITABLE / RESOLVED_WITH_PEDIGREE showed a misleading "Apply 0
RESOLVED". These are all DECISIONS to sync (a synced status can be
EXPLOITABLE — assessed but still actionable), so frame as a sync of
N decisions; the removable subset is surfaced in the worklist lede. #}
{% set tbl_id = 'tblTriage' ~ loop.index %}
{% set head_limit = 10 %}
{{ group_name }}Sync {{ rows | length }} decision{{ '' if rows | length == 1 else 's' }} → {{ laggard_label | short_scope }}
{% if crit %}{% endif %}
{% if high %}{% endif %}
{% if med %}{% endif %}
{% if low %}{% endif %}
{%- set parts = [] -%}
{%- if crit %}{% set _ = parts.append(crit ~ 'C') %}{% endif -%}
{%- if high %}{% set _ = parts.append(high ~ 'H') %}{% endif -%}
{%- if med %}{% set _ = parts.append(med ~ 'M') %}{% endif -%}
{%- if low %}{% set _ = parts.append(low ~ 'L') %}{% endif -%}
{{ parts | join(' · ') }}
{{ rows | length }}decisions
Finding ID
Severity
{{ leader_label | short_scope }}
{{ laggard_label | short_scope }}
Project
{% for row in rows %}
{% set sev_upper = (row.severity or '') | upper %}
{% set lead_status = (row[primary_status_attr] or '') | upper %}
head_limit %} class="mc-row-hidden"{% endif %}>
{{ row.display_id or '—' }}
{{ row.severity or '—' }}
{{ row[primary_status_attr] or '—' }}
Untriaged
{{ (row.project_names | join(', ')) if row.project_names else '—' }}
{% endfor %}
{% set hidden_count = (rows | length) - head_limit %}
{% if hidden_count > 0 %}
{% endif %}
Severity-ranked. Each carries a triage decision in {{ leader_label | short_scope }} that {{ laggard_label | short_scope }} has not yet recorded.
{% endfor %}
{% endif %}
{# Reverse direction — surfaced compactly (collapsed if none). #}
{% if reverse_triage and reverse_triage | length > 0 %}