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

  1. added
    enhancementNew feature or request
    documentsExecutable documents, authored workflows, and reader-facing document behavior
    UXUser-facing usability and interaction improvements
    on Sep 10, 2026
  2. taras commented on Sep 11, 2026

    @taras
    OwnerAuthor

    Architect readiness: READY FOR PLANNING

    The contract in the issue body is ready for a Planner. This is a design-readiness review; no implementation commit exists or was reviewed. The repository's current main head at review time is 06cf5fb8efec48a3a020515588d13bc2fad6e55a, and the Planner should resolve its exact implementation base when preparing the stack.

    The Product Owner approved two feature-local decisions:

    • XMD owns Markdown projection, entry identity and replacement, coalescing, viewport position, follow mode, and unread state. @bomb.sh/tty 0.9.0 owns zero-I/O layout, input decoding, resize processing, and ANSI diff bytes.
    • The proof uses a private test-only entry shape. It proves the seven named component selections and repository-local override behavior without exporting or settling Render Agent session entries with Markdown components #800's production normalized entry type or component props.

    The existing rulebooks settle the remaining boundaries: authors write ordinary Markdown and no region syntax; repository-local resolution keeps its established precedence; rendering and viewport state stay live-only; the proof adds no Workflow, Agent, provider-file, ACP, PTY, terminal-emulator, or Grid authority; and deterministic positive and negative controls run from source and a compiled executable.

    #799 can proceed independently of #781–#783 and the tmux provider. #800 remains downstream of the accepted proof. The next action is a Planner handoff for the smallest disposable implementation and discriminating evidence described by the amended issue.

  3. taras commented on Sep 11, 2026

    @taras
    OwnerAuthor

    Accepted architecture evidence

    PR #805 at exact head 9a3cf2473ca706c0ac89b66700a539a6ca368908, based on 06cf5fb8efec48a3a020515588d13bc2fad6e55a, passes architecture review.

    The focused evidence passed:

    deno task test scripts/tests/session-rendering.test.ts scripts/tests/runtime-exclusions.test.ts scripts/tests/test-file-discovery.test.ts
    
    8 passed (39 steps), 0 failed
    

    The proof establishes these conclusions for #800:

    • @bomb.sh/tty 0.9.0 is viable as a zero-I/O layout, input, resize, and changed-cell ANSI layer under both Deno source and deno compile.
    • XMD can own immutable normalized entry state, stable entry identity and replacement, coalescing, viewport anchoring, follow mode, and unread state in one update loop.
    • Ingestion can continue while rendering is blocked; stale projection work can be discarded and the newest state rendered.
    • Viewport position can remain anchored to entry identity across scrolling, updates, and resize.
    • Ordinary Markdown components can present message kinds while retaining repository-local override precedence.
    • Tail and REPL can share this presentation contract without sharing transports, stores, watchers, ACP connections, or lifecycle authority.

    The accepted evidence does not promote the proof's private synthetic entry type, test-only props, narrow Markdown lexer, mutation switches, evidence-record shape, byte counts, barrier implementation, root dependency placement, or environment-permission exception. Those are disposable proof mechanics.

    #800 owns the production contract. Its exact normalized entry schema, Session.Message.* props, and production package boundary remain architecture decisions.

  4. taras commented on Sep 17, 2026

    @taras
    OwnerAuthor

    The experiment produced useful historical evidence, but its disposable Markdown/Bombshell implementation is no longer a prerequisite for the REPL. #827 deliberately starts with execution semantics, journal truth, identity, reconstruction, and lifecycle before selecting presentation machinery. Open PR #805 is not a production foundation for the new Quest.

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