docs/TUI_PARITY.md

Android / TUI parity

The first target is the existing TUI's behavior and capabilities over the existing JSONL API, with native Android input and presentation. The current Material UI is a working starting point, not a frozen design. Deliberate Android improvements come after the corresponding parity behavior, in separate changes.

Boundaries

  • Android owns its state, navigation, rendering, commands and attachment lifetime. The daemon remains authoritative for sessions, canonical turns, run state, questions and workflow metadata.
  • No protocol or harness changes are bundled into this port. Missing APIs are reported for separate implementation by the user.
  • Long press opens actions for the pressed session, turn, tool entry or attachment. Opening a menu does not select a different session or change Inbox metadata. Important actions must also be discoverable without long press.
  • Preserve SSH host verification, discretionary local key protection, explicit reconnect, credential ownership and the existing foreground connection service.
  • Hub, terminal handoff, remote graphical viewing and on-device execution are not part of this first-pass remote Android client.
  • No app-development format migrations or legacy readers before release.

Capability checklist

This is a live implementation checklist, not a claim of complete parity. "Core" means reusable state/projection code; "UI" means wired Android behavior. Runtime validation is distinct from unit-test coverage.

AreaImplemented native behaviorAcceptance evidence / remaining limits
Connection/workspaceGeneration and exact endpoint/CWD ownership, stale-result guards, explicit reconnectLive authorized SSH and background/return passed; no silent credential retention or replay
Local draftsRAM text/cursor/settings/images; first confirmed send materializes one persistent leaf; uncertain-create/setup/send barriersLive inventory before/after proved exactly one new persistent leaf; explicit reconciliation UI is unit/integration tested, not live fault-injected
Sessionsparent_leaf forest, independent disclosure, ancestor search, recency and stable row identityNative fixture navigation, nesting and renamed child inspected; deep/large forests covered by tests
InboxFlat strictly due alert_time, newest first, maturation/10-second refresh; open does not settleLive nonselected Unsettle and selected Settle ACKs checked against authoritative metadata
AttentionShared acknowledged write lane for settle/unsettle/snooze/send idle arming; independent per-attempt warnings survive draft materializationNative settle/unsettle tested live; warning handoff/late-callback regressions offline; natural-language snooze not exercised live
History/liveExact canonical cuts, hydrated content, guarded replacement, UTF-8 streaming offsets and bounded recoveryReadable checkpoint plus actual native prompt/reply streams; malformed/lost streams tested with deterministic seams
SubmissionOriginal-origin prompt/steer/abort, queue inspection, immutable first-send settings and ACK ownershipText/follow-up/new-draft sends tested live; live steer/abort and uncertainty injection remain unexercised
QuestionsRevision-bound project-config trust, accepted snapshots alone clear, local HideNative UI wired and tested; no live trust approval performed during fixture tests
RenderingNative text/code/thinking/badges, typed headings, occurrence-aware tools, image metadata, bounded reading-state restorationReadable/live checkpoints; original background call lookup on demand, bounded canonical ancestors only
Context actionsCopy/details/fork; confirmed canonical Edit/Try Again and exact-tip rewind; newer text/image CASComponents and process adapter wired/tested; final device action coverage recorded separately
Session managementRename/fork/delete; paged turn tree and exact-CWD orphan recoveryConfirmations, acknowledged identity and no-guess/no-replay covered; tree is seq/parent inspection, not a replica of TUI chain compression
Models/thinking/modesDiscovery, draft-local choices, ACKed real edits, scoped mode lookup and invalid inherited-model handlingLive draft model picker and /thinking medium; authoritative config changed without adding canonical turns
CapabilitiesTools/plugins/filetypes and six trigger arrays; empty vs inherited settings; read-only running usageSettings UI and tests; every capability toggle not exercised against live provider
Commands/macrosTUI grammar/precedence, shorthand, explicit internal invocation, command-owned draft mode edits, errors and uncertainty barrierNative help/command sheets and dispatch; local-only commands never become canonical turns; local/pre-invocation failure vs unknown outcome covered by production-seam tests
CompletionsLocal/provider CSV and RE2 matching, original regex indexes, cursor/text guards, remote pathsLocal thinking completion exercised live; provider/offset/race cases tested
RecallProcess RAM input recall and per-origin drafts, separate from canonical historyNative chooser and regression coverage; no process-death persistence
Images: postingPick/preview/remove/send original inline bytes; explicit share/paste URI intake, bounded memory and gesture CASNative share journey, source-deletion lifetime, JPEG blue and true-color PNG red succeeded; palette PNG misread, independently reproduced outside Android
Stored attachmentsOn-demand image/text preview, Save as for every type, external-app opening for other formatsUses persisted turn ID/original attachment ordinal and validated chunk RPCs; see attachment viewing for bounds and lifecycle
Usage/status/workflowAccess source, timing, run/background/queue/progress; typed native workflow phases/fanouts/paged task graphs, names and guarded pollingLive access/timing observed; workflow parser/controller/UI tests; final runtime/device results recorded in PORT_VALIDATION
Maintenance/helpNative help/cache/prune/deep-prune/recovery; direct seven-day maintenance and an other-age wizardShared-daemon scope; see current validation reports for live destructive maintenance evidence
LifecycleDisposable Activity UI, process-owned operations, foreground SSH, shared deliberate disconnect/replacement cleanup without elapsed deadlines, explicit loss/reconnect and reconciliationHome/Recents/return retained connection; notification/replacement/helper cleanup and credential-cancellation regressions offline; real-phone biometrics/screen lock remain deferred

