agent-ssh 0.3.3

Arrange agent terminal layouts and reconnect through provider attachment plans
Documentation
# Attachment architecture acceptance record

Status: first integrated slice verified. The full seven-stage architecture program is not accepted for production release.

## Delivered stages

| Stage | Delivered in this change | Remaining gate |
| --- | --- | --- |
| 1. Ownership review | Source inventory, two independent designs, blind comparison, ownership decision | Revalidate against later Pulse and Marshal API revisions |
| 2. Contract prototype | Versioned references and observations, exact target validation, executable plans only in the attachable state | Browser and tunnel plans are deliberately unsupported |
| 3. Acceptance checks | Real CLI fixtures, Windows producer-to-consumer pipeline, live tmux protocol scrolling, isolated native local and SSH reconnect checks | Production managed terminal, real inference, OS restart, and active-turn recovery after backend death |
| 4. Library extraction | Experimental `agent-attachment-protocol` 0.1.0 crate used by the terminal CLI and Pulse producer through crates.io | No stable API promises |
| 5. Client integration | Pulse managed plan exporter and attach command, terminal plan consumer | Native plan exporters and Marshal lifecycle-provider integration; the reviewed launch API is still unmerged |
| 6. Migration | Version 1 compatibility, version 2 terminal intent, overwrite refusal, exact sixteen-pane migration comparison | Legacy recovery helpers remain explicit configured commands, not provider health observations |
| 7. Naming and release preparation | agent-ssh repository name, GitHub Windows release, crates.io packages and agent-ssh command | Native production integration and stable shared API release |

## Verified behavior

The terminal suite runs the actual executable with trusted read-only fixture producers. It covers every non-ready state, malformed replies, wrong references, fresh resolution, explicit partial mode, output and timeout bounds, direct child PID termination on Windows, overwrite protection, and unchanged legacy sixteen-pane grid actions.

The Pulse managed producer uses the existing action catalog. Its explicit attach command checks attachment availability again before entering the existing authenticated terminal transport. The producer tests cover unavailable/deleted/unreachable states, malformed and mismatched catalogs, confirmation/disruption requirements, duplicate capabilities, exact URL echo, raw-control rejection, and successful catalog reasons containing fixture secrets.

The same-host Windows pipeline invokes both actual executables through a loopback HTTP fixture. It observes four fresh states and records every HTTP verb. The run requires exactly four GET requests. It checks that fixture credentials never enter exported plans. It runs the consumer with `--plan`, not a production terminal attachment.

The Linux producer suite and warning-denied CLI Clippy pass in its isolated `pulse work` checkout after shared-contract adoption. The twelve new producer fixture tests and the real Windows pipeline also pass after adoption. The full Windows suite encounters an existing Unix-path assertion in `native::codex::tests::parses_running_daemon_socket`. Windows compilation also reports pre-existing unused native Unix-tunnel symbols. This change does not claim full Windows native parity.

## Scrolling evidence

The original mouse-only setting was insufficient. Alternate-screen Codex interfaces left almost no tmux history. The operator authorized a live fix. The remote frontends were reattached in inline mode with a 50,000-line history limit; their shared Codex backend PID and start time remained unchanged.

Real tmux terminal clients consumed SGR wheel events in all fourteen active remote sessions. Each reached the oldest retained line and returned to live input. This is terminal-protocol evidence. Desktop control did not expose Windows Terminal, so no actual desktop wheel gesture was observed. Preserving a backend process does not prove active-turn or pending-approval survival.

## Reproduce the checks

```powershell
cargo test --workspace --all-features --locked
cargo fmt --all --check
cargo clippy --workspace --all-targets --all-features --locked -- -D warnings
cargo build --workspace --release --locked
python scripts/verify_attachment_pipeline.py --producer PATH_TO_PULSE_AGENTS --consumer target/release/agent-ssh.exe --evidence pipeline.json
python scripts/migrate_layout.py old-layout.json terminal-layout.json --binary target/release/agent-ssh.exe
```

In the scoped Pulse checkout, use Rust 1.98 or newer and run these commands:

```text
cargo test -p pulse-agents-cli --locked
cargo clippy -p pulse-agents-cli --all-targets --locked -- -D warnings
```

The producer's `local_process` plan is valid on its own host. A Linux executable path returned over SSH must not be treated as a Windows program. The pipeline proof uses a Windows producer and Windows consumer on the same PC.

## Production gate

Native Codex 0.170.0 passed isolated local Windows and SSH transport checks with a loopback mock Responses provider. Each used a fresh catalog and no API credentials. An active turn completed while the client or SSH tunnel was disconnected. Reconnection retained the same thread and turn and returned the completed assistant message with exactly one model request. Pending approvals retained their thread, turn, and item identities across reconnection. The advertised cancel decision interrupted the turn without executing the requested command. The SSH case also checked an absent side-effect marker.

A separate owned backend restart retained a completed conversation and its assistant message. This proves completed-history recovery, not continuation of an active turn through backend death. A real native terminal client rendered the saved reply and exited cleanly while its owned backend remained alive. No physical desktop gesture was tested. All owned test backends were cleaned up; operator sessions were outside these tests.

The local evidence is retained under `C:\Users\Lucid\.cache\agent-native-probe` and `C:\Users\Lucid\.cache\agent-ssh-native-probe`. These are operator-local experimental artifacts, not a portable acceptance suite. Codex 0.167.0 rejected the tested `includeTurns:true` operation, and empty threads were absent from its default listing. Catalog absence alone must not imply deletion. Version and native state scope remain part of resolution.

Before promoting a broader session manager, test one authenticated existing managed agent, real inference, an OS restart, and active-turn and approval recovery after backend death. Native exporters and the Windows-to-SSH production adapter still need implementation and acceptance. None of those outcomes may be inferred from mock-provider passes or a green build.