{# The answer form for a NEEDS_INPUT packet's questions: on its packet page and on the project page. Import "with context" (csrf). ``back``: "project" returns to the project page after sending. #} {% macro form(e, wpid, qs, id="answer", who=None, back=None) -%}
{% if back %}{% endif %}

{{ who ~ " asks" if who else "It asks" }}{{ " " ~ qs|length ~ " questions" if qs|length > 1 }}

{% set decide = qs|rejectattr("weight", "equalto", "confirm")|list %} {% set confirm = qs|selectattr("weight", "equalto", "confirm")|list %} {% for q in decide %}{{ question(e, wpid, q, qs|length > 1) }}{% endfor %} {% if confirm %}
{{ confirm|length }} to confirm{{ ", filled in with its recommendations" if confirm|length > 1 else ", filled in with its recommendation" }}: {% for q in confirm %}{{ q.id }}{{ ", " if not loop.last }}{% endfor %} {% for q in confirm %}{{ question(e, wpid, q, true, true) }}{% endfor %}
{% endif %} {% if not resolve_ok %}

Hard to follow? Talk it through in a new Claude session that reads the agent's notes for you and answers when you agree: wpk resolve {{ wpid[:8] }} in a terminal (a VS Code terminal in the packet folder works).

{% endif %}
Blank answers are sent as unanswered, unless you take the recommendations.
{% if resolve_ok %}

Hard to follow?

A new Claude session here reads the agent's notes, explains each question in your terms, and answers for you when you agree (wpk answer). Or run wpk resolve {{ wpid[:8] }} in a terminal.

{% endif %} {%- endmacro %} {# One question: what is asked, the situation, what it rests on, each choice's cost. ``fill``: a confirm, so a typed answer starts as the recommendation. #} {% macro question(e, wpid, q, show_id, fill=false) -%}
{% if show_id %}{{ q.id }} {% endif %}{{ ask_links(e, wpid, q.q) }}
{% if q.context %}
{{ ask_links(e, wpid, q.context) }}
{% endif %} {% if q.premise %}
Rests on: {{ ask_links(e, wpid, q.premise) }} If that's wrong, say so under "Other" or in the note.
{% endif %} {% if q.choices %}
{% for c in q.choices %} {% endfor %}
{% else %} {% if q.tradeoffs %}{% endif %} {% endif %}
{% if q.recommend %}Recommends: {{ q.recommend }}{{ " because " ~ q.why if q.why }}.{% endif %} {% if q.grants %}A yes allows {% for t in q.grants %}{{ t }}{{ ", " if not loop.last }}{% endfor %}.{% endif %} {% for w, vals in (q.sets or {}).items() %}{{ "A yes" if w == "yes" and w not in q.choices else "“" ~ w ~ "”" }} sets {% for k, v in vals.items() %}{{ k }} {{ v }}{{ ", " if not loop.last }}{% endfor %}.{% endfor %}
{%- endmacro %}