Forms ask with nushell's own tui on the cli and tui backends; typedialog is needed only for web

Accepted

ontoref
The protocol's forms (reflection/forms/*.ncl) are declarative NCL: elements with a type, a prompt, a

Context

The protocol's forms (reflection/forms/*.ncl) are declarative NCL: elements with a type, a prompt, a nickel_path, and sometimes options, a default, a `when` clause, an editor's prefix_text. Until 2026-10-14 every interactive run of them went through typedialog (forms.nu td-form, td-roundtrip), for all three backends, and `form run` refused without it. The agent path rendered a template or printed the field list instead.

Two things changed the trade, both measured on 2026-10-14:

- nushell 0.116 ships `tui` (book/tui): tui select [--multi], tui textbox, tui label [--titlebar], `tui run`, and `tui debug --keys`, which replays key tokens over the same widget value and returns the same result record. A multiselect's checked rows are in values.<id>.checked — empty when nothing is — while `selected` falls back to the highlighted row. - The F1 finding of the constellation session needed a multiselect (a contract's pay_at) in new_sow, and its interactive path could not be exercised by any contract: typedialog has no replay, so the path a person takes was the one nothing checked.

The twelve forms use eight element types (text, textarea, editor, select, multiselect, confirm, section_header, section) and `when` clauses with ==, != and ||. typedialog's web backend has no nushell counterpart.

Decision

THE CLI AND TUI BACKENDS ARE NUSHELL'S OWN. `form run` asks a form through form-tui.nu: one tui widget per field (text → textbox, select → select starting on its current value, multiselect → select --multi answering what is checked, confirm → a two-item select), editor and textarea through $VISUAL / $EDITOR on a temp file with the field's prefix_text and file_extension, section headers titling the fields after them. Answers are built along each field's nickel_path, prefilled from an --initial record when a flow has one (new_adr's template). The four flows typedialog served write the same files; new_sow, which typedialog only collected, renders its draft into .governance/drafts/ with form render-sow.

TYPEDIALOG IS NEEDED ONLY FOR WEB. `--backend web` keeps typedialog's web form and roundtrip, and says so when typedialog is absent. No other interactive path requires it.

THE PERSON'S PATH IS REPLAYABLE. `form run --keys <nuon>` replays a whole form through `tui debug --keys`, field by field, for any actor; a field the replay names no keys for is refused, so a replay never waits on a terminal. This is how a contract exercises the interactive path.

A FORM SAYS ONLY WHAT FORM-TUI CAN READ. `when` is read as ==, != and || or && (not mixed) over field names already answered; anything else is refused, never taken as true. A field type with no widget is refused by name. A form that needs more extends form-tui first.

Constraints

  • Hard form run on the cli and tui backends asks through form-tui and never answers «typedialog is required»; only --backend web needs typedialog
  • Hard Replayed through tui debug, each field type answers what the keys chose: the typed text, the option's value, the checked list (empty when none), a confirm's boolean, a prefill kept on Enter, a select starting on its current value; an empty required field is refused
  • Hard A `when` clause form-tui cannot read stops the run; it is never taken as true or false

Alternatives considered

  • Keep typedialog for every backend — rejected: It keeps the interactive path unreplayable and an extra install on the adoption path, for the two backends nushell now covers.
  • Replace typedialog on web too — rejected: nushell's tui is a terminal interface; there is no browser surface to replace it with.
  • Drop interactive forms and keep only the agent path — rejected: The agent path prints fields or renders a fixed template; it asks nothing. A person filling a SOW or an ADR needs to be asked.

Related ADRs

ADR-029 · ADR-066 · ADR-072 · ADR-127

Perspectives
Was this useful? Rate it
Got something to add? Tell me what you think, what you'd suggest, or whether we should keep exploring this topic.

· reads