← Back to Pull requests

Remove the entry Server through another Server #2253

Open
unknown opened this pull request with 248 lines diff across 3 files
View on GitHub
unknown unknown commented on Oct 19, 2026 00:09 UTC
Author

Summary

ployz server rm and ployz server forget refused the Server the CLI entered the Cluster through whenever another Server was visible. Through Cloud the entry is the first connection Cloud's Server Access hands out, and the user can't choose it. The beta.6 soak hit this when it rotated out the last old Server: both commands refused machine-1 with "the current entry Server cannot be removed while another Server is visible" (soak row churn-19, evidence/churn/rotate-m1.log).

Now the CLI reconnects through the remaining connections, without the Server being removed, and carries on. It refuses only when no other connection reaches the Cluster, for example a single --connect URL or the local socket. That error tells the user to connect through another Server.

Changes

  • handlers/server.rs: split connect into selection (the existing Cloud-or-context rule) and enter (walk the connections). The new connect_avoiding drops the leaving Server's connections, enters through the rest and checks that the entry it reached is not the leaving Server.

  • handlers/server/remove.rs: leave calls connect_avoiding where it used to refuse.

  • The daemon-side guard in Client::remove_machine stays. The CLI no longer reaches it for the entry Server.
  • Tests

  • the_entry_server_is_removed_through_another_server: a context with two fake daemons removes the first one through the second one, and the context drops it. Before the fix it failed with the soak's refusal.

  • an_entry_server_dialled_alone_names_connecting_through_another: with a single --connect, the command refuses with a conflict and resets nothing.

  • cargo test -p ployz --test connect removal_cli (17 pass), --test login_cli (7), --lib handlers::server (78), cargo clippy -p ployz --all-targets -D warnings.
  • Faults (a) and (b) of churn-19 (rm timing out on a drained target, and forget refusing a stale Volume copy) are out of scope here. They are handled under rt-churn-19.

    Diff: 248 lines (+186 / -62) across 3 files Reviewer: coderabbitai[bot] Review duration: 5m
    All Vouch review confidence checks passed
    Residual risk 0.24 = Change Risk (0.39) × (1 − Review Confidence (0.38)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.39 · 248 lines diff across 3 files
    0.39
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 81% · Reviewer familiarity: 35%
    38%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.330
    Real PR Conversation Timeline
    1 comments
    "Review active on #2253"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: low confidence: 38.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 38.9% (MEDIUM) · Higher = larger blast radius
    38.9%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 38.5% · Lower = rushed or shallow review
    38.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 24.0% · Safe to merge
    24.0%
    Repository