Repository navigation
feat(hosts): add HostHarnessCapabilities contract and Codex host descriptors - #9389
loopx-agent wants to merge 10 commits into
Conversation
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · Gemini · Google · self_reported
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
本次审核基于精确提交 26c4097e90f4a54d257e517dd5fdaf278c356efd(PR #9389,分支 codex/host-harness-capabilities-contract-20261124 -> main)独立完成全部静态检查、TypeScript/Python 单测、跨模块 mypy、架构边界、语义清单以及 canary premerge 门禁复核。
动机 / Motivation
此前 LoopX 的多个宿主适配器目录(如 agy_goal_mode、claude_goal_mode、dsh_goal_mode 等)各自维护提示词、钩子与运行参数,缺少统一的宿主能力描述与查询契约。控制面与宿主集成开发及调用方在查询宿主能力与集成层级时缺少统一入口。在按能力安全启用上下文预算、压缩钩子或校验钩子等机制时无法在单一契约上判断“某个宿主究竟支持哪些已交付能力、依赖哪些原生原语”。
改前需要逐个翻看各宿主模块才能确认是否支持预工具校验钩子、输出预算或原生目标命令;改后可通过统一查询接口直接读取经代码核实的宿主能力矩阵并保证双端结构一致。如果不改,随着更多宿主接入和既有宿主包目录收敛,规划能力误报和分支硬编码会持续累积;而在不改变现有任何宿主默认运行行为的前提下,先建立 TypeScript 主契约、Python 零 Any 镜像和首批 3 个代表宿主(claude、agy、dsh)的真实能力注册,是最小且可独立验收的一步。
调用方可通过统一注册表查询 claude、agy、dsh 的真实能力描述符,并由跨运行时测试锁定 TS 与 Python 词表及描述符等价。本 PR 不修改任何现有 Turn 调度、Hook 拦截或默认宿主选择逻辑,也不在本轮迁移其余 6 个 *_goal_mode 宿主包。目前控制面业务链路尚无直接消费者读取该注册表,且跨运行时词表尚未写入中央语义注册表,留待后续宿主收敛与按能力门控 PR 接入。
改动思路 / Approach
整体采用“TypeScript 控制面单一契约定义 + Python 严格类型镜像 + 宿主适配器按需懒加载自注册”的分层设计:
- 入口与权威边界:以
loopx/control_plane/hosts/host_harness_capabilities.ts作为领域无关的三级宿主协同设计契约(HostIntegrationTier:boundary_cli/orchestrated_app/in_tree_codesigned;HostHarnessCapabilityFlag: 8 个闭集能力标识)的主拥有者,复用既有的runtime_decode.ts和effect_runtime_errors.ts做严格字段校验与不可变冻结(Object.freeze)。Python 侧在loopx/hosts/capabilities.py提供同构Literal+@dataclass(frozen=True)+TypeGuard镜像,源码 AST 零Any。 - 冷启动隔离与所有权权衡:Python 默认全局注册表
DEFAULT_HOST_CAPABILITIES_REGISTRY通过BUILTIN_HOST_ADAPTER_MODULES映射 3 个内置宿主模块,仅在调用get_host_capabilities或list_host_capabilities时按需importlib.import_module,避免导入loopx.hosts.capabilities时提前拖入各宿主重依赖或打破control_plane导入边界。 - 架构评估与当前 PR 边界:将格式校验与依赖不变量(声明
compact_hook或verifier_hook时hook_events必须非空、禁止重复或未注册字段、禁止冲突覆盖)放在共享契约层;各宿主适配器仅在模块级声明自身的只读能力描述符,无持久化状态或外部副作用。结构上将契约不变量校验、只读描述符注册与延迟加载清晰解耦,完全不改变既有宿主运行时路径。当前 PR 刻意收敛在建立 TS 主契约、Python 零Any镜像及首批 3 个代表宿主的真实能力注册,并将其余 6 个宿主包迁移与运行期消费方接入留给后续 PR。
TS Contract (host_harness_capabilities.ts) ──[JSON parity test]──> Python Mirror (loopx/hosts/capabilities.py)
│
[lazy import on get/list] ───┼───> claude (boundary_cli, verifier_hook)
├───> agy (orchestrated_app, Stop hook)
└───> dsh (in_tree_codesigned, native_context_budget)
说明:上图为按精确提交源码整理的示意数据流,仅用于说明组件归属与懒加载路径,不替代下方实测证据。
具体改动 / Changes
本 PR 共涉及 11 个文件(+1617 / -2),其中生产代码涵盖 TS 契约、Python 镜像与 3 个宿主的常量注册,构建配置更新了 tsconfig.control-plane.json 与 pyproject.toml(确保 hosts/*.ts 打入包数据),测试新增 TS 与 Python 双端契约及一致性回归套件。
对照规格文档 docs/architecture/rfcs/loopx-overall-roadmap-v0.md(基线提交 82088c6c1f22f8122e307a5cb81e9e0406ecd74d)中“Harness-neutral kernel and three-level harness co-design”的验收准绳:
three_level_codesign_contract(implemented):已在host_harness_capabilities.ts与loopx/hosts/capabilities.py建立三级集成契约、校验与注册表 API。shipped_truth_only_flags(implemented):claude、agy、dsh的supported_capabilities、hook_events与原生原语布尔值均逐项核对真实代码实现。remaining_host_package_consolidation(deferred):其余 6 个*_goal_mode包向loopx/hosts/迁移及运行期消费者接入超出本 PR 范围,留待后续工作流处理。
关键代码讲解
loopx/control_plane/hosts/host_harness_capabilities.ts:201-275(validateHostHarnessCapabilities) 与createHostCapabilitiesRegistry(294-358 行):
负责在运行边界校验原始描述符对象。函数拒绝未知键与缺失键,校验schema_version必须为loopx_host_harness_capabilities_v0、host_id符合 lowercase slug 正则、adapter_module为点分 Python 模块路径,按HOST_HARNESS_CAPABILITY_FLAGS固定顺序规范化去重排序supported_capabilities,并强制执行compact_hook/verifier_hook需要非空hook_events的跨字段不变量,最后返回深度冻结对象。注册表register对完全相等的重复注册保持幂等,对冲突配置默认 fail-closed 抛错(需显式replace: true才允许替换)。loopx/hosts/capabilities.py:247-318(HostHarnessCapabilities) 与HostCapabilitiesRegistry(388-476 行):
以0 Any和@dataclass(frozen=True)镜像 TS 契约。__post_init__复用了_validate_descriptor_fields与object.__setattr__,确保无论是直接实例化还是通过validate_host_harness_capabilities(mapping)解析都经过同一套校验与标准化(description.strip()、能力标志排序去重、不可变元组存储)。HostCapabilitiesRegistry.get和list通过_ensure_builtin_loaded懒加载内置宿主模块,经子进程隔离测试证明导入loopx.hosts.capabilities本身不会预加载agy/claude/dsh适配器。- 首批 3 个宿主真实能力声明(
loopx/claude_goal_mode/__init__.py:31-47、loopx/agy_goal_mode/host_runtime.py:28-44、loopx/dsh_goal_mode/turn_host_adapter.py:71-86):
逐一核实对应宿主源码后,各声明均严格匹配当前已上线事实:claude为boundary_cli,仅声明verifier_hook与PreToolUse(对应可选--harden门禁goal_policy.py)、native_goal_primitive=False、native_scheduler_primitive=True(原生/loop);agy为orchestrated_app,声明supported_capabilities=()、hook_events=("Stop",)(对应host_runtime.py的 EOF 恢复钩子,非通用 verifier/compact 钩子)、原生/goal与schedule为True;dsh为in_tree_codesigned,声明native_context_budget(对应dsh_output_token_budget的max_tokens输出上限控制)、hook_events=()、native_goal_primitive=False、native_scheduler_primitive=False,并在__init__.py重导出时保持既有__all__不变。
对主干的风险 / Risks
- 适用范围与零行为扰动(scope_fit & default_off_isolation):本次新增的是纯只读描述符契约与注册表,首批活跃调用方为
agy_goal_mode、claude_goal_mode和dsh_goal_mode的模块级常量注册;不改变任何既有 Hook 决策、Turn 执行路径或默认宿主选择。实测agy_runtime.stop_hook空闲事件返回{}、未武装目录下 Claudegoal_policy.py返回{}、selected_turn_host({})仍返回("codex-cli", "no_operator_credential"),且既有 682 项相关 pytest 用例全部通过。 - 权限与生命周期语义(authority_semantics & typed_state_rule):导出符号
HostHarnessCapabilities与HostCapabilitiesRegistry仅表达静态能力元数据与内存查询,不授予任何执行、审批、并发租约或持久化写入权限;全部状态集合均以 TSas const与 PythonLiteral/TypeGuard闭集表达,无字符串子串启发式判断或领域特定文案。 - 非阻塞代码审阅观察:
HostCapabilitiesRegistry.__init__暴露了公开关键字参数builtin_modules(loopx/hosts/capabilities.py:395-415),但_ensure_builtin_loaded仅调用importlib.import_module(module_name)依赖模块顶层对DEFAULT_HOST_CAPABILITIES_REGISTRY的注册副作用。实测创建一个自定义实例HostCapabilitiesRegistry(builtin_modules=BUILTIN_HOST_ADAPTER_MODULES)并调用.get("agy")时会返回None(既不会写入该自定义实例,在模块已导入后也不会重复触发)。当前仅默认单例传入该参数,且测试中独立注册表均以空参数构造,故不构成当前阻塞项;后续可在出现非默认多注册表加载需求时改为从导入模块读取描述符或收紧参数可见性。HostHarnessCapabilities.description: str = ""(loopx/hosts/capabilities.py:259)保留了空字符串默认值,但__post_init__会立即拒绝空白描述,略显冗余,可后续移除默认值使签名本身要求必填。
语义与 CI 对齐
- 执行
scripts/generate_semantic_inventory.py --changed-from origin/main与--report可见:本 PR 引入了两组新的跨运行时闭集词表——HOST_INTEGRATION_TIERS/HOST_INTEGRATION_TIER_VALUES/HostIntegrationTier(3 值)与HOST_HARNESS_CAPABILITY_FLAGS/HOST_HARNESS_CAPABILITY_FLAG_VALUES/HostHarnessCapabilityFlag(8 值)。 - 它们目前在
--report中显示为[cross-runtime]建议级 merge candidates(尚未写入loopx/semantics/vocabulary_v0.json),因为 Python 与 TS 常量命名遵循了各自惯例而未触发强制跨运行时同名预算溢出;examples/semantic-vocabulary-drift-smoke.py(29/29已注册词表、multi_value_twins=8/8、independently_maintained=45/45)与tests/architecture/test_semantic_vocabulary_drift.py、test_semantic_inventory.py均稳定通过。按审查契约,仅由有限分析发出的建议不阻塞批准,待后续接入运行期路由消费时再按需登记至vocabulary_v0.json。 - 独立复核全量验证结果(均在干净临时 detached worktree 精确
HEAD26c4097e90f4a54d257e517dd5fdaf278c356efd上实测):npm run typecheck:control-plane:PASS(exit 0)。node --no-warnings --experimental-sqlite --experimental-strip-types --test tests/control_plane_ts/host_harness_capabilities.test.ts:PASS(6/6)。pytest(test_host_harness_capabilities.py、全部 5 个架构测试、test_maintainability_ratchet.py及agy/claude/dsh现有宿主套件):PASS(682 passed, 0 failed, 0 skipped)。ruff check(7 个改动.py文件):PASS。mypy --follow-imports=silent(capabilities.py、3 个宿主__init__.py、test_host_harness_capabilities.py以及 17 个核心文件):PASS(0 errors);对改动文件执行--follow-imports=normal未在本次改动行引入任何类型错误(仅触发host_runtime.py:120与turn_host_adapter.py:262两处既有的历史遗留注释/缺 stub 报错,以及未改动传递依赖模块的既有错误)。scripts/check_rfc_bilingual.py --base origin/main --head HEAD:PASS。loopx check(9 个 PR 路径,项目注册表绑定):PASS(ok=True, errors=0)。loopx canary premerge --from-git-diff --git-diff-base origin/main:PASS(merge_gate_passed=true,6/6 catalog canaries + 8/8 risk-profile smokes 全过,manual_holds=0)。- 公开/私有边界 diff 扫描:PASS(无本地路径、私有注册表或凭据泄露)。
我的整体评价 / Verdict
- 长程与用户体验影响(
outcome_impact):long_horizon=preserved(纯只读能力契约与延迟加载注册,不改变任何多轮循环、配额、Hook 或恢复状态机);user_experience=preserved(visual_review为控制面与宿主适配层内部能力契约变更,未修改任何前端页面、交互组件或渲染输出,unverified_scope 为 none,既有命令行与 Hook 空操作输出保持不变)。 - 语义兼容性、代码体积与变更比例:
observable_semantics=equivalent(原有调用方、默认宿主解析、Hook 输出和dsh包__all__均与origin/main行为等价);code_volume=necessary(capabilities.py519 行、0 Any,host_harness_capabilities.ts452 行,严格实现契约定义、校验与注册,无兼容性胶水层;HostCapabilitiesRegistry的自定义builtin_modules行为与可选空字符串默认值作为非阻塞follow_up);change_proportionality=proportionate(11 个文件聚焦于目标契约建立与首批 3 宿主落地,边界清晰、可逆)。 - 词汇归属声明:本 PR 新建了一组跨运行时共享宿主契约词汇(
HostIntegrationTier与HostHarnessCapabilityFlag),当前由 TS 与 Python 双端各自严格声明并通过测试强制对齐,尚未登记进loopx/semantics/vocabulary_v0.json(漂移检测与架构测试均已通过)。 - 残留风险:仅有上述两处非阻塞细节改进空间及跨运行时词表尚未登记为正式
vocabulary_v0.json条目;所有本地核验均在精确 head26c4097e90f4a54d257e517dd5fdaf278c356efd实测通过,远端 CI 按目标策略不等待。
English verdict: APPROVE — Exact head 26c4097e90f4a54d257e517dd5fdaf278c356efd cleanly delivers the domain-neutral TS HostHarnessCapabilities contract, strict zero-Any Python mirror, and truthful shipped capability registrations for claude, agy, and dsh with zero default behavior change; verified locally across TS typecheck, 6/6 TS tests, 682/682 pytest tests, ruff, targeted mypy, loopx check, and 14/14 canary premerge checks.
loopx-agent
left a comment
There was a problem hiding this comment.
Request changes conclusion (author-owned PR; GitHub blocks formal self-review)
Reviewer: model_agent · gpt-6.2-sol · OpenAI · runtime_reported · xhigh
动机 / Motivation
为 Claude Code、Antigravity 和 DeepSeek Harness 接入 LoopX 的维护者,需要从两种运行时获得一致的宿主能力描述。 原有适配器各自体现已交付能力,共用查询缺少统一描述符。 本次将三个已交付适配器接入同一套宿主能力描述符,供 TypeScript 和 Python 查询。 本 PR 交付共享描述符和三个适配器的注册。全量宿主迁移及其调度能力验收属于后续阶段。
改动思路 / Approach
TypeScript 定义共享描述符和校验,Python 提供适配器侧的等义镜像,现有 Goal、调度和验证控制链继续由各自实现负责。 本 PR 交付共享描述符和三个适配器的注册。全量宿主迁移及其调度能力验收属于后续阶段。 默认表拥有内置宿主描述,其他调用者可以提交描述符,只有显式 replace 才允许冲突替换。Python 当前把内置登记放在适配器导入阶段,导致同一个约束在冷进程和已查询的进程中表现不同。
具体改动 / Changes
关键代码讲解
- TypeScript 的
createHostCapabilitiesRegistry在返回默认注册表前先登记三个内置描述,处理同 ID 冲突时总能读取已存在的条目。 - Python 的
HostCapabilitiesRegistry.register只查看已经载入内存的条目。首次查询调用_ensure_builtin_loaded。如果有同 ID 条目,该函数会直接略过适配器导入,随后用户直接导入适配器却会再次登记并抛错。 - Python 的
_validate_description检查 512 字符边界,TypeScript 使用相同的数字,但两个语言的长度单位不同。路线图中的「统一描述符」当前在注册和验证上仍有缺口,「全量宿主迁移」属于后续阶段。参照三层宿主协同设计。
对主干的风险 / Risks
- P2 Python 冷态注册绕过内置宿主冲突检查。 在 Python 新进程中,还未查过或导入内置 Claude 适配器时,注册同一个 host_id,仅改 description,且不传 replace=True。 Python 冷态接受冲突注册,查询会返回替换描述符,随后正常导入 Claude 适配器还会因重复注册抛错。先查询再提交同一描述符时,Python 拒绝这次注册。TypeScript 默认注册表也会立即拒绝冲突。 让默认注册表在比较外部注册前就掌握内置标识及其权威描述,保留实际适配器的惰性加载;显式替换与内置加载使用同一套冲突规则。
- P3 描述长度限制的计量不同。 TypeScript 以 UTF-16 code units 计长,Python len 以 Unicode code points 计长。同一段含 257 个非 BMP 字符的描述符在 Python 校验通过,TypeScript 拒绝。 约定描述长度的计量单位并在两端复用同一边界,覆盖 ASCII 与非 BMP 的两侧用例。
语义与 CI 对齐
当前提交的 6 项 TypeScript 描述符测试和 2 项 Python 校验测试均通过。 独立的冷暖进程复现只调整内置 Claude 的描述,观察了登记、读回和真实模块导入。跨语言对照还覆盖了同 ID 竞争、显式替换及 512/513 ASCII 与 256/257 个非 BMP 字符。真实模块在隔离进程中的注册及导入,未启动实际宿主或安装态,未查远端 CI。
我的整体评价 / Verdict
宿主提供事实,运行权限仍归现有控制链,分层方向合适。共享描述符要求同样的注册和输入无论从哪个运行时进入都得到相同判定。应先收敛默认表的冲突语义和描述长度,再复核冷暖读回及内置适配器导入。
English verdict: REQUEST_CHANGES at 26c4097. Reserve built-in descriptors consistently before public registration, and use one Unicode length unit across the TypeScript and Python validators.
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · gpt-6.2-sol · OpenAI · runtime_reported · xhigh
动机 / Motivation
在 Python 和 TypeScript 两侧注册宿主能力的调用方,需要同一份描述符在两个运行时得到同一校验结果。 上次提交在冷加载时接受冲突的内置描述符,部分 emoji 长度两端判断不同。此次修正了这两项,描述字段的清理规则仍会令两个运行时接受不同输入。 同一描述符遇到 Unicode NEL 或 BOM 时,两个实现对空值与长度边界仍得出相反结论。 本批新增描述符注册与校验,Claude、Antigravity 和 DSH 的原宿主启动和 hook 流程仍走现有入口。
改动思路 / Approach
TypeScript 和 Python 同时公开校验入口,描述长度从各自清理后的文本计算;共同码点计数必须有共同的输入和清理合同。 本批新增描述符注册与校验,Claude、Antigravity 和 DSH 的原宿主启动和 hook 流程仍走现有入口。 注册保存描述符,既有 adapter 仍拥有真正执行和宿主权限。 明确可接受的边界空白集合或直接验证原始字串,在两端共享同一验收和归一化规则。将 NEL、BOM、空描述和 512 码点边界放入配对用例。 Python 校验 TypeScript 校验 注册
具体改动 / Changes
关键代码讲解
- _validate_description。Python 先 strip 再量码点。 源码
- validateHostHarnessCapabilities。TypeScript 先 trim 再量码点。 源码
- HostCapabilitiesRegistry.register。现在先加载目标同名内置 adapter,再判冲突。 源码
11 文件 +1775/-2,两套 validator 和独立测试。 TypeScript 和 Python 同时公开校验入口,描述长度从各自清理后的文本计算;共同码点计数必须有共同的输入和清理合同。 COLD-REGISTRATION 已实现。内置条目在冷启动时也保留。。DESCRIPTOR-PARITY 待修复。两侧描述验证对相同输入给出相同结果。。基线 f0ca9ce。 验收依据
对主干的风险 / Risks
[P2] 两侧描述符清理规则仍不一致。 仅含 U+0085 的 description 被 Python 拒绝而被 TypeScript 接受;仅含 U+FEFF 时相反。512 个 ASCII 字符外包这两类字符时,两侧同样会分别拒绝或接受。 冷与热注册的冲突都拒绝,Claude adapter 可以正常导入;两侧都接受 512 个 emoji、拒绝 513 个。 相同宿主测试主干 445 项通过,新提交共 452 项通过,Node 6 项通过。机器默认开启 Python safe path 时,两侧旧 Claude 脚本的 18 项均因缺少同目录导入而失败,按普通路径模式重跑通过。 检查了公开入口执行、返回的错误以及写入后的读回。明确可接受的边界空白集合或直接验证原始字串,在两端共享同一验收和归一化规则。将 NEL、BOM、空描述和 512 码点边界放入配对用例。 本批定义新的共享宿主能力词汇。description 是两侧验证合同的一部分,本次修复只对齐了计数。
语义与 CI 对齐
本批定义新的共享宿主能力词汇。description 是两侧验证合同的一部分,本次修复只对齐了计数。 已执行定向本地检查。采用源码、隔离宿主 fixture 与本地 Python/Node;未验证已安装宿主和远端 CI。
我的整体评价 / Verdict
Request changes conclusion (author-owned PR; GitHub blocks formal self-review)
同一描述符遇到 Unicode NEL 或 BOM 时,两个实现对空值与长度边界仍得出相反结论。 用同一描述符比较接受结果和归一化值。共同限定字符计数没有完全解决共同验证语义。 检查的是描述符注册和宿主入口,无图形界面变更。 采用源码、隔离宿主 fixture 与本地 Python/Node;未验证已安装宿主和远端 CI。
English verdict: REQUEST_CHANGES at 3585f15. The cold registration and Unicode length fixes pass, but Python and TypeScript still disagree on trimming and validation.
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · Gemini · Google · self_reported
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
本次复审基于精确提交 3585f15f5c2c21fcbfc1c42301e2c22d34c92f4c(PR #9389,分支 codex/host-harness-capabilities-contract-20261124 -> main,合并基准提交 f0ca9cef0e394b62d4a0f28c54beba16cb7aa29c)在独立干净临时 worktree 中完成增量修复走读与全量双语测试/门禁复核。上一轮审阅 6038434296 指出的 [P2](Python 冷态注册绕过内置宿主冲突检查)与 [P3](TS 与 Python 512 描述长度计量单位不一致)均已修复,且行内两条审阅线程 PRRT_kwDOStEbEs67VSf1 与 PRRT_kwDOStEbEs67VSgA 均已解决(unresolved_count=0)。
动机 / Motivation
此前接入 Antigravity(agy)、Claude Code(claude)和 DeepSeek Harness(dsh)的宿主适配层缺少统一、跨语言对齐的能力描述符契约,控制面和调用方无法通过单一类型接口查询各宿主真实已交付的集成层级、能力标志和 hook 事件。需要从 TypeScript 与 Python 双运行时查询或校验宿主能力描述符的维护者,在上一轮提交 26c4097e90 中还会遇到冷/热进程下内置冲突检查行为不一致以及非 BMP 字符(如 "😀")长度校验两端分歧的问题。
改前在 Python 新进程未预先查询或导入内置适配器时,调用 register_host_capabilities 提交同 ID 冲突描述符不会先加载内置权威描述符,导致冷态静默覆盖并在后续导入适配器时才抛错;且 TS 用 UTF-16 description.length 而 Python 用 Unicode code point len(trimmed) 计长,使 257 个非 BMP 字符在两端得到相反判定。改后 Python HostCapabilitiesRegistry.register 在比较现有条目之前按 _loading_builtins 防重入地惰性加载目标内置适配器,两端统一以 512 个 Unicode code points 校验描述长度,并通过冷/暖多序隔离进程与 256/257/512/513 非 BMP 用例锁定跨语言完全等价。如果不改,宿主注册契约在不同加载顺序与多字节字符输入下将继续产生隐蔽语义分歧。
本 PR 对照总体路线图 docs/architecture/rfcs/loopx-overall-roadmap-v0.md(基线提交 f0ca9cef0e394b62d4a0f28c54beba16cb7aa29c)中的“Harness-neutral kernel and three-level harness co-design”章节执行:HC-1(交付统一的三层宿主能力描述符契约、TS 控制面拥有者、零 Any Python 类型镜像与首批三大旗舰宿主真实已交付能力登记)已完成;而 HC-2(将剩余 9 个顶层 loopx/*_goal_mode/ 包迁入 loopx/hosts/)与 HC-3(在全部三层协作机制迁入后执行漏斗门禁验收)属于后续独立迁移阶段,本轮不改动各宿主默认运行路径、调度/Goal 权限逻辑或测试通过条件。
改动思路 / Approach
整体严格遵循“TypeScript-first 契约拥有者 + 零 Any Python 等价镜像 + 惰性权威注册校验”的边界设计:
- 双端统一 Unicode Code-Point 校验与共享词表(
host_harness_capabilities.ts、capabilities.py):- TS(
loopx/control_plane/hosts/host_harness_capabilities.ts:41, 249-253)将常量规范为MAX_DESCRIPTION_CODE_POINTS = 512,并以Array.from(description).length > MAX_DESCRIPTION_CODE_POINTS校验抛出description exceeds 512 Unicode code points;Python(loopx/hosts/capabilities.py:55, 175-183)对齐为_MAX_DESCRIPTION_CODE_POINTS = 512与完全一致的错误提示,并在两端测试中覆盖512/513ASCII 及256/257/512/513"😀"边界。 - Python 镜像保持
0 Any、0# type: ignore(534 LOC),闭集词表HOST_INTEGRATION_TIER_VALUES、HOST_HARNESS_CAPABILITY_FLAG_VALUES、HostIntegrationTier、HostHarnessCapabilityFlag逐字对齐 TS 拥有者,由test_python_and_typescript_vocabulary_and_canonical_descriptors_match通过真实 Node 运行时导入对比校验。
- TS(
- 冷/热一致的惰性内置冲突检查(
loopx/hosts/capabilities.py:402-446):HostCapabilitiesRegistry新增_loading_builtins: set[str]重入保护集合;_ensure_builtin_loaded在加载中或已登记时立即跳过,并经try/finally安全清理状态。register在读取self._entries.get(validated.host_id)前先调用self._ensure_builtin_loaded(validated.host_id):冷进程非replace冲突注册会先加载对应内置模块权威描述符并立即ValueError拒绝(而未触及的其他内置宿主保持零提前导入),同时replace=True显式覆盖与幂等重登记行为保持完整一致。
- 架构评估与当前 PR 边界:
loopx/control_plane/hosts/host_harness_capabilities.ts(453 LOC)作为三层宿主描述符的 TS 控制面拥有者,loopx/hosts/capabilities.py(534 LOC,0 Any)作为 Python 零Any运行时注册表镜像,三大旗舰适配器仅在模块初始化登记真实已交付能力并保留原有运行时行为不变。当前 PR 刻意收敛在共享描述符契约与agy/claude/dsh登记,将HC-2旧顶层包目录迁移与HC-3后续宿主能力迁入留给后续独立 PR。
TS Owner (host_harness_capabilities.ts, 453 LOC) <== Node 导入深对比 ==> Python Mirror (capabilities.py, 534 LOC, 0 Any)
├─ 校验统一: Array.from(description).length <= 512 == len(trimmed) <= 512 (Unicode code points)
└─ 注册冲突: register(host_id) -> _ensure_builtin_loaded(host_id) [_loading_builtins 防重入] -> 冲突即 ValueError / replace=True 显式覆盖
说明:上图为按当前精确提交整理的双端对齐与冷态加载顺序示意,各旗舰宿主适配器真实能力值及实测门禁以下方章节为准。
具体改动 / Changes
上轮审阅问题修复(26c4097e90 -> 3585f15f5c)
- 修复
[P2](loopx/hosts/capabilities.py:402-446,线程PRRT_kwDOStEbEs67VSf1已解决):HostCapabilitiesRegistry.register在读取self._entries前先调用self._ensure_builtin_loaded(validated.host_id),配合_loading_builtins防止模块导入自注册无限递归,在tests/hosts/test_host_harness_capabilities.py:141-244通过三个子进程隔离场景(冷态冲突拒收、冷态replace=True覆盖后导入、先查后注冲突)实测验证既保证冲突一致性又不提前导入其他内置宿主。 - 修复
[P3](host_harness_capabilities.ts:41, 249-253&capabilities.py:55, 175-183,线程PRRT_kwDOStEbEs67VSgA已解决):双端统一采用 Unicode code points 计量512限制与相同报错文案,并在 TS(294 LOC)与 Python(421 LOC)中同步补充256/257/512/513非 BMP"😀"与512/513ASCII 用例。
RFC 规格对照与全量清单
对照 docs/architecture/rfcs/loopx-overall-roadmap-v0.md(提交 f0ca9cef0e394b62d4a0f28c54beba16cb7aa29c):
HC-1(implemented):loopx/control_plane/hosts/host_harness_capabilities.ts与loopx/hosts/capabilities.py交付统一的三层宿主能力描述符契约及真实已交付旗舰登记(agy、claude、dsh),全部 TS 与 Python 校验测试实测通过。HC-2(deferred):路线图规划将9个loopx/*_goal_mode/包迁移至loopx/hosts/;本 PR 仅先建立共享注册表与描述符,保留旧包入口与兼容导出不变,目录迁移留待后续独立 PR。HC-3(deferred):三层协作优化的漏斗全量验收将在后续逐个宿主迁移 PR 中结合具体能力交付开展。
全量 PR 涉及 11 个文件:pyproject.toml、tsconfig.control-plane.json、host_harness_capabilities.ts、capabilities.py、hosts/__init__.py、agy_goal_mode/{__init__,host_runtime}.py、claude_goal_mode/__init__.py、dsh_goal_mode/{__init__,turn_host_adapter}.py、tests/control_plane_ts/host_harness_capabilities.test.ts、tests/hosts/test_host_harness_capabilities.py。
关键代码讲解
loopx/hosts/capabilities.py:402-446(HostCapabilitiesRegistry._ensure_builtin_loaded、register):
冷态register通过_loading_builtins防重入地按需导入BUILTIN_HOST_ADAPTER_MODULES[host_id]后再比对_entries,确保冷态与热态冲突检查和 TypeScript 注册表完全一致。loopx/control_plane/hosts/host_harness_capabilities.ts:248-253与loopx/hosts/capabilities.py:175-183:
显式用Array.from(description).length对齐 Pythonlen(trimmed)的 Unicode code points 语义并附上双端互指契约注释。loopx/{agy_goal_mode/host_runtime,claude_goal_mode/__init__,dsh_goal_mode/turn_host_adapter}.py:
按各适配器当前真实能力登记:agy(orchestrated_app、()、("Stop",))、claude(boundary_cli、("verifier_hook",)、("PreToolUse",))、dsh(in_tree_codesigned、("native_context_budget",)、()),无夸大或新增未交付标志。
对主干的风险 / Risks
- 未发现阻塞性缺陷:上轮
[P2]与[P3]均已修复且两项行内线程均为isResolved: True;capabilities.py由三大旗舰适配器直接生产导入登记(scope_fit对齐);新描述符仅用于能力查询与注册,不改变任何现有宿主启动或执行默认值(default_off_isolation不适用);capabilities.py新增的 4 项 Python 词表符号经semantic_alignment核验与 TS 拥有者host_harness_capabilities.ts严格同源对称(create_vocabulary与 TS 契约一致)。 - 精确提交
3585f15f5c2c21fcbfc1c42301e2c22d34c92f4c独立验证矩阵(干净临时 detached worktree 实测,按 Goal 策略不等待远端 GitHub Actions CI):- TypeScript 类型检查与单测:
npm run typecheck:control-plane(tsc --project tsconfig.control-plane.json --noEmit)PASS。node --no-warnings --experimental-sqlite --experimental-strip-types --test tests/control_plane_ts/host_harness_capabilities.test.ts:6 passed, 0 failed, 0 skipped(含非 BMP"😀"边界测试)。
- Pytest 回归与架构门禁(总计
2,449项通过,3项 Windows 平台条件跳过,0失败):pytest -v tests/hosts/test_host_harness_capabilities.py:7 passed in 1.58s(含冷态冲突、冷态replace=True后导入、先查后注及"😀"边界)。pytest -n 6 -q覆盖test_host_harness_capabilities.py、tests/architecture/、tests/canary/test_maintainability_ratchet.py、tests/test_agy_host_surface.py、5 个tests/test_claude_goal_*.py套件与 2 个tests/test_dsh_goal_mode*.py套件:2449 passed, 3 skipped in 95.27s(复跑-rs确认531 passed, 3 skipped in 57.79s,仅tests/test_claude_goal_install_python_launcher.py:348, 504Git Bash discovery is Windows-only与:639powershell.exe is the Windows shell三项 Windows 条件跳过)。
- AST 指标、静态类型与门禁:
loopx/hosts/capabilities.py:534 LOC、0 Any、0# type: ignore;ruff check(7 个 Python 文件)All checks passed!;mypy --follow-imports=silent(17 个核心文件及capabilities.py/claude_goal_mode/__init__.py/test_host_harness_capabilities.py)0错误;--follow-imports=normal在capabilities.py与测试中0错误,仅在未触及旧行host_runtime.py:120与turn_host_adapter.py:262命中既有历史报错。check_rfc_bilingual.pyPASS;generate_semantic_inventory.py检出 4 个对齐 TS 的词表符号;Goal 绑定loopx check(12 路径)ok: true, errors: 0, warnings: 0;补丁与 PR 描述泄露扫描 PASS(0 hits);loopx canary premerge --from-git-diff --git-diff-base origin/mainPASS(status=passed, merge_gate_passed=true,4/4直接检查、1/1py_compile、6/6目录金丝雀含semantic-vocabulary-drift-smoke.py、8/8风险档案 smoke,manual_hold_count=0)。
- TypeScript 类型检查与单测:
我的整体评价 / Verdict
- 长程与用户体验影响(
outcome_impact):long_horizon=preserved(仅新增能力描述符契约与三大已交付适配器登记,原有 Turn/Goal/Hook/预算与恢复语义保持不变);user_experience=preserved(visual_review为纯后台 TypeScript/Python 宿主能力契约与注册表,未改动任何前端 UI 页面或用户可见交互文案,unverified_scope为 none)。 - 语义兼容性、代码体积与变更比例:
observable_semantics=equivalent(双端 Unicode code-point 校验与 Python 冷/暖冲突检测现完全等价);code_volume=necessary(TS453 LOC+ 零AnyPython534 LOC+ 最小旗舰接入);change_proportionality=proportionate(11 个文件精准落地统一宿主描述符契约并闭合[P2]/[P3])。 - 残留风险:当前精确提交无任何未解决线程或阻塞性缺陷;
host_runtime.py:120与turn_host_adapter.py:262的既有mypy历史注解以及HC-2/HC-3后续迁移留待各自独立 PR 处理。
English verdict: APPROVE — Exact head 3585f15f5c2c21fcbfc1c42301e2c22d34c92f4c resolves both [P2] (HostCapabilitiesRegistry.register now lazily loads the target built-in with _loading_builtins re-entrancy guard before conflict detection) and [P3] (aligned 512 Unicode code point limits across TS and Python, threads PRRT_kwDOStEbEs67VSf1 and PRRT_kwDOStEbEs67VSgA resolved), passing typecheck:control-plane, 6/6 TS tests, 7/7 Python capability tests, 2,449 passed (3 Windows-only skips) adapter/architecture/ratchet tests, ruff, loopx check, and canary premerge.
|
Fixed
|
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · Gemini · Google · self_reported
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
本次复审基于精确提交 313b9d623a8ebb1770986748a9bb6728ed2bcd73(PR #9389,分支 codex/host-harness-capabilities-contract-20261124 -> main,合并基准提交 f0ca9cef0e394b62d4a0f28c54beba16cb7aa29c)在独立干净临时 detached worktree 中完成增量修复核验与全量双语测试/门禁复核。上一轮审阅 6041364970 指出的 [P2](TS 与 Python 对 description 首尾空白字符修剪规则不一致)已彻底修复,更早一轮 6038434296 的 [P2](Python 冷态注册绕过内置冲突检查)与 [P3](512 Unicode 码点长度边界对齐)保持完整有效,行内线程 PRRT_kwDOStEbEs67VSf1 与 PRRT_kwDOStEbEs67VSgA 均保持已解决(unresolved_count=0),全部分支提交均包含 DCO Signed-off-by。
动机 / Motivation
此前接入 Antigravity(agy)、Claude Code(claude)和 DeepSeek Harness(dsh)的宿主适配层缺少统一、跨语言对齐的能力描述符契约,控制面与调用方无法在单一强类型接口上查询各宿主真实已交付的集成层级、能力标志和 hook 事件。需要从 TypeScript 与 Python 双运行时校验或注册同一份宿主能力描述符的维护者,在上一轮提交 3585f15f5c 中仍会因为两种语言默认空白修剪语义不同而在描述字段的空值与长度边界上得到相反判定。
改前 Python _validate_description 调用 str.strip()(会裁剪 U+0085 NEL 与 ASCII 控制符 U+001C..U+001F 却保留 U+FEFF BOM),而 TypeScript 调用 .trim()(会裁剪 U+FEFF 却保留 U+0085),导致仅含 "\u0085"、仅含 "\ufeff" 以及 512 个 ASCII 字符外包上述字符的同一份描述符在两端得出相反的接收/拒绝结论。改后 TypeScript 与 Python 显式共享同一份 26 个边缘空白码点集合(同时修剪 U+0085 与 U+FEFF 并刻意保留 U+001C..U+001F),在完成同一规范化修剪后再按 512 个 Unicode code points 校验,使得相同描述符在双端的接收与规范化结果完全一致。如果不改,合法或边界描述符将在跨语言边界反复出现隐蔽校验分歧。
本批交付统一的三层宿主能力描述符契约、TypeScript 控制面拥有者、零 Any Python 类型镜像与首批三大旗舰宿主真实已交付能力登记;本 PR 不改动任何既有宿主默认运行路径、调度/Goal 权限逻辑或测试通过条件,剩余顶层宿主包迁移留待后续独立阶段推进。
改动思路 / Approach
整体延续“TypeScript-first 契约拥有者 + 零 Any Python 等价镜像 + 惰性权威注册校验”的边界架构:
- 入口、权威输入与跨运行时边界空白契约(
host_harness_capabilities.ts、capabilities.py):- TypeScript(
loopx/control_plane/hosts/host_harness_capabilities.ts:45-50, 257-268)不再对description先走通用requireNonEmptyString(...).trim(),而是定义显式锚定边缘空白字符集DESCRIPTION_EDGE_WHITESPACE_CHARS与正则DESCRIPTION_EDGE_WHITESPACE_RE,先对字符串首尾执行.replace(DESCRIPTION_EDGE_WHITESPACE_RE, ""),再判非空并用Array.from(description).length > MAX_DESCRIPTION_CODE_POINTS校对 512 码点上限。 - Python(
loopx/hosts/capabilities.py:59-63, 183-195)对应定义_DESCRIPTION_WHITESPACE_CHARS并在_validate_description中调用value.strip(_DESCRIPTION_WHITESPACE_CHARS),随后判空并校验len(trimmed) > _MAX_DESCRIPTION_CODE_POINTS。 - 两端共享完全相同的 26 个边缘空白码点(
\t,\n,\x0b,\x0c,\r,,U+0085,U+00A0,U+1680,U+2000..U+200A,U+2028,U+2029,U+202F,U+205F,U+3000,U+FEFF),共同拒绝空结果或超过 512 码点的文本,并对U+001C..U+001F保持一致不修剪。
- TypeScript(
- 冷/热一致冲突检测与零副作用复用(
capabilities.py:401-458):HostCapabilitiesRegistry.register先经_validate_descriptor_fields校验与规范化,再经_loading_builtins防重入保护调用_ensure_builtin_loaded(validated.host_id)按需导入目标内置模块(不影响未触及的内置适配器惰性加载),最后执行幂等或显式replace=True覆盖规则;TS 端复用既有runtime_decode.ts与EffectRuntimeRequestError。
- 架构评估与当前 PR 边界:
loopx/control_plane/hosts/host_harness_capabilities.ts(468 LOC)作为三层宿主能力描述符契约与校验的 TS 控制面拥有者,loopx/hosts/capabilities.py(546 LOC,0 Any)作为 Python 零Any运行时镜像与惰性内置注册表,三大旗舰适配器仅在模块初始化登记只读真实能力事实且完全不改变既有执行/Hook/调度行为。当前 PR 刻意收敛在共享描述符契约与agy/claude/dsh登记,将HC-2旧顶层包目录迁入loopx/hosts/与HC-3运行期优化门禁留给后续独立 PR。
PR #9389@313b9d623a: Cross-Runtime Description Normalization & Registry Parity
TS Owner (host_harness_capabilities.ts, 468 LOC) <== 63,491 code points (0 mismatches) ==> Python Mirror (capabilities.py, 546 LOC, 0 Any)
├─ Edge trim: DESCRIPTION_EDGE_WHITESPACE_RE (26 chars incl. U+0085 & U+FEFF; keeps U+001C..U+001F) == value.strip(_DESCRIPTION_WHITESPACE_CHARS)
├─ Length cap: Array.from(description).length <= 512 == len(trimmed) <= 512 (Unicode code points)
└─ Conflict check: register(host_id) -> _ensure_builtin_loaded(host_id) [_loading_builtins guard] -> ValueError / replace=True
说明:上图为按精确提交
313b9d623a8ebb1770986748a9bb6728ed2bcd73源码整理的组件边界示意图,实测等价数据以下方验证章节为准。
具体改动 / Changes
本轮增量修复(3585f15f5c -> 313b9d623a,回应 6041364970 [P2])
- TS 边缘空白集统一(
loopx/control_plane/hosts/host_harness_capabilities.ts:45-50, 257-268):引入DESCRIPTION_EDGE_WHITESPACE_CHARS与DESCRIPTION_EDGE_WHITESPACE_RE替代默认.trim(),确保同时去除首尾U+0085与U+FEFF且不裁剪U+001C..U+001F,并加注双端一致契约注释。 - Python 边缘空白集统一(
loopx/hosts/capabilities.py:59-63, 183-195):定义完全对等的_DESCRIPTION_WHITESPACE_CHARS替代默认value.strip(),validate_host_harness_capabilities与HostHarnessCapabilities.__post_init__共同复用同一_validate_description逻辑。 - 配对回归与跨运行时互证测试(
tests/control_plane_ts/host_harness_capabilities.test.ts:255-284、tests/hosts/test_host_harness_capabilities.py:365-449):双端补充"\u0085"、"\ufeff"、"\u0085" + "a"*512 + "\u0085"、"\ufeff" + "a"*512 + "\ufeff"、"\u0085" + "a"*513 + "\ufeff"与"\u001c"用例,且 Python 测试直接拉起 Node 子进程执行validateHostHarnessCapabilities并断言py_outcomes == ts_outcomes。
RFC 规格对照与全量清单
对照架构路线图 docs/architecture/rfcs/loopx-overall-roadmap-v0.md(基线提交 f0ca9cef0e394b62d4a0f28c54beba16cb7aa29c)中的“Harness-neutral kernel and three-level harness co-design”:
HC-1(implemented):loopx/control_plane/hosts/host_harness_capabilities.ts与loopx/hosts/capabilities.py交付统一的三层宿主能力描述符契约、跨运行时一致校验及首批三大旗舰宿主(agy、claude、dsh)真实能力登记。HC-2(deferred):路线图规划将9个loopx/*_goal_mode/包迁入loopx/hosts/;本 PR 刻意先建立共享契约并保持现有顶层适配器包导入兼容,包目录迁移留待后续独立 PR。HC-3(deferred):三层协作优化的漏斗全量验收将在后续消费该契约的宿主优化与迁移 PR 中开展。
全量 PR 共涉及 11 个文件(+1919/-2):pyproject.toml、tsconfig.control-plane.json、loopx/control_plane/hosts/host_harness_capabilities.ts、loopx/hosts/__init__.py、loopx/hosts/capabilities.py、loopx/agy_goal_mode/{__init__,host_runtime}.py、loopx/claude_goal_mode/__init__.py、loopx/dsh_goal_mode/{__init__,turn_host_adapter}.py、tests/control_plane_ts/host_harness_capabilities.test.ts、tests/hosts/test_host_harness_capabilities.py。
关键代码讲解
loopx/control_plane/hosts/host_harness_capabilities.ts:211-291(validateHostHarnessCapabilities)与loopx/hosts/capabilities.py:183-195(_validate_description):
双端以完全对称的 26 字符边缘空白集合修剪首尾空白并校验非空及512Unicode code points 上限,随后检查compact_hook/verifier_hook必须搭配非空hook_events,并返回不可变冻结对象/dataclass。loopx/hosts/capabilities.py:418-458(HostCapabilitiesRegistry._ensure_builtin_loaded、register):
register在读取_entries之前按需加载目标host_id对应的内置适配器(通过_loading_builtins防止模块初始化自注册递归),使得冷态冲突注册与先查后注及 TS 默认表一样 fail-closed 抛出ValueError,同时保持其余未查询内置适配器惰性加载且保留replace=True显式覆盖语义。loopx/{agy_goal_mode/host_runtime,claude_goal_mode/__init__,dsh_goal_mode/turn_host_adapter}.py:
三家适配器在模块级登记经源码核实的已交付事实:agy(orchestrated_app、()、("Stop",))、claude(boundary_cli、("verifier_hook",)、("PreToolUse",))、dsh(in_tree_codesigned、("native_context_budget",)、()),并保持原有运行时与__all__不变。
对主干的风险 / Risks
- 未发现阻塞性缺陷:
6041364970的[P2]与6038434296的[P2]/[P3]已全部修复并经跨语言独立穷举探针实测验证;scope_fit由三大旗舰适配器直接生产导入登记;新描述符为只读元数据契约,不改变任何原有宿主默认运行、Goal 或调度权限(default_off_isolation不适用);全部 3 个分支提交均完成 DCOSigned-off-by,无任何私有路径、凭据或内部信息泄露。 - 非阻塞后续改进点:此前指出的
HostCapabilitiesRegistry.__init__(..., builtin_modules=...)仅调用importlib.import_module注册到默认单例、以及HostHarnessCapabilities.description: str = ""的多余默认值仍可作为后续小清理 PR 处理;host_id/adapter_module字段内部对空字符串各自正则拒绝也会拦截"\u0085"/"\ufeff"(仅提示报错前缀差异,不影响 accept/reject 判定)。 - 精确提交
313b9d623a8ebb1770986748a9bb6728ed2bcd73独立复核验证结果(于干净临时 detached worktree 实测,按 Goal 策略不等待远端 GitHub Actions CI):- 全量 Unicode 跨运行时穷举探针(TS vs Python):同步测试全部 63,488 个非代理 BMP 码点(
0x0000..0xFFFF)+ 3 个非 BMP 代表码点(共 63,491 个单字符输入)以及 9 组边缘包装用例(含"\u0085"、"\ufeff"、512/513个'a'与'😀'外包\u0085/\ufeff、"\u001c"),MISMATCHES=0,两端仅修剪完全一致的26个空白码点,其余全部一致接受或拒绝。 - TypeScript 类型检查与单测:
npm run typecheck:control-plane(tsc --project tsconfig.control-plane.json --noEmit)PASS;node --no-warnings --experimental-sqlite --experimental-strip-types --test tests/control_plane_ts/host_harness_capabilities.test.ts:6 passed, 0 failed, 0 skipped。 - Python 单测、架构门禁与棘轮回归:
pytest -v tests/hosts/test_host_harness_capabilities.py:7 passed in 0.88s。pytest -n 6 -rs -q覆盖tests/hosts/test_host_harness_capabilities.py、tests/architecture/、tests/canary/test_maintainability_ratchet.py、test_agy_host_surface.py、5 个test_claude_goal_*.py与 2 个test_dsh_goal_mode*.py:2449 passed, 3 skipped in 79.58s(3 项跳过均系tests/test_claude_goal_install_python_launcher.py:348, 504, 639的 Windows 平台条件跳过:Git Bash / PowerShell)。
- 代码体积、AST 指标、静态类型与发布门禁:
loopx/hosts/capabilities.py:546 LOC、0 Any、0# type: ignore;host_harness_capabilities.ts:468 LOC;test_host_harness_capabilities.py:507 LOC、0 Any。ruff check(8 个 Python 文件):All checks passed!;mypy --follow-imports=silent(6 个核心 PR 文件):Success: no issues found in 6 source files;mypy --follow-imports=normal在capabilities.py、claude_goal_mode/__init__.py与test_host_harness_capabilities.py中0错误,仅在未触及旧行loopx/agy_goal_mode/host_runtime.py:120与loopx/dsh_goal_mode/turn_host_adapter.py:262命中既有历史注解缺失。scripts/check_rfc_bilingual.py --base origin/main --head HEADPASS;Goal/注册表绑定loopx check(12 路径)ok: true, errors: 0, warnings: 0;补丁与 PR 正文泄露扫描 PASS;loopx canary premerge --from-git-diff --git-diff-base origin/mainPASS(status=passed, merge_gate_passed=true,4/4直接检查、1/1py_compile、6/6目录金丝雀、8/8风险档案 smoke,manual_hold_count=0)。
- 全量 Unicode 跨运行时穷举探针(TS vs Python):同步测试全部 63,488 个非代理 BMP 码点(
语义与 CI 对齐
scripts/generate_semantic_inventory.py --changed-from origin/main检出 PR 在 TS 侧与 Python 侧对齐引入的一组宿主集成层级与能力闭集词汇(HOST_INTEGRATION_TIERS/HOST_INTEGRATION_TIER_VALUES/HostIntegrationTier与HOST_HARNESS_CAPABILITY_FLAGS/HOST_HARNESS_CAPABILITY_FLAG_VALUES/HostHarnessCapabilityFlag),属于基于 TS 控制面拥有者创建的跨运行时对称词汇(create_vocabulary),目前仅在内部契约测试与注册表中使用,尚未写入loopx/semantics/vocabulary_v0.json;examples/semantic-vocabulary-drift-smoke.py与全部tests/architecture/测试均已实测通过,待后续运行期路由消费接入时再按需登记。
我的整体评价 / Verdict
- 长程与用户体验影响(
outcome_impact):long_horizon=preserved(只读宿主能力契约与惰性注册表不修改任何 Turn 循环、配额、Hook 或恢复状态机);user_experience=preserved(visual_review为纯后台 TypeScript/Python 宿主能力描述符契约与旗舰适配器登记,未改动任何前端 UI 界面或用户可见交互文案,unverified_scope 为 none)。 - 语义兼容性、代码体积与变更比例:
observable_semantics=equivalent(双端不仅统一了冷/热冲突检查和 512 Unicode 码点计算,现对 63,491 个单码点与多边界包装输入均达到 0 分歧等价);code_volume=necessary(TS 拥有者468 LOC+ 零AnyPython 镜像546 LOC+ 最小旗舰接入与双端互证测试,无兼容性冗余层);change_proportionality=proportionate(11 个文件精准落地统一契约并逐一闭合全部审阅问题)。 - 词汇归属声明:本 PR 新建一组跨运行时对称词汇(
HostIntegrationTier与HostHarnessCapabilityFlag,create_vocabulary),当前以 TShost_harness_capabilities.ts为主拥有者、Pythoncapabilities.py为零Any镜像并通过跨语言测试锁定对齐;全量架构测试及semantic-vocabulary-drift-smoke.py均通过,暂无需阻塞登记到vocabulary_v0.json。 - 残留风险:当前精确头
313b9d623a8ebb1770986748a9bb6728ed2bcd73无阻塞项或未解决线程;上述既有mypy历史行注解及HC-2/HC-3后续迁移各自归属独立后续 PR;所有门禁均已在干净临时 worktree 本地实测通过。
English verdict: APPROVE — Exact head 313b9d623a8ebb1770986748a9bb6728ed2bcd73 cleanly fixes review 6041364970 [P2] by aligning TS (DESCRIPTION_EDGE_WHITESPACE_RE) and Python (_DESCRIPTION_WHITESPACE_CHARS) on one exact 26-character Unicode edge-whitespace contract (verified with 0 mismatches across 63,491 checked Unicode code points and wrapped U+0085/U+FEFF/U+001C boundaries), preserves prior cold-conflict and Unicode code-point parity fixes, and passes typecheck:control-plane, 6/6 TS tests, 7/7 Python capability tests, 2,449 passed (3 Windows-only skips) adapter/architecture/ratchet tests, ruff, loopx check, and 14/14 canary premerge checks.
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · gpt-6.2-sol · OpenAI · runtime_reported · xhigh
Request changes conclusion (author-owned PR; GitHub blocks formal self-review)
动机 / Motivation
维护宿主适配器和查询其能力的调用方,需要在第一次加载宿主时拿到可信描述,也需要 Python 和 TypeScript 对同一份列表给出一致结果。 没有共用的三层宿主描述形状。此前复审发现同一段说明在两个语言入口可能分别通过和拒绝。 新版使三种宿主的描述及所测空白、长度边界一致。并发冷查与注册时,Python 仍可记录冲突描述并使合法适配器加载失败。 用共享的宿主事实支持查询。重复注册保持幂等,非替换注册统一拒绝冲突,列表顺序不受语言或区域设置影响。 本次范围是三种现有宿主的事实声明、验证、查找和打包。宿主执行、审批、调度与完整上下文优化继续由原有入口负责。 前次评审
改动思路 / Approach
沿已接受的三层描述协议。保留 TypeScript 的校验边界和 Python 的惰性模块加载,确认内置描述时只让该次合法自注册越过初始化阶段。给列表排序用同一个 ASCII 宿主 ID 比较规则。 本次范围是三种现有宿主的事实声明、验证、查找和打包。宿主执行、审批、调度与完整上下文优化继续由原有入口负责。 共享描述给调用方提供事实。首次真实模块导入仍需正常读取或拒绝冲突,其结果决定说明是否可靠。
具体改动 / Changes
基于 f0ca9cef0e394b62d4a0f28c54beba16cb7aa29c 的路线图和准确头 313b9d623a8ebb1770986748a9bb6728ed2bcd73 审查完整 11 个文件、+1919/−2。核对 THREE_LEVEL_HOST_DESCRIPTOR、SHARED_TRUTHFUL_NEGOTIATION 和 HOST_ADOPTION_FUNNEL。三种宿主已声明,首个加载结果及跨语言列表仍有差异,实际采用验证保留在已有路线图。 基线规范
关键代码讲解
- validateHostHarnessCapabilities。解码共享字段并按相同 Unicode 码点和空白规则校验 description。 准确提交
- CLAUDE_HOST_CAPABILITIES。适配器导入时登记其原生已发布描述。 准确提交
- _ensure_builtin_loaded。首次按固定内置映射导入。其他线程和当前导入共用加载标记。 准确提交
- HostCapabilitiesRegistry.register。先尝试收齐内置事实,再对同 ID 做相等或冲突判定。 准确提交
- HostCapabilitiesRegistry.list。过滤描述后按 localeCompare 排序,Python 使用普通字符串序。 准确提交
对主干的风险 / Risks
- P2 并发首次读取可破坏内置 Claude 描述。 在一个线程第一次查询 Claude 并即将导入内置适配器时,另一个线程的普通冲突注册通过,虽然没有提供 replace。随后实际导入执行内置注册并抛出冲突,模块没有加载。再次查询仍返回外部登记的值。相同输入串行执行会拒绝冲突并读回内置描述。 区分同一导入的合法重入与其他线程的注册。先完成该宿主的内置声明,再对外部注册作一次冲突判定,不延迟其他宿主的首次加载。 登记路径
- P3 共享列表的宿主 ID 顺序不一致。 配对登记 a-b、a_b、az,再按相同层级和能力过滤。Node 返回 a_b、a-b、az,Python 返回 a-b、a_b、az。现有三个字母宿主的测试读回一致,所以不会发现这组差异。 让两个列表使用同一明确的 ASCII 字符序。为带下划线和连字符的合法 ID 加同输入跨语言测试。 排序规则
语义与 CI 对齐
三种内置描述字段成对一致,NEL、BOM、控制分隔符、emoji 与 512/513 码点的 8 组描述结果一致。串行冲突被拒绝,正常查询加载 Claude,agy 和 dsh 保持冷态。 Node 描述测试 6 项、控制面 TypeScript 类型检查和 Ruff 通过。准确头的 Python 宿主、SDK 和边界套件 518 过、30 跳过。基线共同调用端 497 过、30 跳过。补上现有 Chat 构建产物后,源码 wheel 的 TypeScript、Python 声明和三宿主入口均已读回。 并发探针只控制初次 import 的时序,其余是真实导入和注册。整仓用例和已安装的各宿主端到端会话未运行。
我的整体评价 / Verdict
前次的 description 空白不一致已修复,现有三种宿主的声明和原有调用端有成对读回。要求补齐重叠首次加载对内置事实的保护,并用同一组扩展宿主核对排序。当前准确头的串行验证仍会放过这两个差异。
English verdict: REQUEST_CHANGES at 313b9d6. An overlapping first lookup and registration can replace the built-in Claude descriptor without replace and abort adapter import. The public list API also orders valid IDs differently in Python and TypeScript.
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · Gemini · Google · self_reported
Request changes conclusion (author-owned PR; GitHub blocks formal self-review)
本次复审基于精确提交 f8026223a2e071e4ba41f4a65eee64430b76f554(PR #9389,分支 codex/host-harness-capabilities-contract-20261124 -> main,合并基准提交 f0ca9cef0e394b62d4a0f28c54beba16cb7aa29c)在独立干净临时 detached worktree 中完成增量修复核验与并发探针复测。上轮审阅 6043650122 指出的 [P3](TS 与 Python list() 按宿主 ID 排序规则不一致,线程 PRRT_kwDOStEbEs67e58l)已彻底修复,原有描述空白与长度限制、7/7 TS 单测、2,451 项 pytest 与 canary premerge 均通过;但本轮为修复 [P2](线程 PRRT_kwDOStEbEs67e58c)引入的 self._builtin_locks[host_id] 在真实模块直接导入与注册表并发查询交错时引入了新的 [P2] ABBA 死锁,导致双线程永久卡死。
动机 / Motivation
需要从 TypeScript 与 Python 双运行时并发查询能力描述符、或在一个线程直接导入内置宿主模块同时于另一线程调用统一注册表的开发者与运行期组件,期望首次懒加载既能隔离并行不同宿主、又能拒绝外部未声明 replace=True 的冲突覆盖,同时双端列表排序完全一致。上轮提交 313b9d623a 在两个线程重叠首次加载 claude 时可能让外部冲突写入成功并使合法导入抛错,且 localeCompare 在带有 - 与 _ 的合法宿主 ID 上与 Python 排序结果不同。
改后 HostCapabilitiesRegistry.list 与 TypeScript 侧 listHostCapabilities 现已对 "az"、"a_b"、"a-b"、"a0b"、"ab" 等合法标识符产出完全相同的 ASCII 码点序(["a-b", "a0b", "a_b", "ab", "az"]),且使用 monkeypatch 暂停模拟导入的单元并发用例通过。然而在真实 CPython 导入路径上,直接 import loopx.dsh_goal_mode.turn_host_adapter 的线程会先持有 CPython _ModuleLock 并随后在模块顶层调用 register_host_capabilities,反方向去争抢 self._builtin_locks[host_id];而与此同时调用 get_host_capabilities("dsh") 或 list_host_capabilities() 的线程正持有 self._builtin_locks["dsh"] 并在 importlib.import_module(...) 内部阻塞等待同一把 _ModuleLock,形成经典 ABBA 死锁使进程永久挂起。如果不修复,任何在启动或运行期并发触发模块直接导入与能力注册表查询的进程都会发生不可恢复的死锁。
本 PR 意图交付统一的三层宿主能力描述符契约、TypeScript 控制面拥有者、零 Any Python 镜像与首批三大旗舰宿主真实能力登记;本批不改动既有 Turn/Goal/Hook 调度执行路径,且需在消除该并发模块导入死锁后方可合入。
改动思路 / Approach
从整体边界看,TypeScript 拥有者 loopx/control_plane/hosts/host_harness_capabilities.ts(472 LOC)的 ASCII 排序修正(改为显式 < / > 比较)与空白/码点校验设计简洁准确;问题集中在 Python 镜像 loopx/hosts/capabilities.py(561 LOC,0 Any)的锁层次倒置:
- 入口与双锁序倒置根因(
capabilities.py:428-468):- 路径 1(直接模块导入,例如
import loopx.dsh_goal_mode.turn_host_adapter或agy_goal_mode.host_runtime):CPython 先获取模块导入锁_ModuleLock(module_name),随后在导入顶部依赖后到达register_host_capabilities(...)->HostCapabilitiesRegistry.register->_ensure_builtin_loaded(host_id),此时若_loading_threads.get(host_id)记录的是另一线程,就会尝试阻塞获取_builtin_locks[host_id]。 - 路径 2(注册表并发查询或外部注册,例如
get_host_capabilities("dsh")/list_host_capabilities()/register_host_capabilities(conflicting)):先获取self._builtin_locks[host_id],设置_loading_threads[host_id] = current_thread_id,随后在持有builtin_lock的情况下执行importlib.import_module(module_name),尝试获取同一把_ModuleLock(module_name)。 - 当两条路径在真实冷态并发交错执行时,锁获取顺序互逆,CPython 无法检测跨
RLock与_ModuleLock的循环等待,双方永久死锁。
- 路径 1(直接模块导入,例如
- 架构评估与最小修复边界:
loopx/control_plane/hosts/host_harness_capabilities.ts(472 LOC)作为三层宿主契约主拥有者、loopx/hosts/capabilities.py(561 LOC,0 Any)作为零Any运行时镜像边界合理。当前唯一阻塞原因是内置宿主适配器顶层初始化复用了还会回调用_ensure_builtin_loaded(争抢_builtin_locks)的公共register_host_capabilities入口。- 最小安全修法是将内置模块自身顶层登记改为私有辅助方法
_register_builtin_host_capabilities(仅校验并获取self._lock写入_entries,绝不触发_ensure_builtin_loaded或接触_builtin_locks),外部调用方继续经公共register_host_capabilities走_ensure_builtin_loaded。
PR #9389@f8026223a2 ABBA Lock-Order Deadlock:
Thread 1 (direct import dsh/agy/claude): holds CPython _ModuleLock ──▶ calls register() ──▶ blocks on _builtin_locks[host_id]
Thread 2 (get/list/external register): holds _builtin_locks[host_id] ──▶ calls import_module() ──▶ blocks on CPython _ModuleLock
说明:上图基于精确提交
f8026223a2e071e4ba41f4a65eee64430b76f554源码与真实模块并发实测复现整理。
具体改动 / Changes
本轮增量核验(313b9d623a -> f8026223a2,回应 6043650122)
- 修复已通过项
[P3](loopx/control_plane/hosts/host_harness_capabilities.ts:370-374,线程PRRT_kwDOStEbEs67e58l已解决):移除localeCompare,改用确定的 UTF-16/ASCII 码元大小比较,并在 TS(370 LOC)与 Python(507 LOC)配对测试及独立 Node↔Python 探针下核实"az","a_b","a-b","a0b","ab"均按["a-b", "a0b", "a_b", "ab", "az"]排序。 - 待修复阻塞项
[P2](loopx/hosts/capabilities.py:428-468,回应PRRT_kwDOStEbEs67e58c的锁机制存在倒置):新增了self._lock、self._builtin_locks与self._loading_threads,通过了基于monkeypatch(importlib.import_module)的模拟单测,但在真实 CPython 导入与直接import并发交错时会触发_ModuleLock与_builtin_locks之间的 ABBA 死锁。
RFC 规格对照与全量清单
对照架构路线图 docs/architecture/rfcs/loopx-overall-roadmap-v0.md(基线提交 f0ca9cef0e394b62d4a0f28c54beba16cb7aa29c)中的“Harness-neutral kernel and three-level harness co-design”:
HC-1(not_met):统一描述符契约、TS 校验、ASCII 列表排序与空白/码点边界均已对齐,但 Python 懒加载并发保护在真实直接导入交错场景存在 ABBA 死锁(minimum_repair:内置模块改用仅持self._lock、不重入_builtin_locks的_register_builtin_host_capabilities登记并补齐并发真导入回归测试)。HC-2(deferred):路线图规划将9个loopx/*_goal_mode/包迁入loopx/hosts/;目录迁移留待后续独立 PR。HC-3(deferred):三层协作优化的漏斗全量验收将在后续消费该契约的宿主优化与迁移 PR 中开展。
全量 PR 共涉及 11 个文件:pyproject.toml、tsconfig.control-plane.json、loopx/control_plane/hosts/host_harness_capabilities.ts、loopx/hosts/__init__.py、loopx/hosts/capabilities.py、loopx/agy_goal_mode/{__init__,host_runtime}.py、loopx/claude_goal_mode/__init__.py、loopx/dsh_goal_mode/{__init__,turn_host_adapter}.py、tests/control_plane_ts/host_harness_capabilities.test.ts、tests/hosts/test_host_harness_capabilities.py。
关键代码讲解
loopx/hosts/capabilities.py:418-451(HostCapabilitiesRegistry._ensure_builtin_loaded):
先在self._lock下获取或创建self._builtin_locks[host_id],随后在持有builtin_lock的区间内设置_loading_threads[host_id] = current_thread_id并调用importlib.import_module(module_name),而在importlib.import_module内部又需获取 CPython 的_ModuleLock。loopx/hosts/capabilities.py:453-468(HostCapabilitiesRegistry.register)与loopx/dsh_goal_mode/turn_host_adapter.py:71/loopx/agy_goal_mode/host_runtime.py:28/loopx/claude_goal_mode/__init__.py:31:
三家内置宿主在模块导入体(即持有 CPython_ModuleLock期间)直接调用register_host_capabilities(...)->register(...)->self._ensure_builtin_loaded(...);当另一线程已在_ensure_builtin_loaded中持有一把builtin_lock等待该_ModuleLock时,模块导入线程无法跨过with builtin_lock:完成自身注册,立即死锁。loopx/control_plane/hosts/host_harness_capabilities.ts:369-375(createHostCapabilitiesRegistry.list):
已将排序比较修复为确定性的 ASCII/UTF-16 码元顺序,与 Pythonsorted(..., key=lambda entry: entry.host_id)在所有有效标识符上完全一致。
对主干的风险 / Risks
[P2]阻塞发现(真实直接模块导入与注册表并发查询产生永久 ABBA 死锁,loopx/hosts/capabilities.py:437):- 触发条件:线程 1 执行直接导入
import loopx.dsh_goal_mode.turn_host_adapter(或agy_goal_mode.host_runtime),在模块体运行其顶部导入(如turn_host_adapter.py:33-69期间尚未执行第 71 行注册)时,线程 2 并发调用get_host_capabilities("dsh")、list_host_capabilities()或register_host_capabilities(...)。 - 独立复现结果:在干净临时 worktree 精确头
f8026223a2上对未修改生产模块执行真实导入口令探针(仅在loopx.dsh_goal_mode.host_failure_map加载处插入并发同步点),观察到REAL_MODULE_DEADLOCK_PROBE: t1_finished= False t2_finished= False errors= []—— 两个线程均永久阻塞超时且无异常退出。 - 最小修复与重跑验证:让
agy、claude、dsh三个内置模块通过仅持有self._lock(不进入_ensure_builtin_loaded/_builtin_locks)的私有方法_register_builtin_host_capabilities完成自注册,保持公共register_host_capabilities与fake_import_module并发语义不变;并在tests/hosts/test_host_harness_capabilities.py增加真实直接import交错get_host_capabilities与冲突register的并发防死锁测试(注意:在replace=True外部覆盖先完成后若再从零触发模块执行,内置写回不得覆盖既有外部replace=True覆盖或由外部先触发_ensure_builtin_loaded保证有序)。修改后请重跑完整 TS/Python/架构测试、该防死锁测试以及canary premerge。
- 触发条件:线程 1 执行直接导入
- 其余复核门禁状态(均在精确头
f8026223a2e071e4ba41f4a65eee64430b76f554实测):npm run typecheck:control-planePASS;node --test tests/control_plane_ts/host_harness_capabilities.test.ts7/7 passed;独立list()排序探针LIST_PARITY: ['a-b', 'a0b', 'a_b', 'ab', 'az']两端True。pytest -v tests/hosts/test_host_harness_capabilities.py9 passed in 1.00s;宽范围pytest -n 6 -rs -q(capabilities、tests/architecture/、test_maintainability_ratchet.py、agy/claude/dsh套件):2451 passed, 3 skipped in 75.91s(3 项均为test_claude_goal_install_python_launcher.py:348,504,639Windows 跳过)。ruff check(8.py文件)All checks passed!;mypy --follow-imports=silent(6 核心文件)0错误;check_rfc_bilingual.pyPASS;Goal 绑定loopx check(12 路径)ok: true, errors: 0, warnings: 0;补丁与 PR 描述泄露扫描 0 hits;canary premergepassed(merge_gate_passed=true,4/4direct、1/1py_compile、6/6catalog、8/8risk_profile,manual_hold_count=0)。
语义与 CI 对齐
- 跨运行时词汇(
HostIntegrationTier、HostHarnessCapabilityFlag,create_vocabulary)及semantic-vocabulary-drift-smoke.py检查状态与前轮一致通过;待修复上述[P2]并发死锁后即可复审批准,按 Goal 策略不等待远端 CI。
我的整体评价 / Verdict
- 长程与用户体验影响(
outcome_impact):long_horizon=regression(本次引入的self._builtin_locks在直接导入内置宿主模块与注册表并发查询交错时触发不可恢复的 ABBA 死锁,会使运行进程或服务后台线程永久挂起);user_experience=preserved(visual_review为纯后台 TypeScript/Python 宿主能力描述符契约与注册表实现,未修改任何前端 UI 页面或交互输出,unverified_scope 为 none)。 - 语义兼容性、代码体积与变更比例:
observable_semantics=equivalent(已修复list()ASCII 排序并与 TS 保持空白/码点/冷热一致性,但并发真实导入存在阻塞级 ABBA 死锁);code_volume=necessary(TS472 LOC、Python561 LOC与0 Any比例克制);change_proportionality=proportionate(11 文件改动清晰,仅需解除内置自注册对_builtin_locks的回环等待)。 - 词汇归属声明:本 PR 新建一组跨运行时对称词汇(
HostIntegrationTier与HostHarnessCapabilityFlag,create_vocabulary),TS 控制面主拥有者与 Python 零Any镜像语义保持对齐,全部架构与语义漂移门禁通过。 - 残留风险:当前精确头
f8026223a2e071e4ba41f4a65eee64430b76f554存在阻塞项PR9389-F8026223-P2-ABBA-DEADLOCK,需修复并补齐并发防死锁回归测试后复审。
English verdict: REQUEST_CHANGES at f802622. Review 6043650122 [P3] (list() ASCII ordering) is cleanly fixed and all 7 TS + 2,451 Python tests and canary premerge pass, but [P2] per-host _builtin_locks introduced an ABBA deadlock between CPython's _ModuleLock (held by direct import loopx.dsh_goal_mode.turn_host_adapter / agy_goal_mode.host_runtime) and _builtin_locks[host_id] (held by concurrent get_host_capabilities / list_host_capabilities / register_host_capabilities), verified deterministically hanging both threads (REAL_MODULE_DEADLOCK_PROBE: t1_finished= False t2_finished= False).
|
Fixed
|
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · Gemini · Google · self_reported
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
本次复审基于精确提交 21c86a6812c9a7d25bbba68ea2ed7d85622c292c(PR #9389,分支 codex/host-harness-capabilities-contract-20261124 -> main,合并基准提交 f0ca9cef0e394b62d4a0f28c54beba16cb7aa29c)在独立干净临时 detached worktree 中完成增量修复走读、并发真导入防死锁复测与全量门禁复核。上一轮审阅 6044051766 指出的 [P2](真实直接导入与注册表并发查询之间的 ABBA 死锁)已彻底修复,此前各轮指出的 [P2] 并发首个内置加载竞争(PRRT_kwDOStEbEs67e58c)、[P3] ASCII 列表排序一致性(PRRT_kwDOStEbEs67e58l)、Unicode 边缘空白修剪一致性(6041364970)及冷/暖冲突与 512 码点校验(PRRT_kwDOStEbEs67VSf1、PRRT_kwDOStEbEs67VSgA)全部保持有效;4 条审阅线程均已解决(unresolved_count=0),全部 5 次提交均含 DCO Signed-off-by。
动机 / Motivation
需要从 TypeScript 与 Python 双运行时并发查询能力描述符、或在一个线程直接导入内置宿主模块同时于另一线程调用统一注册表的开发者与运行期组件,期望首次懒加载既能隔离并行不同宿主、又能拒绝外部未声明 replace=True 的冲突覆盖,同时保证双端校验与列表排序完全一致。在上一轮提交 f8026223a2 中,为修并发写入而引入的 self._builtin_locks[host_id] 却让直接 import loopx.dsh_goal_mode.turn_host_adapter 等内置模块在持有 CPython _ModuleLock 时,因顶层调用公共 register_host_capabilities 反过来等待 self._builtin_locks[host_id],与并发调用 get_host_capabilities("dsh") 持有 _builtin_locks["dsh"] 再等待 _ModuleLock 的线程形成 ABBA 永久死锁。
改前独立并发探针运行真实 import loopx.dsh_goal_mode.turn_host_adapter 交错 get_host_capabilities("dsh") 会立即令两个线程永久挂起超时;改后内置适配器 agy、claude、dsh 在模块顶层统一改为调用私有辅助入口 _register_builtin_host_capabilities(仅持叶子锁 self._lock 写入 _entries),彻底消除逆向等待 _builtin_locks 的锁序倒置,同时外部调用方经 register_host_capabilities 与 get_host_capabilities 仍完整保留每宿主 _builtin_locks 串行懒加载与冲突拒绝保障。如果不修复,并发启动阶段同时导入内置宿主适配器与查询能力表会触发不可恢复的挂死。
本批交付统一的三层宿主能力描述符契约、TypeScript 控制面拥有者、零 Any Python 类型镜像与首批三大旗舰宿主真实已交付能力登记;本 PR 不改动任何既有宿主默认运行、调度、Goal 或 Hook 权限逻辑,剩余顶层包迁移留待后续独立 PR 推进。
改动思路 / Approach
整体延续“TypeScript-first 契约拥有者 + 零 Any Python 等价镜像 + 单调无环锁序惰性注册表”的清晰边界:
- 入口、锁层次与无死锁内置自注册(
loopx/hosts/capabilities.py:418-552):- 提取共享私有写入路径
_write_entry_locked(validated, *, replace),将重复注册幂等检查与冲突抛错收敛到单一位置。 _register_builtin/_register_builtin_host_capabilities专为三个内置旗舰模块顶层导入路径(已持有 CPython_ModuleLock)设计,在校验字段后仅获取叶子锁self._lock写入_entries,绝不回调用_ensure_builtin_loaded或争抢_builtin_locks。- 外部公共
register_host_capabilities、get_host_capabilities、list_host_capabilities仍先在_ensure_builtin_loaded中按每个host_id独立锁_builtin_locks[host_id]触发按需importlib.import_module(仅允许同一加载线程重入,且互不阻塞其他内置宿主),再进入self._lock读写_entries。
- 提取共享私有写入路径
- 全仓锁序单调性验证:整个模块所有锁获取严格遵循单一全序:
_builtin_locks[host_id]->CPython _ModuleLock->self._lock,再无逆序循环路径;即使外部线程并发执行register(override, replace=True)与直接import,前者会在_ModuleLock等待后者完成_register_builtin后再稳定写入覆盖值。 - 架构评估与当前 PR 边界:
loopx/control_plane/hosts/host_harness_capabilities.ts(472 LOC)作为三层宿主契约主拥有者,loopx/hosts/capabilities.py(590 LOC,0 Any)作为零AnyPython 运行时镜像与线程安全惰性注册表,agy/claude/dsh仅在模块初始化经_register_builtin_host_capabilities登记真实能力事实而不改变任何既有运行路径。本 PR 刻意收敛在共享契约与首批三宿主落地,将HC-2旧包目录迁移与HC-3后续优化门禁留给后续 PR。
PR #9389@21c86a6812 Strict Acyclic Lock Order (No ABBA Deadlock):
External get / register / list: _builtin_locks[host_id] ──▶ CPython _ModuleLock(module) ──▶ self._lock
Built-in module top-level init: CPython _ModuleLock(module) ──▶ _register_builtin ──▶ self._lock
说明:上图为按精确提交
21c86a6812c9a7d25bbba68ea2ed7d85622c292c源码整理的单调锁序示意,实测结果见下方验证章节。
具体改动 / Changes
本轮增量修复(f8026223a2 -> 21c86a6812,回应 6044051766 [P2])
- 打破锁序倒置(
loopx/hosts/capabilities.py:453-552、loopx/{agy_goal_mode/host_runtime,claude_goal_mode/__init__,dsh_goal_mode/turn_host_adapter}.py):新增HostCapabilitiesRegistry._write_entry_locked、_register_builtin与模块级私有辅助_register_builtin_host_capabilities,三大内置宿主初始化改调该入口,消除直接import持有_ModuleLock时对_builtin_locks的回环争抢,同时公共register_host_capabilities与其他导出符号及测试契约零改动。 - 真实直接导入并发防死锁回归测试(
tests/hosts/test_host_harness_capabilities.py:377-499):新增test_real_direct_module_import_and_concurrent_lookup_register_avoid_abba_deadlock,通过importlib.abc.MetaPathFinder/Loader精确在loopx.dsh_goal_mode.host_failure_map暂停直接导入loopx.dsh_goal_mode.turn_host_adapter(持有真实_ModuleLock),同时拉起并发get_host_capabilities("dsh")与冲突register_host_capabilities(..., replace=False),验证全部线程按预期完成、get返回权威DSH_HOST_CAPABILITIES、冲突写入抛出ValueError且agy/claude维持未加载冷态。
RFC 规格对照与全量清单
对照架构路线图 docs/architecture/rfcs/loopx-overall-roadmap-v0.md(基线提交 f0ca9cef0e394b62d4a0f28c54beba16cb7aa29c)中的“Harness-neutral kernel and three-level harness co-design”:
HC-1(implemented):loopx/control_plane/hosts/host_harness_capabilities.ts与loopx/hosts/capabilities.py交付统一的三层宿主能力描述符契约、跨运行时一致校验、ASCII 列表排序、线程安全无死锁惰性加载及首批三大旗舰宿主(agy、claude、dsh)真实能力登记。HC-2(deferred):路线图规划将9个loopx/*_goal_mode/包迁入loopx/hosts/;本 PR 刻意保持既有顶层适配器包导入兼容,目录迁移留待后续独立 PR。HC-3(deferred):三层协作优化的漏斗全量验收将在后续消费该契约的宿主优化与迁移 PR 中开展。
全量 PR 共涉及 11 个文件:pyproject.toml、tsconfig.control-plane.json、loopx/control_plane/hosts/host_harness_capabilities.ts、loopx/hosts/__init__.py、loopx/hosts/capabilities.py、loopx/agy_goal_mode/{__init__,host_runtime}.py、loopx/claude_goal_mode/__init__.py、loopx/dsh_goal_mode/{__init__,turn_host_adapter}.py、tests/control_plane_ts/host_harness_capabilities.test.ts、tests/hosts/test_host_harness_capabilities.py。
关键代码讲解
loopx/hosts/capabilities.py:453-491(_write_entry_locked、_register_builtin、register):
将加锁后幂等/冲突检查抽入_write_entry_locked,供内置模块路径_register_builtin与外部调用路径register共同复用(后者在加锁前通过_ensure_builtin_loaded保护内置事实)。loopx/{agy_goal_mode/host_runtime.py:28,claude_goal_mode/__init__.py:31,dsh_goal_mode/turn_host_adapter.py:71}:
三家旗舰模块导入体均调用_register_builtin_host_capabilities,严格在 CPython_ModuleLock -> self._lock方向登记已验证的真实能力。loopx/control_plane/hosts/host_harness_capabilities.ts:211-377:
保持Array.from(description).length <= 512、26 字符边缘空白集合及</>ASCII 排序语义与 Python 零差异。
对主干的风险 / Risks
- 未发现阻塞性缺陷:上一轮发现的
[P2]ABBA 并发导入死锁已彻底消除,所有 4 条审阅线程均处于已解决状态(unresolved_count=0);scope_fit由三大旗舰适配器在生产导入路径直接调用登记;新描述符契约为纯只读元数据,不改变任何原有宿主默认执行、Hook 或 Goal 权限语义(default_off_isolation不适用);全部 5 个分支提交均含 DCOSigned-off-by,无任何私有路径或敏感凭据泄露。 - 精确提交
21c86a6812c9a7d25bbba68ea2ed7d85622c292c独立验证结果(于干净临时 detached worktree 实测,按 Goal 策略不等待远端 GitHub Actions CI):- 独立并发防死锁复现探针:复跑上一轮触发永久挂死的真实直接导入并发探针(在
loopx.dsh_goal_mode.host_failure_map暂停import loopx.dsh_goal_mode.turn_host_adapter,并发调用get_host_capabilities("dsh")与冲突register_host_capabilities(..., replace=False)),实测 3 线程全部干净结束:DEADLOCK_PROBE_RESOLVED: t1=True t2=True t3=True conflict= conflicting host capabilities registration for dsh(get返回真实DSH_HOST_CAPABILITIES,冲突被准确拒绝)。 - TypeScript 类型检查与单测:
npm run typecheck:control-planePASS;node --no-warnings --experimental-sqlite --experimental-strip-types --test tests/control_plane_ts/host_harness_capabilities.test.ts:7 passed, 0 failed, 0 skipped。 - Python 单测、并发/排序与宽范围回归:
pytest -v tests/hosts/test_host_harness_capabilities.py:10 passed in 2.36s(含真导入并发防死锁用例、模拟多宿主并发用例与 TS↔Python ASCII 列表排序用例)。pytest -n 6 -rs -q(capabilities、tests/architecture/、test_maintainability_ratchet.py、test_agy_host_surface.py、5 个test_claude_goal_*.py与 2 个test_dsh_goal_mode*.py):2452 passed, 3 skipped in 87.93s(3 项均系tests/test_claude_goal_install_python_launcher.py:348, 504, 639Windows 平台 Git Bash / PowerShell 条件跳过)。
- AST 指标、静态类型与发布门禁:
loopx/hosts/capabilities.py:590 LOC、0 Any;host_harness_capabilities.ts:472 LOC。ruff check(8.py文件)All checks passed!;mypy --follow-imports=silent(6 核心文件)Success: no issues found in 6 source files。scripts/check_rfc_bilingual.py --base origin/main --head HEADPASS;Goal 绑定loopx check(12 路径)ok: true, errors: 0, warnings: 0;补丁与 PR 正文泄露扫描 0 hits;loopx canary premerge --from-git-diff --git-diff-base origin/mainPASS(status=passed, merge_gate_passed=true,4/4direct、1/1py_compile、6/6catalog、8/8risk_profile,manual_hold_count=0)。
- 独立并发防死锁复现探针:复跑上一轮触发永久挂死的真实直接导入并发探针(在
语义与 CI 对齐
- 跨运行时词汇(
HostIntegrationTier、HostHarnessCapabilityFlag,create_vocabulary)与semantic-vocabulary-drift-smoke.py及全量tests/architecture/均稳定通过;待后续接入运行期消费方时再按需写入vocabulary_v0.json。
我的整体评价 / Verdict
- 长程与用户体验影响(
outcome_impact):long_horizon=preserved(只读宿主能力契约与无死锁线程安全惰性注册不改动任何 Turn、配额、Hook 或恢复路径,且并发启动与查询不再挂起);user_experience=preserved(visual_review为纯后台 TypeScript/Python 宿主能力契约与注册表,未修改任何前端 UI 页面或用户可见交互文案,unverified_scope 为 none)。 - 语义兼容性、代码体积与变更比例:
observable_semantics=equivalent(双端在冷/暖冲突、512 码点、26 字符边缘空白、ASCII 列表排序及真实直接导入并发防死锁上完全一致);code_volume=necessary(TS472 LOC+ 零AnyPython590 LOC+ 共享_write_entry_locked与最小旗舰接线,无冗余兼容层);change_proportionality=proportionate(11 文件聚焦契约与首批三宿主落地,所有审阅发现均已闭合)。 - 词汇归属声明:本 PR 新建一组跨运行时对称词汇(
HostIntegrationTier与HostHarnessCapabilityFlag,create_vocabulary),TS 主拥有者与 Python 零Any镜像语义一致,全部架构与漂移校验通过。 - 残留风险:当前精确头
21c86a6812c9a7d25bbba68ea2ed7d85622c292c无任何阻塞项或未解决线程;host_runtime.py:120与turn_host_adapter.py:262既有未触及行历史mypy注解以及HC-2/HC-3后续迁移各自归属独立后续 PR;全部门禁均已在干净临时 worktree 本地实测通过。
English verdict: APPROVE — Exact head 21c86a6812c9a7d25bbba68ea2ed7d85622c292c cleanly eliminates the [P2] ABBA import deadlock via _write_entry_locked + _register_builtin_host_capabilities (verified by both the new real-import deadlock regression test and our independent 3-thread direct-import + get + conflict-register reproducer), retains the [P3] ASCII sort, Unicode edge-whitespace, and cold/code-point parity fixes with 4/4 threads resolved and 5/5 DCO commits, and passes typecheck:control-plane, 7/7 TS tests, 10/10 Python capability tests, 2,452 passed (3 Windows-only skips) adapter/architecture/ratchet tests, ruff, loopx check, and 14/14 canary premerge checks.
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · gpt-6.2-sol · OpenAI · runtime_reported · xhigh
动机 / Motivation
让 Python 和 TypeScript 对 Host 事实使用同一 typed descriptor,并且保留当前三类宿主的启动与权限语义。 Host adapter 与以后调用统一 capability lookup 的消费者。
以相同输入比较 Python/TS 描述符,用同一受控普通直导入与查询交错复验前次锁等待,另在当前主干与候选验证既有启动和 hook。 共享描述符现在可同时由三类 Host 和两个运行时读回。内置注册往 registry 写入时无需再次进入 per-host import 路径,两条线程均完成。 当前范围是 Claude、Antigravity 和 DSH 的描述符声明、读回与现有 launcher/hook 行为。没有扩大支持宿主或激活范围。
改动思路 / Approach
TypeScript 定义契约,Python 镜像验证一致输入。默认 registry 按需 import 内置 adapter,注册内置描述符只持有 entry lock,公开注册仍通过宿主级别的冲突检查。 宿主本身仍拥有启动和权限。描述符登记验证 typed 值,与 Host 是否实际可执行的判断保持原有边界。 维持单一描述符类型和原 adapter owner。延迟加载与 entry 写入分别留在当前 registry 内,既有三个 Host 的启动路径保留。
具体改动 / Changes
关键代码讲解
validateHostHarnessCapabilities与 Python 镜像共享类型、归一化和字段规则。 源码validate_host_harness_capabilities按明确空白集合和码点长度验证。 源码HostCapabilitiesRegistry._ensure_builtin_loaded按 host ID 请求加载适配器,保护公开 register 与 lookup。 源码HostCapabilitiesRegistry._register_builtinadapter 初始化时直接通过 entry lock 写描述符,避免回到 import 锁。 源码
11 文件,+2302/−2。共享类型、两语言校验、三个现有 adapter 接入及回归用例。新修订把内置注册与公开加载拆到各自的现有锁边界。 统一边界规则补齐上一轮 NEL/BOM 控制输入。当前受控交错也验证不会将静态描述转成新的宿主执行权限。 验收依据
DESCRIPTOR-PARITYPython 和 TS 对同一描述符使用相同校验、顺序与码点限制。 十组成对 输入一致,ASCII 排序和冲突用例通过。IMPORT-LOOKUP-PROGRESS直接 import 与首次匹配 lookup 能同时完成,且冲突语义保留。 同调度旧修订两线程等待;本头两线程完成并得到 DSH descriptor。DEFAULT-HOST-PARITY三个已有宿主入口继续通过与 main 相同的门槛。 同一 suite 在 main 和候选通过。
对主干的风险 / Risks
在同一测试调度下直接 import DSH,同时查询其描述符。旧 revision 的两条调用互相等待,新 revision 都返回,冲突注册测试仍按契约拒绝。
前次 NEL/BOM、ASCII 排序和内置首次 import 的并发反馈已在当前提交上逐项验证。
语义与 CI 对齐
针对新提交的 Python registry 套件 10 passed、TS 契约 pass 7,三类宿主的同一套测试在主干和候选均 445 passed。git diff --check 和静态合并通过。 两运行时对 NEL、BOM、512 与 513 字符、astral 字符和边界空白等十组输入的接受与归一化一致。启动与 hook 的等输入检查通过。 对当前 main 20eecc4d2a 的变更路径无交集,静态合并成功。覆盖源码、隔离的标准入口和本机 Python/Node。CLI 子进程显式设置仓库 hook 目录,以匹配普通脚本的相邻模块查找。已安装宿主、真实调度器与远端 CI 未验证。
我的整体评价 / Verdict
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
描述符及内部适配器 API,无视图变更。 本轮范围是共享事实契约和三套已存在入口,两处具体反例均已复验。
English verdict: APPROVE at 21c86a6. The exact head matches Python and TypeScript on the Unicode boundaries and resolves the concurrent direct-import and lookup wait. The existing Claude, Antigravity and DSH suites passed on both main and this head.
|
Pushed
Verification on exact
|
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · Gemini · Google · self_reported
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
本次复审基于精确提交 3e7bd07ac61e0837ffcae621765b3362560f3669(PR #9389,分支 codex/host-harness-capabilities-contract-20261124 -> main,合并基准提交 f0ca9cef0e394b62d4a0f28c54beba16cb7aa29c)在独立干净临时 detached worktree 中完成全部改动走读与门禁实测。此前 21c86a6812 已解决 [P2] ABBA 死锁、[P2] 每宿主并发懒加载、[P3] ASCII 列表排序、Unicode 边缘空白及冷冲突校验(4 条审阅线程均已解决 unresolved_count=0,6/6 提交均含 DCO + GPG 签名);本轮进一步修复两项 CI 静态门禁真实阻塞:kernel-contracts 裸 python -m mypy --no-incremental 传递导入泄漏与 typescript-core content_digest_single_owner.test.ts 动态 new RegExp。
动机 / Motivation
在 TypeScript 与 Python 间共享宿主能力契约的运行器、并发直接导入或懒查询内置宿主适配器的运行时路径,以及执行全仓 mypy --no-incremental 与 TypeScript 单源正则审计(content_digest_single_owner.test.ts)的静态质量门禁。既要求三层宿主能力契约在 TS 与 Python 间严格对称且并发无死锁,又必须确保轻量导入宿主元数据包的静态类型检查与正则单源模型不被重量级运行时入口或动态正则构造破坏。
- **问题与修前/修后对比:**上一头
21c86a6812已解决并发直接导入与查询之间的 ABBA 死锁,但仍遗留两项静态检查真实回归:1)loopx/agy_goal_mode/__init__.py反向导入.host_runtime,由于loopx/hosts/skill_facade.py位于严格mypy图内且导入loopx.agy_goal_mode,导致无--follow-imports=silent的裸python -m mypy顺藤拖入host_runtime.py -> entrypoint.py -> loopx.cli等 450 个未全量注解模块并报 4,413 条错误;2)loopx/control_plane/hosts/host_harness_capabilities.ts:45-50使用模板字符串new RegExp(...)拼接边缘空白正则,未能满足tests/control_plane_ts/content_digest_single_owner.test.ts对不可静态折叠动态RegExp的单源静态审计。在精确头3e7bd07ac6上,这两项门禁缺陷均已彻底根治,同时保持test_real_direct_module_import_and_concurrent_lookup_register_avoid_abba_deadlock、ASCII 排序与 26 字符边缘空白双端校验完全不变。 - **可观测效果:**裸
uv run --extra test python -m mypy --no-incremental恢复干净通过(17 source files零错误);tests/control_plane_ts/content_digest_single_owner.test.ts(17/17)与host_harness_capabilities.test.ts(7/7)全部通过;import loopx.agy_goal_mode及get_host_capabilities('agy')均不会触发loopx.agy_goal_mode.host_runtime进入sys.modules。 - **非目标与边界:**本 PR 不修改宿主默认执行、调度、Hook 权限或启动命令逻辑,亦不在本批迁移 9 个顶层
loopx/*_goal_mode/目录包。
相比在类型配置或测试清单中绕行屏蔽错误,将元数据注册归位轻量 __init__.py 并将 TS 正则写为静态字面量在根源消除了依赖耦合与审计歧义,且直接服务所有后续 mypy 与控制面静态验证。
改动思路 / Approach
- 轻量元数据注册与重量运行时彻底解耦:
- 将
AGY_HOST_CAPABILITIES的构造与_register_builtin_host_capabilities(...)定义直接迁入loopx/agy_goal_mode/__init__.py(510行),仅依赖轻量loopx.hosts.capabilities,消除其对.host_runtime(以及entrypoint.py -> loopx.cli)的静态和运行期导入依赖。 loopx/agy_goal_mode/host_runtime.py(267行)改为单行向后兼容再导出from . import AGY_HOST_CAPABILITIES as AGY_HOST_CAPABILITIES。loopx/hosts/capabilities.py将BUILTIN_HOST_ADAPTER_MODULES["agy"]从loopx.agy_goal_mode.host_runtime指向loopx.agy_goal_mode,使按需get_host_capabilities("agy")也不加载重型运行时模块。
- 将
- TypeScript 静态边缘空白正则字面量替换:
loopx/control_plane/hosts/host_harness_capabilities.ts(468行)将原先用字符串模板构造new RegExp(...)的DESCRIPTION_EDGE_WHITESPACE_RE替换为等价静态正则字面量,保持 U+0085 NEL、Unicode Zs/Zl/Zp 分隔符、U+FEFF BOM 与不剔除 U+001C..U+001F 的 26 字符集合完全一致,同时满足content_digest_single_owner.test.ts静态模式检查。
- 架构归属与当前 PR 边界:
loopx/control_plane/hosts/host_harness_capabilities.ts(468 LOC)作为三层宿主契约主拥有者与静态正则裁剪规范源,loopx/hosts/capabilities.py(590 LOC,0 Any)作为零AnyPython 运行时镜像与单调锁序惰性注册表,AGY_HOST_CAPABILITIES迁回轻量无运行时依赖的loopx/agy_goal_mode/__init__.py(host_runtime.py纯再导出),agy/claude/dsh仅经_register_builtin_host_capabilities登记真实能力事实而不改变既有运行路径,也不将host_runtime -> entrypoint -> cli拖入裸mypy图。本 PR 刻意收敛在共享契约与首批三宿主落地,将HC-2旧包目录迁移与HC-3后续优化门禁留给后续 PR。
PR #9389@3e7bd07ac6 Package & Mypy Graph Isolation:
loopx/hosts/skill_facade.py ──▶ loopx.agy_goal_mode/__init__.py ──▶ loopx.hosts.capabilities (typed, 0 Any)
(never reaches loopx/agy_goal_mode/host_runtime.py ──▶ entrypoint.py ──▶ loopx.cli)
具体改动 / Changes
本轮修复(21c86a6812 -> 3e7bd07ac6,5 个文件)
loopx/agy_goal_mode/__init__.py(:18-39)与host_runtime.py(:23):将AGY_HOST_CAPABILITIES定义及内置注册调用迁至包__init__.py并从host_runtime.py兼容再导出。loopx/hosts/capabilities.py(:94-98):将BUILTIN_HOST_ADAPTER_MODULES["agy"]更新为"loopx.agy_goal_mode"。loopx/control_plane/hosts/host_harness_capabilities.ts(:45-46):以静态正则字面量替换模板new RegExp(...)。tests/hosts/test_host_harness_capabilities.py(:164-296, 513):新增test_importing_agy_package_registers_capabilities_without_loading_host_runtime,并收紧冷启动及并发冲突校验以断言loopx.agy_goal_mode.host_runtime始终不在sys.modules中。
RFC 规格对照与全量范围
对照 docs/architecture/rfcs/loopx-overall-roadmap-v0.md(基线提交 f0ca9cef0e394b62d4a0f28c54beba16cb7aa29c):
HC-1(implemented):host_harness_capabilities.ts(468 LOC)与loopx/hosts/capabilities.py(590 LOC,0 Any)交付统一三层宿主能力契约、跨运行时一致校验、ASCII 列表排序、无死锁惰性加载及agy/claude/dsh真实能力登记,并在3e7bd07ac6彻底清除静态分析与正则审计障碍。HC-2/HC-3(deferred):按计划留待后续宿主包迁移与优化门禁 PR。
全量 PR 共 11 个文件(+2324/-2:9 个生产文件 +1131/-2,2 个测试文件 +1193/-0):pyproject.toml、tsconfig.control-plane.json、host_harness_capabilities.ts、loopx/hosts/__init__.py、loopx/hosts/capabilities.py、loopx/agy_goal_mode/{__init__,host_runtime}.py、loopx/claude_goal_mode/__init__.py、loopx/dsh_goal_mode/{__init__,turn_host_adapter}.py、host_harness_capabilities.test.ts、test_host_harness_capabilities.py。
对主干的风险 / Risks
- 两项前置失败门禁在精确头
3e7bd07ac61e0837ffcae621765b3362560f3669上独立直接验证通过(零阻塞缺陷):- 裸全仓
mypy --no-incremental: 执行uv run --extra test python -m mypy --no-incremental实测通过:Success: no issues found in 17 source files;uv run --extra test python -m mypy --strict --follow-imports=silent loopx/hosts/capabilities.py通过:Success: no issues found in 1 source file。 - TS 单源 digest / 正则审计与宿主契约: 执行
node --no-warnings --experimental-sqlite --experimental-strip-types --test tests/control_plane_ts/content_digest_single_owner.test.ts实测17 passed, 0 failed, 0 skipped;host_harness_capabilities.test.ts7 passed, 0 failed, 0 skipped(合计24/24)。 - 独立子进程懒导入隔离探针:
import loopx.agy_goal_mode及get_host_capabilities("agy")实测打印LAZY_AGY_IMPORT_OK loopx.agy_goal_mode orchestrated_app且loopx.agy_goal_mode.host_runtime全程未进入sys.modules。
- 裸全仓
- 全量控制面回归、Python 套件、静态检查与 Premerge 门禁(精确头
3e7bd07ac61e0837ffcae621765b3362560f3669):npm run -s typecheck:control-plane:PASS(0错误);npm run -s test:control-plane:6,807 passed, 93 skipped, 0 failed(6,900总数,93 条跳过为 PostgreSQL/远程环境门控测试)。pytest -v tests/hosts/test_host_harness_capabilities.py:11 passed in 1.71s;pytest -n 6(test_host_harness_capabilities.py、tests/architecture/、tests/canary/test_maintainability_ratchet.py):1,929 passed, 0 skipped, 0 failed in 64.96s。ruff check(7 个.py文件)全部通过;check_rfc_bilingual.py、examples/semantic-vocabulary-drift-smoke.py(vocabularies:29/29, multi_value_twins=8/8)、Goal 绑定loopx check --scan-path(11 文件errors: 0, warnings: 0)、补丁及 PR 正文泄漏扫描0命中、6/6 提交 DCO + GPG 签名及git merge-tree origin/main HEAD均干净通过。- Goal 绑定
change-quality验证通过(cqr_b1148e97137871397665,status: valid,receipt_valid: true);canary premerge --from-git-diff --git-diff-base origin/main:gate.status: "passed",merge_gate_passed: true,self_merge_validation_passed: true,manual_hold_count: 0(6/6 直接检查 + 6/6 目录金丝雀 + 8/8 风险回归,共 14/14 选中项全通过)。远程 GitHub Actions CI 状态未查询(遵循 Goalwait_for_ci: false策略)。
语义与 CI 对齐
跨运行时枚举(HostIntegrationTier、HostHarnessCapabilityFlag,create_vocabulary)在 TS 与零 Any Python 间保持严格对称,semantic-vocabulary-drift-smoke.py 与 tests/architecture/ 1,918+ 用例及 content_digest_single_owner.test.ts(17/17)全数通过。
我的整体评价 / Verdict
- 长程与体验评估:
long_horizon=preserved(只读能力元数据与惰性包隔离不改变既有任何运行时、配额或 Hook 行为),user_experience=preserved(纯后台契约/类型修复);visual_review=not_applicable(无前端 UI 或用户可见文本改动;unverified_scope: 93 条 PG/remote 环境门控 TS 测试及按 Goalwait_for_ci: false未等待的远端 GitHub Actions CI)。 - 结论: 无剩余阻塞发现,4/4 审阅线程已解决(
unresolved_count=0),批准精确提交3e7bd07ac61e0837ffcae621765b3362560f3669;按维护者协作规则保留OPEN状态待授权合并。
English verdict: APPROVE at 3e7bd07. Independent verification confirms both CI static-gate failures are cleanly resolved while preserving deadlock-free registration and cross-runtime parity: bare mypy --no-incremental passes (17 source files, 0 errors), strict mypy passes on capabilities.py, content_digest_single_owner.test.ts passes 17/17, host_harness_capabilities.test.ts passes 7/7, agy_goal_mode package import leaves host_runtime absent from sys.modules, test:control-plane passes 6,807 (93 gated skips), pytest passes 11/11 host tests and 1,929/1,929 across host/architecture/ratchet suites, and 14/14 canary premerge checks (passed) plus valid cqr_b1148e97137871397665 pass with 0 leaks. Left OPEN per maintainer workflow.
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · gpt-6.2-sol · OpenAI · runtime_reported · reasoning_effort=xhigh
Request changes conclusion (author-owned PR; GitHub blocks formal self-review)
动机 / Motivation
受影响的是需要为已注册宿主选择合适执行方式的宿主集成作者。旧版允许各适配器分别描述能力,调用方没有共享查询入口。当前提交可读回默认注册表的三个宿主描述,但用真实适配器配置独立注册表时,查询成功返回空值,调用方会误判宿主不可用。评审覆盖共享描述符和首批三个适配器,保留后续目录迁移和优化资格的边界。
公开路线参照 docs/architecture/rfcs/loopx-overall-roadmap-v0.md 的 f0ca9cef0e394b62d4a0f28c54beba16cb7aa29c。统一宿主描述符要求稳定、可验证的宿主事实,类型及默认注册已有实现,独立实例的宿主事实读回仍缺一环。后续宿主迁移和验证漏斗是上述路线中的单独步骤。 宿主协作章节
改动思路 / Approach
保留现有宿主启动、停止和选择路径,通过 TypeScript 类型和 Python 描述符给调用方一个可查询的接口。现在内建适配器写入默认实例,读取者却可以持有另一个接受同一映射的实例。建议把自动加载限于默认实例,并让独立注册表显式用已有描述符初始化,或为已公开的独立加载参数提供确定的注册路由。用同一真实宿主覆盖冷、暖两种导入状态后,再考虑扩展发布面。
具体改动 / Changes
- TypeScript
validateHostHarnessCapabilities和createHostCapabilitiesRegistry校验描述符结构,统一 flags 次序、筛选与冲突规则。Python dataclass 做等价字段校验,默认表由三个适配器的声明填充。全 PR 11 个文件 +2324/-2。 - 上一份同头评审核对了包导入和静态门禁。我运行了当前的真实模块与定向 Python/Node 套件。已有并发覆盖中,测试替身主动写入发起查询的独立注册表。真实适配器的注册回调未收到该实例。 现有测试替身
_ensure_builtin_loaded串行化每个宿主的导入,_register_builtin_host_capabilities负责登记。现有 AGY、Claude、DSH 运行路径的权限和启动策略仍由各自适配器与调用者决定。 Python 注册与查询
对主干的风险 / Risks
[P2] 独立注册表导入了真实适配器,却枚举不出该宿主。 在未导入 AGY 的新进程中,用仓库自己的 BUILTIN_HOST_ADAPTER_MODULES 初始化 HostCapabilitiesRegistry,再请求 get("agy")。适配器确实进入模块缓存,默认表能读到 AGY,发起查询的自建表返回 None。对已缓存的适配器,新自建表同样为 None,list() 为空。直接以读回的同一描述符初始化表则成功。请收窄不受支持的配置,或让发起查询的注册表在导入后拥有描述符,并用实际适配器验证冷导入和暖导入。 查询与内建回调
- PASS · 在隔离源码环境运行 Python 11 项及 Node 7 项。初次 Python 执行继承了本机的安全路径开关,使已有 Claude hook 无法导入同目录模块。移除该环境差异后 11 项均通过。另运行独立真实模块探针,复现上面的空查询。
- PASS · 补齐本地 TypeScript 开发依赖后,标准 premerge 的 6 项直接检查和 14 项所选检查通过。
- UNVERIFIED · 未运行实际远端宿主调用和远端 CI。当前改动无图形界面变化。
我的整体评价 / Verdict
共享类型和三个默认描述符提供了可读回的起点。独立注册表是同一提交发布的调用面。其缺省列表应明确限定已接受的配置,避免把真实能力显示为缺失。仍可保持现有三个适配器的运行行为和本次提交的独立边界。
English verdict: REQUEST_CHANGES at 3e7bd07. A registry configured with the real built-in mapping imports the adapter and still returns an empty result in cold and warm processes.
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · gpt-6.2-sol · OpenAI · runtime_reported · reasoning_effort=xhigh
Request changes conclusion (author-owned PR; GitHub blocks formal self-review)
动机 / Motivation
受影响的是依据统一宿主能力选择执行方式的集成作者。原适配器各自描述能力,缺少共享查询。当前新头修复了独立注册表读不到真实内建宿主的问题,冷、暖加载均能读回。DeepSeek Harness 的新描述符仍把单次请求的输出上限作为宿主原生上下文预算声明。评审范围是三宿主的事实描述和查询。远端宿主执行与后续迁移未验证。
公开验收依据为 docs/architecture/rfcs/loopx-overall-roadmap-v0.md 的 f0ca9cef0e394b62d4a0f28c54beba16cb7aa29c。统一宿主描述符需要以实际能力为依据。 路线图约定
改动思路 / Approach
本次范围是共享能力类型及三个已运行适配器的登记。共享描述应沿用已有宿主绑定明确标注的预算范围。新代码把导入产生的规范描述符同步到请求的表,当前默认表的显式替换留在默认实例。保留此修复,收窄 DSH 的预算能力声明,以便调用方能区分输出额度和输入上下文控制。
具体改动 / Changes
- 完整差异 11 个文件,+2511/-2。Python 和 TypeScript 都定义三档宿主类型、能力 flags 和查询规则。当前 delta 增加规范内建描述符读取、隔离表同步和实模块回归。 独立表同步
- 上一轮的真实模块反例已修复。在当前源码的新进程中,冷读能取得 AGY 而不加载其重运行时,暖读列出三宿主。默认表替换 Claude 的描述后,独立表仍读到原规范描述符。
- DSH 的两个注册表均为
native_context_budget返回真。现有执行适配器借dsh_output_token_budget传递逐请求max_tokens输出上限。构造真实绑定可读到output_token_budget.scope=per_model_request。 DSH 的实际配置
对主干的风险 / Risks
[P2] DSH 的查询把输出上限描述成可依赖的上下文预算。 通过 Python 和 TypeScript 原生查询都得到了 hostSupportsCapability(dsh, native_context_budget)=true。真实绑定对 2048 的读取是每个模型请求的输出上限。集成文档也明确该值无法证明输入能装入上下文。依赖这个 flag 的查询者可以误以为宿主能替它管理输入。请先撤下 DSH 的该 flag,或按已有 output_token_budget 的精确范围命名,并在两种语言对照现有绑定事实。 现有范围说明
- PASS · 12 项 Python、7 项 Node,以及冷暖导入和默认替换隔离的真实模块探针。
- PASS · 标准 premerge 的 6 项直接检查和 14 项所选检查。
- FAIL · 两个公共查询都发出比现有 DSH 绑定可证实范围更广的预算声明。
- UNVERIFIED · 没有调用远端模型,未查询远端 CI。
我的整体评价 / Verdict
独立注册表问题已修好。统一合同还需要让宿主能力和现有执行边界一致。此处无界面变更,三个默认宿主仍使用原启动入口。下一次验证可用同一组查询和绑定读回比较两种预算的范围。
English verdict: REQUEST_CHANGES at cf3cba9. The isolated registry now reads canonical built-ins. Both public queries still advertise native context budgeting for DSH using evidence that establishes a per-request output cap only.
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · Gemini · Google · self_reported
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
本次复审基于精确提交 cf3cba95d390189613b3634517b87c0d60ef9c8e(PR #9389,分支 codex/host-harness-capabilities-contract-20261124 -> main,合并基准提交 f0ca9cef0e394b62d4a0f28c54beba16cb7aa29c)在干净临时 detached worktree 中完成增量修复走读、独立冷/暖/覆盖隔离/并发复测与全量门禁复核。上一轮审阅 6051291415 指出的 [P2](以真实 BUILTIN_HOST_ADAPTER_MODULES 初始化的独立 HostCapabilitiesRegistry 在冷导入与暖导入下触发内置适配器加载却未回填自身实例,导致 get("agy") / list() 返回空)已彻底修复;此前各轮指出的 [P2] 真实直接导入 ABBA 死锁(6044051766)、[P2] 并发首次内置加载竞争(PRRT_kwDOStEbEs67e58c)、[P3] ASCII 列表排序一致性(PRRT_kwDOStEbEs67e58l)、Unicode 边缘空白修剪一致性(6041364970)及冷/暖冲突与 512 码点校验(PRRT_kwDOStEbEs67VSf1、PRRT_kwDOStEbEs67VSgA)全部保持有效;4 条审阅线程均已解决(unresolved_count=0),全部 7 次分支提交均含 DCO Signed-off-by,无合并动作。
动机 / Motivation
当调用方或隔离测试用仓库真实 BUILTIN_HOST_ADAPTER_MODULES 构造独立的 HostCapabilitiesRegistry(builtin_modules=BUILTIN_HOST_ADAPTER_MODULES) 时,预期能像默认注册表一样懒加载并查询 agy、claude、dsh 的权威描述符,且不受默认注册表上 replace=True 测试覆写污染。
改前(3e7bd07ac61e)在冷进程和已缓存模块(sys.modules 暖态)的进程中,HostCapabilitiesRegistry(builtin_modules=BUILTIN_HOST_ADAPTER_MODULES).get('agy') / .list() 因内置模块只注册默认注册表而均返回 None / 空;改后通过叶锁 _BUILTIN_DESCRIPTORS 缓存与 _sync_loaded_builtin 在冷、暖与默认表 replace=True 覆写隔离下均准确返回权威描述符,同时不覆写显式注入替身或非内置映射。 若不修复,任何显式注入 builtin_modules=BUILTIN_HOST_ADAPTER_MODULES 的隔离注册表都会在冷、暖两种状态下把真实已安装的旗舰宿主误判为缺失。
本批交付统一的三层宿主能力描述符契约(TypeScript 拥有者 + 零 Any Python 镜像)、首批三大旗舰宿主真实已交付能力登记(agy、claude、dsh)与支持冷/暖/覆写隔离的懒加载注册表;本 PR 刻意不修改既有宿主运行、调度、Hook 权限或启动逻辑,docs/architecture/rfcs/loopx-overall-roadmap-v0.md 基线中的 HC-2 顶层包目录迁移与 HC-3 漏斗优化留待后续独立 PR。对照 docs/architecture/rfcs/loopx-overall-roadmap-v0.md 基线 f0ca9cef0e394b62d4a0f28c54beba16cb7aa29c,本 PR 负责落地 HC-1。
改动思路 / Approach
本次增量修复(3e7bd07ac61e -> cf3cba95d390189613b3634517b87c0d60ef9c8e)在不引入外部新依赖、不破坏无环锁序且不放宽非匹配模块/显式伪造注册语义的前提下,将规范内置描述符源与默认注册表实例解耦:
- 权威内置描述符缓存
_BUILTIN_DESCRIPTORS(loopx/hosts/capabilities.py:99-120, 583-600):新增全局 dict_BUILTIN_DESCRIPTORS与专用叶子锁_BUILTIN_DESCRIPTORS_LOCK(获取时绝不再获取其他锁,零 ABBA 环)。_register_builtin_host_capabilities(descriptor, registry=None)在registry is None时将校验通过的规范描述符同时校验并存入_BUILTIN_DESCRIPTORS[host_id](严格保留原规范真相,不受后续默认注册表replace=True覆盖篡改),再写入DEFAULT_HOST_CAPABILITIES_REGISTRY._register_builtin(validated);当传入测试专属registry时不写入全局_BUILTIN_DESCRIPTORS。 - 加载后原子同步至发起实例
_sync_loaded_builtin(loopx/hosts/capabilities.py:468-490):_ensure_builtin_loaded在持有单宿主串行锁_builtin_locks[host_id]完成module = importlib.import_module(module_name)后,调用_sync_loaded_builtin(host_id, module_name, module):- 仅当
BUILTIN_HOST_ADAPTER_MODULES.get(host_id) == module_name时才解析并同步,避免误用非内置自定义模块映射; _resolve_loaded_builtin_descriptor优先读取_BUILTIN_DESCRIPTORS.get(host_id)(保证默认表replace=True后仍读到原始规范描述符),否则退回扫描module.__dict__中唯一的匹配HostHarnessCapabilities;- 在
self._lock下仅当host_id not in self._entries时写入validated,从而保留导入期间显式调用register(...)写入的测试替身而不被覆盖。
- 仅当
- 跨两轮架构对齐边界:loopx/control_plane/hosts/host_harness_capabilities.ts(468 LOC)作为三层宿主契约主拥有者,loopx/hosts/capabilities.py(639 LOC,0 Any)作为零 Any Python 运行时镜像与无死锁、支持冷/暖同步的惰性注册表,agy/claude/dsh 仅在模块初始化登记真实能力事实而不改变任何既有运行路径。 本 PR 收敛在共享契约与首批三宿主落地(HC-1),将 HC-2 旧包目录迁移与 HC-3 优化漏斗留待后续独立 PR。
- 具体对应:
loopx/control_plane/hosts/host_harness_capabilities.ts(468 LOC)继续作为主拥有者,loopx/hosts/capabilities.py(639 LOC、0 Any)保持严格同源并与loopx/agy_goal_mode/__init__.py、loopx/claude_goal_mode/__init__.py、loopx/dsh_goal_mode/turn_host_adapter.py构成无环锁序。
- 具体对应:
Isolated HostCapabilitiesRegistry(builtin_modules=BUILTIN_HOST_ADAPTER_MODULES):
.get(host_id) / .list()
└─ _ensure_builtin_loaded(host_id) [_builtin_locks[host_id]]
├─ module = importlib.import_module(module_name)
│ ├─ cold: module init calls _register_builtin_host_capabilities() -> _BUILTIN_DESCRIPTORS[host_id] & DEFAULT_REGISTRY
│ └─ warm: returns cached module in sys.modules immediately
└─ _sync_loaded_builtin(host_id, module_name, module)
└─ _BUILTIN_DESCRIPTORS.get(host_id) -> self._entries.setdefault-if-absent [self._lock]
说明:上图为按精确提交
cf3cba95d390189613b3634517b87c0d60ef9c8e源码整理的控制流示意,冷/暖/覆盖隔离/并发实测结果见下方验证章节。
具体改动 / Changes
本轮增量修复(3e7bd07ac61e -> cf3cba95d390189613b3634517b87c0d60ef9c8e,回应 6051291415 [P2])
loopx/hosts/capabilities.py:99-120, 468-490, 583-600(639 LOC、0 Any、0 # type: ignore):新增_BUILTIN_DESCRIPTORS_LOCK、_BUILTIN_DESCRIPTORS、_resolve_loaded_builtin_descriptor与HostCapabilitiesRegistry._sync_loaded_builtin,扩展_ensure_builtin_loaded与_register_builtin_host_capabilities,使独立实例在冷导入和暖导入后均正确填充权威描述符,同时保持锁全序(_builtin_locks -> CPython _ModuleLock -> _BUILTIN_DESCRIPTORS_LOCK / self._lock)严格单调。tests/hosts/test_host_harness_capabilities.py:827-961(961 LOC):新增test_isolated_registry_loads_real_builtins_in_cold_and_warm_processes,覆盖冷态子进程独立查询get('agy')触发懒加载(不误加载host_runtime/claude/dsh)、冷态冲突register(..., replace=False)拒写、list()枚举全三家、暖态子进程经默认表replace=True后独立实例仍返回权威描述符,以及子集映射、非匹配模块路径和导入回调内显式 fake 保留。
RFC 规格对照与全量清单
对照 docs/architecture/rfcs/loopx-overall-roadmap-v0.md(基线提交 f0ca9cef0e394b62d4a0f28c54beba16cb7aa29c)中的三层宿主协同条目:
HC-1(implemented):loopx/control_plane/hosts/host_harness_capabilities.ts(468 LOC)与loopx/hosts/capabilities.py(639 LOC,0 Any)交付统一三层宿主能力契约、跨运行时校验/ASCII 排序、无死锁且支持独立实例冷/暖同步的懒加载注册表及agy、claude、dsh真实已交付能力登记。HC-2(deferred):9个顶层loopx/*_goal_mode/包目录迁入loopx/hosts/留待后续独立目录迁移 PR,本 PR 保留既有导入兼容性。HC-3(deferred):三层边界各自优化方案的漏斗验收留待后续消费本契约的优化接入 PR。
全 PR 11 个文件(+2511/-2):pyproject.toml、tsconfig.control-plane.json、loopx/control_plane/hosts/host_harness_capabilities.ts、loopx/hosts/capabilities.py、loopx/agy_goal_mode/{__init__,host_runtime}.py、loopx/claude_goal_mode/__init__.py、loopx/dsh_goal_mode/{__init__,turn_host_adapter}.py、tests/control_plane_ts/host_harness_capabilities.test.ts、tests/hosts/test_host_harness_capabilities.py。
关键代码讲解
loopx/hosts/capabilities.py:99-120, 475-490(_resolve_loaded_builtin_descriptor与_sync_loaded_builtin):先查BUILTIN_HOST_ADAPTER_MODULES.get(host_id) == module_name再取全局权威快照,最后在self._lock下按host_id not in self._entries写入,保证既不污染自定义映射也不覆写测试显式注入的替身。loopx/hosts/capabilities.py:583-600(_register_builtin_host_capabilities):仅在registry is None时将校验后规范描述符登记到_BUILTIN_DESCRIPTORS(带不相等冲突检查),避免测试使用临时registry时污染进程级内置缓存。tests/hosts/test_host_harness_capabilities.py:827-961:以独立subprocess.run([sys.executable, ...])分别跑冷、暖子进程探针,真实验证sys.modules懒加载边界与默认表replace=True隔离性。
对主干的风险 / Risks
- 未发现阻塞性缺陷:审阅
6051291415指出的独立注册表冷/暖加载空值[P2]已完全闭合;全部 4 条审阅线程均处于已解决状态(unresolved_count=0);全部 7 个分支提交均含 DCOSigned-off-by;git merge-tree --write-tree origin/main HEAD无冲突;补丁及 PR 正文敏感信息泄露扫描均为 0 hits(BODY_LEAKS=[]、DIFF_LEAKS=[]);契约纯只读且保留所有原有宿主执行/Hook/Goal 行为(default_off_isolation保持隔离)。 - 精确提交
cf3cba95d390189613b3634517b87c0d60ef9c8e独立复测结果(于干净临时 detached worktree 实测,按 Goal 策略不等待远端 GitHub Actions CI):- 独立冷/暖/并发三模式探针(针对
6051291415):cold:agy_id="agy",agy_adapter="loopx.agy_goal_mode",claude_id="claude",dsh_id="dsh",listed_ids=["agy","claude","dsh"],host_runtime_loaded=false,matches_default=[true,true,true]。warm(含默认注册表replace=True覆盖之后新建独立实例):default_claude_overridden=true,iso_claude_canonical=true,iso_agy_canonical=true,iso_dsh_canonical=true,iso_list_ids=["agy","claude","dsh"],plain_iso_empty=true。concurrent(6 线程并发r1.get+r2.list): 无死锁全部完成,r1_ids=["agy","claude","dsh"],r2_lists=[["agy","claude","dsh"]] * 3。
- Python 定向与全量关联回归:
uv run --extra test python -m pytest -v tests/hosts/test_host_harness_capabilities.py:12 passed in 1.87s(0 failed,0 skipped)。- 宽范围
pytest -n 6(tests/hosts/、10 个agy/claude/dsh宿主与适配器测试、tests/architecture/、tests/canary/test_maintainability_ratchet.py):2,481 passed, 3 skipped in 72.43s(3 skipped 为未运行 Windows Git Bash/PowerShell 条件用例,0 failed)。
- TypeScript 静态检查与回归:
npm run typecheck:control-plane:通过。node --no-warnings --experimental-sqlite --experimental-strip-types --test tests/control_plane_ts/content_digest_single_owner.test.ts tests/control_plane_ts/host_harness_capabilities.test.ts:24 passed, 0 failed, 0 skipped(17 项 single-owner + 7 项 host capabilities)。npm run test:control-plane:6,807 passed, 0 failed, 93 skipped(总计 6,900 项,93 项为环境门控 PostgreSQL/远端测试跳过)。
- 静态门禁、AST 与预合并检查:
ruff check(7 个.py文件)All checks passed!;裸uv run --extra test python -m mypy --no-incremental:Success: no issues found in 17 source files;mypy --strict --follow-imports=silent loopx/hosts/capabilities.py:Success: no issues found in 1 source file;mypy --follow-imports=silent(4 个无缺失三方包文件):Success: no issues found in 4 source files;turn_host_adapter.py:262未修改行历史deepseek_harnessimport-not-found 与host_runtime.py:99历史未标注参数按既有基线保留。- AST 检查:
loopx/hosts/capabilities.py(639 LOC、AST_Any=[]、type_ignore=[]),claude_goal_mode/__init__.py(49 LOC、0 Any),dsh_goal_mode/__init__.py(58 LOC、0 Any),module_metric_baseline.json未被修改。 scripts/check_rfc_bilingual.py --base origin/main --head HEAD:通过;examples/semantic-vocabulary-drift-smoke.py:ok(vocabularies:29/29、owner_symbols:56/56);Goal 绑定loopx check(11 路径):ok=True, errors=0, warnings=0;Goal 绑定change-quality:pass;Goal 绑定loopx canary premerge --from-git-diff --git-diff-base f0ca9cef0e394b62d4a0f28c54beba16cb7aa29c:gate.status="passed", merge_gate_passed=true(direct_checks 4/4、py_compile 1/1、catalog_canaries 6/6、risk_profile_smokes 8/8、failures=0、manual_hold_count=0)。
- 独立冷/暖/并发三模式探针(针对
语义与 CI 对齐
scripts/generate_semantic_inventory.py --changed-from f0ca9cef0e394b62d4a0f28c54beba16cb7aa29c仅检出同源新增的HostIntegrationTier与HostHarnessCapabilityFlag(TypeScriptas const与 Pythontuple/Literal镜像共 6 项),tests/architecture/与semantic-vocabulary-drift-smoke.py(29/29)全部通过。
我的整体评价 / Verdict
- 长程与用户体验影响(
outcome_impact):long_horizon=preserved(只读能力注册表加上冷/暖隔离同步后不改变任何 Turn、配额、Hook 或恢复逻辑,并避免独立注册表在冷/暖状态误报宿主缺失);user_experience=preserved(visual_review为纯后台 TypeScript/Python 契约与注册表,未修改任何前端 UI 页面或交互文案,unverified_scope 为 none)。 - 语义兼容性、代码体积与变更比例:
observable_semantics=equivalent(TS 与 Python 在冷/暖隔离加载、默认表覆写隔离、Unicode 边缘空白、512 码点、ASCII 排序与真实直接导入防死锁上保持一致);code_volume=necessary(核心修复仅 55 行,TS468 LOC+ 零AnyPython639 LOC);change_proportionality=proportionate(11 文件聚焦契约与首批三宿主落地)。 - 词汇归属声明:本 PR 新建一组跨运行时对称词汇(
HostIntegrationTier与HostHarnessCapabilityFlag,create_vocabulary),TS 主拥有者与 Python 零Any镜像语义一致,全部架构与漂移校验通过。 - 残留风险:当前精确头
cf3cba95d390189613b3634517b87c0d60ef9c8e无阻塞项与未解决线程;全部 11 项构建、测试、静态类型、契约与预合并门禁均已在干净临时 worktree 本地实测通过,PR 保持OPEN供人工确认合并。
English verdict: APPROVE — Exact head cf3cba95d390189613b3634517b87c0d60ef9c8e completely fixes [P2] review 6051291415 by caching canonical shipped descriptors under leaf lock _BUILTIN_DESCRIPTORS_LOCK and atomically syncing isolated HostCapabilitiesRegistry(builtin_modules=...) entries in _sync_loaded_builtin across both cold and warm imports (plus isolation from DEFAULT_HOST_CAPABILITIES_REGISTRY replace=True overrides) without re-introducing ABBA deadlocks or clobbering explicit/custom entries; verified via independent cold/warm/concurrent probes, 12/12 capabilities pytest, 2,481 passed, 3 skipped broad pytest, typecheck:control-plane, 24/24 targeted TS tests, 6,807 passed, 93 skipped test:control-plane, ruff, bare 17/17 + strict 1/1 mypy, check_rfc_bilingual, semantic-vocabulary-drift-smoke (29/29), Goal loopx check (0/0), Goal CQR pass, and Goal canary premerge (19/19 checks, manual_hold_count=0), with 7/7 DCO commits, 4/4 resolved threads, and clean PR diff/body leak scans.
cf3cba9 to
fa0b425
Compare
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · gpt-6.2-sol · OpenAI · runtime_reported · xhigh
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
动机 / Motivation
为 Claude、Antigravity 和 DSH 提供统一类型化宿主描述符,为后续消费原生能力事实建立可部署的契约。 主干各宿主已有自己的绑定、hook 和运行规则,尚无统一可查询的三类能力描述符。 读取宿主绑定事实的 CLI/runtime 维护者和现有 Claude、Antigravity、DSH 操作者。
靠宿主名或描述文字推断能力会混淆可用性与授权,尤其会把 DSH 的单请求输出上限误读为整体上下文管理。 源码与重新构建的完整 wheel 都读回同一组三个 Python/TypeScript 描述符。默认无凭证时仍选择 codex-cli;原 DSH binding 保持 per_model_request 的 2048 输出限制。精确头两个语言查询均返回 native_context_budget=false。 从两个精确检出各跑出 572 个现有宿主测试通过、3 跳过;精确头新增 Python 契约 13 项、Node 定向 24 项通过。独立构建并安装 wheel 后,打包目录内两语言查询一致。TypeScript typecheck、双语 RFC diff 和 merge-tree 通过。两组既有失败的定向回跑见风险。 仅验证已声明的三种宿主与现有绑定。新 registry 在该提交中还没有策略决策调用点。本次未运行远程 CI、真实付费模型或全量 Node 套件。 基线契约
改动思路 / Approach
该改动沿用 宿主 adapter 注册 → Python HostCapabilitiesRegistry;同契约的 TypeScript registry 和 packaged wheel。保留现有宿主生命周期与绑定。三类描述符进入共同契约,测试对齐 TypeScript 声明和 Python adapter 镜像,schema、校验和注册规则限于已声明事实。 新增闭合 tier/flag vocabulary,使用 shared runtime decoder、类型镜像和成对校验。Python 的按需注册只在读或相应 adapter import 时发生;候选撤回 DSH 输入预算标记。 当前版本可作为宿主事实契约单独交付。消费方接入时沿同一模型,现有默认入口继续由原 owner 控制。
具体改动 / Changes
精确提交 fa0b425,本次对照目标 bcb4753。11 文件,+2585/-2。约千行新增为 Python 测试;主体增加 TypeScript 契约、Python 镜像与三个 adapter 声明。
关键代码讲解
-
validateHostHarnessCapabilities。校验 schema、字段、flag 与 hook 不变量。 源码 -
HostCapabilitiesRegistry。Python 查询、懒加载和隔离 registry 的冲突规则。 源码 -
DSH_HOST_CAPABILITIES。DSH descriptor 不声明原生 context budget。 源码 -
roadmap-host-capabilities-facts(implemented)。宿主通过同一类型契约声明事实,保留现有运行边界,区分原生输入上下文预算与每次模型请求的输出限制。
对主干的风险 / Risks
冷态独立 registry 正确加载三个内置描述符且不加载 Antigravity host_runtime;并发、替换冲突、未知宿主与字符边界通过新增套件。现有声明未让设备预算或宿主工具扩大权限。 对照复现相同的 12 个 File/SQLite managed execution 和 2 个 canonical lease 失败,名称和 assertion 相同,相关测试与控制面逻辑均不在 diff。作者另报的全套 26 项范围仍只作为作者观测。 保留原 binding 回读和两语言的否定断言,继续以真实 import 并发回归保护 registry。
我的整体评价 / Verdict
APPROVE。 这版修正 DSH 声明,已安装产物确认三宿主描述符一致,现有宿主行为的对照覆盖通过。 宿主能力和实际执行边界可有类型地独立读回。
English verdict: APPROVE at fa0b425. The packaged Python and TypeScript descriptors match. DSH retains its per-request output cap and no longer advertises native context-budget support.
|
This pull request has merge conflicts with Choose the remote for the base repository, not an out-of-date fork. git fetch upstream
git rebase upstream/main
# Resolve each conflict, git add the resolved files, then git rebase --continue.
git push --force-with-lease origin HEADFor a same-repository clone whose Keep the DCO |
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
…nt parity Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
…SCII list sort Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
…_capabilities Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
… static edge-whitespace regex - Define and register AGY_HOST_CAPABILITIES in loopx/agy_goal_mode/__init__.py so mypy does not pull host_runtime/CLI into kernel-contracts - Point BUILTIN_HOST_ADAPTER_MODULES['agy'] at loopx.agy_goal_mode and re-export AGY_HOST_CAPABILITIES from host_runtime.py - Replace dynamic new RegExp(...) in host_harness_capabilities.ts with a static regex literal preserving exact code-point coverage - Add package-import laziness regression test and update cold-import assertions Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
…and warm loads Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
…t descriptor Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
… descriptors Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
fa0b425 to
55a2941
Compare
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · gpt-6.2-sol · OpenAI · runtime_reported · xhigh
Request changes conclusion (author-owned PR; GitHub blocks formal self-review)
[P2] 普通 Codex CLI 的能力标记应限于 EpochReset prefetch。该标记要求同 epoch 尾部折叠与预读。以普通 Codex CLI 的 argv 和实际 prompt renderer 配对检查,基线、候选及安装版均只在 EpochReset 注入预读观测,同 epoch 输入保留原工作内容。安装版 TypeScript 和 Python 镜像(loopx/hosts/codex_capabilities.py:63)仍回答 true,可能使后续调用方选择不受支持的上下文交接。 从两个普通 codex-cli 描述符撤回 fold_and_prefetch,保留 epoch_reset。调整两语言断言,把普通 CLI 与需启用的 hook 入口分别验证。 源码
动机 / Motivation
为已接入的七个宿主入口提供同一类型化描述符,让调用方能按各宿主的实际能力决策。 基线由原宿主绑定和生命周期入口负责执行,尚无统一只读注册表。 维护宿主绑定、上下文交接与能力查询的调用方。
能力查询的调用方可能选择同 epoch 折叠路线,并假设探索尾部已回收、后续观测已注入。候选把现有 EpochReset 投递计入另一种能力。 从隔离源码和重建安装的 wheel 读到一致的七个描述符,四个 Codex 项逐个冷查均未加载重依赖,导出对象与运行模块相符。仅 Codex App 声明原生调度,hook 事件与既有运行常量一致。两版本默认仍选 codex-cli,DSH 保留每次请求的 2048 输出上限。 基线与候选的 Codex App RRULE、operation host、context lifecycle、semantic fold hook、Quiet-Turn 组各 275 通过、4 跳过。候选另有 Python 宿主契约 15 项和 Node 定向 24 项通过,控制面 typecheck 通过。安装 wheel 独立读回复现标记误报。 验证范围是隔离 fixture、实际 Python 和 TypeScript 查询、打包 CLI 渲染器及源路径回归。远程 CI、付费模型、原生 App 实时调度和 hook 后模型上下文实际删减均未实测。 验收契约
改动思路 / Approach
该改动沿用 Python 和 TypeScript 宿主能力注册表 → Codex App、app-server、普通 CLI 与 opt-in lifecycle hook 四个入口。使用共享闭合 vocabulary 及 Python 镜像,并保留原运行时。独立检查确认 App-server fork 由 native chat 路径触发,operation host 的 resume 沿用原绑定。 新 descriptor 模块懒注册四个 Codex surface,普通 CLI 与 lifecycle hook 分别查询。历史工作集 RFC 分别定义同 epoch 尾部替换和跨 epoch prefetch。 现有注册表足以表达已交付范围。直接收窄普通 CLI 标记并校正两语言契约测试。
具体改动 / Changes
精确提交 55a2941,本次对照目标 6915df6。19 文件,+3136/-2。主体为共享契约、Python 注册表、四个 Codex 描述符和跨语言回归。
关键代码讲解
-
CODEX_CLI_HOST_CAPABILITIES。普通 CLI 的 TypeScript 列表同时声明两种 prefetch 能力。 源码 -
CODEX_CLI_HOST_CAPABILITIES。Python 镜像也把 fold_and_prefetch 暴露给普通 CLI。 源码 -
_render_prompt。该普通 CLI 入口将 EpochReset 预读正文交付到 prompt,并处理 KeepRaw。 源码 -
_format_semantic_unit_hook_output。单独启用的 hook 路径生成 FoldToReceipt 证据和 additionalContext。 源码 -
codex-cli-prefetch-carrier(not_met)。普通外部 Codex CLI 只能声明已验证的 EpochReset prefetch。同 epoch 尾部替换和预读作为单独能力,需要宿主实际接收并应用。
对主干的风险 / Risks
独立对照实际 CLI prompt renderer 和 argv。基线、候选及安装版均仅在 EpochReset 将新读回内容注入 prompt。同 epoch FoldToReceipt 输入保留原诊断内容,未注入该读回;普通 launcher 未配置 opt-in hook。候选两语言查询却都返回 codex-cli 的 fold_and_prefetch=true。 四个 Codex 项单独冷读确实轻量。全量 list 仍会随其他 adapter 导入 sqlite3 和 subprocess,轻量结论适用于 Codex 逐项查询。hook 的追加上下文与回执测试覆盖独立入口,模型侧旧尾部的实际回收待验证。 移除普通 codex-cli 的 fold_and_prefetch 并保留 epoch_reset。把断言绑定到实际交付行为,分别验证 hook 输出和普通 CLI。
我的整体评价 / Verdict
REQUEST_CHANGES。 请修正普通 Codex CLI 声明的 prefetch 范围。两语言和值的安装证据一致,现有运行回归通过。 能力标记可用于后续路由,前提是能区分同 epoch 折叠与下一 epoch 水合。
English verdict: REQUEST_CHANGES at 55a2941. The plain Codex CLI advertises same-epoch FoldAndPrefetch. Both source and installed probes confirm only EpochReset hydration in the plain launcher. Keep the epoch_reset flag and withdraw this additional claim.
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · gpt-6.2-sol · OpenAI · runtime_reported · xhigh
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
动机 / Motivation
为已接入的七个宿主入口提供同一类型化描述符,让调用方能按各宿主的实际能力决策。 基线由原宿主绑定和生命周期入口负责执行,尚无统一只读注册表。 维护宿主绑定、上下文交接与能力查询的调用方。
能力范围准确后,后续路由可按真实宿主约束选择上下文策略,避免把跨 epoch 预读计成同 epoch 折叠。 源码与重建 wheel 的两语言查询均确认七个宿主,普通 Codex CLI 支持 EpochReset,仅 codex-cli-hooks 声明 fold_and_prefetch。普通入口的 EpochReset 水合标记恰好出现一次。 固定基线和候选的实际 Codex 宿主入口组各 161 通过、4 跳过。候选 Python 契约 15 项、Node 定向 24 项及控制面 typecheck 通过。独立构建 wheel 重装,并回读七个描述符及筛选结果。 独立证据覆盖隔离 CLI、app-server 夹具和 hook 回执、源码与重建 wheel。模型对同 epoch 尾部实际遗忘、App 实时调度及托管 CI 留作各自验收。 验收契约
改动思路 / Approach
该改动沿用 Python 和 TypeScript 宿主能力注册表 → Codex App、app-server、普通 CLI 与 opt-in lifecycle hook 四个入口。使用共享闭合 vocabulary 及 Python 镜像,并保留原运行时。独立检查确认 App-server fork 由 native chat 路径触发,operation host 的 resume 沿用原绑定。 普通 CLI 继续使用跨 epoch 预读 carrier。能力筛选只把同 epoch fold_and_prefetch 交给显式 hook 路径。两语言镜像对齐同一闭合 vocabulary。 沿用原运行器和生命周期 hook,在现有两语言描述符收窄能力范围。
具体改动 / Changes
精确提交 e0fbabe,本次对照目标 6915df6。19 文件,新增 3144 行,删除 2 行。相较上轮候选四文件调整 Python 和 TypeScript 的普通 CLI 声明及配对断言。
关键代码讲解
-
CODEX_CLI_HOST_CAPABILITIES。普通 CLI 的 TypeScript 列表同时声明两种 prefetch 能力。 源码 -
CODEX_CLI_HOST_CAPABILITIES。Python 镜像也把 fold_and_prefetch 暴露给普通 CLI。 源码 -
_render_prompt。该普通 CLI 入口将 EpochReset 预读正文交付到 prompt,并处理 KeepRaw。 源码 -
_format_semantic_unit_hook_output。单独启用的 hook 路径生成 FoldToReceipt 证据和 additionalContext。 源码 -
codex-cli-prefetch-carrier(implemented)。普通外部 Codex CLI 只能声明已验证的 EpochReset prefetch。同 epoch 尾部替换和预读作为单独能力,需要宿主实际接收并应用。
对主干的风险 / Risks
未启用 lifecycle hook 时,同 epoch FoldToReceipt 输入依旧保留原正文,独立 renderer 检查和 wheel 的能力查询都反映这条边界。显式 hook 的同轮回执、重放和保留原文测试通过。 四个 Codex 项的独立冷读保持轻量。全量枚举可加载其他 adapter 模块。hook 的追加上下文与回执已有夹具证据,模型侧旧尾部实际回收仍待单独核验。 当前候选已从两份普通 CLI 描述符撤回错误标记。两语言断言覆盖普通路径及 hook 路径。
我的整体评价 / Verdict
APPROVE。 通过。两种语言和重装的 wheel 均已纠正普通 CLI 能力声明,实际入口对照未发现回归。 能力标记可用于后续路由,前提是能区分同 epoch 折叠与下一 epoch 水合。
English verdict: APPROVE at e0fbabe. The pinned head fixes the previous plain Codex CLI capability overclaim. Both installed registries scope FoldAndPrefetch to the hooks surface. Paired entrypoint tests and the standalone wheel readback passed.
Summary
Establishes the shared, domain-neutral 3-level capability-negotiated Host Co-Design contract (
HostHarnessCapabilities) with a TypeScript-first owner and strict0 AnyPython typed mirror, registers verified shipped descriptors for the flagship adapters (claude,agy,dsh), and extends the registry across all four shipped Codex host surfaces (codex-app,codex-app-server,codex-cli,codex-cli-hooks) with lazy cold-load registration and zero default behavior change.Rebased cleanly onto
origin/main@6915df67db(git merge-tree --write-treeconflict-free at34301c5c6f, preservingloopx/agy_goal_mode/host_runtime.pywatchdog imports and priorDSH_HOST_CAPABILITIESfix from review6051597331) and resolved review threadPRRT_kwDOStEbEs68i9ur(discussion_r4712973676) by withdrawing"fold_and_prefetch"from plainCODEX_CLI_HOST_CAPABILITIESwhile preserving"epoch_reset".Contract Owner & Typed Mirror
loopx/control_plane/hosts/host_harness_capabilities.ts):HOST_HARNESS_CAPABILITIES_SCHEMA_VERSION("loopx_host_harness_capabilities_v0"),HostIntegrationTier,HostHarnessCapabilityFlag, Unicode code point bound (<= 512) and edge-whitespace parity, canonical descriptors (AGY,CLAUDE,CODEX_APP,CODEX_APP_SERVER,CODEX_CLI,CODEX_CLI_HOOKS,DSH), and deterministic ASCII code-unitlistHostCapabilitiesordering.loopx/hosts/capabilities.py,0 Any) & lazy Codex descriptor module (loopx/hosts/codex_capabilities.py,0 Any): Frozen dataclass +Literalcontract matching the TS owner verbatim with thread-safe, ABBA-deadlock-free lazy built-in loading (BUILTIN_HOST_ADAPTER_MODULES), keeping cold capability queries free ofsqlite3,subprocess, CLI, or chat module imports while keeping top-levelloopx/*.pyunchanged at112.tsconfig.control-plane.jsonincludestests/control_plane_ts/host_harness_capabilities.test.ts, andpyproject.tomlincludes"hosts/*.ts"under[tool.setuptools.package-data] "loopx.control_plane".Shipped Host Descriptors (Truthful Flags Only, Zero Behavior Change)
claude(loopx/claude_goal_mode/__init__.py->CLAUDE_HOST_CAPABILITIES):integration_tier="boundary_cli",supported_capabilities=("verifier_hook",),hook_events=("PreToolUse",),requires_utf8_stdio=True,native_goal_primitive=False,native_scheduler_primitive=True.agy(loopx/agy_goal_mode/__init__.py, decoupled fromhost_runtime.py->AGY_HOST_CAPABILITIES):integration_tier="orchestrated_app",supported_capabilities=(),hook_events=("Stop",),requires_utf8_stdio=True,native_goal_primitive=True,native_scheduler_primitive=True.dsh(loopx/dsh_goal_mode/turn_host_adapter.py, re-exported in__init__.pywithout altering__all__->DSH_HOST_CAPABILITIES):integration_tier="in_tree_codesigned",supported_capabilities=(),hook_events=(),requires_utf8_stdio=True,native_goal_primitive=False,native_scheduler_primitive=False.codex-cli(loopx/control_plane/turn_driver/codex_cli.py->CODEX_CLI_HOST_CAPABILITIES):integration_tier="boundary_cli",supported_capabilities=("epoch_reset", "quiet_turn", "managed_thread_resume"),hook_events=(),requires_utf8_stdio=True,native_goal_primitive=False,native_scheduler_primitive=False(plain Codex CLI injects onlyEpochResetprefetch, leaving intra-epochfold_and_prefetchscoped tocodex-cli-hooks).codex-cli-hooks(loopx/control_plane/turn_driver/codex_context.pyandsemantic_unit_hook.py->CODEX_CLI_HOOKS_HOST_CAPABILITIES):integration_tier="boundary_cli",supported_capabilities=("epoch_reset", "fold_and_prefetch", "quiet_turn", "compact_hook"), exact shippedhook_events=("SessionStart", "PreCompact", "PostCompact", "PostToolUse", "Interrupt")matchingCONTEXT_LIFECYCLE_HOOKS(no unshipped"Stop"claim),requires_utf8_stdio=True,native_goal_primitive=False,native_scheduler_primitive=False.codex-app(loopx/codex_app_thread_activity.pyandloopx/host_loop_activation.py->CODEX_APP_HOST_CAPABILITIES):integration_tier="orchestrated_app",supported_capabilities=(),hook_events=(),requires_utf8_stdio=True,native_goal_primitive=False,native_scheduler_primitive=True(Codex Appautomation.tomlRRULE heartbeat scheduling).codex-app-server(loopx/control_plane/turn_driver/codex_operation_host.pyandloopx/capabilities/native_chat/codex_adapter.py->CODEX_APP_SERVER_HOST_CAPABILITIES):integration_tier="orchestrated_app",supported_capabilities=("session_fork", "managed_thread_resume"),hook_events=(),requires_utf8_stdio=True,native_goal_primitive=False,native_scheduler_primitive=False(distinct fromcodex-appbecauseapp-serverthreads are orchestrated by external LoopX Turn/Steward controllers).Author declaration
model_agent(following prior PR feat(hosts): add HostHarnessCapabilities contract and Codex host descriptors #9389 commits)10commits carry DCO sign-off (git commit -s).Verification (on exact
HEADe0fbabe8ad81942f75e1b91f6fee4985e8b9e4db)npm run typecheck:control-plane:0errors.node --no-warnings --experimental-sqlite --experimental-strip-types --test tests/control_plane_ts/content_digest_single_owner.test.ts tests/control_plane_ts/host_harness_capabilities.test.ts:24/24passed (0failed,0skipped, assertinghostSupportsCapability("codex-cli", "fold_and_prefetch") === falseandhostSupportsCapability("codex-cli-hooks", "fold_and_prefetch") === true).uv run --extra test python -m pytest -q tests/hosts/test_host_harness_capabilities.py:15 passed(0failed,0skipped), including TS/Python parity across all7canonical hosts,0 AnyAST enforcement on bothcapabilities.pyandcodex_capabilities.py,list_host_capabilities(capability="fold_and_prefetch") == ["codex-cli-hooks"], lazy cold-load zero-heavy-import subprocess verification, isolated registry sync, and concurrent shared-module deadlock probes.pytestacrosstests/hosts/test_host_harness_capabilities.py,tests/architecture/, andtests/canary/test_maintainability_ratchet.py:1,948 passed(0failed,0skipped).ruff check(loopx/hosts/capabilities.py,loopx/hosts/codex_capabilities.py,tests/hosts/test_host_harness_capabilities.pyclean);mypy --follow-imports=silent(17/17configured files clean);mypy --strict --follow-imports=silent loopx/hosts/capabilities.py loopx/hosts/codex_capabilities.py(2/2clean).scripts/check_rfc_bilingual.py --base origin/main --head HEAD,examples/control_plane/control-plane-maintainability-ratchet-smoke.py(unreviewed=0,stale_exceptions=0,magnitude_regressions=0), andexamples/semantic-vocabulary-drift-smoke.py(34/34): all passed.19changed files (loopx check --scan-path ...):ok=true,errors=0,warnings=0.cqr_25d7f8d1d7085b6eacc1, scope fingerprint25d7f8d1d7085b6eacc18eb9583299123bec714ac31a2cdb051505f9fb5c9146):decision="pass",receipt_valid=true,blocking=false.loopx canary premerge --from-git-diff --git-diff-base origin/main --tier standard:gate.status="passed",merge_gate_passed=true,6/6direct checks,14/14executed smokes (6/6catalog +8/8risk-profile,0failures,0manual holds).Boundary checklist
scripts/check_rfc_bilingual.py --base origin/main --head HEAD).Signed-off-bytrailer (git commit -s).