Skip to content

feat(desktop): answer structured form interactions - #4384

Open
me2seeks wants to merge 8 commits into
feat/4364-runtime-form-interactionsfrom
feat/4364-desktop-form-interactions
Open

feat(desktop): answer structured form interactions#4384
me2seeks wants to merge 8 commits into
feat/4364-runtime-form-interactionsfrom
feat/4364-desktop-form-interactions

Conversation

@me2seeks

@me2seeks me2seeks commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Summary

  • render Runtime Host-owned structured form interactions in the Desktop composer for both the main conversation and Side Chat
  • preserve omitted optional fields separately from explicit empty or false values, while validating all six primitive field kinds through the shared core contract
  • decode renderer responses at the IPC boundary and retire prompts only after Host settlement or its projected acknowledgement

Why

PR #4379 establishes the durable form interaction contract and Runtime Host continuation authority. Desktop still needs a surface adapter so a tool can collect bounded structured input without falling back to an untyped text question or inventing a second pending-interaction owner in the renderer.

This PR is stacked on #4379 and implements the Desktop slice of the rollout in #4364. It does not add provider-specific form state or change the MCP wire path.

Screenshots

Before, Desktop could only render the fixed question prompt. After, the same composer slot renders a structured form, preserves optional field intent, and reports field-local validation errors.

Before: fixed question prompt After: structured form prompt
Desktop fixed question prompt before this PR Desktop structured form prompt after this PR

Usability states

Optional field included with explicit true Field-local validation after submit
Optional boolean inclusion and explicit true value Invalid string value with field-local error

Test plan

  • npm run build
  • 122 focused UI/Desktop interaction tests
  • 45 focused storage tests with a non-worktree temporary directory
  • Storybook interaction check at 1440x900: defaults, optional boolean inclusion/value, invalid required string

Part of #4364.

@me2seeks
me2seeks force-pushed the feat/4364-desktop-form-interactions branch from f6247a5 to b814c29 Compare August 31, 2026 17:50
@me2seeks
me2seeks force-pushed the feat/4364-desktop-form-interactions branch from b814c29 to 661ee44 Compare August 31, 2026 17:56
@me2seeks
me2seeks force-pushed the feat/4364-desktop-form-interactions branch from 828699d to 098cac3 Compare August 31, 2026 19:03
@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 #4384098cac3 — blind review sealed

Summary: Desktop structured-form answer surface stacked on #4379. Exact head 098cac3a547454b51cf0a37c36b775024583ddc9 frozen. Source is approvable with comments; inherits #4379's 2×P2+1×P3. No simplify finding. Full build passed; 91 focused Desktop/UI tests passed; exact-head hosted test green. 0 reviews/0 threads on stacked base; mergeable on stacked base.

Findings (reproducible):

  • P2 — drafts reset on fields identity change — form resets drafts when fields array identity changes. Runtime Host recovery republishes same pending request as freshly projected objects; React DOM probe typed release-candidate, rerendered clone with same request ID → input became empty. Any pending-set change can trigger. Fix: reset only on stable requestId/semantic revision, add recovery regression.
  • P2 — constraints not rendered — surface enforces minimum/maximum, length, cardinality, format but renders only generic invalid message. Production render of integer min=max=997 + date-time field contained neither 997 nor date-time, so legal opaque forms can be undiscoverably unanswerable. Fix: render visible/accessible constraint help and cover formats/ranges.

Gating: hosted test green on stacked base; full stack inherits #4379 risk. Direct current-main merge has explicitly ignored epoch conflict plus generated inventory conflicts (base stack not landed) — not retained as finding.

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 098cac3 的独立盲审,已按 @me2seeks 指示排除 compatibility epoch 冲突的计分。编排仅核对 head 未漂移与 CI 状态。

@me2seeks
me2seeks force-pushed the feat/4364-desktop-form-interactions branch from 098cac3 to 28ad94a Compare September 1, 2026 08:26
@me2seeks

me2seeks commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

Fixed both findings in 28ad94a. Draft state is now keyed by requestId, so a recovery projection of the same request keeps local edits while a different request resets them. Field constraints are rendered visibly and linked to their field group through aria-describedby.

Added a DOM regression covering cloned fields, request replacement, ranges, formats, and accessible descriptions.

@me2seeks
me2seeks requested review from ARE404, Astro-Han and M4n5ter and removed request for ARE404 and Astro-Han September 1, 2026 14:49
@me2seeks
me2seeks force-pushed the feat/4364-desktop-form-interactions branch from 28ad94a to 5bf55c9 Compare September 1, 2026 15:04
@me2seeks

me2seeks commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

The previous CI failure was the renderer architecture ledger after the rebase, not a form test failure. This head refreshes that ledger and retains the form variant in the composer interaction union alongside main's Goal projection ownership. Local full build, renderer architecture check, UI form regression, and AppShell response regression pass.

@me2seeks
me2seeks force-pushed the feat/4364-desktop-form-interactions branch from 5bf55c9 to addd05b Compare September 1, 2026 15:25
@me2seeks
me2seeks force-pushed the feat/4364-desktop-form-interactions branch from addd05b to 4e66b42 Compare September 2, 2026 13:58
@me2seeks

