Skip to content

docs: propose remote App Server targets for the native terminal - #2278

Merged
eric8810 merged 3 commits into
mainfrom
codex/native-terminal-target-design
Nov 27, 2026
Merged

eric8810 merged 3 commits into
mainfrom
codex/native-terminal-target-design

Conversation

@eric8810

@eric8810 eric8810 commented Nov 27, 2026 •

Copy link
Copy Markdown
Collaborator

Refs #2269

Summary

A person with Dim Alpha on two computers can launch dima locally, open /devices, then resume an active Session on the other computer or start one in a chosen remote directory. The proposal illustrates sharing, token entry and reuse, discovery, Session selection, the root-based directory picker, the device name before the composer path, and reconnection. Read the design and terminal sketches · Network topology · Module architecture

Three issues track delivery:

Design rule checklist

  • Scope. The sharing process owns incoming links, the terminal owns target selection, and each App Server owns its Sessions.
  • Commands and results. Existing Session and management methods carry user actions to their owners.
  • Handover. The terminal accepts input for the new target after attach and first read, or after validating the chosen directory. Accepted work stays with its originating server.
  • Timeline callbacks. N/A for a client and transport proposal.
  • Infrastructure. The design reuses App Server dispatch and Session lifecycle.
  • Core. The target advertises its own methods through the existing handshake.
  • Atomic batches. N/A for this documentation change.
  • Model context. N/A for target selection and transport.
  • Ownership. The target reports active Sessions and directory contents through its own entry.
  • Data faces. The proposal describes a process-owned transport face and points to the existing link controls and POSIX entry.
  • Configuration. User sharing preferences belong to the sharing computer and saved credentials belong to the connecting client.
  • Mechanism requirements. Share a native App Server over LAN or Tailscale with POSIX protocol parity #2275 covers the transport and return stream. Route native client filesystem and system operations to the selected computer #2277 covers directory access before Session creation.
  • Timeline facts. The terminal owns selection, drafts and composer display. The network process owns live links.

Documentation

  • The design is a proposal. Existing ADRs are untouched.
  • The entry contract links to the proposal. The proposal records the requirements raised to the transport, TUI and workspace owners.
  • The documentation index links the design. Delivery tracking lives in the issues.

Verification

Checked the staged diff, the ADR freeze against origin/main, local Markdown links and anchors in the proposal, pinned rutis-network source paths, and alignment in the eleven ASCII diagrams. Two-computer LAN/Tailscale flows, protocol parity, and local tmux interaction runs are implementation acceptance criteria.

@eric8810
eric8810 marked this pull request as ready for review November 27, 2026 10:28

@yyhhyyyyyy yyhhyyyyyy left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Problem and scope: This PR proposes a two-computer Dim Alpha flow. The native terminal selects a remote App Server, authenticates with a shared token, and gets the protected POSIX entry's Session and management access. It adds a 251 line research proposal, one INDEX entry, and one note in the Session boundary contract. Three open issues (#2275, #2276, #2277) track delivery.

Verification: node scripts/adr-check.mjs --base 1997683c0 passes and no ADR changes. Local links and anchors resolve. The external rutis-network links resolve at 558af188 and confirm the mTLS dial/listen plugins, the five control methods, the loopback TCP example, macOS/Linux mDNS publish support, and Tailscale tag and name/IP dialing. The code claims match: running and attachedClients exist (crates/dim-app-server/src/protocol.rs:1292-1305, crates/dim-app-server/src/connection.rs:1205-1206), submissionId is the input identity (docs/design/contracts/session-access.md:307), --cwd, --resume and --server exist (crates/dim-cli/src/args.rs:220-225), the POSIX socket is private (crates/dim-cli/src/session_host.rs:6138-6140), and the UI leaf rules are as cited (docs/design/plugins/Tui.md:287-305). CI at 82c92f9: changes and ci-ok succeeded; code jobs were skipped for a docs-only diff. Mergeable, with the merge state blocked only by the required review. #2273 adds a separate INDEX line, and #2274's gate would pass because #2269 carries P2. No prior threads. The two-computer LAN/Tailscale flows and the tmux interaction runs are implementation acceptance and were not run for this docs-only change.

Optional findings (P3), none blocking:

  1. UI leaf return path. Problem: Tui.md:287-305 says the leaf binds the private address and ui.open {peer, address} makes the daemon dial it, while native-terminal-targets.md:229 has the target side allocate the address. Failure: an implementation that follows the existing contract has the remote leaf pass its local ui-<8 hex> address, which the target daemon cannot dial across the network, so the remote UI never attaches. Evidence: docs/design/plugins/Tui.md:287-305 and docs/design/research/native-terminal-targets.md:229. Fix: say the client passes the target-side address returned by terminalTransport to ui.open, the target-side relay forwards the dial to the leaf, and the TUI owner updates Tui.md section 3.6 in #2275.

  2. Directory picker. Problem: native-terminal-targets.md:188 links workspace.files.search for the root-based picker, but that method is a query over a walked index (crates/dim-app-server/src/workspace_files.rs:1-3, 69-80; crates/dim-agent-capabilities/src/workspace_tools/mentions.rs:31-42), not a one-level directory listing. Failure: a picker built on it cannot list immediate children from / and skips directories such as target and vendor. Evidence: docs/design/research/native-terminal-targets.md:188 and the two files above. Fix: name #2277 as the owner of the new target-side listing and validation, and present the link as a related search.

  3. Active Session scope. Problem: native-terminal-targets.md:170 uses running to decide the list, but running follows the default branch only (docs/design/appserver/session-catalog.md:115; crates/dim-app-server/src/agents.rs:1371). Failure: a Session whose work runs on another line and has no attached client is not listed, so the user cannot find it. Evidence: docs/design/research/native-terminal-targets.md:170, docs/design/appserver/session-catalog.md:115, and crates/dim-app-server/src/agents.rs:1371. Fix: state that the list covers the default line, or define active to include any running line.

  4. Alpha packaging. Problem: native-terminal-targets.md:155 says the Alpha package provides the connection components, but the package ships the native CLI and App Server only (npm/README.alpha.md:1-30), and #2275 does not scope a Go rutis host or the rutis-network link plugins. Failure: two fresh Alpha installs cannot start discovery or sharing, so acceptance item 4 cannot run. Evidence: docs/design/research/native-terminal-targets.md:155, npm/README.alpha.md:1-30, and the #2275 scope. Fix: add packaging and loader wiring to #2275 or a release follow-up.

The contract note at docs/design/contracts/session-boundary.md:356 is consistent with A.3: the token client reaches the local protected entry, so management methods follow from that entry, not from RemoteGateway. The proposal states that the sharing user enables the entry, the token holder gets full capability, and a reset disconnects all clients. No change required.

No P0-P2 findings. APPROVE.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants