{% extends "base.html" %} {% block title %}Request {{ req.request_id[:12] }} - MoralStack{% endblock %} {% block content %} {# Caption for a recorded pipeline failure; used by the Final Response card and the OUTPUT summary. #} {% set failure_caption = {"SYSTEM.ERROR": "SYSTEM ERROR", "SYSTEM.TIMEOUT": "SYSTEM TIMEOUT", "SYSTEM.FAIL_SAFE": "SYSTEM FAIL-SAFE"}.get(pipeline_failure_principle, "SYSTEM ERROR") %} {# Per-call token badge. Reads the numeric llm_calls columns present on every real call row (total_tokens/input_tokens/output_tokens/token_usage_estimated/ token_usage_missing). Renders nothing for synthetic nodes (no total_tokens). #} {% macro token_badge(call) %} {% set tt = call.get('total_tokens') %} {% if tt is not none %} {% set est = call.get('token_usage_estimated') %} {% set miss = call.get('token_usage_missing') %} {% set cached = call.get('cached_input_tokens') %} ⛊ {{ '{:,}'.format(tt) }} tok{% if est %} est{% elif miss %} ?{% endif %} {# Only a measured hit gets a badge: a measured 0 and an unreported call would both be noise here. #} {% if cached %} ↻ {{ '{:,}'.format(cached) }} {% endif %} {% endif %} {% endmacro %}
{{ delivery_path_summary.explanation }}
| Turn | Request | Domain |
|---|---|---|
| {{ 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 '—' }} |
| Op | Outcome | Similarity | Reason | From 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 '—' }} |
| Op | Outcome |
|---|---|
| {{ ev.operation or '—' }} | {{ ev.outcome or '—' }} |
Constitution retrieval fans out to one LLM call per candidate domain (plus the shared prefilter). Each row is a real persisted constitution_retriever call with its token cost.
| Phase | Call | Domain | Model | Input | Output | Total | Cache hit | ms | Quality |
|---|---|---|---|---|---|---|---|---|---|
| {{ r.phase or '—' }} | {{ r.action or '—' }} | {{ r.domain or '—' }} | {{ r.model or '—' }} | {{ '{:,}'.format(r.input_tokens) }} | {{ '{:,}'.format(r.output_tokens) }} | {{ '{:,}'.format(r.total_tokens) }} | {% if r.cache_hit_pct is not none %}{{ r.cache_hit_pct }}%{% else %}—{% endif %} | {% if r.duration_ms %}{{ r.duration_ms | round(0) | int }}{% else %}—{% endif %} | {% if r.estimated %}est {% elif r.missing %}no-usage {% else %}exact{% endif %} |
Structured runtime posture from decision traces (risk, retrieval context, per-cycle summaries). Scheduler / speculative / gating fields appear here as they are emitted.
The DCCL evaluated whether this request invokes a deployer-authorized behavior.
{% if compliance_card.veto %}Vetoed: this DCCL MATCH was blocked by the hard-signal safety gate (P0) after the verdict-time draft validation completed; the request was routed to the standard pipeline instead of the authorized output below.
{% endif %} {% if compliance_card.draft_discarded %}Draft discarded: the validated speculative draft was discarded and never delivered (reason: {{ compliance_card.draft_discarded_reason or '—' }}).
{% endif %} {% if compliance_card.consumption_undetermined %}The final consumption of this MATCH is not determined from persisted events.
{% endif %} {% if compliance_card.action_payload_summary %}Authorized output: {{ compliance_card.action_payload_summary }}
{% endif %} {% if compliance_card.rationale %}Rationale: {{ compliance_card.rationale }}
{% endif %} {% if compliance_card.modules_deferred_detail %}Modules deferred to compliance: {{ compliance_card.modules_deferred | join(', ') }}
{% endif %}Orchestration events persisted independently of LLM calls (scheduler, retrieval, convergence). Empty when no rows were recorded for this request.
| 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 '—' }} |
No orchestration events recorded for this request.
{% endif %}Per-cycle summaries from CYCLE_SUMMARY decision traces.
No per-cycle summary traces for this request.
{% endif %}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).
Calibration guard reversed the raw operational signal. The operational-risk estimator returned {{ guard.raw_risk_policy_action }} at risk_score {{ guard.raw_risk_score }}; a calibration guard capped it to {{ guard.capped_risk_policy_action }} at {{ guard.capped_risk_score }} before the branch and sensitive-overlay values below were computed.
{% endif %} {% set sig = orchestrator_observability.get('routing_signals', {}) %} {% if sig %} {% endif %}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.
To re-enable: remove excluded: true from
moralstack/constitution/data/overlays/{{ execution_summary.excluded_domain }}.yaml.
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.
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.
{{ p.id }}
{% if p.title %}{{ p.title }}{% endif %}
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.
{{ p.id }}
{% if p.title %}{{ p.title }}{% endif %}
{{ relevant_principles.overlay_applied }}
{{ relevant_principles.winning_rule }}
{{ relevant_principles.reason_codes | join(', ') }}
{{ code }}{{ req.prompt }}
{{ failure_caption }} The text below is a system-error placeholder recorded when the governance pipeline crashed before reaching a governed decision — it is not a governed answer.
{{ req.final_response }}
{{ req.final_response }}
Exact execution order (first call to last). Steps that overlap in time are marked Parallel.
When each module ran over time. Overlapping bars = parallel execution.
A single input→output deliberation spine, in exact execution order. Parallel tiers branch from the line and rejoin it.
{{ req.prompt }}
{{ preview }}
{{ call.prompt }}
{{ call.system_prompt }}
{{ message_sections.system_messages | join('\n\n---\n\n') }}
{% endif %}
{% if message_sections.developer_messages %}
{{ message_sections.developer_messages | join('\n\n---\n\n') }}
{% endif %}
{{ msg.content }}
{% endfor %}
{% if message_sections.final_user_message %}
{{ message_sections.final_user_message }}
{% endif %}
{{ call.raw_response }}
{{ call.parsed_summary_json }}
“{{ (delivered_preview[:140] + '…') if delivered_preview | length > 140 else delivered_preview }}” (full text in “Final Response” below)
{% endif %} {% endif %}{{ final_decision_card.reason_codes | join(', ') }}
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 %}The governance pipeline crashed before reaching a governed FINAL decision — no FINAL decision-trace row exists for this request. There is no final_action to report; the delivered text is a system-error placeholder, not a governed REFUSE / SAFE_COMPLETE / NORMAL_COMPLETE outcome.
{{ preview }}
{{ call.prompt }}
{{ call.system_prompt }}
{{ message_sections.system_messages | join('\n\n---\n\n') }}
{% endif %}
{% if message_sections.developer_messages %}
{{ message_sections.developer_messages | join('\n\n---\n\n') }}
{% endif %}
{{ msg.content }}
{% endfor %}
{% if message_sections.final_user_message %}
{{ message_sections.final_user_message }}
{% endif %}
{{ call.raw_response }}
{{ call.parsed_summary_json }}
{{ t.trace_json }}
{{ ev.payload_json }}
Question {{ benchmark_result.question_id }} ({{ benchmark_result.category }}) | expected_action={{ benchmark_result.expected_action }}
Time: {{ benchmark_result.baseline_time_ms | round(0) | int }}ms | Predicted action: {{ benchmark_result.baseline_predicted_action or '-' }}
{{ benchmark_result.baseline_response }}
Judge reasoning: {{ benchmark_result.baseline_eval.get('judge_reasoning', '') }}
{% endif %}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 reasoning: {{ benchmark_result.moralstack_eval.get('judge_reasoning', '') }}
{% endif %}Winner: {{ benchmark_result.winner | upper }} (margin: {{ benchmark_result.winner_margin | round(1) }})
{{ benchmark_result.comparison_reasoning }}