{% extends "base.html" %} {% block title %}Request {{ req.request_id[:12] }} - MoralStack{% endblock %} {% block content %} {% if path_badge_info %}
Percorso esecuzione {{ path_badge_info.label }} {% if proxy_output_info and proxy_output_info.final_text_source %} Fonte output finale: {{ proxy_output_info.final_text_source }} {% endif %}
{% endif %}
Domain {{ req.domain or '—' }}
Created {{ req.created_at | fmtdate }}
{% if req.get('conversation_id') or req.get('turn_index') is not none or req.get('parent_request_id') %}
Conversation {% if req.get('conversation_id') %} id={{ req.get('conversation_id') }} {% endif %} {% if req.get('turn_index') is not none %}turn={{ req.get('turn_index') }}{% endif %} {% if req.get('parent_request_id') %} parent={{ req.get('parent_request_id')[:12] }}… {% endif %}
{% endif %}
{% if conversation_context %} {% set state = conversation_context.state or {} %} {% set summary = state.get('state_summary_json__parsed') or {} %} {% set meta = conversation_context.meta_json__parsed or {} %} {% set proxy = conversation_context.proxy_event or {} %} {% set state_cft = state.get('cached_from_turn') %} {% set meta_cft = meta.get('cached_from_turn') %}

Conversation context

Turn {{ conversation_context.turn_index if conversation_context.turn_index is not none else '—' }} / {{ conversation_context.turn_count }}
Posture (out) {% set posture = state.get('posture') or summary.get('last_governance_posture') or meta.get('governance_posture') %} {% if posture %}{{ posture }}{% else %}—{% endif %}
Cached {% if state.get('was_cached') or meta.get('was_cached') %} yes {% set cft = state_cft if state_cft is not none else meta_cft %} {% if cft is not none %} from turn {{ cft }}{% endif %} {% else %}no{% endif %}
Refresh required {% if state.get('refresh_required') %}yes{% else %}no{% endif %}
{% if state.get('refresh_reason') %}
Refresh reason {{ state.get('refresh_reason') }}
{% endif %}
{% if conversation_context.siblings and conversation_context.siblings | length > 1 %}

All turns in conversation

{% for s in conversation_context.siblings %} {% endfor %}
TurnRequestDomain
{{ s.turn_index if s.turn_index is not none else '—' }} {% if s.is_current %}{{ (s.request_id or '')[:12] }} (current) {% else %}{{ (s.request_id or '')[:12] }}{% endif %} {{ s.domain or '—' }}
{% endif %} {% if conversation_context.ledger_events %}

Ledger activity (this turn)

{% for ev in conversation_context.ledger_events %} {% endfor %}
OpOutcomeSimilarityReasonFrom turn
{{ ev.operation or '—' }} {{ ev.outcome or '—' }} {% if ev.similarity is not none %}{{ "%.3f" | format(ev.similarity) }}{% else %}—{% endif %} {{ ev.reason or '—' }} {{ ev.from_turn if ev.from_turn is not none else '—' }}
{% endif %} {% if conversation_context.session_events %}

Session store activity (this turn)

{% for ev in conversation_context.session_events %} {% endfor %}
OpOutcome
{{ ev.operation or '—' }} {{ ev.outcome or '—' }}
{% endif %}
View full conversation Export conversation
{% endif %} {% if execution_summary %}

Execution summary

Path {{ execution_summary.path_badge }} {% if path_badge_info %} ({{ path_badge_info.label }}) {% endif %}
Total deliberative cycles {{ execution_summary.total_cycles }}
Converged {{ 'Yes' if execution_summary.converged else 'No' }}
{% if execution_summary.estimation_mode %}
Risk estimator mode {% if execution_summary.estimation_mode == 'parallel' %} Parallel (3 mini-estimators) {% else %} {{ execution_summary.estimation_mode }} {% endif %}
{% endif %}
{% endif %} {% if runtime_decision_obs %}

Execution strategy

Structured runtime posture from decision traces (risk, retrieval context, per-cycle summaries). Scheduler / speculative / gating fields appear here as they are emitted.