This table describes implemented source, not blanket proof of interactive parity. See PORT_VALIDATION.md for exact source checkpoints, commands, counts, device evidence and limitations. Android-specific bounds (tree 32,768, 100-choice pages, workflow 4,096 rows/collection and 80-task graph pages) are explicit resource policy, not wire changes. No terminal UI is embedded.

API/data blockers

  1. Remote retained capture output: the remote TUI itself marks retained bash: output previews unavailable. Original call arguments can still be recovered from historical turns. No JSONL retained-capture read operation was identified. Match that limitation rather than reading remote paths locally or running extra SSH commands.

Other inspected core parity gaps have existing operations; they require Android client implementation, not new RPC categories. New confirmed blockers belong here with the exact missing data/operation and affected feature.

Contract details that must survive the port

  • leaf_updated replaces a full snapshot, including empty/null/zero values. Positive itr is connection-local ordering, not a cross-connection revision.
  • History is a selected leaf cut, not every turn in its root. Old hydration must not overwrite a newer visit or newer accepted head.
  • Offsets in message_update are UTF-8 bytes. Android editor offsets are UTF-16; completion offsets require an explicit boundary conversion.
  • Completion CSV uses single-quoted fields with doubled apostrophes, not ordinary double-quoted CSV. Provider list and query replies retain original regex indexes.
  • Prompt/steer acceptance releases submission ownership, not proof of run completion. Never replay an ambiguously delivered mutation automatically.
  • Inbox membership uses only a valid, strictly due alert_time on persistent leaves. alert_idle is separate. Opening does not mutate either field.
  • Missing metadata-write acknowledgements create uncertainty for that leaf; service rejections are different. Attention errors cannot undo an accepted send.
  • Internal macros are hidden from ordinary suggestions but explicitly invocable. Plugin and trigger selection use full configuration arrays, not invented RPCs.
  • Local UI notices never become canonical turns or acquire rewind actions.
  • Raw repository-controlled trust descriptions are data, not security instructions.

Delivery and validation

Work is organized on port/tui-parity as small coherent commits with focused regression coverage and accurate AI attribution. Independent worktrees isolate parallel implementation. The coordinator owns integration builds and major Waydroid checkpoints; implementation workers own explicitly assigned focused tests.

Major checkpoints: readable live conversations; complete text conversation and navigation/Inbox; settings/completions/images; final applicable-parity audit. Update this checklist and current README behavior as features are wired. Do not label a pure projection or passing build as completed interactive UI.

Live validation is restricted to the user's authorized mog/Waydroid environment. Use a test CWD under build/tui-test-workspace and test-owned leaves for mutations. An isolated side-by-side development package may preserve the installed app's existing key/profile data; never silently reset or replace them. Keep fixture cleanup separate from unrelated user sessions and authorization entries.

Authorities

  • Harness docs/pkg/tui.md, pkg/tui/ behavior and regression tests.
  • Harness docs/agent-api/jsonl-api.html and pkg/protocol/ wire contracts.
  • Harness docs/internal/frontend/stream.md and stream assembler conformance tests.
  • This repository's ez-agent-lib/README.md, service wrappers and tests.
  • SSH security and lifecycle and project AGENTS.md.