← Back to Pull requests

fix(cli): stable fallback Machine Name and typed --name hint (#3116 follow-up) #3138

Closed
unknown closed this pull request without merging on Oct 22, 2026 23:58 UTC
View on GitHub
unknown unknown commented on Oct 22, 2026 23:41 UTC
Author

Follow-up to #3124 (#3116). The merge queue merged #3124 at 160d0244, before these two fixes landed. #3121 already has them on release/0.3, so this brings main level with the 0.3 patch.

Summary

 hostname default, nothing usable left
-  server-<8 random hex>              # a new name on every retry
+  server-<first 8 hex of Machine ID> # a retry presents the same name to Cloud's saved allocation

 invalid explicit --name
-  "MY-SERVER" is not a Server name. Try --name my-server.   (message only)
+  invalid Machine Name "MY-SERVER": …   + Hint::Closest("my-server")   (human hint line and --json)

 checkin loop, Cloud's name = this host's invalid hostname
   server add --name <Cloud's name normalised>
+  server add (no --name) only when nothing usable is left → Machine ID fallback

Why.

  • A random fallback broke retries: allocate_enrollment refuses the same Machine ID under a new name.

  • The suggestion should be a typed hint, so --json carries it.

  • Normalising Cloud's chosen name keeps the kernel hostname that checkin reported. Without --name, server add would read /etc/hostname, which can differ.
  • Bets: 5 Two-tier identity: the fallback is still just a name, taken from the ID only so retries agree.

    Evidence

  • an_unusable_hostname_falls_back_to_a_name_from_the_machine_id: the same name on a second call.

  • an_invalid_requested_name_is_refused_with_its_normalised_form_as_a_hint: InvalidArgument and Closest("my-server"). ___ gets no hint.

  • a_cloud_name_taken_from_an_invalid_hostname_is_normalised: MY-SERVER → my-server, and ___ → no --name.

  • On main: handlers::server (123) and checkin::enroll (28) pass, and clippy is clean. On release/0.3, the same commits passed the full CI.
  • Merge Danger

    Door: two-way

    Blast Radius: naming

    The change only affects hosts whose hostname leaves nothing usable, and the wording of the --name refusal.

    Diff: 242 lines (+181 / -61) across 3 files Reviewer: nick-potts Review duration: 16m
    All Vouch review confidence checks passed
    Residual risk 0.19 = Change Risk (0.44) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.44 · 242 lines diff across 3 files
    0.44
    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.329
    Shallow Review Depth shallow_review_depth
    0.289
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #3138"
    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: 43.8% (MEDIUM) · Higher = larger blast radius
    43.8%
    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: 18.9% · Safe to merge
    18.9%
    Repository