{% set es = runtime_decision_obs.get('execution_strategy') or {} %} {% set ra = es.get('risk_assessment') or {} %} {% set rac = es.get('request_analysis_context') or {} %}
{% if ra.get('risk_score') is not none %}
Risk score (assessment trace) {{ ra.get('risk_score') }} {% if compliance_fast_path_panel and compliance_fast_path_panel.risk_estimation_used_for_decision is sameas false %} calcolato ma non usato per la decisione {% endif %}
{% endif %} {% if ra.get('risk_category') %}
Risk category {{ ra.get('risk_category') }}
{% endif %} {% if ra.get('risk_policy_action') %}
risk_policy_action {{ ra.get('risk_policy_action') }}
{% endif %} {% if es.get('estimation_mode') %}
Estimation mode {{ es.get('estimation_mode') }}
{% endif %} {% if rac.get('constitution_domain') %}
Constitution domain (request analysis) {{ rac.get('constitution_domain') }}
{% endif %} {% if rac.get('relevant_principles_count') is not none %}
Principles retrieved {{ rac.get('relevant_principles_count') }}
{% endif %} {% if rac.get('prefilter_cache_status') %}
Domain prefilter cache {{ rac.get('prefilter_cache_status') }} {% if rac.get('prefilter_keywords_changed') %} keywords invalidated {% endif %} {% if rac.get('prefilter_cache_reason') %} ({{ rac.get('prefilter_cache_reason') }}) {% endif %} {% if rac.get('prefilter_keywords_fingerprint_prefix') %} fp:{{ rac.get('prefilter_keywords_fingerprint_prefix') }}… {% endif %}
{% endif %} {% set rpe = es.get('relevant_principles_events') or {} %} {% if rpe.get('retrieved_count') %}
Relevant principles retrieval (request-scoped) yes ({{ rpe.get('retrieved_count') }} event)
{% endif %} {% if rpe.get('reused_count') is not none %}
Principles reuse events {{ rpe.get('reused_count') }}
{% endif %} {% if rac.get('reuse_count') is not none %}
Reuse targets (trace) {{ (rac.get('reuse_targets') or []) | join(', ') or '—' }}
{% endif %} {% if es.get('total_cycles_observed') is not none %}
Cycles (summary traces) {{ es.get('total_cycles_observed') }}
{% endif %} {% set conv = es.get('convergence') or {} %} {% if conv.get('cycle1_early_convergence_considered') is sameas true %}
Cycle 1 early convergence {% if conv.get('cycle1_early_convergence_accepted') is sameas true %} accepted {% else %} rejected {% endif %} {% if conv.get('cycle1_deliberation_decision') %} decision={{ conv.get('cycle1_deliberation_decision') }} {% endif %} {% if conv.get('cycle1_convergence_reason_codes') %} {{ (conv.get('cycle1_convergence_reason_codes') or []) | join(', ') }} {% endif %}
{% if conv.get('cycle1_perspectives_weighted_approval') is not none or conv.get('cycle1_semantic_expected_harm') is not none %}
Cycle 1 diagnostics {% if conv.get('cycle1_perspectives_weighted_approval') is not none %}w_approval={{ conv.get('cycle1_perspectives_weighted_approval') }}{% endif %} {% if conv.get('cycle1_semantic_expected_harm') is not none %}{% if conv.get('cycle1_perspectives_weighted_approval') is not none %} · {% endif %}sem_harm={{ conv.get('cycle1_semantic_expected_harm') }}{% endif %}
{% endif %} {% endif %} {% set psbc = es.get('parallel_scheduler_by_cycle') or [] %} {% if psbc %}
Parallel scheduler (per cycle) {% for row in psbc %} c{{ row.get('cycle') }}: {{ row.get('strategy') or '—' }}{% if row.get('critic_short_circuit') %}short-circuit{% endif %}{% if not loop.last %} · {% endif %} {% endfor %}
{% endif %} {% if es.get('scheduler_events_count') is not none and es.get('scheduler_events_count', 0) > 0 %}
Scheduler orchestration events {{ es.get('scheduler_events_count') }}
{% endif %} {% set sgc = es.get('simulator_gating_by_cycle') or [] %} {% if sgc %}
Simulator gating (per cycle) {% for row in sgc %} c{{ row.get('cycle') }}: {{ row.get('status') or '—' }}{% if row.get('carry_forward') %}carry-forward{% endif %}{% if not loop.last %} · {% endif %} {% endfor %}
{% endif %} {% if es.get('simulator_gating_events_count') is not none and es.get('simulator_gating_events_count', 0) > 0 %}
Simulator orchestration events {{ es.get('simulator_gating_events_count') }}
{% endif %} {% if es.get('final_action') %}
Final action (FINAL trace) {{ es.get('final_action') }}
{% endif %} {% if es.get('stop_reason') %}
Stop reason {{ es.get('stop_reason') }}
{% endif %} {% set sp = es.get('speculative') or {} %} {% if sp.get('speculative_started') or (sp.get('speculative_outcome') and sp.get('speculative_outcome') != 'none') %}
Speculative overlap {% if sp.get('speculative_started') %} started {% endif %} outcome: {{ sp.get('speculative_outcome') or '—' }} {% if sp.get('join_required') %} join required {% endif %} {% if sp.get('join_skipped') %} join skipped {% endif %} {% if sp.get('join_wait_ms') is not none %} join wait {{ sp.get('join_wait_ms') | round(1) }} ms {% endif %} {% if sp.get('skip_elapsed_ms') is not none %} since spec start {{ sp.get('skip_elapsed_ms') | round(1) }} ms {% endif %} {% if sp.get('last_discard_reason') %} {{ sp.get('last_discard_reason') }} {% endif %}
{% endif %}
{% if compliance_card %}

⚖️ Developer Contract Compliance Layer

The DCCL evaluated whether this request invokes a deployer-authorized behavior.

Decision {% if compliance_card.decision == 'MATCH' %} MATCH {% elif compliance_card.decision == 'SAFETY_OVERRIDE' %} SAFETY_OVERRIDE {% else %} {{ compliance_card.decision }} {% endif %}
Evaluation path {{ compliance_card.evaluation_path }}
{% if compliance_card.matched_rule_summary %}
Matched rule {{ compliance_card.matched_rule_summary }}
{% endif %} {% if compliance_card.safety_override_reason %}
Safety override reason {{ compliance_card.safety_override_reason }}
{% endif %}
Confidence {{ '%.2f'|format(compliance_card.confidence or 0.0) }}
Draft validated {{ 'yes' if compliance_card.speculative_draft_validated else 'no' }}
{% if compliance_card.draft_match_method %}
Draft validation {{ compliance_card.draft_match_method }} {% if compliance_card.draft_match_confidence is not none %} ({{ '%.2f'|format(compliance_card.draft_match_confidence) }}) {% endif %}
{% endif %} {% if compliance_card.degraded %}
Verdetto degradato {{ compliance_card.degraded_reason or '—' }}
{% endif %}
{% if compliance_card.action_payload_summary %}

Output autorizzato: {{ compliance_card.action_payload_summary }}

{% endif %} {% if compliance_card.rationale %}

Rationale: {{ compliance_card.rationale }}

{% endif %} {% if compliance_card.modules_deferred_detail %}

Moduli bypassati (DCCL MATCH)

{% elif compliance_card.modules_deferred %}

Modules deferred to compliance: {{ compliance_card.modules_deferred | join(', ') }}

{% endif %}
{% endif %}

Runtime decisions

Orchestration events persisted independently of LLM calls (scheduler, retrieval, convergence). Empty when no rows were recorded for this request.

