Skip to content

feat(browser): operator-declared origins for scoped ask/auto sessions — ADR 0195 Phase 4 CLI slice(含 OCR delegate 复审) - #541

Closed
Qiyuanqiii wants to merge 0 commit into
feat/agent-browser-origin-scopefrom
feat/browser-scoped-sessions
Closed

Qiyuanqiii wants to merge 0 commit into
feat/agent-browser-origin-scopefrom
feat/browser-scoped-sessions

Conversation

@Qiyuanqiii

Copy link
Copy Markdown
Member

动机

ADR 0195 Phase 4 第一片(CLI-only):让 ask/auto Run 拥有操作者声明的 scoped 浏览器会话——对标 Codex in-app browser 的站点级授权,第一次端到端点亮 Phase 1 的执法管道。本 PR 堆叠在 #538(Phase 1,已 CI 全绿)之上,base 设为其分支;#538 合并后 base 自动跟随 main。

内容(10 文件 +225/-5)

  • RunConfig.BrowserOrigins:创建时钉死的受信操作者输入(1..8 精确 origin,经共享 scope 语法 canonical 化,fail-closed),与不可信 .prayu 快照严格分离;线程后继继承(多轮对话保持边界)、fork/resume/branch 永不从 continuity 重建(对称既有 NotInherited 语义)、项目移动跟随重建的 Run。
  • currentAuthority scoped 分支:ask/auto + 声明 → scoped 权威(DeclaredOrigins 取 scope 规范化串 + ScopeFingerprint);所有其他模式的拒绝面与 Phase 1 逐字节一致,Full 保持 unscoped 并忽略声明。Capabilities 暴露 DeclaredOrigins(live view 投影随 Desktop 落地)。
  • readiness scoped 分支:scoped 会话仅可预检声明 origin 内的 service(MatchesOrigin 纯成员判断、无解析),navigate 的双重执法必然兜底。
  • CLI:run create --browser-origin(重复旗标,reorderFlags 登记),错误 fail-closed 进 stderr。
  • 范围声明:worker 链保持 Full-only(既有设计);origin-add 见 docs(adr): design the Phase 3 origin-add transition semantics(含 OCR delegate 设计评审) #540 锁定的 Phase 3 设计。

测试

  • scoped ask run 端到端(真链路:能力广告 → 9 工具目录 → 权威绑定校验 → in-scope dispatch → launch 收到 canonical ScopedOrigins)
  • ask 无声明不可用、Full 忽略声明(能力+权威双层断言)、normalizeBrowserOrigins 规范化矩阵
  • CLI 三断言(canonical 创建成功 / 私网 fail-closed / 超 8 上限拒绝)
  • 后继继承回归(TestThreadSuccessorInheritsBrowserOrigins)
  • browserruntime/toolgateway/domain 全量 + application 定向套件全绿(application 全包在本机有环境性超时,干净 main 对照实验已证明与本 diff 无关,见 feat(browser): operator-declared origin scopes for the agent browser — ADR 0195 Phase 1(含 OCR delegate 复审) #538 评审记录)

评审

OCR delegate 复审(9 项专项核对 + 7 项发现全部处置):currentAuthority 拆分后非 ask/auto/full 模式的拒绝面逐字节一致;scoped 权威全链 Equal 稳定(PermissionActivation=0 链自洽);声明三层独立重建比对指纹;继承矩阵测试与文档固化。记录:docs/reviews/browser-origin-declaration/。

关联

@coderabbitai

coderabbitai Bot commented Nov 5, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8c03160e-e9a7-466a-8f5d-ca7226cfe7f5

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant