Skip to content

refactor: extract connection state - #89

Merged
zatevakhin merged 1 commit into
refactor/componentsfrom
refactor/connection-state
Aug 21, 2026
Merged

refactor: extract connection state#89
zatevakhin merged 1 commit into
refactor/componentsfrom
refactor/connection-state

Conversation

@zatevakhin

Copy link
Copy Markdown
Collaborator

change

  • extract the five application-owned connection fields into private ConnectionState
  • move ConnState and ServerState into the owner while keeping ConnectionEvent, ServerEvent, runtime retry policy, transport, channels, endpoint selection, and process supervision at their existing boundaries
  • preserve connection/server event ordering, exact status strings, reconnect commands, launch-cwd precedence, command guards, and the three-state indicator
  • add focused owner, app coordinator, server-event, handler, and ui tests

exact base and scope

  • base commit: b8237b6959c44ad3f5d8486107c595add7dd326b
  • base parent: 3a7a599ff0fb04def35f2ba1591d3623dc5e9ba0
  • base tree: c6ce4018b275f14e5eee0fb54d92ad8ed04c9f4d
  • source commit: d8ad276
  • target: refactor/components
  • changed exactly the 11 approved source files: src/connection_state.rs, src/lib.rs, src/app.rs, src/server_manager.rs, src/runtime/endpoint.rs, src/runtime/mod.rs, src/runtime/event_loop.rs, src/handlers.rs, src/session.rs, src/acp_state.rs, and src/ui/mod.rs
  • diff: 508 insertions, 191 deletions

validation

  • cargo fmt --all -- --check
  • cargo check --all-targets --all-features
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo build --all-targets --all-features
  • cargo test --all-targets --all-features — 859 passed, 0 failed (base: 848)
  • git diff --check
  • focused owner, app connection-event, command-guard, server-event suppression/status, endpoint, reconnect/launch-cwd, and ui indicator tests passed

boundary proof

  • one private mod connection_state;; no export or re-export
  • one App.connection: ConnectionState; owner has exactly five fields; App has 63 direct fields
  • one definition each of ConnectionState, ConnState, and ServerState
  • no flat App declarations or accesses for the extracted fields; no getter/facade/alias/Deref/second owner
  • ConnectionEvent remains in app; ServerEvent remains in server_manager; ConnectionManagerEvent and ServerChannelMsg remain in runtime
  • runtime backoff remains in runtime/connection.rs; ACP runtime launch cwd remains in acp_client.rs
  • 52 Rust files, 44,822 Rust lines, five App implementation files, and four phase 11 compatibility forward tags
  • AGENTS.md, CLAUDE.md, REFACTOR.md, roadmap/history, runtime retry, transport, config, protocol, and domain files are absent from the source commit

integration into refactor/components is still pending review and merge.

@zatevakhin
zatevakhin merged commit 8fb8257 into refactor/components Aug 21, 2026
3 checks passed
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.

1 participant