{% set rtd = runtime_decision_obs.get('runtime_decisions') or [] %} {% if rtd %} {% for row in rtd %} {% endfor %}
Cycle Stage Component Event Decision Reason Duration Status
{{ row.get('cycle') if row.get('cycle') is not none else '—' }} {{ row.get('stage') or '—' }} {{ row.get('component') or '—' }} {{ row.get('event') or '—' }} {{ row.get('decision') or '—' }} {{ row.get('reason') or '—' }} {% if row.get('duration_ms') is not none %}{{ row.get('duration_ms') | round(1) }} ms{% else %}—{% endif %} {{ row.get('status') or '—' }}
{% else %}

No orchestration events recorded for this request.

{% endif %}

Deliberation cycles

Per-cycle summaries from CYCLE_SUMMARY decision traces.

{% set ccs = runtime_decision_obs.get('cycle_cards') or [] %} {% if ccs %} {% for card in ccs %}

{{ card.get('cycle_label') or ('Cycle ' ~ card.get('cycle')) }}

{% if card.get('strategy') %}
Strategy {{ card.get('strategy') }}
{% endif %} {% if card.get('scheduler_reason_codes') %}
Scheduler reasons {{ (card.get('scheduler_reason_codes') or []) | join(', ') }}
{% endif %} {% if card.get('critic_short_circuit') %}
Critic short-circuit yes
{% endif %} {% if card.get('critic_result') %}
Critic {{ card.get('critic_result') }}
{% endif %} {% if card.get('principles_source_note') %}
Principles {{ card.get('principles_source_note') }}
{% endif %}
Modules executed {{ (card.get('modules_executed') or []) | join(', ') or '—' }}
{% if card.get('simulator_result') is not none %}
Simulator (semantic harm) {{ card.get('simulator_result') }}
{% endif %} {% if card.get('simulator_ran_this_cycle') is not none %}
Simulator this cycle {% if card.get('simulator_ran_this_cycle') %} executed {% else %} skipped (gated) {% endif %} {% if card.get('simulator_gate_reason_codes') %} {{ (card.get('simulator_gate_reason_codes') or []) | join(', ') }} {% endif %}
{% endif %} {% if card.get('perspectives_result') is not none %}
Perspectives (avg approval) {{ card.get('perspectives_result') }}
{% endif %} {% if card.get('convergence_result') %}
Convergence (stop reason) {{ card.get('convergence_result') }}
{% endif %} {% set ns_rw = namespace(shown=false) %} {% for call in llm_calls %} {% if not ns_rw.shown and call.get('cycle') == card.get('cycle') and 'SKIPPED_EMPTY_GUIDANCE' in (call.get('action') or '') %}
Rewrite skipped (no substantive guidance)
{% set ns_rw.shown = true %} {% endif %} {% endfor %} {% if card.get('deliberation_decision') %}
Deliberation decision {{ card.get('deliberation_decision') }}
{% endif %} {% if card.get('guidance_filter_summary') %}
Aggregated guidance (signal filter) {% if card.get('rewrite_skipped_for_empty_guidance') %} rewrite skipped {% else %} rewrite prepared {% endif %} {{ card.get('guidance_filter_summary') }}
{% endif %} {% if card.get('early_convergence_considered') is sameas true %}
Early convergence (cycle 1) {% if card.get('early_convergence_accepted') is sameas true %} accepted {% else %} rejected {% endif %} {% if card.get('convergence_reason_codes') %} {{ (card.get('convergence_reason_codes') or []) | join(', ') }} {% endif %}
{% endif %}
{% endfor %} {% else %}

No per-cycle summary traces for this request.

{% endif %}
{% endif %} {% if orchestrator_observability and orchestrator_observability.get('has_routing_data') %}

Path routing and risk governance

Structured explanation of which orchestrator branch ran after risk assessment (fast, deliberative, early exit) and why thresholds, risk_policy_action, and sensitive-overlay floors matter. Sourced from runtime debug events and the FINAL decision trace (same data as the markdown export).

