Skip to content

Test incremental Agent session rendering with Markdown components #799

Description

@taras

Story

As an XMD contributor, I want to test whether Markdown components can incrementally render a live Agent conversation through @bomb.sh/tty, so the Tail and REPL Stories can share a presentation contract that works from source and a compiled executable.

Current gap

XMD documents execute as generators, while a conversation viewer needs to update an entry as it streams and replace that entry with its completed presentation. @bomb.sh/tty 0.9.0 accepts structured UI operations and input bytes and returns ANSI bytes that redraw changed terminal cells, but XMD has not yet established that its generator model, repository-local components, update coalescing, Markdown projection, viewport behavior, and compiled Deno host compose correctly.

This issue produces finite, disposable evidence. It does not add a production Tail, REPL, provider observer, Agent connection, PTY, terminal emulator, or Grid provider.

Contract

A synthetic source emits immutable entry snapshots shaped only for this proof. One XMD update loop reduces those snapshots into the latest view and invokes the Markdown component selected for each message kind.

The proof uses these component names:

  • Session.Message.User
  • Session.Message.Assistant
  • Session.Message.Thought
  • Session.Message.Tool
  • Session.Message.Permission
  • Session.Message.Status
  • Session.Message.Unknown

Repository-local Markdown component resolution can override each default. For example, components/Session/Message/Tool.md replaces only the tool presentation. The selected component executes with ordinary XMD component behavior. The proof uses a private test-only entry shape and does not export or settle the production normalized entry type or component props; #800 owns that public contract.

The proof captures each selected component's ordinary Markdown result before terminal formatting. A proof-owned projection converts that result into @bomb.sh/tty operations keyed by the entry's stable identity. The deterministic journey includes paragraphs, emphasis, and a fenced code block so displaying raw Markdown or reducing every result to plain text cannot satisfy the evidence. The proof does not settle the complete production Markdown-presentation breadth.

XMD owns the immutable entry state, stable entry identity, coalescing, viewport position, follow mode, unread state, and entry replacement. A streaming snapshot replaces only that entry's region. A completed snapshot replaces it with the final presentation. Authors write ordinary Markdown and do not manage regions.

Input ingestion does not wait for rendering. If a component is deliberately blocked, later snapshots continue to enter the projection and coalesce to the latest state. Releasing the component renders that latest state rather than replaying every intermediate frame.

The viewer reconstructs a complete synthetic conversation, opens at the newest entry, follows new entries while positioned at the bottom, suspends follow when the reader scrolls upward, reports unread entries, and resumes follow when the reader returns to the end.

@bomb.sh/tty 0.9.0 owns zero-I/O layout, input decoding, resize processing, and the ANSI bytes representing cells changed since the previous frame. It does not own the conversation viewport or follow state, acquire a PTY, emulate a child terminal, own Agent sessions, or multiplex processes. The evidence records the exact package version it exercised.

Acceptance

  • One update loop renders every proof message kind through its named default Markdown component.
  • A repository-local components/Session/Message/Tool.md override changes only the tool presentation.
  • Paragraphs, emphasis, and a fenced code block become structured Bombshell presentation rather than raw Markdown or uniformly plain text.
  • Several streaming snapshots replace one stable entry region, and completion replaces it with a final summary without duplicating neighboring entries.
  • A signal-controlled blocked component does not block source ingestion; pending visual work coalesces to the latest immutable snapshot and renders after release.
  • Full history is scrollable from an initial position at the newest entry.
  • Scrolling upward suspends follow, incoming entries increment the unread state, and returning to the end resumes follow without losing entries.
  • Resize preserves entry identity, viewport position, and the correct follow state.
  • Bombshell emits ANSI bytes for the changed cells rather than repainting an unbounded transcript; a negative control that forces a whole-history repaint fails.
  • The same deterministic journey passes through the Deno source entrypoint and a deno compile executable using the recorded @bomb.sh/tty version.
  • Negative controls fail if stable regions, component overrides, Markdown projection, coalescing, follow suspension, bounded diff output, or the compiled entrypoint are removed.
  • No exported type, component prop contract, or production package adopts the proof's synthetic entry shape.
  • The proof uses synthetic entries and spends no model turn, reads no provider file, opens no ACP connection, and starts no PTY or native Agent.

Decision

Passing evidence authorizes #800 to build the shared production presentation used independently by <Session.Tail> and the XMD REPL. A failure identifies whether the generator update model, Markdown projection, Bombshell integration, viewport ownership, or compiled host must change before either consumer proceeds.

Relationships

Out of scope

  • The production normalized entry schema or component-prop contract.
  • The complete production Markdown-presentation breadth.
  • Provider-file discovery or normalization.
  • ACP interaction, prompt queues, permissions, or cancellation.
  • Durable rendering frames or terminal UI state.
  • Native child processes, PTYs, terminal emulation, or Grid implementation.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    UXUser-facing usability and interaction improvementsdocumentsExecutable documents, authored workflows, and reader-facing document behaviorenhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions