← Back to Pull requests

feat(relay): persist machine identity and expose binding recovery #668

Closed
unknown closed this pull request without merging on Nov 16, 2026 15:00 UTC
View on GitHub
unknown unknown commented on Nov 16, 2026 13:19 UTC
Author

变更

  • 独立 relay-machine.json 随机机器 ID:首次配对前持久化,解绑、旧密钥丢失与服务重启不改变;损坏、锁冲突或落盘失败不生成替代身份。

  • 同账号同机重新授权恢复固定地址;未配对页面提供显式「恢复已有绑定」,不同机器与旧空 ID 必须确认替换,不自动开启公网访问。

  • 固定公开协议 v0.0.0-20261116123157-9870f0df20d0,提供所有者删除机器的代际请求契约;服务端配套 PR:https://github.com/mzdluo123/webmux-relay/pull/6。

  • 沿用 #667 的固定池认证完成同步,避免 owner 拒绝时测试节点仍有辅助连接在认证;未合并该 PR。

  • 更新 OpenSpec、持久化登记与 US-A08–US-A10;保持当前生产绑定,不执行删除、替换或迁移。
  • 本地验证

  • cmd/webmux、独立机器身份与 owner 隔离目标 Go race;目标 Go lint 通过。

  • 专用 PostgreSQL 中 Relay store/control/httpcontrol/console race 通过;真实 WebMux 配对客户端覆盖首次、同机、跨机冲突与旧空 ID 显式迁移。

  • scripts/test-host-integration.sh 真实 connector 冷加载与真实配对客户端联合回归通过。

  • 设置页 Playwright 桌面和 iPhone SE 共 4 项;前端、测试和 Storybook 类型、lint、架构门禁 46 项通过。

  • 文档及持久化守卫通过;128 项现行 OpenSpec 与本次变更严格校验通过。

  • 隔离 Linux 无头 Chromium:桌面、平板、手机明暗主题,额外 320×568;无横向溢出、确认框落在视口内。未验证真实 GitHub 登录或 iOS/Android 真机触屏。
  • 部署边界

    按用户授权,在双端 CI 通过后备份并部署;不操作当前生产绑定。客户端安装版本与当前运行进程是否重启将单独记录。PR 保持开放,不自动合并。

    设置页交互

    !恢复确认交互

    | 视口/主题 | 修改前 | 修改后 |
    | --- | --- | --- |
    | desktop 1280×900 light | !before | !after |
    | tablet 768×800 light | !before | !after |
    | phone 390×844 light | !before | !after |
    | desktop 1280×900 dark | !before | !after |
    | tablet 768×800 dark | !before | !after |
    | phone 390×844 dark | !before | !after |

    Diff: 404 lines (+303 / -101) across 5 files Reviewer: mzdluo123 Review duration: 101m
    All Vouch review confidence checks passed
    Residual risk 0.18 = Change Risk (0.45) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.45 · 404 lines diff across 5 files
    0.45
    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.359
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #668"
    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: 44.8% (MEDIUM) · Higher = larger blast radius
    44.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: 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: 17.7% · Safe to merge
    17.7%