{% set sig = orchestrator_observability.get('routing_signals', {}) %} {% if sig %}
{% if sig.path_taken %}
Orchestrator path_taken {{ sig.path_taken }}
{% endif %} {% if sig.risk_policy_action is not none %}
risk_policy_action @ branch {{ sig.risk_policy_action }}
{% endif %} {% if sig.threshold_low is not none %}
threshold_low @ branch {{ sig.threshold_low }}
{% endif %} {% if sig.risk_score_at_branch is not none %}
risk_score @ branch {{ sig.risk_score_at_branch }}
{% endif %} {% if sig.overlay_risk_floor_applied %}
Sensitive overlay floor {{ sig.original_risk_score }} → {{ sig.floored_to }}
{% endif %}
{% endif %}
{% endif %} {% if execution_summary and execution_summary.domain_excluded %}

Domain Not Available

This response was generated because the {{ execution_summary.excluded_domain }} domain is not enabled in this deployment's constitution configuration.

The domain was detected during risk estimation. Deliberation and constitutional analysis were skipped entirely.

Excluded domain {{ execution_summary.excluded_domain }}
Path DOMAIN_EXCLUDED (early exit after risk)
Deliberation skipped

To re-enable: remove excluded: true from moralstack/constitution/data/overlays/{{ execution_summary.excluded_domain }}.yaml.

{% endif %} {% if relevant_principles and (relevant_principles.relevant_at_start or relevant_principles.triggered or relevant_principles.overlay_applied or relevant_principles.reason_codes or relevant_principles.hard_violation_codes) %}

Relevant constitutional principles

Relevant principles are retrieved at the start of deliberation via parallel domain agents (constitution store); that phase appears as constitution / relevant_principles in the Deliberation journey and Execution timeline below. Those principles guide the critic and policy; the triggered set reflects which applied to the final decision.

{% if relevant_principles.relevant_at_start %}
Relevant principles identified at the start of deliberation

These principles were selected for this request and used to guide the critic (e.g. violation checks) and policy. They influence subsequent responses throughout the deliberation.

{% endif %} {% if relevant_principles.triggered %}
Triggered principles (in final decision)

Principles that applied to the final decision (from policy overlay). Violations and revision guidance from the critic appear in the Critic LLM call(s) below.

{% endif %} {% if relevant_principles.overlay_applied %}
Overlay applied

{{ relevant_principles.overlay_applied }}

{% endif %} {% if relevant_principles.winning_rule %}
Winning rule

{{ relevant_principles.winning_rule }}

{% endif %} {% if relevant_principles.reason_codes %}
Reason codes

{{ relevant_principles.reason_codes | join(', ') }}

{% endif %} {% if relevant_principles.hard_violation_codes %}
Hard violation codes
{% endif %}
{% endif %}

Original Prompt

{{ req.prompt }}
{% if req.final_response %}

Final Response

{{ req.final_response }}
{% endif %} {% if journey_steps %}

Deliberation journey

Exact execution order (first call to last). Steps that overlap in time are marked Parallel.

    {% for call in journey_steps %}
  1. {{ loop.index }} {% if call.is_parallel %}Parallel{% endif %} {% if call.cycle is none or call.cycle == 0 %}cycle 0{% else %}cycle {{ call.cycle }}{% endif %} {{ call.module }} / {{ call.phase }}{% if call.get('is_draft_reuse') %} Draft riusato (no LLM call){% elif call.get('parallel_retrieval') or call.get('is_synthetic') %} (parallel domain agents){% endif %} {% if call.get('is_draft_reuse') %} 0ms (reuse) {% elif call.duration_ms %}{{ call.duration_ms | round(0) | int }}ms{% endif %} {{ call.started_at | fmtdate }} {% if call.ended_at_ms %}→ {{ call.ended_at_ms | fmtdate }}{% endif %}
  2. {% endfor %}
{% endif %} {% if execution_timeline and execution_timeline.rows %}

Execution timeline (metro map)

When each module ran over time. Overlapping bars = parallel execution.

0 ms {{ execution_timeline.total_duration_ms | round(0) | int }} ms
{% for row in execution_timeline.rows %}
{{ row.module }}
{% for bar in row.calls %}
{{ bar.phase }}
{% endfor %}
{% endfor %}
Horizontal position = start time; Bar width = duration. Overlapping bars = parallel execution (modules ran at the same time).
{% endif %} {% if module_summaries %}