me2seeks commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto the updated parent head (cd16fd613) and completed the composer-queue follow-up in 4e66b42ec.

The parent narrowed ComposerInteraction to the request kinds a surface without form support can render, so a pending form can no longer hide the composer behind an empty prompt. This branch installs the Desktop form surface, so the shared queue now accepts form_request again and retires it on form_answer_ack, matching the boundary/question siblings; the parent coverage that asserted forms stay out of the queue is replaced with enter/leave and rehydration coverage for the form kind.

Validation on 4e66b42ec: full npm run build, Desktop typecheck including stories, renderer architecture check, @maka/ui suite 318/318, @maka/desktop dist suite 1956/1956.

@me2seeks
me2seeks force-pushed the feat/4364-desktop-form-interactions branch from 4e66b42 to 78bd322 Compare September 3, 2026 02:26
@me2seeks

me2seeks commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto the updated parent head (3dd69e776, which fixes the answer-envelope byte domain) and closed the architecture ratchet in 78bd322de.

The form responder wiring adds tokens to two debt-tracked legacy files; single-statement conditionals collapse to braceless form so both stay at or below the parent baseline (app-shell-session-events.ts 2974, app-shell.tsx 15778 vs base 15779), and the renderer architecture ledger is refreshed to match.

Validation on 78bd322de: full build; ratchet passes against the current parent head; @maka/ui form suites 14/14; focused Desktop form/quote suites 17/17; Desktop dist suite 1956/1956; baseline architecture check green.

@me2seeks
me2seeks force-pushed the feat/4364-desktop-form-interactions branch from 78bd322 to 64b659b Compare September 3, 2026 06:01
@me2seeks

me2seeks commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto the updated parent head (51bacd210, strict escaped-envelope admission) in 64b659b05; the child delta is unchanged and the renderer architecture ratchet still passes against the new parent. Validation: full build; @maka/ui form suites 14/14; Desktop dist suite 1956/1956.

@me2seeks
me2seeks force-pushed the feat/4364-desktop-form-interactions branch from 64b659b to dff1608 Compare September 3, 2026 07:07
@me2seeks

me2seeks commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto the current parent head (9ec0c5f9a, format-aware envelopes, rebased onto main) in 2b7430c05.

Main rewrote the transcript reading-position block while the parent moved, so the token-debt golf was re-measured from scratch against the new base: seven single-statement conditionals collapse to braceless form and app-shell.tsx lands at 15,690 nonTriviaTokens, two under the parent baseline; the renderer ledger is regenerated to match. The hosted test failure on the intermediate head was the stale astryx surface inventory (the form prompt and story bring coverage to 245 files), now refreshed.

Validation on 2b7430c05: full build; Desktop typecheck; ratchet passes against the current parent; @maka/ui form suites 14/14; Desktop dist suite 2009/2009; astryx inventory and baseline architecture checks green; exact-head hosted test is green.

@me2seeks
me2seeks force-pushed the feat/4364-desktop-form-interactions branch from 2b7430c to 23e509f Compare September 3, 2026 09:17
@me2seeks
me2seeks force-pushed the feat/4364-desktop-form-interactions branch from 23e509f to 04616dc Compare September 3, 2026 09:32
Render the Host-owned primitive form contract in the shared composer slot for both the main conversation and Side Chat. Preserve optional omission separately from explicit values, validate through the shared core contract, and expose cancel, decline, and accept without introducing surface-owned continuation state.

Decode renderer responses at the Desktop IPC boundary, settle them through Runtime Host, and retire prompts only after the authoritative answer succeeds or its acknowledgement is projected. Cover all six field kinds, malformed responses, reconnect hydration, and both Desktop surfaces.

Part of #4364.

Generated-by: OpenAI Codex
Route main-surface form answers through the existing Desktop platform adapter, expose test-only companion helpers from the Workbar testing entry, and keep legacy AppShell debt monotonic while sharing response settlement behavior.

Add focused coverage for answer acceptance and failure retention.

Part of #4364.
Refresh the generated Astryx surface inventory for the aligned structured-form prompt.

Part of #4364.
Keep the Session Workbar Storybook services aligned with the required structured-form response capability.

Part of #4364.
The parent narrows the composer queue to the request kinds a surface
without form support can render, so a pending form can no longer hide
the composer behind an empty prompt. This branch installs the Desktop
form surface, so the shared queue accepts form_request again and
retires it on form_answer_ack, matching the boundary/question siblings.

Replace the parent coverage that asserted forms stay out of the queue
with enter/leave and rehydration coverage for the form kind.
The composer form responder wiring adds tokens to two debt-tracked
legacy files. Collapse single-statement conditionals to braceless form
so both files stay at or below the parent baseline and refresh the
renderer architecture ledger.
The form interaction prompt and its story bring the inventory to 245
files; regenerate so the hosted inventory gate matches the tree.
@me2seeks
me2seeks force-pushed the feat/4364-desktop-form-interactions branch from 04616dc to e8b22e8 Compare September 3, 2026 10:56
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