Build OpenTUI + SolidJS reference client for prolog_agent_ui_v1 #112

Closed
opened 2026-08-19 04:06:15 +00:00 by lost-rob0t · 0 comments
lost-rob0t commented 2026-08-19 04:06:15 +00:00 (Migrated from github.com)

Goal

Build the first real frontend for prolog_agent_ui_v1: a small OpenTUI + SolidJS terminal client that consumes the deterministic child-swipl fixture and proves the renderer boundary before the headless coding workflow is wired in.

Implementation: #113.

Architectural constraints

  • Prolog remains authoritative.
  • The client consumes only prolog_agent_ui_v1 snapshots/events/results/errors and sends explicit correlated commands.
  • No tool execution, authority policy, verification semantics, project state inference, or alternate agent runtime in TypeScript.
  • NDJSON/stdin/stdout transport is isolated behind a client transport interface so a local socket can replace it later without changing protocol/view code.
  • Unknown tools and optional extension events render generically.
  • Sequence gaps, session mismatches, malformed frames, unsupported required extensions, unexpected server frames, and transport exit are visible errors rather than silently ignored state.

Slice

  • add a self-contained Bun/OpenTUI/Solid package under agentProlog/ui/opentui/;
  • pin direct OpenTUI/Solid dependencies and configure the official Solid JSX preload/TypeScript settings;
  • implement typed protocol decoding/validation for the v1 wire envelope;
  • implement bounded presentation state derived only from canonical snapshots and ordered semantic events;
  • implement child-process NDJSON transport against agentProlog/bin/prolog-agent-ui-fixture.pl;
  • implement request correlation for negotiate/commands/results/errors;
  • render conversation streaming, tools, approvals/questions, subagents, verification/usage/traces/effect status, and generic unknown events/tools;
  • add keyboard interaction for the fixture approval/question/cancel commands without embedding authority semantics beyond the advertised options;
  • add deterministic protocol/replay tests plus a non-interactive OpenTUI render smoke test;
  • add a standalone persistent child-swipl transport integration that negotiates, replays, issues a correlated command, and observes the next semantic event;
  • add CI coverage for typecheck/tests without requiring a real terminal;
  • update AgentProlog docs/roadmap.

CI hardening found during implementation

The first UI runs caught renderer/transport integration issues rather than being papered over:

  • strict TypeScript callback inference was fixed explicitly without disabling strict;
  • OpenTUI false conditional branches were producing orphan text nodes, so conditional panels now render through empty/non-empty collections under valid <text>/<box> parents;
  • transport exit and unexpected server frames are surfaced explicitly;
  • the real long-lived SWI transport check is executed as a standalone Bun integration after the unit/render suite instead of being removed when the Bun test harness interfered with the child-process lifecycle.

Current exact implementation head: 6e74c6cfaf88178a0da05c34ad5388a52617dd4f.

The final exact-head AgentProlog UI, core CI, and Tree-sitter lanes are queued/running. Do not mark the issue complete or merge #113 until those exact-head gates finish green and the branch is rechecked against current main.

Definition of done

From a clean checkout, the JS client can spawn the fixture server, negotiate prolog_agent_ui_v1, render the canonical session without reconstructing state from logs, issue correlated fixture commands, survive replay/reconnect without duplicate semantic state, and pass deterministic typecheck/tests in CI. No real coding workflow or repository mutation is introduced in this slice.

## Goal Build the first real frontend for `prolog_agent_ui_v1`: a small OpenTUI + SolidJS terminal client that consumes the deterministic child-`swipl` fixture and proves the renderer boundary before the headless coding workflow is wired in. Implementation: #113. ## Architectural constraints - Prolog remains authoritative. - The client consumes only `prolog_agent_ui_v1` snapshots/events/results/errors and sends explicit correlated commands. - No tool execution, authority policy, verification semantics, project state inference, or alternate agent runtime in TypeScript. - NDJSON/stdin/stdout transport is isolated behind a client transport interface so a local socket can replace it later without changing protocol/view code. - Unknown tools and optional extension events render generically. - Sequence gaps, session mismatches, malformed frames, unsupported required extensions, unexpected server frames, and transport exit are visible errors rather than silently ignored state. ## Slice - [x] add a self-contained Bun/OpenTUI/Solid package under `agentProlog/ui/opentui/`; - [x] pin direct OpenTUI/Solid dependencies and configure the official Solid JSX preload/TypeScript settings; - [x] implement typed protocol decoding/validation for the v1 wire envelope; - [x] implement bounded presentation state derived only from canonical snapshots and ordered semantic events; - [x] implement child-process NDJSON transport against `agentProlog/bin/prolog-agent-ui-fixture.pl`; - [x] implement request correlation for negotiate/commands/results/errors; - [x] render conversation streaming, tools, approvals/questions, subagents, verification/usage/traces/effect status, and generic unknown events/tools; - [x] add keyboard interaction for the fixture approval/question/cancel commands without embedding authority semantics beyond the advertised options; - [x] add deterministic protocol/replay tests plus a non-interactive OpenTUI render smoke test; - [x] add a standalone persistent child-`swipl` transport integration that negotiates, replays, issues a correlated command, and observes the next semantic event; - [x] add CI coverage for typecheck/tests without requiring a real terminal; - [x] update AgentProlog docs/roadmap. ## CI hardening found during implementation The first UI runs caught renderer/transport integration issues rather than being papered over: - strict TypeScript callback inference was fixed explicitly without disabling `strict`; - OpenTUI false conditional branches were producing orphan text nodes, so conditional panels now render through empty/non-empty collections under valid `<text>`/`<box>` parents; - transport exit and unexpected server frames are surfaced explicitly; - the real long-lived SWI transport check is executed as a standalone Bun integration after the unit/render suite instead of being removed when the Bun test harness interfered with the child-process lifecycle. Current exact implementation head: `6e74c6cfaf88178a0da05c34ad5388a52617dd4f`. The final exact-head AgentProlog UI, core CI, and Tree-sitter lanes are queued/running. Do not mark the issue complete or merge #113 until those exact-head gates finish green and the branch is rechecked against current `main`. ## Definition of done From a clean checkout, the JS client can spawn the fixture server, negotiate `prolog_agent_ui_v1`, render the canonical session without reconstructing state from logs, issue correlated fixture commands, survive replay/reconnect without duplicate semantic state, and pass deterministic typecheck/tests in CI. No real coding workflow or repository mutation is introduced in this slice.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nsaspy/prolog-rlm#112
No description provided.