← Back to Pull requests

Coordinator: refuse to start in production without a discovery join token #125

Closed
unknown closed this pull request without merging on Nov 01, 2026 21:08 UTC
View on GitHub
unknown unknown commented on Oct 30, 2026 16:38 UTC
Author

Defence in depth for the gap the coordinator image gate found on 30 Oct: with BL_DISCOVERY_JOIN_TOKEN unset, require_join falls back to loopback?/1, and under the release's dual-stack :: bind an unauthenticated POST /api/discovery/workers via [::1] from inside the container was admitted (200). Today only Compose's ${BL_DISCOVERY_JOIN_TOKEN:?…} prevents that; as deployed it isn't exploitable.

Change

  • config/runtime.exs: in prod, raise BL_DISCOVERY_JOIN_TOKEN must be set in production when the variable is unset or empty (same shape as the BL_ADMIN_TOKEN refusal; no value printed).

  • Dev and test unchanged: local loopback joins still work without a token.

  • release_config_test.exs: refusal for unset and empty, error message carries no secret values, a set token reaches config, dev/test runtime reads still succeed without one. Existing prod tests now set the token. Checked that the new test fails with the raise removed.

  • deploy/README.md and the controller's moduledoc say so.
  • Not included: the coordinator image gate (tools/test/coordinator-image.test.ts, branch claude/backlog-project-workflow-45cc4d) hasn't landed on main, so its no-token control isn't turned into a refusal case here. That should follow when it lands.

    Checks: mix precommit (577 tests, 0 failures). Codex Sol 6.1 High read-only review: no P1/P2; one P3 (README overstated the empty-value guarantee for SECRET_KEY_BASE) fixed. Not deployed.

    <!-- This is an auto-generated comment: release notes by coderabbit.ai -->

    <!-- coderabbit-ai-generated:v1 -->

    Summary by CodeRabbit

    Bug Fixes
    Production deployments now require a non-empty discovery join token to start. If it is missing, startup reports which configuration value is needed without revealing secret values.
    Development and test environments are unaffected; an unset join token permits loopback access only in those environments.
    Documentation
    * Deployment guidance now lists the required production secrets and explains the startup behavior when they are missing.

    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 269 lines (+201 / -68) across 3 files Reviewer: treetopdevs Review duration: 3149m
    All Vouch review confidence checks passed
    Residual risk 0.25 = Change Risk (0.63) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.63 · 269 lines diff across 3 files
    0.63
    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.335
    Shallow Review Depth shallow_review_depth
    0.289
    Sensitive Paths sensitive_paths
    0.063
    Real PR Conversation Timeline
    1 comments
    "Review active on #125"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed sensitive_module
    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: 62.6% (MEDIUM) · Higher = larger blast radius
    62.6%
    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: 24.7% · Safe to merge
    24.7%