Skip to content

feat(tui): answer structured form interactions - #4392

Open
me2seeks wants to merge 6 commits into
feat/4364-runtime-form-interactionsfrom
feat/4364-tui-form-interactions
Open

feat(tui): answer structured form interactions#4392
me2seeks wants to merge 6 commits into
feat/4364-runtime-form-interactionsfrom
feat/4364-tui-form-interactions

Conversation

@me2seeks

@me2seeks me2seeks commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add a review-first TUI overlay for all six structured form field kinds, including optional omission, defaults, decline, and cancel
  • route form answers and acknowledgements through the existing Runtime Host Interaction operation and ordered pending-interaction queue
  • stop the exact Turn with a form-specific error in non-interactive maka run instead of dropping a request it cannot answer
  • show requester provenance and sensitive-data guidance, validate with the shared Core contract, and close stale overlays when authoritative transcript state is replaced

Why

#4379 establishes the provider-neutral, Host-owned form contract. Without a TUI adapter, an interactive CLI Turn that receives one of those requests has no way to continue. This PR keeps Runtime Host as the only lifecycle and answer authority; the overlay owns only an uncommitted local draft.

This is a sibling of the Desktop adapter in #4384. Both depend directly on #4379; neither surface depends on the other.

Part of #4364.

Screenshots

Captured from the production TUI runner at the exact parent and current heads.

Before — Host waits without a form surface After — review-first structured form
Before: the Host is waiting but the TUI has no form surface After: the TUI shows requester provenance, safety guidance, fields, and actions
Validation remains editable Optional value remains distinct from omission
Validation failure remains in the form review surface An optional explicit true value is reviewable before submission

Test plan

  • npx biome check on all changed files
  • npm run build
  • TMPDIR=/dev/shm/maka-4364-tui-tests node --test --test-reporter=dot 'packages/cli/dist/**/*.test.js'

Generated-by: OpenAI Codex

@me2seeks
me2seeks force-pushed the feat/4364-runtime-form-interactions branch from be4056c to ed745fb Compare August 31, 2026 17:47
@me2seeks
me2seeks force-pushed the feat/4364-tui-form-interactions branch from 9fe4ef1 to 773a8c7 Compare August 31, 2026 17:50
@me2seeks
me2seeks force-pushed the feat/4364-runtime-form-interactions branch from ed745fb to 032d77f Compare August 31, 2026 17:56
@me2seeks
me2seeks force-pushed the feat/4364-tui-form-interactions branch from 773a8c7 to 1b643ad Compare August 31, 2026 17:56
@me2seeks
me2seeks force-pushed the feat/4364-runtime-form-interactions branch from 032d77f to d8bae9f Compare August 31, 2026 19:00
@me2seeks
me2seeks force-pushed the feat/4364-tui-form-interactions branch 2 times, most recently from 0de6710 to 2c1e2b9 Compare August 31, 2026 19:10
@github-actions github-actions Bot added the effort/XL Over 1000 readable lines label Sep 1, 2026

@Astro-Han Astro-Han left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR #43922c1e2b9 — blind review sealed

Summary: TUI structured-form answer surface stacked on #4379/#4384. Exact head 2c1e2b9ec92f3ab92581de8e676451381ffec553 frozen. Source is approvable with comments; inherits #4379's 2×P2+1×P3. No simplify finding. Full build passed; CLI suites 396/396 green (70-test driver suite after TMPDIR parent fix), exact-head audit green; no hosted test on this head; 0 reviews/0 threads.

Findings (reproducible):

  • P2 — reconnect clears pending drafts — replacement reconnect clears pending interaction and closes overlay, discarding its only #drafts copy. Production recovery then re-seeds same still-pending Host request from defaults. Reducer+overlay probe typed release-candidate; after replacement + same-request seed it became Version (required): empty. Fix: preserve drafts by {sessionId, requestId} until authority resolves/removes request; add canonical same-request reseeding test.
  • P2 — constraints not rendered — all Core constraints enforced but none rendered (same as #4384 TUI). Overlay with required integer min=max=997 + required date-time showed neither value, only generic invalid feedback → legal forms not discoverably answerable. Fix: render localized range/length/cardinality/format help and test.

Gating: current-main merge clean except explicitly ignored epoch conflict. Inherits base-stack risk.

Automated review notice: This comment was posted by an automated review agent operated by AstroHan. It is not an independent human review and does not replace one.


简体中文

本条结论来自 @捣蛋鬼 在 exact head 2c1e2b9 的独立盲审,已按 @me2seeks 指示排除 compatibility epoch 冲突的计分。编排仅核对 head 未漂移与 CI 状态。

@me2seeks
me2seeks force-pushed the feat/4364-runtime-form-interactions branch from d8bae9f to 1fba905 Compare September 1, 2026 08:26
@me2seeks
me2seeks force-pushed the feat/4364-tui-form-interactions branch from 2c1e2b9 to 1804908 Compare September 1, 2026 08:26
@me2seeks

me2seeks commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

Fixed both findings in e898717. The TUI now keeps one schema-matched transient draft snapshot by session/request across the reconnect replay gap, while an authoritative replacement with another request still discards it. Active-field constraints are localized and visible.

Added runner-level reconnect replay and overlay regressions. The rebase onto current main also required extending the catalog test values for the new constraint variables (1804908).

Define a bounded provider-neutral primitive form contract and carry its request and acknowledgement facts through the Runtime Event Log. Broker pending forms through the existing InteractionStore authority so schema-invalid answers remain pending, concurrent equivalent answers converge on one canonical outcome, and Turn closure or Host restart closes the exact continuation.

Part of #4364.

Generated-by: OpenAI Codex
Expose one closed decoder for renderer-to-runtime form responses so surface adapters do not copy protocol validation. Queue the same canonical continuity refresh for form requests that user questions already receive.

Refs #4364.

Generated-by: OpenAI Codex
Review and edit Host-owned forms in the existing TUI interaction queue, preserving optional omission and all six primitive field kinds. Route accepted, declined, and cancelled responses through the generic Runtime Host interaction operation, while non-interactive runs stop the exact Turn instead of dropping the request.

Keep requester provenance and sensitive-data guidance visible, validate with the shared Core contract, and retire stale overlays when authoritative transcript state changes.

Part of #4364.

Generated-by: OpenAI Codex
@me2seeks
me2seeks force-pushed the feat/4364-runtime-form-interactions branch from 1fba905 to 4609622 Compare September 1, 2026 15:04
@me2seeks
me2seeks force-pushed the feat/4364-tui-form-interactions branch from 1804908 to c7abdac Compare September 1, 2026 15:05
@me2seeks
me2seeks force-pushed the feat/4364-runtime-form-interactions branch from a12633d to 066718d Compare September 1, 2026 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/XL Over 1000 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants