Skip to content

fix(manager-context): filter private host surface labels before discovery export - #7974

Merged
huangruiteng merged 1 commit into
mainfrom
codex/manager-agent-surface-public-safe-20261103
Nov 3, 2026
Merged

huangruiteng merged 1 commit into
mainfrom
codex/manager-agent-surface-public-safe-20261103

Conversation

@loopx-agent

Copy link
Copy Markdown
Collaborator

Summary

Follow-up fix for PR #7929 (PRR_kwDOStEbEs8AAAABVoQgeQ):

  • Filter candidate host_surface strings through _public_safe_host_surface (validate_public_safe_value, classify_private_text with path gaps and compound credential assignments, path/quote character rejection, and public_safe_compact_text) before building row["host_surfaces"] and the query search index in loopx/capabilities/manager_context/discovery.py.
  • Preserve the true binding summary in row["registered_host_binding"] (outcome, candidate_count, address_shared, scope) even when an unsafe host_surface label is withheld from public/restricted discovery output.
  • Add regression tests in tests/test_manager_agent_discovery.py covering path-shaped (/Users/alice/private-host, ~/private-host, file:///tmp/private-host, ./local-host) and credential-shaped (ghp_..., token:secret-value) host_surface bindings across both restricted ManagerInspection (view=agents) and the loopx goal-portfolio --manager-view agents CLI export.

Verification

  • uv run --extra test python -m pytest tests/test_manager_agent_discovery.py tests/control_plane/test_peer_host_route.py tests/test_host_thread_activity.py tests/test_chat_manager_inspection.py tests/test_manager_ssh_evidence.py -q (246 passed)
  • node --test tests/control_plane_ts/execution_identity.test.ts (16 passed)
  • uv run ruff check loopx/capabilities/manager_context/discovery.py tests/test_manager_agent_discovery.py

…very export

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent; gpt-6.1-sol; OpenAI; runtime_reported; reasoning_effort=max

Approval conclusion (author-owned PR; GitHub blocks formal self-approval)

动机 / Motivation

Manager 在许可的库存中寻找合适 Agent 时,需要看见 Host 的公开种类和真实绑定概况。旧版直接把注册表中的 host_surface 放进发现行和搜索索引;即使最终证据导出有其他保护,受限的 Manager read 与实际 goal-portfolio --manager-view agents 仍能把私有路径、凭据样式标签带出。修复的结果应是隐藏不安全标签,同时保留合法 Host 和真实绑定数量,不能把“标签未公开”误写成“没有绑定”。

本次审查完整精确 head dbd7ea733158360499d14feacf1d65b656fef9e9,不可变差异基线为 1b37e2e6e0ea77b9bd405cf9a5ef5fcd8557e92e。这是既有只读发现旅程的隐私修复;不新增投递、执行或 Host 访问权,也不认证真实模型采用、交接成功或长期成本收益。

本轮真实入口对照确认:私有标签不再进入输出和搜索,合法标签及真实绑定数量保留。真实模型后续采用及完整费用仍未资格化。

改动思路 / Approach

过滤放在既有 agent_page 投影、搜索之前,两个现有消费者自然得到相同边界。局部 helper 复用 validate_public_safe_value、classify_private_text 和 public_safe_compact_text;它只适配 Host 标签的长度、空白、控制字符和路径形状。绑定事实仍由 summarize_agent_binding_routes 计算,避免为了删展示文本而改写注册真相。

这是一条可用的完整增量:受限发现、CLI 导出、无匹配、撤权和恢复均有实际入口证据。无需新增 capability、配置、provider、状态或通用脱敏框架;现有 audience scope、activation 和失败 owner 保留。过滤是现有公开边界的不变量,不是需要默认关闭的新策略。

具体改动 / Changes

先读的接受依据是基线版本的 Manager-directed Core inspection,spec_revision 1b37e2e6e0ea77b9bd405cf9a5ef5fcd8557e92e,以及 #7929 的具体隐私 finding,其受评 head 为 9a1ad2d881bc7f9a6c0e8c7234ee2a5bbb75764c。条款映射(本次审计标签):public-safe-labels 公开安全标签已实现;truth-and-scope 发现范围不等于投递名单、绑定概况真实且 readiness 不推定,均已保留。原 review 的结论没有替代本次执行。仓库提供的经验仅用于先建立用户任务和独立预期,没有继承其 verdict 或声称 memory utility。

完整差异两文件 +93/-3:生产 +35/-3,原测试模块 +58。逐行分类为局部隐私适配、已有投影调用和实际入口回归,没有新增协议词汇或持久数据。

关键代码讲解

  • _public_safe_host_surface:非字符串、空值、超长、空白、控制字符及路径/引号形状被拒绝,再复用已有公开安全和私有文本 owner。返回公开标签或 None,没有改变工作状态分类。
  • agent_page:先在许可的完整库存中计算注册事实,再过滤 host_surfaces,然后构造行、搜索及分页。过滤后的标签不会通过查询命中泄漏;candidate_count、address_shared 和 scope 继续来自原 binding owner。
  • ManagerInspection 的 agents 分支 与 evidence_export 未新增独立规则,分别沿现有受限读取与 CLI 导出消费这个结果。

独立同一脚本在真实 base/head 执行受限 ManagerInspection.read 和实际 CLI 子进程:13 类标签,包含3类合法标签、9类私有或控制字符样式、1类超长输入;另执行越界、撤权、损坏库存及恢复。旧版隐私 oracle 实际退出1,新版退出0;不是仅运行 helper 或用新输出反推预期。先前私有 driver 错传超出公开限制的 limit,两个版本同样拒绝;保留该调用失败,修正 driver 后才执行这些观察。

相同输入 Base 当前 head
合法 Host 标签 可见、可搜索 原样可见、可搜索
私有标签 两行可见、查询命中2 标签为空、查询命中0
私有标签对应一个绑定 candidate_count=1 仍为1
私有与合法标签混合 candidate_count=2 仍为2,只公开合法标签
撤权/源损坏/恢复 明确错误后恢复可读 保留相同拒绝与恢复

每次读取后 registry 字节不变,没有 Host 地址进入结果、没有 Host store/chat 写入。execution_readiness 仍为 not_checked,无投递授权的 Agent 仍为 not_granted;分页和第35个 Agent 的可发现性由完整 owning 测试覆盖。

对主干的风险 / Risks

最强风险是过滤过度导致合法 Host 消失,或只删显示、不删搜索;本轮同时执行合法值、私有值和混合绑定,并独立核对绑定数量,覆盖这两个相反方向。只用短标签 fixture 或最终导出 validator 会漏掉原受限 read 的泄漏,所以证据同时经过两个实际消费者。当前仍是基于文本形状的公开安全判断,不能识别任意自然语言中的私密含义;没有将其描述成全面秘密检测,也没有新增对其他状态的 prose 分类。

PASS:5个完整 focused Python 模块共246项;变更 Python Ruff;diff-scoped semantic advisory;standard premerge 的6个直接检查及2个 catalog 项,0 blocking。完整 semantic 检查仍保留原受支持消费者边界,零 vocabulary candidate 不是语义证明。

原始 maintainability ratchet 仍为 FAIL:base/head 独立执行的完整 stdout/stderr 签名一致,均仅报告未变的 render_canonical_todo_sections oversized finding,无 magnitude regression。相同486项因果 control-plane/rule 输入与工具环境已核对;premerge 将其作为 inherited advisory,当前 exact-scope CQR cqr_b6459a4666186650ce7f 通过并保留这条可选归因失败。未把红灯改写为通过,未查询、轮询或等待 CI。

不涉及 store/provider 写入协议,未运行真实 PostgreSQL;它不是这条 discovery projection 的验收来源。没有新增 default-off gate、共享状态、兼容 decoder 或 Agent 义务;既有 source-unavailable 错误和恢复文本未改。更大的脱敏规则整理可留给其现有 owner,当前没有需要为本 PR 创造的新框架或后继任务。

我的整体评价 / Verdict

APPROVE。 对当前完整两文件提案未发现可验证的阻断项。机制和问题相称:复用现有隐私 owner,在真实入口中关闭泄漏并保持合法发现、真实绑定和撤权恢复;局部整理已随这个投影适配完成,不需要改 binding authority 或并行实现。

操作者沿现有发现和 CLI 旅程直接拿到可用结果,无需重填已知信息、重新授权或额外确认。重复读取、失败与恢复保持事实和只读边界;这支持本切片的长程连续性,不能推出真实 Agent 后续采用或净收益。已检查 CLI 与 Manager inspection 消费路径;没有渲染组件、布局或首屏变化,visual_review 不适用,视觉未验证范围为 none。安装态 Host、真实模型、完整费用和跨平台原生执行没有在本轮资格化。

此批准结论与讨论、native readiness、合并和安装权限各自独立;同账号仅以 COMMENTED 承载批准,不声称 GitHub formal self-approval。

English verdict: APPROVE — dbd7ea7. Real restricted discovery and CLI export now withhold private Host labels from output and search while preserving safe labels, truthful binding counts and recovery.246focused tests, current premerge and exact-scope quality pass; the unchanged ratchet failure and unverified live adoption remain disclosed.

@huangruiteng
huangruiteng merged commit 2f83233 into main Nov 3, 2026
30 of 39 checks passed
@huangruiteng
huangruiteng deleted the codex/manager-agent-surface-public-safe-20261103 branch November 3, 2026 12:52
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.

2 participants