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.
| Area | Implemented native behavior | Acceptance evidence / remaining limits |
|---|---|---|
| Connection/workspace | Generation and exact endpoint/CWD ownership, stale-result guards, explicit reconnect | Live authorized SSH and background/return passed; no silent credential retention or replay |
| Local drafts | RAM text/cursor/settings/images; first confirmed send materializes one persistent leaf; uncertain-create/setup/send barriers | Live inventory before/after proved exactly one new persistent leaf; explicit reconciliation UI is unit/integration tested, not live fault-injected |
| Sessions | parent_leaf forest, independent disclosure, ancestor search, recency and stable row identity | Native fixture navigation, nesting and renamed child inspected; deep/large forests covered by tests |
| Inbox | Flat strictly due alert_time, newest first, maturation/10-second refresh; open does not settle | Live nonselected Unsettle and selected Settle ACKs checked against authoritative metadata |
| Attention | Shared acknowledged write lane for settle/unsettle/snooze/send idle arming; independent per-attempt warnings survive draft materialization | Native settle/unsettle tested live; warning handoff/late-callback regressions offline; natural-language snooze not exercised live |
| History/live | Exact canonical cuts, hydrated content, guarded replacement, UTF-8 streaming offsets and bounded recovery | Readable checkpoint plus actual native prompt/reply streams; malformed/lost streams tested with deterministic seams |
| Submission | Original-origin prompt/steer/abort, queue inspection, immutable first-send settings and ACK ownership | Text/follow-up/new-draft sends tested live; live steer/abort and uncertainty injection remain unexercised |
| Questions | Revision-bound project-config trust, accepted snapshots alone clear, local Hide | Native UI wired and tested; no live trust approval performed during fixture tests |
| Rendering | Native text/code/thinking/badges, typed headings, occurrence-aware tools, image metadata, bounded reading-state restoration | Readable/live checkpoints; original background call lookup on demand, bounded canonical ancestors only |
| Context actions | Copy/details/fork; confirmed canonical Edit/Try Again and exact-tip rewind; newer text/image CAS | Components and process adapter wired/tested; final device action coverage recorded separately |
| Session management | Rename/fork/delete; collapsible turn tree using the TUI projection (linear runs collapse into expandable ranges, older fork siblings open side lanes, leaf tips listed under their turn) and exact-CWD orphan recovery | Confirmations, acknowledged identity and no-guess/no-replay covered; projection parity, lane geometry and visible-row-only previews unit tested; forked 1005-turn root browsed in Waydroid |
| Models/thinking/modes | Discovery, draft-local choices, ACKed real edits, scoped mode lookup and invalid inherited-model handling | Live draft model picker and /thinking medium; authoritative config changed without adding canonical turns |
| Capabilities | Tools/plugins/filetypes and six trigger arrays; empty vs inherited settings; read-only running usage | Settings UI and tests; every capability toggle not exercised against live provider |
| Commands/macros | TUI grammar/precedence, shorthand, explicit internal invocation, command-owned draft mode edits, ordered chains and non-blocking error/uncertainty reporting | Native help/command sheets and dispatch; local-only commands never become canonical turns; local/pre-invocation failure vs unknown outcome covered by production-seam tests |
| Completions | Local/provider CSV and RE2 matching, original regex indexes, cursor/text guards, remote paths | Local thinking completion exercised live; provider/offset/race cases tested |
| Recall | Process RAM input recall and per-origin drafts, separate from canonical history | Native chooser and regression coverage; no process-death persistence |
| Images: posting | Pick/preview/remove/send original inline bytes; explicit share/paste URI intake, bounded memory and gesture CAS | Native share journey, source-deletion lifetime, JPEG blue and true-color PNG red succeeded; palette PNG misread, independently reproduced outside Android |
| Stored attachments | On-demand image/text preview, Save as for every type, external-app opening for other formats | Uses persisted turn ID/original attachment ordinal and validated chunk RPCs; see attachment viewing for bounds and lifecycle |
| HTTP tunnels | Confirmed custom conversation links, native loopback forwarding, nonempty-only, endpoint-owned Inbox Tunnels rows sharing the threads' scrollable list, with direct URL/browser/copy/stop controls | Original custom address stays in chat; runtime mappings and Inbox visibility are independent of selected/background leaf and due alerts. Model-free SSH → macro → browser and background Inbox behavior verified in Waydroid; pipe/lifecycle/bounds and API 26/35 touch tests. Open full management with /tunnels or under Options. See HTTP tunnels |
| Usage/status/workflow | Access source, timing, run/background/queue/progress; typed native workflow phases/fanouts/paged task graphs, names and guarded polling | Live access/timing observed; workflow parser/controller/UI tests; final runtime/device results recorded in PORT_VALIDATION |
| Maintenance/help | Native help/cache/prune/deep-prune/recovery; direct seven-day maintenance and an other-age wizard | Shared-daemon scope; see current validation reports for live destructive maintenance evidence |
| Lifecycle | Disposable Activity UI, process-owned operations, foreground SSH, shared deliberate disconnect/replacement cleanup without elapsed deadlines, explicit loss/reconnect and reconciliation | Home/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
- 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_updatedreplaces a full snapshot, including empty/null/zero values. Positiveitris 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_updateare 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_timeon persistent leaves.alert_idleis 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.htmlandpkg/protocol/wire contracts. - Harness
docs/internal/frontend/stream.mdand stream assembler conformance tests. - This repository's
ez-agent-lib/README.md, service wrappers and tests. - SSH security and lifecycle and project
AGENTS.md.