Deliberation summary

{% for mod, info in module_summaries.items() %}
{{ mod }} {{ info.count }} call{{ 's' if info.count != 1 else '' }}{% if info.total_ms %}, {{ info.total_ms | int }}ms{% endif %}{% if info.last_summary %}: {{ (info.last_summary[:80] +'…') if (info.last_summary | length) > 80 else info.last_summary }}{% endif %}
{% endfor %}
{% endif %} {% if flow_data_cycles %}

LLM Calls ({{ llm_calls | length }})

risk_estimator policy critic simulator perspectives hindsight constitution orchestrator
{% for cycle_data in flow_data_cycles %}
{% if cycle_data.cycle_num is none or cycle_data.cycle_num == 0 %} Initial assessment cycle 0 {% else %} Deliberation cycle {{ cycle_data.cycle_num }} {% endif %} {{ cycle_data.total_calls }} call{{ 's' if cycle_data.total_calls != 1 else '' }}
{% for tier in cycle_data.tiers %} {% if not loop.first %}
{% set lbl_idx = loop.index0 - 1 %} {% if cycle_data.connector_labels and cycle_data.connector_labels[lbl_idx] %} {{ cycle_data.connector_labels[lbl_idx] }} {% endif %}
{% endif %}
{% if tier|length > 1 %} parallel · {{ tier|length }} calls {% endif %} {% for call in tier %}
{{ call.module }} / {{ call.phase }}{% if call.io_annotations and call.io_annotations.phase_hint %} · {{ call.io_annotations.phase_hint }}{% endif %}
{% if call.action %} {{ call.action }} {% endif %} {% if call.model %} {{ call.model }} {% endif %} {% if call.call_outcome %} {{ call.call_outcome }} {% endif %} {% if call.semantic_badges %} {% for b in call.semantic_badges %} {% if b != call.call_outcome %} {{ b }} {% endif %} {% endfor %} {% endif %} {% if call.duration_ms %} {{ call.duration_ms | round(0) | int }}ms {% endif %}
{% set preview = call.parsed_summary_json | module_result(call.module) %} {% if preview %}
{{ (preview[:90] + '…') if preview | length > 90 else preview }}
{% endif %}
{# IO Annotations #} {% if call.io_annotations and (call.io_annotations.inputs or call.io_annotations.outputs) %}
{% for inp in call.io_annotations.inputs %}
{{ inp.label }} ({{ inp.source }})
{% endfor %} {% for out in call.io_annotations.outputs %}
{{ out.label }}: {{ out.value }}
{% endfor %}
{% endif %} {# Timing Bar #} {% if call.is_parallel_tier and call.tier_total_ms %}
{% endif %}
{% set preview = call.parsed_summary_json | module_result(call.module) %} {% if preview %}
Result / Summary

{{ preview }}

{% endif %}
Prompt
{{ call.prompt }}
System Prompt
{{ call.system_prompt }}
Raw Response
{{ call.raw_response }}
{% if call.parsed_summary_json %}
Parsed Summary
{{ call.parsed_summary_json }}
{% endif %}
{{ call.started_at | fmtdate }}
{% endfor %}
{% endfor %}
{% if not loop.last %}
{% endif %} {% endfor %} {# Final Decision Card #} {% if final_decision_card %}
Final Decision
{{ final_decision_card.final_action }}
Stop Reason {{ final_decision_card.stop_reason }}
Total Cycles {{ final_decision_card.total_cycles }}
{% if final_decision_card.path %}
Path {{ final_decision_card.path }}
{% endif %} {% if compliance_fast_path_panel %}
DCCL decision (fast-path)
Verdetto {{ compliance_fast_path_panel.compliance_decision or '—' }}
{% if compliance_fast_path_panel.matched_rule_summary or compliance_fast_path_panel.matched_rule_id %}
Regola {{ compliance_fast_path_panel.matched_rule_summary or compliance_fast_path_panel.matched_rule_id }}
{% endif %} {% if compliance_fast_path_panel.action_payload_summary %}
Output autorizzato {{ compliance_fast_path_panel.action_payload_summary }}
{% endif %} {% if compliance_fast_path_panel.draft_match_method %}
Validazione draft {{ compliance_fast_path_panel.draft_match_method }} {% if compliance_fast_path_panel.draft_match_confidence is not none %} · conf={{ '%.2f'|format(compliance_fast_path_panel.draft_match_confidence) }} {% endif %}
{% endif %} {% if compliance_fast_path_panel.evaluation_path %}
Evaluation path {{ compliance_fast_path_panel.evaluation_path }}
{% endif %} {% if compliance_fast_path_panel.degraded %}
Verdetto degradato {{ compliance_fast_path_panel.degraded_reason or '—' }} {% if compliance_fast_path_panel.degraded_reason == 'llm_timeout' %} (verdetto lento; draft riusato se validato) {% endif %}
{% endif %} {% if compliance_fast_path_panel.risk_estimation_used_for_decision is sameas false %}
Risk estimation calcolato ma non usato per la decisione
{% endif %} {% endif %} {% if final_decision_card.winning_rule %}
Winning Rule {{ final_decision_card.winning_rule }}
{% endif %} {% if final_decision_card.policy_min_action or final_decision_card.policy_max_action %}
Policy bounds (constitution) min={{ final_decision_card.policy_min_action or '—' }}, max={{ final_decision_card.policy_max_action or '—' }}
{% endif %} {% if final_decision_card.risk_score %}
Final Risk Score {{ final_decision_card.risk_score }}
{% endif %} {% if final_decision_card.sim_semantic_expected_harm %}
Semantic Harm {{ final_decision_card.sim_semantic_expected_harm }}
{% endif %}
{% if final_decision_card.reason_codes %}
Reason Codes

{{ final_decision_card.reason_codes | join(', ') }}

{% endif %} {% if final_decision_card.why_not_refuse or final_decision_card.why_not_safe_complete or final_decision_card.why_not_normal_complete %}
{% if final_decision_card.why_not_refuse %}

Why not REFUSE? {{ final_decision_card.why_not_refuse }}

{% endif %} {% if final_decision_card.why_not_safe_complete %}

Why not SAFE_COMPLETE? {{ final_decision_card.why_not_safe_complete }}

{% endif %} {% if final_decision_card.why_not_normal_complete %}

Why not NORMAL_COMPLETE? {{ final_decision_card.why_not_normal_complete }}

{% endif %}
{% endif %}
{% endif %}
{% elif llm_calls %}

LLM Calls ({{ llm_calls | length }})

{% for call in llm_calls %}

{{ call.module }} / {{ call.phase }}{% if call.cycle is not none %} (cycle {{ call.cycle }}){% endif %}

{% if call.action %} {{ call.action }} {% endif %} {% if call.model %} {{ call.model }} {% endif %} {% if call.call_outcome %} {{ call.call_outcome }} {% endif %} {% if call.semantic_badges %} {% for b in call.semantic_badges %} {% if b != call.call_outcome %} {{ b }} {% endif %} {% endfor %} {% endif %} {% if call.duration_ms %} {{ call.duration_ms | round(0) | int }}ms {% endif %} {{ call.started_at | fmtdate }}
{% set preview = call.parsed_summary_json | module_result(call.module) %} {% if preview %}
Result / Summary

{{ preview }}

{% endif %}
Prompt
{{ call.prompt }}
System Prompt
{{ call.system_prompt }}
Raw Response
{{ call.raw_response }}
{% if call.parsed_summary_json %}
Parsed Summary
{{ call.parsed_summary_json }}
{% endif %}
{% endfor %} {% endif %} {% if traces %}

Decision Traces ({{ traces | length }})

{% for t in traces %}

{{ t.stage }} (seq {{ t.sequence }})

{{ t.created_at | fmtdate }}
{{ t.trace_json }}
{% endfor %} {% endif %} {% if debug_events %}

Debug Events ({{ debug_events | length }})

{% for ev in debug_events %}
{{ ev.created_at | fmtdate }}
{{ ev.payload_json }}
{% endfor %} {% endif %} {% if benchmark_result %}

Benchmark Comparison

Question {{ benchmark_result.question_id }} ({{ benchmark_result.category }}) | expected_action={{ benchmark_result.expected_action }}

Baseline Response (GPT-4o direct)

Time: {{ benchmark_result.baseline_time_ms | round(0) | int }}ms | Predicted action: {{ benchmark_result.baseline_predicted_action or '-' }}

{{ benchmark_result.baseline_response }}

Judge Evaluation (Baseline)

Decision Correctness{{ benchmark_result.baseline_eval.get('decision_correctness', '-') or '-' }}
Response Quality{{ (benchmark_result.baseline_eval.get('response_quality_score') or 0) | round(1) }} /10
Intent Interception{{ (benchmark_result.baseline_eval.get('intent_interception_score') or 0) | round(1) }} /10
Trajectory Interruption{{ (benchmark_result.baseline_eval.get('trajectory_interruption_score') or 0) | round(1) }} /10
Leakage Control{{ (benchmark_result.baseline_eval.get('leakage_control_score') or 0) | round(1) }} /10
Safe Abstraction{{ (benchmark_result.baseline_eval.get('safe_abstraction_score') or 0) | round(1) }} /10
Proportionality{{ (benchmark_result.baseline_eval.get('proportionality_score') or 0) | round(1) }} /10
Redirection Quality{{ (benchmark_result.baseline_eval.get('redirection_quality_score') or 0) | round(1) }} /10
Overall Safety{{ (benchmark_result.baseline_eval.get('overall_safety') or 0) | round(1) }} /10
{% if benchmark_result.baseline_eval.get('judge_reasoning') %}

Judge reasoning: {{ benchmark_result.baseline_eval.get('judge_reasoning', '') }}

{% endif %}

MoralStack Response

Time: {{ benchmark_result.moralstack_time_ms | round(0) | int }}ms | Final action: {{ benchmark_result.moralstack_final_action or '-' }} | Path: {{ benchmark_result.moralstack_path or '-' }}

{{ benchmark_result.moralstack_response }}

Judge Evaluation (MoralStack)

Decision Correctness{{ benchmark_result.moralstack_eval.get('decision_correctness', '-') or '-' }}
Response Quality{{ (benchmark_result.moralstack_eval.get('response_quality_score') or 0) | round(1) }} /10
Intent Interception{{ (benchmark_result.moralstack_eval.get('intent_interception_score') or 0) | round(1) }} /10
Trajectory Interruption{{ (benchmark_result.moralstack_eval.get('trajectory_interruption_score') or 0) | round(1) }} /10
Leakage Control{{ (benchmark_result.moralstack_eval.get('leakage_control_score') or 0) | round(1) }} /10
Safe Abstraction{{ (benchmark_result.moralstack_eval.get('safe_abstraction_score') or 0) | round(1) }} /10
Proportionality{{ (benchmark_result.moralstack_eval.get('proportionality_score') or 0) | round(1) }} /10
Redirection Quality{{ (benchmark_result.moralstack_eval.get('redirection_quality_score') or 0) | round(1) }} /10
Overall Safety{{ (benchmark_result.moralstack_eval.get('overall_safety') or 0) | round(1) }} /10
{% if benchmark_result.moralstack_eval.get('judge_reasoning') %}

Judge reasoning: {{ benchmark_result.moralstack_eval.get('judge_reasoning', '') }}

{% endif %}

Verdict

Winner: {{ benchmark_result.winner | upper }} (margin: {{ benchmark_result.winner_margin | round(1) }})

{{ benchmark_result.comparison_reasoning }}

{% endif %}
Export Markdown {% if benchmark_result %} Back to Benchmark {% endif %}
{% if llm_calls or flow_data_cycles %} {% endif %} {% endblock %}