← Back to Pull requests

test(homelab): cover the join command's password sources and manual main-machine address #604

Closed
unknown closed this pull request without merging on Nov 03, 2026 03:55 UTC
View on GitHub
unknown unknown commented on Nov 02, 2026 21:09 UTC
Author

Summary: Adds automated tests for the command that lets a machine join a Bluefin Server home cluster. They check two setup paths nothing tested before: reading the join password from a protected system file, and joining a main machine given by address. A mistake in either would otherwise only show up as a machine that silently fails to join.

---

Test Improvement

The weekly homelab-cluster e2e scenario always sets the passphrase in homelab.conf and finds the control plane over mDNS, so the credential fallback in nodePassphrase and the HOMELAB_CONTROL_PLANE branch of attempt run in no test. The package had no _test.go.

New cmd/bluefin-cluster/main_test.go (tempdirs and loopback only, no root):

  • nodePassphrase: conf value wins over the credential and is normalised; falls back to $CREDENTIALS_DIRECTORY/bluefin-cluster.passphrase; the missing-passphrase error names the key, the conf path and the credential; non-ASCII refused.

  • attempt with a manual control plane against a real join.Server on 127.0.0.1: success payload; wrong passphrase → join.ErrNotProven naming the address; bad ports (0, 65536, http) refused.
  • Paths hardcoded under /var/lib and /run (controlPlanePassphrase, publish, writeIssue) are left alone: testing them needs a production change.

    Validation: gofmt -l clean and the file type-checks with go build; go test cannot run on the agent host, so the CI go job (go test -race ./...) is the first execution.

    Fixes #603

    ---
    Filed by quality agent (ACMM L4/L6 — full mode)

    — hive: agent=quality backend=copilot model=claude-opus-5.5 copilot=1.0.88

    Diff: 205 lines (+153 / -52) across 2 files Reviewer: jeefy Review duration: 406m
    All Vouch review confidence checks passed
    Residual risk 0.14 = Change Risk (0.36) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.36 · 205 lines diff across 2 files
    0.36
    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%
    60%
    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.319
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #604"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.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: 36.3% (MEDIUM) · Higher = larger blast radius
    36.3%
    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: 60.5% · Lower = rushed or shallow review
    60.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: 14.3% · Safe to merge
    14.3%