{% macro analysis_review(selector_ids) -%}

{{ t('macros.forms.review-this-analysis') }}

{{ t('macros.forms.verdict') }}
{%- endmacro %} {% macro plan_approval(state) -%}
{% if state.reentry_command %}

{{ t('macros.forms.selected-direction-invalidated') }}

{{ t('macros.forms.return-to-option-selection') }} {{ state.reentry_command }}

{% else %}

{{ t('macros.forms.decide-on-this-plan') }}

{{ t('macros.forms.verdict') }}
{% if state.show_option_selector %} {% endif %} {% if state.disabled_reason %}

{{ t('macros.forms.approval-is-held') }} {{ state.disabled_reason }}.

{{ t('macros.forms.answer-the-blockers-then-regenerate') | replace('{ids}', state.blocker_ids | join(', ')) }}

{% endif %} {% endif %}
{%- endmacro %} {% macro direction_selection(state) -%}

{{ t('macros.forms.select-an-implementation-direction') }}

{{ t('macros.forms.direction') }} {% for option in state.rankedOptions %} {% endfor %}
{%- endmacro %} {% macro clarification_article(row, compact=false) -%} {% set is_closed = row.status in ['resolved', 'obsolete'] %} {% set approval_context = row.approvalContext | default(None) %} {% set resolution = row.resolution | default(None) %} {% set options = row.options | default([]) %}
{% if compact %}
{{ row.id | inline_code }} · {{ row.status }}{% endif %}

{{ row.id | inline_code }} · {{ row.kind }}

{{ row.statement | paragraphs }}
{{ t('macros.forms.answer-as') }}
{{ row.expectedForm | inline_code }}
{% if approval_context %}

{{ approval_context.classification }}

{{ t('tasks.implementation-planning.unblock-condition') }} {{ approval_context.unblockCondition | inline_code }}

{% set check_refs = resolution.checkRefs if resolution else approval_context.activityIds | default([]) %} {% if check_refs %}

{{ t('tasks.implementation-planning.agent-evidence') }} {% for activity_id in check_refs %}{{ activity_id }}{% if not loop.last %}, {% endif %}{% endfor %}

{% endif %}
{% endif %} {% if options %}
    {% for option in options %}
  1. {{ option.answer }}{% if option.role == 'recommended' %} {{ t('macros.forms.recommended') }}{% endif %}

    {% if option.disposition | default(None) %}

    {{ option.disposition }}

    {% endif %}

    {{ option.rationale }}

    {{ t('macros.forms.scope-impact') }}
    {% if option.reach | default(None) %}{{ option.reach }}{% if option.scopeEffects | default([]) %}, {{ option.scopeEffects | join(', ') }}{% endif %}{% else %}{{ option.scopeImpact | join(', ') }}{% endif %}
    {{ t('macros.forms.added-work') }}
    {{ option.addedWork }}
    {{ t('macros.forms.direction-change') }}
    {{ option.directionChange }}
  2. {% endfor %}
{% endif %} {% if options %} {% set pick = namespace(has_other=false, current=row.userInput | default('')) %} {% for option in options %}{% if option.answer == '__other__' %}{% set pick.has_other = true %}{% endif %}{% endfor %} {% set is_custom = pick.current and pick.current not in (options | map(attribute='answer') | list) %} {% if not pick.has_other %}{% endif %} {% else %} {% endif %} {% if compact %}
{% endif %}
{%- endmacro %} {% macro clarification_responses(items) -%} {% if items %} {% set ns = namespace(open=[], closed=[]) %} {% for row in items %} {% if row.status in ['open', 'answered'] %} {% set ns.open = ns.open + [row] %} {% else %} {% set ns.closed = ns.closed + [row] %} {% endif %} {% endfor %}
{% if ns.open %}

{{ t('macros.forms.count-questions-waiting-on-you') | replace('{count}', ns.open | length) }}

{{ t('macros.forms.the-code-alone-could-not-settle-these-fill-i') }} {{ t('macros.forms.export-my-answers') }} {{ t('macros.forms.at-the-foot-of-the-page') }}

{% for row in ns.open %}{{ clarification_article(row) }}{% endfor %} {% endif %} {% if ns.closed %} {% if ns.open %}

{{ t('macros.forms.count-answered-questions') | replace('{count}', ns.closed | length) }}

{% else %}

{{ t('macros.forms.count-answered-questions') | replace('{count}', ns.closed | length) }}

{% endif %} {% for row in ns.closed %}{{ clarification_article(row, compact=true) }}{% endfor %} {% endif %}
{% endif %} {%- endmacro %}