Skip to content

[REQ-128][CODE] 定义 Alpha Connection handler、记录与 prerequisite 生命周期 #704

Closed

Description

@jinjunnn

Covers

alpha-work#49 AC4/AC5/AC7:为非 MCP OAuth 的已审核服务连接提供静态
AlphaConnectionHandlerV1 与 main-owned ConnectionRecordV1;未知 handler 在 auth
前要求更新 App。

Solution baseline

REQ-128 accepted baseline
§2.6–§2.7。

Boundary

  • handler 只能编译进 main 静态 allowlist,固定
    begin(attempt) / status(attemptId) / disconnect(connectionId)。
  • ConnectionRecordV1 repository 由 main 拥有;service identity/reuse key 来自 handler
    bounded result,renderer 不传。
  • Catalog 只引用稳定 connectionHandlerId 和 prerequisite ID,不含 handler code/token。

Development plan

  1. 冻结 handler/record/state/reuse/disconnect contract 与 reason codes。
  2. main 验 signed prerequisite/envelope 后创建 attempt;unknown handler 在任何外部交互前
    update-required。
  3. required connection ready 后才可进入 admission;optional connection 保持
    installed-unavailable。
  4. package只绑定 connectionId;Bundle claim归零或卸载不自动 disconnect/revoke shared
    connection。
  5. handler error/cancel/stale/reuse conflict 全部 fail closed 并可重试。

Acceptance and named gates

  • package-alpha-connection.test.ts 覆盖 allowlist、record owner、reuse key、unknown handler、
    stale attempt、shared disconnect boundary。
  • renderer tamper service/reuse/connectionId 无效;main 每次绑定重验。
  • receipt只记录 connection reference/status,不记录 credential或摘要。

Dependencies

Blocked by alpha-code#694。

Out of scope

动态 handler、远端 handler code、通用账户系统、具体 provider 产品连接器。

Exit condition

Merged PR + security review + static handler/record tests + canonical docs impact handled。

Activity

  1. self-assigned this
    on Jul 30, 2026
  2. added
    type:featureNew user or system capability
    prio:P1High-value near-term delivery
    area:securitySecurity or access control
    cross-repoRequires coordinated work in multiple repositories
    on Jul 30, 2026
  3. added 4 commits that reference this issue on Jul 30, 2026
  4. jinjunnn commented on Aug 1, 2026

    @jinjunnn
    OwnerAuthor

    审计留痕:一条按第零问延后的 OPTIONAL(不在本票修)

    跨模型对抗审计(Codex,PR #755 R1)开出,我已过三问筛,判为延后而非不修:

    「卸载共享 Connection」的测试没有执行真实 uninstallByKey 接线 —— 删掉生产的
    releaseAlphaConnectionBindings(...) 调用仍全绿。

    证据:ext-install-planner.ts:3891、package-alpha-connection.test.ts:705、
    ext-install-planner.test.ts:1211。
    审计方实测:把 release helper 变成 no-op 时测试会红(说明它咬单件语义),
    但删掉生产调用点仍绿(说明它不咬生产接线)。

    为什么现在不修:本构建的 handler allowlist 是空的,真实 Connection 记录
    今天不可能由生产路径产生 ⇒ 第零问答不上「走我们自己的代码到得了吗」。

    为什么必须记着:第一个真 handler 落地后,这条卸载接线可以消失而门仍绿,
    留下永久陈旧的 packageBindings。

    交接给第一个真 handler 的那张 PR:增加一条走真实 uninstallByKey 的测试,
    预置共享记录,断言 ①release 真被调用、②记录仍 ready、③另一个 binding 保留。

    同批一并要做的(本票报告里已列,此处汇总):

    • data-clear.ts 的 CREDENTIAL_ITEMS 补 alpha-connections 行 + 同步 docs/runbooks/uninstall.md;
    • renderer 侧的 IPC 注册与 preload 面(本票有意不暴露:handler 表为空时开入口 = 净增攻击面)。
  5. added 4 commits that reference this issue on Aug 1, 2026
  6. added a commit that references this issue on Aug 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:securitySecurity or access controlcross-repoRequires coordinated work in multiple repositoriesprio:P1High-value near-term deliverytype:featureNew user or system capability

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions