← Back to Pull requests

fix(cli): clarify Server removal inputs and upgrade outcomes #3181

Closed
unknown closed this pull request without merging on Oct 23, 2026 04:43 UTC
View on GitHub
unknown unknown commented on Oct 23, 2026 03:20 UTC
Author

Summary

Clarify Server lifecycle CLI input and outcome reporting for #2861 and #2849.

- empty affected-volume list; internal target wording; ignored approval
+ name held Volumes; reject empty Server names early; warn for standalone --approval
- every changed upgrade says Upgraded; infrastructure says Everything is up to date
+ report unchanged, upgraded, or downgraded; infrastructure says No Service changes needed
- missing release uses internal daemon wording
+ not_found: No Ployz release 9.9.9.

Direct upgrade JSON adds the observed from_version and, when known, change. Existing fields, RPC, and schemas keep their meaning. Repeated Volume acceptances remain harmless. The user guide describes the new output.

The CLI has no shared release resolver. It maps both current and older daemon missing-release responses, so direct upgrades do not require a separate CLI connection to GitHub.

Evidence

The committed regression tests ran before the fix. Removal process tests failed 3 of 3 on the empty list, missing Volume sentence, and absent approval warning. Upgrade process tests failed 4 of 4 on same-version and downgrade wording, missing JSON metadata, and the internal missing-release code.

Focused after-checks passed in core/ with CARGO_BUILD_JOBS=4 and the shared CARGO_TARGET_DIR:

  • cargo test -p ployz --test cli_shape server_rm_empty_name_uses_server_wording -- --nocapture: 1 passed.

  • cargo test -p ployz --test connect server_rm_ -- --nocapture: 3 passed.

  • cargo test -p ployz --test connect upgrade_cli_ -- --nocapture: 5 passed.

  • cargo test -p ployz --lib handlers::server::upgrade::tests:: -- --nocapture: 19 passed.

  • cargo test -p ployz --lib handlers::verbs::tests::a_verb_the_docs_show_names_its_page -- --nocapture: 1 passed.

  • cargo clippy -p ployz --all-targets and cargo fmt --check: passed.
  • The built ployz binary and process tests produced these before and after observations. The before cases are from #2861 and #2849, except the isolated empty-name run recorded before this fix.

    | Case | Before | After |
    | --- | --- | --- |
    | Empty Server name | Isolated CLI exited 1 with Not signed in to Cloud. before validation; the connected issue run exited 2 with invalid Machine Target wording. | Built CLI exits 2 with invalid_argument and Name a Server by name or ID. |
    | Extra Volume acceptance on a Server with no Volumes | Exit 2, Actual affected volumes: . | Exit 2, Server machine-1 holds no Volumes; drop --accept-volume-loss. No changes made. |
    | First removal refusal for a Volume holder | Exit 2, only asked for the Server name. | Exit 2, Server machine-1 holds Volumes: data. in the refusal and JSON error. |
    | Standalone --approval xyz | Removal succeeded with no warning. | Removal succeeds, exit 0, with --approval applies only when Ployz Cloud manages the Server. in stderr and JSON warnings. |
    | Missing release 9.9.9 | Exit 3, daemon no checksums.txt wording and JSON internal. | Exit 1, No Ployz release 9.9.9. and JSON follow_up_error.code: not_found. |
    | Same version and downgrade | Both said Upgraded and Everything is up to date. | Server machine-1 already runs 1.2.3. or Downgraded Server machine-1 from 1.2.4 to 1.2.3. The direct upgrade tests assert the old note is absent. |

    Merge Danger

    Door: Two-way. This changes CLI reporting only. It changes no Machine operation, wire format, or persisted schema.

    Blast Radius: CLI. The shared removal handler also gives server forget early Server wording and the standalone approval warning. The infrastructure no-op text also appears during server setup.

    Empty names now exit 2 before connection lookup; the isolated before run exited 1. Connected invalid-name and no-Volume acceptance refusals remain exit 2. The issue's upgrade exit 3 to exit 1 correction already exists on main and is preserved; a definitive first missing-release failure exits 1, while partial or uncertain runs stay 3. The new ui::warn adds JSON warnings without changing the exit code. No new refusal applies to valid input.

    Bets touched in core/DESIGN.md: Stable promise keeps JSON additive; 4. Partial results are outcomes preserves failed versus partial exits; 7. Cloud drives, never owns warns when Cloud approval has no role; 8. Evidence over claims reports observed versions and Volume names; 10. Client-first, daemon when forced keeps the fix in the CLI. No red flag is crossed.

    Closes #2861.
    Closes #2849.

    Diff: 565 lines (+423 / -142) across 7 files Reviewer: nick-potts Review duration: 82m
    All Vouch review confidence checks passed
    Residual risk 0.21 = Change Risk (0.50) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.50 · 565 lines diff across 7 files
    0.50
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    56%
    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
    Diff Size diff_size
    0.379
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #3181"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% 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: 49.7% (MEDIUM) · Higher = larger blast radius
    49.7%
    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: 56.8% · Lower = rushed or shallow review
    56.8%
    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: 21.5% · Safe to merge
    21.5%
    Repository