attune-forms
Structured agent ↔ user communication for AI coding agents: typed,
validated forms instead of guessing or twenty questions.
Ask an agent for a security audit and it usually either guesses your
intent or interrogates you one question at a time. Both failures share a
root cause: free-form chat is the only channel most agents have. This
library gives agents the other channel — a communication grammar of
declarative, validated forms. Independent decisions batch into one
round-trip; malformed questions are refused at build time; malformed
answers are refused at collection time. Nothing is silently accepted in
either direction.
The full argument: "A Communication Grammar for AI
Agents".
What's new in 0.17.0
-
The AskUserQuestion profile declares the multi-select escaping it
was measured to have, which is none. It had claimed JSON-quoting the
host does not perform: a live trial offering red, green and blue
returned red, green,blue — a bare comma join indistinguishable from
three atoms — and say "hi" / back\slash came back raw. Labels
containing the delimiter or a quote were already refused and still
are, but now permanently rather than pending evidence, and the
refusal says which case it is. Evidence:
docs/probes/host-question-escaping-2026-09-08.md.
Consumers pinning the profile's facet digest should re-pin; a
downstream that characterizes this host's codec should read the probe
before writing its own receipt.
What's new in 0.16.0
- The host-question line is reachable end to end.
attune_forms.host_question_adapter decodes a raw reply from a host's
own question control back to typed answers through the bindings AF-2
retains, and elicitation_render_form / elicitation_collect_response
now carry it: host_question out, host_response back, with a bounded
re-ask (next_host_question, next_attempt, answered_so_far) and
cancelled: true for a dismissed prompt. batches still ships and is
deprecated.
- The public surface is tiered. 46 names are stable, 91 provisional,
2 deprecated — a promise you can rely on instead of 139 names promised
equally.
attune_forms.stability records it and a test fails when a new
export carries no tier. See docs/stability.md.
- Behavior changes to promised surface can't land silently. A checked-in
record pins what the stable surface does, so a change arrives as a
readable diff rather than a flipped hash — and it digests the contract,
not the paint: a CSS change provably does not move it.
- First deprecations.
form_to_askuserquestion and is_trivial_form
now warn, naming their replacements; removal no earlier than 0.18.0.
- A running server can say which version it is. The MCP handshake
reported the SDK's version under this package's name; it now reports its
own. Pinning is documented for every install path.
What's new in 0.15.0
- Host-question profile facet —
InteractionProfile.host_question
describes a host's built-in question control as data: question, option
and header limits, multi-select, the reserved Other label and where free
text arrives, cancellation, validation feedback with a finite attempt cap
and deadline, closed text normalizations, the raw multi-select response
encoding, the recommended-label suffix and the host's unanswered marker.
CLAUDE_ASKUSERQUESTION is the installed profile for Claude Code's
AskUserQuestion, from a live desktop trial; installed_profile(id)
looks profiles up.
- Pure admissibility and renderer —
host_question_admissibility(form, profile) says before any render whether a form fits the control without
truncation or ambiguity, naming every reason it does not;
form_to_host_question(form, profile) returns a frozen
HostQuestionBatch: the host-visible payload plus immutable
QuestionAnswerBindings a server adapter retains to map raw answers back
to option ids. No raw-host decoder ships; the consuming adapter owns
correlation, cancellation, feedback and receipts.
- Route-active registry target —
form.host_question sits beside the
unchanged compatibility-only form.askuserquestion; a route-active
target must resolve to an installed profile carrying the facet;
render_fixture() and scripts/af2_clean_wheel_probe.py execute the
canonical host-question fixture from a wheel.
- Host-native router default —
select_form_surface now returns
"ask" for every form the installed host profile admits and "widget"
only for forms it cannot carry (number/date/textarea, over-cap questions
or options, a ranking, an uncorrelatable duplicate question).
This minor adds the host-question line (attune-ai host-surface-parity
AF-2, D15–D17); everything from 0.14 remains available unchanged.
What's new in 0.14.0