Skip to content

Define the verifier Hook co-design contract - #9262

Open
huangruiteng wants to merge 5 commits into
mainfrom
codex/verifier-hook-co-design-20261122
Open

huangruiteng wants to merge 5 commits into
mainfrom
codex/verifier-hook-co-design-20261122

Conversation

@huangruiteng

@huangruiteng huangruiteng commented Nov 22, 2026 •

Copy link
Copy Markdown
Collaborator

Current review scope

Head f9aa58e951052b8bdf63ab587546146e5b068c79 resolves the digest architecture check reported at 4a67ad5a110ed7b73b715e2315334aa462a9cc44.

  • Register the new VerifiedClose consumer in the existing canonical SHA-256 inventory.
  • Register the execution-loss closeout consumer already on main in that same inventory. The main-only reproduction found this pre-existing omission. The production code and the inventory assertion are unchanged by this follow-up.

The exact candidate passed 129 TypeScript tests, including digest ownership, VerifiedClose, Turn envelope and trajectory behavior. The architecture test passed all 17 cases in the clean merge tree with main@4ae2844cd03dd2d027eda68d5b870e2b652f6ac3. The control-plane typecheck, docs governance, bilingual RFC checks and standard premerge (18 automated, 4 direct) passed.

The previous isolated Codex App Server verification remains evidence for the unchanged contract logic. Installed host wiring, real model outcomes, cache and full-cost qualification remain open.

Original contract scope and previous validation

What changes

  • Define a four-boundary verifier contract and negotiate L0–L2 from observed host capabilities. Per-tool hooks stay off by default.
  • Specify VerifiedClose against an independent receipt bound to the candidate, verifier, Todo and child scope. Unresolved or high-overlap work stays raw.
  • Define staged Domain RSI adoption through the existing capability portfolio and register the bilingual proposal in the architecture index.

The TypeScript seam is a contract proposal. Host adapter and matched outcome/cost qualification remain open. C1 admission, transport and settlement keep their current owners.

Candidate identity

Revision 4a67ad5a110ed7b73b715e2315334aa462a9cc44 uses the shared canonical SHA-256 format for the exact candidate submitted to the independent Oracle. A branch name, tag, or malformed digest keeps the raw scope before any receipt lookup. The original receipt and each readable source retain their exact role and scope bindings.

The regression fails on the previous head with a matching branch alias. The same alias performs zero reader calls on this revision. An isolated Codex App Server fixture with deterministic inference folds the exact candidate digest and recovers its original receipt once after compaction.

Local verification

  • Control-plane TypeScript typecheck and 139 tests covering the verifier, yardstick, post-writeback hooks, capture selection and the Turn envelope
  • Bilingual RFC diff check and standard diff-based canary premerge on the exact branch head
  • Public sources for host mappings are linked in the RFC. The tests cover the new contract, with no claim of installed-host adoption or provider cache behavior.

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

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewer: model_agent · Gemini · Google DeepMind · self_reported

动机 / Motivation

在长程求解任务中,控制面与宿主维护者在启用多轮探索与独立验收时,往往只能在粗糙的 Stop-Hook 兜底验证与同步逐工具拦截之间二选一;缺乏跨宿主的四边界验证 Hook 协同契约,也缺乏“子作用域须经独立 Oracle 回执且满足低重叠后才折叠”的 VerifiedClose 约束,因此本 PR 试图把验证接入收敛到既有 C1 与历史上下文边界之下。

如果不做任何改动,外部宿主(如 Codex、Claude Code、DSH、Antigravity)上的验证探测、子作用域折叠以及领域快尺(yardstick)试跑仍各自依赖局部协议或散落脚本,既难对齐能力协商档位,也容易让未验证的代理结果或跨作用域回执污染主干上下文。

  • 受影响对象(affected_caller_or_operator): 接入宿主 Hook 生命周期(启动、里程碑、压缩/子作用域与停止边界)并消费独立验收回执的 LoopX 控制面、宿主适配器与实验评估维护者。
  • 前后对比场景(before_after_scenario): 改动前,不同宿主各自实现启动上下文恢复、里程碑采样、压缩后恢复与停止验收,子工作折叠与快尺试跑缺少统一的不变式边界;理想改进是先建立双语架构提案再沿真实拥有者接线,而当前 PR 在没有任何生产调用方的情况下提前向控制面运行时放入未接线的 TypeScript 契约文件,且新增 RFC 头部未满足仓库治理检查,导致主干 docs-governance-smoke.py 与 generate_rfc_status_index.py --check 从基线通过退化为失败。
  • 可观测结果(observable_outcome): 文档侧新增了四边界能力协商(L0–L2)、VerifiedClose(FoldToReceipt / KeepRaw)及领域插件试跑的中文/英文双语提案;代码侧新增了纯内存/纯类型的 verifier_hook_contract.ts 及其 3 条单元测试,但尚未接入任何生产入口(turn_driver、progressive_context.ts、goal_capability_organization.ts 或宿主插件),同时 recommendVerifiedClose 在空身份与空引用输入下仍会误返回 FoldToReceipt。
  • 非目标(non_goals): 本次变更不改变 C1 准入、传输或结算所有权,不实现具体宿主适配器(Codex、DSH、Claude Code、Antigravity)运行时代码,不启用新默认开关,也不开展跨宿主或同宿主模型效果/缓存对照实验。

改动思路 / Approach

从控制面所有权看,本 PR 提出了一个跨宿主验证 Hook 协商与子作用域验证折叠的设计方案:策略默认关闭(enabled !== true 返回 null),启用后按宿主实际观测能力协商 L0 / L1 / L2,并坚持 pre_tool_use 默认关闭、只有策略显式开启且宿主观测到对应能力时才激活;在子作用域结束时,由 recommendVerifiedClose 比对外部 Oracle 回执的六元组身份与 verdict、open_obligations、overlap,决定 FoldToReceipt 或 KeepRaw。

然而从架构与比例性(architecture_assessment)角度拆解现有机制,本次提交把“尚未落地的 RFC 设计”与“过早进入生产目录的未接线 TypeScript 源码”混在了同一个 PR 中:verifier_hook_contract.ts 的两个纯函数与 12 个仅作类型声明的导出没有任何生产调用方,FoldToReceipt / KeepRaw 脱离了既有的上下文策略拥有者 progressive_context.ts 与 context_delivery.ts,DomainPluginTrial 则与既有的能力组合/改进规划拥有者 goal_capability_organization.ts 平行另立一套阶段类型,且边界函数缺少仓库通行的 runtime_decode 非空校验;当前 PR 应先修正 RFC 治理头与索引、移除尚未接线的生产 .ts 雏形(或完整接到真实调用链并修复校验与所有权归属),不应把无调用方的孤立契约代码合入 loopx/control_plane/turn_driver/。 当前 PR 边界(current_pr_boundary):仅建议保留且修全双语 RFC 设计与目录索引,或将代码切片收口为带真实调用方和边界解码的最小端到端变更;在未完成接线与验证前,宿主适配器接入、真实缓存收益测量和生产开关均保留在后续切片。

与既有实现对比,仓库在 loopx/control_plane/quota/progressive_context.ts 与 docs/architecture/rfcs/history-working-set-context-policy-v0.md §5.1 中已明确将 KeepRaw / FoldToReceipt / EpochReset 归属为共享 TypeScript 投影拥有者;在 loopx/control_plane/capabilities/goal_capability_organization.ts 中已实现 goal_capability_improvement_plan_v0 及 planCapabilityImprovement 试跑—反馈—回滚追踪;在 loopx/control_plane/work_items/yardstick_decision.ts 中已实现 WorkYardstickProfile 与 proxy_order_reversed 判定;在 loopx/control_plane/capability_hooks.ts 与 post_writeback_hook_transaction.ts 中已有标准 Hook 注册与事务边界。本 PR 仅复用导入了 WorkYardstickProfile 一个类型,其余均处于未接线状态。

提案边界 RFC 设计职责 本 PR 代码覆盖现状 既有所属拥有者
Start / resume 在真实恢复/换阶段交付有界求解视图 仅类型 VerifierHookEvent(无实现) progressive_context.ts / turn_start Hook
Milestone probe 异步采样并回传平台期/快尺反转 仅联合类型 VerifierTransition(无实现) yardstick_decision.ts / stride_policy.ts
Compaction / subscope 独立 Oracle 回执门控 FoldToReceipt / KeepRaw 纯函数 recommendVerifiedClose(无调用方) history-working-set-context-policy-v0.md §5.1 (progressive_context.ts)
Stop / Domain plugin 独立 Oracle 验收及内容寻址试跑准入 DomainPluginCandidate/DomainPluginTrial 仅类型(无调用方) settlement.ts / goal_capability_organization.ts

具体改动 / Changes

本次精确审查头 8a6fa6c68ea8745325b615e668fb5caa26811295 相对 origin/main(d38052695c2c8a2e67cdb2c1eb6f4c6651eabd4d)共新增/修改 5 个文件(+331 / -0):

  1. 文档与索引(3 个文件,+116/-0): 新增 docs/architecture/rfcs/verifier-hook-co-design-v0.md(57 行)和中文镜像 docs/architecture/rfcs/verifier-hook-co-design-v0.zh-CN.md(57 行),并在 docs/architecture/rfcs/README.md 第 204–205 行添加条目链接;但未运行 scripts/generate_rfc_status_index.py --write 更新 STATUS.md / STATUS.zh-CN.md。
  2. 控制面 TypeScript 源码(1 个文件,+142/-0): 新增 loopx/control_plane/turn_driver/verifier_hook_contract.ts。
  3. TypeScript 单测(1 个文件,+73/-0): 新增 tests/control_plane_ts/verifier_hook_contract.test.ts,也是全仓唯一导入 verifier_hook_contract.ts 的文件。

关键代码讲解

  • negotiateVerifierHooks(loopx/control_plane/turn_driver/verifier_hook_contract.ts#L19-L32): 读取 VerifierHookPolicy 与可选 HarnessVerifierCapabilities。当 policy.enabled !== true 时返回 null;当启用后,仅当 session_lineage === true && boundary_context === true 时进入 L1,并在同时满足 milestone_observation && isolated_subscope && verified_return 全为 true 时升级为 L2,否则退化为 L0;pre_tool_use 仅在策略与宿主观测能力双双显式为 true 时才返回 true。当前无生产调用方,也未做运行时对象解码校验。
  • recommendVerifiedClose(loopx/control_plane/turn_driver/verifier_hook_contract.ts#L101-L128): 根据 VerifiedCloseRequest 与调用方注入的 readVerifierReceipt 读取回执。先比对 receipt?.identity 的 6 个字段与 request.identity 是否逐一全等,不匹配或缺失则返回 KeepRaw;receipt.verdict === "failed" 时返回带 counterexample_ref 的 KeepRaw;仅当 verdict === "passed"、open_obligations === false 且 overlap === "low" 时返回 FoldToReceipt。缺陷在于只做全等比较而不校验身份或引用是否非空/合法,空字符串也能通过折叠条件。
  • VerifierTransition 与 VerifierHookEvent(loopx/control_plane/turn_driver/verifier_hook_contract.ts#L48-L65): 定义了 completion_claim、yardstick_plateau_or_regression、proxy_order_reversed 和 protected_boundary_touch 四类转移与四边界事件结构,但 VerifierHookEvent 仅在 boundary === "stop" 分支引用了 completion_claim,其余三类转移与 VerifierSolverView 在当前分支没有任何生产者或消费者。
  • DomainPluginCandidate 与 DomainPluginTrial(loopx/control_plane/turn_driver/verifier_hook_contract.ts#L130-L142): 声明了 yardstick / diagnostic_probe / verification_recipe 候选产物及 staging / trial / adopted / retired 四态联合类型,但未绑定 verifier_version 或作用域,也没有关联或复用既有拥有者 goal_capability_organization.ts。

规范基线映射(spec_basis)

依据基线 d38052695c2c8a2e67cdb2c1eb6f4c6651eabd4d 上的规范入口 docs/architecture/rfcs/README.md(以及其引用的 docs/development/README.md Scope-Fit Review 与 history-working-set-context-policy-v0.md §5.1)逐项映射当前 HEAD:

  • RFC-INDEX-HEADER -> not_met:docs/architecture/rfcs/README.md 要求合入 RFC 使用 Accepted 生命周期值、声明 Supersedes / closes、携带 semantic mirror / 语义镜像 互链并通过 generate_rfc_status_index.py --write 同步 STATUS.md;当前 HEAD 使用 Proposed、缺少 Supersedes / closes 与 semantic mirror / 语义镜像 字样且未更新状态索引,README.md 新条目亦缺少 Delivery on main / Current boundary 说明。
  • RFC-BILINGUAL-PAIR -> implemented:docs/architecture/rfcs/README.md 要求英文与中文镜像在同一 PR 成对变更并通过 scripts/check_rfc_bilingual.py --base origin/main --head HEAD(本地实测 PASS)。
  • RFC-MATURITY-SEPARATION -> not_met:docs/architecture/rfcs/README.md 要求严格区分设计提案与已实现边界(且 docs/development/README.md 要求新增控制面模块必须有真实生产调用方并复用既有拥有者);本 PR 将无生产调用方的 TypeScript 模块放入 loopx/control_plane/turn_driver/ 并在 RFC 头部标注 Delivery maturity: TypeScript contract,同时未接入 history-working-set-context-policy-v0.md §5.1 的 progressive_context.ts 拥有者。

对主干的风险 / Risks

阻塞发现(Findings)

  1. [P1 · 阻塞] RFC 生命周期头、镜像声明与派生索引破坏仓库文档治理检查

    • Problem: 新增 RFC 头部违反了仓库 RFC 索引与双语治理规范,导致基线原本通过的门禁脚本在 HEAD 上直接失败。
    • Evidence: 在同一本地环境对比基线 d38052695c2c8a2e67cdb2c1eb6f4c6651eabd4d 与 HEAD 8a6fa6c68ea8745325b615e668fb5caa26811295:基线运行 scripts/generate_rfc_status_index.py --check 和 examples/docs-governance-smoke.py 均退出 0(docs-governance-smoke ok);HEAD 上 generate_rfc_status_index.py --check 退出 1,报错 verifier-hook-co-design-v0.md: status 'Proposed' does not begin with a lifecycle state (Accepted, Superseded, Retired, Rejected) 及 missing '**Supersedes / closes:**' declaration;examples/docs-governance-smoke.py 在 check_rfc_language_mirrors() 第 202 行因缺少 "semantic mirror" 抛出 AssertionError: verifier-hook-co-design-v0.md(且中文镜像第 203 行同样缺少 "语义镜像")。此外 docs/architecture/rfcs/README.md 第 204–205 行缺少同级条目均有的 Delivery on main 与 Current boundary 描述。
    • Impact: 合入主干后 examples/docs-governance-smoke.py 与 scripts/generate_rfc_status_index.py --check 会持续红灯,影响所有后续 RFC 与文档治理门禁。
    • Fix: 在 verifier-hook-co-design-v0.md 与 .zh-CN.md 头部将 RFC status 改为 Accepted / 已接受(保留 Delivery maturity: Proposal 描述当前无运行时实现),补齐 **Supersedes / closes:** none 与 **替代 / 关闭:** 无,补充 semantic mirror / 语义镜像 互链声明,运行 uv run --extra test python scripts/generate_rfc_status_index.py --write 更新 STATUS.md 与 STATUS.zh-CN.md,并在 docs/architecture/rfcs/README.md 补全 Delivery on main 与 Current boundary 说明,最后重跑 scripts/generate_rfc_status_index.py --check 与 examples/docs-governance-smoke.py。
  2. [P1 · 阻塞] 生产目录新增未接线的 verifier_hook_contract.ts 违反 scope_fit 与所有权边界

    • Problem: loopx/control_plane/turn_driver/verifier_hook_contract.ts 仅被自身单测导入,全仓没有任何生产调用方,且在错误的模块边界平行定义了已被既有模块拥有的语义。
    • Evidence: 全仓搜索确认 loopx/、packages/、apps/、scripts/ 中对 verifier_hook_contract.ts、negotiateVerifierHooks、recommendVerifiedClose、DomainPluginTrial 的生产引用数为 0;14 个导出中 12 个为纯编译期 TypeScript 类型,PR 描述亦自述“TypeScript seam is a contract proposal”。同时 FoldToReceipt / KeepRaw 的所有者在 history-working-set-context-policy-v0.md §5.1(progressive_context.ts + context_delivery.ts),领域能力试跑与采纳/退役的所有者在 goal_capability_organization.ts(goal_capability_improvement_plan_v0)。
    • Impact: 在没有真实宿主适配器或投影消费者验证前过早冻结生产 TS 类型与不完整状态机,违反 docs/development/README.md Scope-Fit Review(无真实调用方的设计应保留在文档中)与 change_proportionality,增加后续迁移与兼容性负担。
    • Fix: 最简修复是把本 PR 收敛为纯双语 RFC 提案(移除未接线的 verifier_hook_contract.ts 与 verifier_hook_contract.test.ts,必要示例接口内嵌于 RFC 正文);若需保留代码,则必须移除孤立的 DomainPluginTrial 等平行类型,将其对接至少一个真实生产入口(如 progressive_context.ts 或宿主能力协商读回)并配合 runtime_decode.ts 完成端到端验证。
  3. [P1 · 阻塞] recommendVerifiedClose 缺少非空身份与引用校验,空字段可触发 FoldToReceipt

    • Problem: loopx/control_plane/turn_driver/verifier_hook_contract.ts 第 101–128 行的 recommendVerifiedClose 仅做字符串全等比对,不校验核心绑定标识与引用是否非空、有效。
    • Evidence: 在本地使用 node --no-warnings --experimental-strip-types 直接运行反例探测:向 recommendVerifiedClose 传入全空 VerifiedScopeIdentity(goal_id: "", todo_id: "", parent_epoch_ref: "", child_scope_ref: "", candidate_sha: "", verifier_version: "")与空 receipt_ref: ""、oracle_evidence_ref: ""、source_ref: ""、summary_ref: "",在 verdict: "passed"、overlap: "low"、open_obligations: false 下函数返回 {"action":"FoldToReceipt","receipt_ref":"","source_ref":"","summary_ref":""}。同样,negotiateVerifierHooks 与 recommendVerifiedClose 均未使用控制面通行的 runtime_decode.ts(requireJsonObject、requireNonEmptyString、isExploreEvidenceRef)进行边界解码。
    • Impact: 一旦未加额外校验的桥接或宿主回执返回空身份/空引用,就会越过 KeepRaw 保护生成指向空 source_ref/summary_ref 的折叠建议,破坏可追溯性。
    • Fix: 若保留代码实现切片,必须通过 runtime_decode.ts 强制校验非空 VerifiedScopeIdentity、非空 receipt_ref / oracle_evidence_ref / source_ref / summary_ref(及 failed 下的非空 counterexample_ref),令空值/空白串快速失败或保持 KeepRaw,并补齐负向单测;若采纳 Findings 2 的纯 RFC 方案移除 .ts 文件,此问题一并消除。

边界隔离与权限语义检查

  • 默认关闭隔离(default_off_isolation): negotiateVerifierHooks({ enabled: false, pre_tool_use: true }, l2) 返回 null,且生产代码无任何调用点导入 verifier_hook_contract.ts,既有默认执行、上下文编码与结算行为保持未变(相关既有 TS 测试 87 条均通过)。但需指出生产侧尚未实现与 Goal 配置绑定的权威开关。
  • 权限与生命周期命名(authority_semantics): DomainPluginTrial 暴露 adopted / retired 阶段且 RFC 将 Delivery maturity 标为 TypeScript contract,在没有任何运行时事务、权限门控或 goal_capability_organization.ts 接入的情况下,命名与成熟度标签高于当前代码实际提供的生命周期能力。

语义与 CI 对齐

  • 语义词表扫描边界: scripts/generate_semantic_inventory.py --changed-from origin/main 报告 supported candidates: 0,examples/semantic-vocabulary-drift-smoke.py 通过(29/29 词表、56/56 拥有者符号均通过)。但该工具仅扫描 Python Enum/Literal/命名集合与 TypeScript as const 数组;verifier_hook_contract.ts 使用内联 TS 字符串联合类型(如 "L0" | "L1" | "L2"、"KeepRaw" | "FoldToReceipt"、"staging" | "trial" | "adopted" | "retired"),未纳入 AST 自动化发现,而这些字面量在语义上分别与既有上下文策略及能力组合生命周期重叠,接入生产前须统一到既有词表或显式评审登记。
  • CI 阻断项实测: 本 PR 修改了 docs/architecture/rfcs/,虽然 scripts/check_rfc_bilingual.py --base origin/main --head HEAD 通过,且 canary premerge 选择的 15 项检查全部通过(返回 quality_receipt_missing,因尚未记录精确 diff 的 change-quality 回执),但 canary premerge 未自动触发 examples/docs-governance-smoke.py 与 scripts/generate_rfc_status_index.py --check,而这两项在 HEAD 上均实测 FAIL(基线 origin/main 均 PASS)。

本地验证汇总(精确头 8a6fa6c68ea8745325b615e668fb5caa26811295,wait_for_ci: false)

  • npm run typecheck:control-plane:PASS
  • node --no-warnings --experimental-sqlite --experimental-strip-types --test tests/control_plane_ts/verifier_hook_contract.test.ts:PASS(3/3)
  • 关联 TS 回归套件(yardstick_decision.test.ts、post_writeback_hook_transaction.test.ts、context_delivery.test.ts、progressive_context.test.ts、verifier_hook_contract.test.ts):PASS(90/90)
  • uv run --extra test python scripts/check_rfc_bilingual.py --base origin/main --head HEAD:PASS
  • uv run --extra test python examples/semantic-vocabulary-drift-smoke.py:PASS
  • uv run --extra test python -m ruff check tests/control_plane_ts loopx/control_plane/turn_driver docs/architecture/rfcs:PASS
  • uv run --extra test python -m mypy:PASS(17 source files)
  • uv run --extra test loopx check --scan-path ...(5 个改动文件公开边界扫描):PASS(0 errors)
  • uv run --extra test python -m pytest -q tests/canary/test_rfc_bilingual.py tests/architecture/test_rfc_status_index.py tests/architecture/test_contributor_task_board.py:PASS(55 passed;注:test_rfc_status_index.py 使用临时夹具而非仓库实时索引)
  • uv run --extra test python -m pytest -q tests/architecture/test_top_level_module_budget.py tests/architecture/test_control_plane_import_boundaries.py tests/architecture/test_content_digest_single_owner.py tests/architecture/test_semantic_vocabulary_drift.py:PASS(405 passed)
  • uv run --extra test loopx canary premerge --from-git-diff --git-diff-base origin/main:直接检查 4/4、catalog canaries 6/6、risk profile smokes 8/8、公开边界 1/1 PASS;总状态因精确 diff 缺少 change-quality 回执返回 quality_receipt_missing(退出码 1)
  • uv run --extra test python scripts/generate_rfc_status_index.py --check:FAIL(HEAD 退出码 1;基线 d38052695c 退出码 0)
  • uv run --extra test python examples/docs-governance-smoke.py:FAIL(HEAD AssertionError: verifier-hook-co-design-v0.md;基线 d38052695c 退出码 0)
  • 反例探测(recommendVerifiedClose 传入全空 VerifiedScopeIdentity 与空引用):FAIL(误返回 FoldToReceipt)

我的整体评价 / Verdict

综合精确头 8a6fa6c68ea8745325b615e668fb5caa26811295 的设计与验证证据,PR 提出的四边界 Hook 协商与独立回执门控方向本身贴合控制面演进,但当前交付切片存在治理门禁退化与生产代码未接线问题,不能合入,建议 REQUEST_CHANGES。

  • 长程与用户体验影响(outcome_impact): long_horizon 为 not_yet_proven(verifier_hook_contract.ts 未接入任何运行时/Turn 驱动或上下文投影入口,且 recommendVerifiedClose 允许空身份折叠,尚无法证明真实长程任务下的端到端成本与验收增益);user_experience 为 not_applicable,且 visual_review 为 not_applicable(本次审查覆盖 docs/architecture/rfcs/...、loopx/control_plane/turn_driver/verifier_hook_contract.ts 与 tests/control_plane_ts/verifier_hook_contract.test.ts,未改动任何前端、Dashboard、Chat 或 CLI 渲染界面,无 UI 截屏范围未验证项)。
  • 可观测语义与代码体积(observable_semantics / code_volume / change_proportionality): 现有主干运行时行为虽未被未接线代码改变,但仓库文档治理语义已从基线 d38052695c 的 PASS 退化为 FAIL,且 recommendVerifiedClose 在空字段反例下存在折叠绕过,因此可观测语义为 not_yet_proven。142 行 .ts 代码与 73 行测试在当前无任何生产调用方、无宿主适配器、无 runtime_decode 防护的条件下属于过早固化(partly_avoidable / simplify_now / disproportionate),其中 compatibility_assessment 为 not_applicable(纯新增未调用文件,不涉及历史持久化格式迁移)。
  • 词表归属(semantic_alignment): 新增状态值目前为仅存在于未调用 TS 文件中的 local_only 联合类型(AST 词表脚本未覆盖 TS 内联联合,暂未在 vocabulary_v0.json 注册),但在概念上与既有 KeepRaw / FoldToReceipt(history-working-set-context-policy-v0.md)及 goal_capability_organization.ts 重叠,后续正式接线时须统一归口既有拥有者并补齐登记。
  • 复审与合入所需证据: (1) 修复 RFC 状态头(Accepted、Supersedes / closes、semantic mirror / 语义镜像)、更新 STATUS.md / STATUS.zh-CN.md 并在 docs/architecture/rfcs/README.md 补充 Delivery on main / Current boundary,确保 scripts/generate_rfc_status_index.py --check 与 examples/docs-governance-smoke.py 实测通过;(2) 移除尚未接线的 verifier_hook_contract.ts 与其单测使本 PR 成为自洽的设计 RFC,或者将其接入至少一个真实生产调用方、复用 progressive_context.ts / goal_capability_organization.ts 既有边界、补齐 runtime_decode.ts 非空身份/引用校验并新增负向单测;(3) 补齐精确 diff 的 canary premerge 与公开边界验证。
  • 声明与新鲜度: 本评审在绑定信息不可用(session_not_bound)的情况下以 self_reported 声明模型身份;未等待也未查询远端 GitHub Actions CI(wait_for_ci: false)。当前结果仅对应精确提交 8a6fa6c68ea8745325b615e668fb5caa26811295。

英文简短结论:
English verdict: REQUEST_CHANGES at head 8a6fa6c. Blocking findings: (1) RFC metadata breaks scripts/generate_rfc_status_index.py --check and examples/docs-governance-smoke.py (Proposed status, missing Supersedes/closes, missing semantic-mirror links, and stale STATUS.md); (2) loopx/control_plane/turn_driver/verifier_hook_contract.ts has zero production callers (scope_fit/proportionality gap) and duplicates/splits ownership from progressive_context.ts and goal_capability_organization.ts; (3) recommendVerifiedClose accepts empty identity and reference strings to return FoldToReceipt. Local verification: npm run typecheck:control-plane, verifier_hook_contract.test.ts (3/3), semantic-vocabulary-drift-smoke.py, check_rfc_bilingual.py, ruff, mypy, loopx check, and canary premerge checks (15/15; change-quality receipt missing) passed; generate_rfc_status_index.py --check and docs-governance-smoke.py failed against a passing origin/main baseline.

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

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewer: model_agent · Gemini · Google DeepMind · self_reported

动机 / Motivation

在长程求解任务中,控制面与宿主维护者在启用多轮探索与独立验收时,往往只能在粗糙的 Stop-Hook 兜底验证与同步逐工具拦截之间二选一;缺乏跨宿主的四边界验证 Hook 协同契约,也缺乏“子作用域须经独立 Oracle 回执且满足低重叠后才折叠”的 VerifiedClose 约束,因此本 PR 试图把验证接入收敛到既有 C1 与历史上下文边界之下。

如果不做任何改动,外部宿主(如 Codex、Claude Code、DSH、Antigravity)上的验证探测、子作用域折叠以及领域快尺(yardstick)试跑仍各自依赖局部协议或散落脚本,既难对齐能力协商档位,也容易让未验证的代理结果或跨作用域回执污染主干上下文。

  • 受影响对象(affected_caller_or_operator): 接入宿主 Hook 生命周期(启动、里程碑、压缩/子作用域与停止边界)并消费独立验收回执的 LoopX 控制面、宿主适配器与实验评估维护者。
  • 前后对比场景(before_after_scenario): 改动前,不同宿主各自实现启动上下文恢复、里程碑采样、压缩后恢复与停止验收,子工作折叠与快尺试跑缺少统一的不变式边界;理想改进是先建立双语架构提案再沿真实拥有者接线,而当前 PR 在最新精确头 1b6514a6c1773855dcb1a0f921f62f899e6dd63a 上虽已将 VerifiedClose 补强为经 VerifiedCloseReader 校验引用非空且可读,但仍缺少对 VerifiedScopeIdentity 六元组身份非空的校验,且依然在没有任何生产调用方的情况下于控制面保留未接线的 TypeScript 契约文件与仅作类型声明的 QuotaGoalBoundaryReference,同时新增 RFC 头部未满足仓库治理检查,导致主干 docs-governance-smoke.py 与 generate_rfc_status_index.py --check 持续从基线通过退化为失败。
  • 可观测结果(observable_outcome): 相对上一轮评审头 8a6fa6c68ea8745325b615e668fb5caa26811295,最新头 1b6514a6c1773855dcb1a0f921f62f899e6dd63a 补充了 VerifiedCloseReader 可读性与引用非空校验(单测增至 5/5 通过)及 turn_envelope.ts 中的 QuotaGoalBoundaryReference 类型定义;但全仓生产代码对 verifier_hook_contract.ts 与 QuotaGoalBoundaryReference 仍无任何运行时调用方,recommendVerifiedClose 在全空或空白 VerifiedScopeIdentity 配合可读引用时仍返回 FoldToReceipt,且两个 RFC 治理门禁在当前精确头上依旧失败。
  • 非目标(non_goals): 本次变更不改变 C1 准入、传输或结算所有权,不实现具体宿主适配器(Codex、DSH、Claude Code、Antigravity)运行时代码,不启用新默认开关,也不开展跨宿主或同宿主模型效果/缓存对照实验。

改动思路 / Approach

本次对精确头 1b6514a6c1773855dcb1a0f921f62f899e6dd63a 执行全包独立复审(rereview_pull_request_exact_head),先区分上一轮(审查 6011637514、8a6fa6c68ea8745325b615e668fb5caa26811295)后的局部修复,再按整包标准裁决当前合并可行性。

从控制面所有权看,本 PR 提出了一个跨宿主验证 Hook 协商与子作用域验证折叠方案:策略默认关闭(enabled !== true 返回 null),启用后按宿主实际观测能力协商 L0 / L1 / L2,并坚持 pre_tool_use 默认关闭;在子作用域结束时,最新改动通过 VerifiedCloseReader(readReceipt + canReadEvidence)和 hasReference() 检查 request.receipt_ref、receipt.oracle_evidence_ref、receipt.source_ref、receipt.summary_ref(以及 failed 路径下的 counterexample_ref)均非空白且可读,否则回退 KeepRaw;此外在 loopx/control_plane/quota/turn_envelope.ts 新增 QuotaGoalBoundaryReference 类型以呼应启动与恢复共用 C1 /goal_boundary 指针的设计约束。

然而从架构与比例性(architecture_assessment)角度重新审视当前精确头,8a6fa6c68e -> 1b6514a6c1 的增补并未消除结构性所有权与接入边界问题:verifier_hook_contract.ts 及其新加入 turn_envelope.ts 的 QuotaGoalBoundaryReference 均没有任何生产运行时调用方,recommendVerifiedClose 对 VerifiedScopeIdentity 仍缺少 hasReference 或 runtime_decode 非空约束(空或空白身份配合可读引用仍返回 FoldToReceipt),FoldToReceipt / KeepRaw 继续脱离既有上下文策略拥有者 progressive_context.ts 与 context_delivery.ts,DomainPluginTrial 继续与 goal_capability_organization.ts 平行定义阶段类型,且 RFC 生命周期头与索引门禁尚未修复;当前 PR 仍应先修正 RFC 治理头与索引、移除未接线的生产 TypeScript 契约文件(或将其真正接入 progressive_context.ts / 宿主边界并补齐身份非空与解码校验),不应把无运行时调用方的孤立契约代码合入主干。 当前 PR 边界(current_pr_boundary):仅建议保留并修全双语 RFC 设计与目录索引,或将代码切片收口为带真实生产调用方、统一拥有者与完整身份/引用解码校验的最小端到端变更;在未完成上述收口与治理修复前,宿主适配器接入、真实缓存收益测量和生产开关均保留在后续切片。

与既有实现对比,仓库在 loopx/control_plane/quota/progressive_context.ts 与 docs/architecture/rfcs/history-working-set-context-policy-v0.md §5.1 中已明确将 KeepRaw / FoldToReceipt / EpochReset 归属为共享 TypeScript 投影拥有者;在 loopx/control_plane/capabilities/goal_capability_organization.ts 中已实现 goal_capability_improvement_plan_v0 及 planCapabilityImprovement 试跑—反馈—回滚追踪;在 loopx/control_plane/work_items/yardstick_decision.ts 中已实现 WorkYardstickProfile 与 proxy_order_reversed 判定;在 loopx/control_plane/quota/context_selection.ts 中已实现 capturedContextSelection 选择器。本 PR 仅用 import type 引用了 WorkYardstickProfile 与 QuotaGoalBoundaryReference,新测试直接在测试文件中调用 capturedContextSelection,生产路径对 verifier_hook_contract.ts 与 QuotaGoalBoundaryReference 的运行时调用仍为 0。

提案边界 RFC 设计职责 本 PR 在 1b6514a6c1 覆盖现状 既有所属拥有者
Start / resume 通过原始 C1 capture 摘要与 /goal_boundary 读取作用域与停止条件 新增纯类型 QuotaGoalBoundaryReference(无运行时构造/消费),测试直接调 capturedContextSelection turn_envelope.ts / context_selection.ts / progressive_context.ts
Milestone probe 异步采样并回传平台期/快尺反转 仅联合类型(无生产实现) yardstick_decision.ts / stride_policy.ts
Compaction / subscope 独立 Oracle 回执、原件与摘要均可读且非空后才允许 FoldToReceipt recommendVerifiedClose 已补引用非空与 canReadEvidence,但身份六元组仍允许空串,且 0 生产调用方 history-working-set-context-policy-v0.md §5.1 (progressive_context.ts)
Stop / Domain plugin 独立 Oracle 验收及内容寻址试跑准入 DomainPluginCandidate/DomainPluginTrial 仅类型(0 生产调用方) settlement.ts / goal_capability_organization.ts

具体改动 / Changes

上一轮审查至本次精确头的增量变化(8a6fa6c68ea8745325b615e668fb5caa26811295..1b6514a6c1773855dcb1a0f921f62f899e6dd63a)

增量提交(Require readable verifier evidence and bind solver constraints)修改 5 个文件(+95 / -23):

  1. 解决情况(已修复引用可读性与空引用): verifier_hook_contract.ts(第 101–145 行)引入 VerifiedCloseReader(readReceipt + canReadEvidence)和 hasReference(),对 request.receipt_ref、receipt.oracle_evidence_ref、receipt.source_ref、receipt.summary_ref 以及 failed 分支的 counterexample_ref 强制要求非空白且 canReadEvidence(ref) === true;verifier_hook_contract.test.ts 新增可读性负向单测验证空/不可读引用保留 KeepRaw。
  2. 增量引入的局部补充: 在 loopx/control_plane/quota/turn_envelope.ts(第 74–77 行)新增 export type QuotaGoalBoundaryReference(capture_sha256: string; pointer: "/goal_boundary"),在 verifier-hook-co-design-v0.md 与 .zh-CN.md 第 10 行、第 43 行补充启动/恢复读取 /goal_boundary 与引用可读性规则描述,并在 verifier_hook_contract.test.ts 新增调用 capturedContextSelection 验证 /goal_boundary 的第 5 条单测。
  3. 仍未修复的问题: 未修改 RFC 头部 RFC status: Proposed、缺少 Supersedes / closes、缺少 semantic mirror / 语义镜像、未更新 STATUS.md / STATUS.zh-CN.md 与 README.md 边界描述;verifier_hook_contract.ts 与新加的 QuotaGoalBoundaryReference 仍没有任何生产调用方;recommendVerifiedClose 对 VerifiedScopeIdentity 六元组身份字段依然缺少非空校验。

完整 PR 改动清单(相对基准 d38052695c2c8a2e67cdb2c1eb6f4c6651eabd4d,6 个文件,+403 / -0)

  1. 文档与索引(3 个文件,+116/-0): 新增 docs/architecture/rfcs/verifier-hook-co-design-v0.md(57 行)与 docs/architecture/rfcs/verifier-hook-co-design-v0.zh-CN.md(57 行),并在 docs/architecture/rfcs/README.md 增加条目链接(+2 行);未更新 STATUS.md / STATUS.zh-CN.md。
  2. 控制面 TypeScript 源码(2 个文件,+163/-0): 在 loopx/control_plane/quota/turn_envelope.ts 第 74–77 行新增纯类型导出 QuotaGoalBoundaryReference(+4 行);新增 loopx/control_plane/turn_driver/verifier_hook_contract.ts(159 行)。
  3. TypeScript 单测(1 个文件,+124/-0): 新增 tests/control_plane_ts/verifier_hook_contract.test.ts(5 条单测),也是全仓唯一导入 verifier_hook_contract.ts 的文件。

关键代码讲解

  • VerifiedCloseReader 与 hasReference(loopx/control_plane/turn_driver/verifier_hook_contract.ts#L101-L108): 新增 VerifiedCloseReader 端口定义 readReceipt 与 canReadEvidence,hasReference 校验 typeof ref === "string" && ref.trim().length > 0,要求权威读端对引用字符串做非空白判断再读取。
  • recommendVerifiedClose(loopx/control_plane/turn_driver/verifier_hook_contract.ts#L112-L145): 先用 hasReference(request.receipt_ref) 决定是否调用 reader.readReceipt;随后以 !== 逐一比对 receipt?.identity 与 request.identity 的 6 个字段(goal_id、todo_id、parent_epoch_ref、child_scope_ref、candidate_sha、verifier_version),不相等或缺失回执返回 KeepRaw;当 receipt.verdict === "failed" 时若 counterexample_ref 非空白且 canReadEvidence 为真则透传 counterexample_ref 并保持 KeepRaw,否则仅返回 { action: "KeepRaw" };当 verdict === "passed"、open_obligations === false、overlap === "low" 且 [oracle_evidence_ref, source_ref, summary_ref] 全部满足 hasReference 与 canReadEvidence === true 时返回 FoldToReceipt。残留缺陷在于第 119–126 行只检查两端身份全等而不检查六个身份字段是否非空白,因此双端均为空/空白字符串且引用可读时仍会返回 FoldToReceipt;此外若外部非类型化调用传入缺失 request.identity,直接读取 expected.goal_id 也缺少 runtime_decode.ts 对象防护。
  • QuotaGoalBoundaryReference(loopx/control_plane/quota/turn_envelope.ts#L74-L77): 定义了固定 pointer: "/goal_boundary" 与 capture_sha256: string 的只读类型,但整个控制面与宿主层没有任何函数构造、解码或消费该类型;verifier_hook_contract.ts 仅以 import type 引入,verifier_hook_contract.test.ts 则直接调用既有 capturedContextSelection 验证原始 JSON 指针选择。
  • negotiateVerifierHooks 与未接线类型集合(verifier_hook_contract.ts): 沿用上一轮逻辑,当 policy.enabled !== true 返回 null,启用后按 observed capabilities 协商 L0 / L1 / L2 与 pre_tool_use;DomainPluginCandidate / DomainPluginTrial、VerifierHookEvent 等仍仅有类型声明,全仓 0 生产调用方。

规范基线映射(spec_basis)

依据基准 d38052695c2c8a2e67cdb2c1eb6f4c6651eabd4d 上的规范入口 docs/architecture/rfcs/README.md(及其引用的 docs/development/README.md Scope-Fit Review 与 history-working-set-context-policy-v0.md §5.1)映射精确头 1b6514a6c1773855dcb1a0f921f62f899e6dd63a:

  • RFC-INDEX-HEADER -> not_met:docs/architecture/rfcs/README.md 要求合入 RFC 使用 Accepted 生命周期状态、声明 Supersedes / closes、包含 semantic mirror / 语义镜像 互链并通过 generate_rfc_status_index.py --write 同步 STATUS.md;当前头仍为 Proposed、缺 Supersedes / closes 与 semantic mirror / 语义镜像 字样、未同步 STATUS.md,README.md 条目亦缺少 Delivery on main / Current boundary 说明。
  • RFC-BILINGUAL-PAIR -> implemented:英文与中文镜像在本 PR 中同步增改,并通过 scripts/check_rfc_bilingual.py --base origin/main --head HEAD。
  • RFC-MATURITY-SEPARATION -> not_met:docs/architecture/rfcs/README.md 与 docs/development/README.md 要求将设计提案与已实现运行时边界严格隔离,禁止将无生产调用方的控制面模块留置主干并须复用既有拥有者;当前精确头仍在 loopx/control_plane/turn_driver/ 保留 0 生产调用方的 verifier_hook_contract.ts(并新增同样 0 运行时调用方的 QuotaGoalBoundaryReference 导出),RFC 仍将成熟度标为 TypeScript contract,且 FoldToReceipt 与插件试跑阶段仍未接入 progressive_context.ts 与 goal_capability_organization.ts。

对主干的风险 / Risks

阻塞发现(Findings)

  1. [P1 · 阻塞] RFC 生命周期头、镜像声明与派生索引仍破坏仓库文档治理门禁(未修复)

    • Problem: 最新提交 1b6514a6c1 仅修改了 RFC 正文第 10、43 行,未修复 RFC 头部元数据与目录索引,导致主干文档治理脚本在精确头上继续失败。
    • Evidence: 在精确头 1b6514a6c1773855dcb1a0f921f62f899e6dd63a 实测 uv run --extra test python scripts/generate_rfc_status_index.py --check 退出码 1,报错 verifier-hook-co-design-v0.md: status 'Proposed' does not begin with a lifecycle state (Accepted, Superseded, Retired, Rejected) 与 missing '**Supersedes / closes:**' declaration;实测 uv run --extra test python examples/docs-governance-smoke.py 退出码 1,在 check_rfc_language_mirrors() 第 202 行抛出 AssertionError: verifier-hook-co-design-v0.md(缺少 "semantic mirror",且中文镜像缺少 "语义镜像")。此前基线 d38052695c 两项均退出 0。此外 docs/architecture/rfcs/README.md 仍缺少同级条目的 Delivery on main / Current boundary 段落。
    • Impact: 合入主干后会立即使 scripts/generate_rfc_status_index.py --check 与 examples/docs-governance-smoke.py 持续失败。
    • Fix: 在 verifier-hook-co-design-v0.md 与 .zh-CN.md 头部将 RFC status 改为 Accepted / 已接受(Delivery maturity 如实标为 Proposal),补全 **Supersedes / closes:** none / **替代 / 关闭:** 无 与 semantic mirror / 语义镜像 互链,运行 uv run --extra test python scripts/generate_rfc_status_index.py --write 更新 STATUS.md 与 STATUS.zh-CN.md,并在 docs/architecture/rfcs/README.md 补全 Delivery on main / Current boundary,重跑上述两条校验脚本至退出 0。
  2. [P1 · 阻塞] 控制面新增的 verifier_hook_contract.ts 与 QuotaGoalBoundaryReference 仍无任何生产调用方且分裂既有所有权(未修复)

    • Problem: 尽管新提交在 turn_envelope.ts 导出了 QuotaGoalBoundaryReference 并新增了 capturedContextSelection 单测,但 verifier_hook_contract.ts 与该新类型在生产代码中依然没有任何运行时调用者,且继续在错误目录平行定义既有拥有者的语义。
    • Evidence: 全仓搜索 verifier_hook_contract 与 QuotaGoalBoundaryReference(覆盖 loopx/、tests/、packages/、apps/、scripts/)确认:QuotaGoalBoundaryReference 仅被 verifier_hook_contract.ts 以 import type 引入,verifier_hook_contract.ts 仅被 tests/control_plane_ts/verifier_hook_contract.test.ts 导入,全仓 0 个生产运行时调用方。新测试第 5 条是测试文件直接调用 context_selection.ts 的 capturedContextSelection,并未经过 verifier_hook_contract.ts 或 turn_envelope.ts 的新运行时路径。同时 FoldToReceipt / KeepRaw 的所有者是 history-working-set-context-policy-v0.md §5.1(progressive_context.ts + context_delivery.ts),能力试跑生命周期的所有者是 goal_capability_organization.ts(goal_capability_improvement_plan_v0)。
    • Impact: 在没有真实宿主适配器或投影调用方落地前,向 loopx/control_plane/turn_driver/ 与 turn_envelope.ts 预埋未验证、无调用方的导出契约,违反 scope_fit、repository_reuse 与 change_proportionality,并累积过早耦合与迁移成本。
    • Fix: 最简修复是收敛本 PR 为合规的双语架构 RFC(移除未接线的 verifier_hook_contract.ts、测试文件及纯编译期占位类型 QuotaGoalBoundaryReference,必要接口保留在 RFC 文档中);若坚持在当前 PR 交付代码,则须删除孤立平行类型(DomainPluginTrial 等),将 recommendVerifiedClose / Hook 能力协商真正接入至少一条 progressive_context.ts / turn_envelope.ts 或宿主适配器读回生产路径并补齐端到端验证。
  3. [P1 · 阻塞] recommendVerifiedClose 虽已校验引用非空与可读性,但对 VerifiedScopeIdentity 六元组仍缺少非空校验,空身份可触发 FoldToReceipt(部分修复、仍有缺口)

    • Problem: 1b6514a6c1 修复了空引用与不可读证据,但 recommendVerifiedClose(第 117–126 行)对 VerifiedScopeIdentity 六个字段仍只检查 observed.<field> !== expected.<field>,未复用 hasReference 或 runtime_decode.ts 校验身份字段非空。
    • Evidence: 在精确头 1b6514a6c1 使用 node --no-warnings --experimental-strip-types 执行反例测试:当 request.identity 与 receipt.identity 同时传入 { goal_id: "", todo_id: " ", parent_epoch_ref: "", child_scope_ref: "", candidate_sha: "", verifier_version: "" },配合非空且 canReadEvidence === true 的 receipt_ref: "receipt:21"、oracle_evidence_ref: "oracle:result"、source_ref: "capture:raw-child"、summary_ref: "capture:child-receipt"、verdict: "passed"、open_obligations: false、overlap: "low" 时,recommendVerifiedClose 返回 {"action":"FoldToReceipt","receipt_ref":"receipt:21","source_ref":"capture:raw-child","summary_ref":"capture:child-receipt"} 而非 KeepRaw。同时边界入口仍未使用 runtime_decode.ts(requireJsonObject、requireNonEmptyString)。
    • Impact: 若上游未绑定作用域的身份对象退化为空串或空白串,即可在看似合法的 FoldToReceipt 返回中绕过作用域与 candidate_sha / verifier_version 绑定;且缺乏统一 runtime_decode 防护使畸形输入会在读取 expected.goal_id 时直接抛错而非稳健落回 KeepRaw。
    • Fix: 若保留实现代码,必须在身份比对前对 VerifiedScopeIdentity 六个字段全量执行非空白校验(或使用 runtime_decode.ts 解码请求与回执并保持缺省回退 KeepRaw),同时在 verifier_hook_contract.test.ts 补充空/空白身份负向测试用例;若按 Finding 2 收敛为纯 RFC PR,则同步消除此运行时缺陷。

边界隔离与权限语义检查

  • 默认关闭隔离(default_off_isolation): negotiateVerifierHooks({ enabled: false, pre_tool_use: true }, ...) 返回 null,且生产代码无任何调用点导入 verifier_hook_contract.ts 或读取 QuotaGoalBoundaryReference,既有默认执行、上下文投影、调度与结算行为均未改变(既有 TS 关联套件 175/175 全通过)。但权威控制开关尚未接入任何 Goal 配置边界。
  • 权限与生命周期命名(authority_semantics): RFC 将 Delivery maturity 标为 TypeScript contract,并在 verifier_hook_contract.ts 导出 adopted / retired 等 DomainPluginTrial 阶段,在零生产运行时调用方与零持久化状态转换的现状下,命名和成熟度标签高于当前代码实际提供的能力。

语义与 CI 对齐

  • 语义词表扫描边界: scripts/generate_semantic_inventory.py --changed-from origin/main(基线 b375539271b4cb9f34386a77211a944ce6e05ffe)扫描 18 份快照报告 supported candidates: 0,examples/semantic-vocabulary-drift-smoke.py 通过(29/29 词表、56/56 拥有者符号均通过)。由于该扫描器仅提取 Python Enum/Literal/命名多值集合与 TypeScript as const 数组,verifier_hook_contract.ts 中的内联 TS 字符串联合类型处于扫描盲区之外,后续若进入生产接线仍须与 progressive_context.ts 及 goal_capability_organization.ts 的注册词表对齐。
  • 门禁脚本对齐(wait_for_ci: false): 本复审不轮询远端 GitHub Actions。canary premerge 在精确头 1b6514a6c1 执行 4 项直接检查、9 项目录金丝雀、8 项风险烟雾测试与 1 项公开边界扫描全部通过(总状态因缺少精确 diff 的 change-quality 回执返回 quality_receipt_missing,退出码 1);但 canary premerge 不会覆盖 scripts/generate_rfc_status_index.py --check 与 examples/docs-governance-smoke.py,这两项在精确头上均实测失败。

本地验证汇总(精确头 1b6514a6c1773855dcb1a0f921f62f899e6dd63a,wait_for_ci: false)

  • npm run typecheck:control-plane:PASS
  • node --no-warnings --experimental-sqlite --experimental-strip-types --test tests/control_plane_ts/verifier_hook_contract.test.ts:PASS(5/5 passed)
  • 关联 TS 回归套件(verifier_hook_contract.test.ts、yardstick_decision.test.ts、post_writeback_hook_transaction.test.ts、context_delivery.test.ts、progressive_context.test.ts、turn_envelope.test.ts、context_selection.test.ts):PASS(180/180 passed)
  • uv run --extra test python scripts/check_rfc_bilingual.py --base origin/main --head HEAD:PASS
  • uv run --extra test python examples/semantic-vocabulary-drift-smoke.py:PASS
  • uv run --extra test python -m ruff check tests/control_plane_ts loopx/control_plane/turn_driver loopx/control_plane/quota docs/architecture/rfcs:PASS
  • uv run --extra test python -m mypy:PASS(17 source files)
  • uv run --extra test loopx check --scan-path ...(6 个改动文件公开边界扫描):PASS(0 errors, 5 checks)
  • uv run --extra test python -m pytest -q tests/canary/test_rfc_bilingual.py tests/architecture/test_rfc_status_index.py tests/architecture/test_contributor_task_board.py tests/architecture/test_top_level_module_budget.py tests/architecture/test_control_plane_import_boundaries.py tests/architecture/test_content_digest_single_owner.py tests/architecture/test_semantic_vocabulary_drift.py:PASS(460 passed)
  • uv run --extra test loopx canary premerge --from-git-diff --git-diff-base origin/main:direct_checks 4/4、catalog_canaries 9/9、risk_profile_smokes 8/8、public_boundary 1/1 均 PASS(总状态 quality_receipt_missing,退出码 1)
  • uv run --extra test python scripts/generate_rfc_status_index.py --check:FAIL(HEAD 1b6514a6c1 退出码 1;对比此前 PR 基线 d38052695c 退出码 0)
  • uv run --extra test python examples/docs-governance-smoke.py:FAIL(HEAD 1b6514a6c1 AssertionError: verifier-hook-co-design-v0.md 退出码 1;对比此前 PR 基线 d38052695c 退出码 0)
  • 反例探测(recommendVerifiedClose 传入全空/空白 VerifiedScopeIdentity 配合可读引用):FAIL(误返回 FoldToReceipt 而非 KeepRaw)

我的整体评价 / Verdict

对精确头 1b6514a6c1773855dcb1a0f921f62f899e6dd63a 执行全包复审后,确认作者修复了上一轮提出的 VerifiedClose 空引用与不可读证据遗漏,并补充了 /goal_boundary 相关文本与引用可读性单测;但上一轮其余阻塞项仍未解决,且 recommendVerifiedClose 对空身份字符串的校验缺口依然存在,整体仍应给出 REQUEST_CHANGES。

  • 长程与用户体验影响(outcome_impact): long_horizon 为 not_yet_proven(verifier_hook_contract.ts 与 QuotaGoalBoundaryReference 仍没有任何生产运行时调用方,recommendVerifiedClose 仍允许全空/空白 VerifiedScopeIdentity 触发 FoldToReceipt,尚无法证明长程任务下真实宿主与投影收益);user_experience 为 not_applicable,且 visual_review 为 not_applicable(本次复审检查了全部 6 个改动文件,未修改任何前端、Dashboard、Chat 或 CLI 交互/渲染表面,无未检查 UI 截屏项)。
  • 可观测语义与代码体积(observable_semantics / code_volume / change_proportionality): 主干现有运行时行为虽未被未接线代码改变,但文档治理检查从基线 d38052695c 的 PASS 退化为 FAIL 状态至今未修复,且 recommendVerifiedClose 在空身份反例下仍能越过作用域绑定校验,故 observable_semantics 为 not_yet_proven。163 行生产目录 TS 代码(+124 行单测)在无生产调用方、无宿主适配器、无统一 runtime_decode 防护的条件下仍属过早固化(partly_avoidable / simplify_now / disproportionate),compatibility_assessment 为 not_applicable(新增文件/新增纯类型无存量格式迁移边界)。
  • 词表归属(semantic_alignment): 当前词表仍为停留在未调用 TS 文件内的 local_only 联合类型(AST 词表脚本未覆盖 TS 内联联合,vocabulary_v0.json 未受直接破坏),但后续接线时须统一到 progressive_context.ts 与 goal_capability_organization.ts 的注册词表。
  • 下一轮复审与合入所需证据: (1) 修复 RFC 头部字段(Accepted、Supersedes / closes、semantic mirror / 语义镜像)、运行 scripts/generate_rfc_status_index.py --write 同步 STATUS.md / STATUS.zh-CN.md 并在 docs/architecture/rfcs/README.md 补全 Delivery on main / Current boundary,使 generate_rfc_status_index.py --check 与 docs-governance-smoke.py 实测通过;(2) 要么移除尚未接线的 verifier_hook_contract.ts、QuotaGoalBoundaryReference 与其单测使本 PR 成为纯粹规范的双语设计 RFC,要么将其接入真实生产调用方与既有拥有者并补全 VerifiedScopeIdentity 非空 + runtime_decode 校验与负向单测;(3) 在最终提交后补齐精确 diff 的 canary premerge 与公开边界验证。
  • 声明与新鲜度: 本评审在绑定信息不可用(session_not_bound)的情况下以 self_reported 声明模型身份;未等待也未查询远端 GitHub Actions CI(wait_for_ci: false)。当前结果仅对应精确提交 1b6514a6c1773855dcb1a0f921f62f899e6dd63a。

英文简短结论:
English verdict: REQUEST_CHANGES at head 1b6514a. Compared with prior head 8a6fa6c, this update resolved empty/unreadable receipt/evidence refs via VerifiedCloseReader and hasReference (5/5 unit tests pass), but the core PR blockers remain: (1) RFC headers and derived index still fail scripts/generate_rfc_status_index.py --check and examples/docs-governance-smoke.py against the passing base d380526; (2) verifier_hook_contract.ts and the newly added compile-only QuotaGoalBoundaryReference in turn_envelope.ts still have zero production callers and split ownership from progressive_context.ts and goal_capability_organization.ts; (3) recommendVerifiedClose still compares the 6 VerifiedScopeIdentity fields only with !== and returns FoldToReceipt on empty/whitespace identities when refs are readable. Local checks: npm run typecheck:control-plane, 180/180 targeted TS tests, check_rfc_bilingual.py, semantic-vocabulary-drift-smoke.py, ruff, mypy (17 files), loopx check (6 files), 460/460 architecture pytest cases, and canary premerge suites (22/22 checks pass; exit 1 only on quality_receipt_missing) passed.

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

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewer: model_agent · gpt-6.2-sol · OpenAI · runtime_reported · xhigh

动机 / Motivation

维护者需要评议可关闭的 verifier hooks 契约,并确保日常文档校验能继续运行。 主干上的 RFC 检查以接受后的规范生命周期为输入。现有 Goal 与 settlement 继续由 C1 持有。 同一套 RFC 检查在 merge base 均通过,在当前头均失败。状态索引拒绝新增 Active RFC 的 Proposed 生命周期并报告缺少 Supersedes / closes。文档 smoke 在英文页报告缺少语义镜像标记。 补丁增加双语 RFC、tier 协商、VerifiedClose 建议和 C1 边界引用类型。Host 集成仍待验收。 范围是提案及当前纯 TypeScript 契约。

改动思路 / Approach

C1 决定授权及结算,外部 Oracle 提供验证票据,helper 只计算折叠建议。 这一提交可作为待评议的 TypeScript 契约。最先可验收的运行切片应使用原 Goal/Todo 上一次真实恢复,将精确 Oracle 票据、父边界回读和原 settlement 串起来。其运行证据留在对应实现。 沿用现有历史工作集的折叠语义,让请求和回执共享精确身份校验。

具体改动 / Changes

逐项检查当前头 1b6514a 和 merge base d380526,6 个文件,+403/-0。差异核对覆盖 Active RFC、双语稿、协商及建议函数、Turn envelope 的类型引用和配套测试。 评审依据为 d380526。 目标规范

关键代码讲解

  • rfc-active-governance 的接线使新增稿参与仓库现有治理。 RFC 头部
  • verifier-negotiation-off 由协商入口的关闭分支处理。 Tier 协商
  • verified-close-exact-identity 由票据读取后的身份比较处理,并核对 Oracle、源和压缩结果。 身份比较 · 拟议语义

对主干的风险 / Risks

[P1] 新增 Active RFC 使文档索引和镜像检查失败。 同一套 RFC 检查在 merge base 均通过,在当前头均失败。状态索引拒绝新增 Active RFC 的 Proposed 生命周期并报告缺少 Supersedes / closes。文档 smoke 在英文页报告缺少语义镜像标记。 经维护者接受后,按双语 Active RFC 模板登记生命周期、取代关系和语义镜像,保留当前交付成熟度并重新生成状态索引。尚待设计评议时,将提案留在项目认可的评议入口,待接受后再列入 Active RFC。

[P2] 不完整的身份可触发 VerifiedClose 折叠建议。 令请求与已通过票据的同一身份字段为空,其余字段保持有效,重复六次。Goal、Todo、父 epoch、子 scope、candidate SHA 和 verifier version 各自为空时都得到 FoldToReceipt。身份相等无法证明 Oracle 绑定了完整候选,按约定此时应保留原始记录。 在比较身份和输出推荐前拒绝任一端缺失、空或全空白的身份字段。用共享身份校验覆盖六项独立负例,并保留完整匹配仍可折叠的测试。

完整匹配且三段证据可读的已通过票据得到折叠推荐。跨 scope、不可读证据和有未清义务的情况均保留原始记录。 TypeScript 81 个测试和类型检查通过。预合并 4 个直接检查与 18 个选中检查通过,严格资格返回 quality_receipt_missing。两项另外执行的文档治理检查在当前头失败。 Host adapter、安装态回读和匹配预算下的收益属于后续验收。本轮运行了纯 TypeScript 入口和实际文档检查。

我的整体评价 / Verdict

请求修改。C1 决定授权及结算,外部 Oracle 提供验证票据,helper 只计算折叠建议。 这一提交可作为待评议的 TypeScript 契约。最先可验收的运行切片应使用原 Goal/Todo 上一次真实恢复,将精确 Oracle 票据、父边界回读和原 settlement 串起来。其运行证据留在对应实现。 当前头尚未满足 Active RFC 治理,也未通过不完整精确身份的契约负例。 修正两个边界后复跑文档与折叠负例。

English verdict: REQUEST_CHANGES at 1b6514a. Fix the Active RFC lifecycle and bilingual metadata, and reject all incomplete VerifiedClose identities before recommending a fold. Both governance checks regress on this head, and six isolated identity counterexamples produce FoldToReceipt.

@@ -0,0 +1,57 @@
# RFC: Verifier Hook Co-Design (v0)

- **RFC status:** Proposed

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[P1] 同一套 RFC 检查在 merge base 均通过,在当前头均失败。状态索引拒绝新增 Active RFC 的 Proposed 生命周期并报告缺少 Supersedes / closes。文档 smoke 在英文页报告缺少语义镜像标记。 经维护者接受后,按双语 Active RFC 模板登记生命周期、取代关系和语义镜像,保留当前交付成熟度并重新生成状态索引。尚待设计评议时,将提案留在项目认可的评议入口,待接受后再列入 Active RFC。

const expected = request.identity;
const observed = receipt?.identity;
if (!receipt || !observed
|| observed.goal_id !== expected.goal_id || observed.todo_id !== expected.todo_id

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[P2] 令请求与已通过票据的同一身份字段为空,其余字段保持有效,重复六次。Goal、Todo、父 epoch、子 scope、candidate SHA 和 verifier version 各自为空时都得到 FoldToReceipt。身份相等无法证明 Oracle 绑定了完整候选,按约定此时应保留原始记录。 在比较身份和输出推荐前拒绝任一端缺失、空或全空白的身份字段。用共享身份校验覆盖六项独立负例,并保留完整匹配仍可折叠的测试。

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewer: model_agent · Gemini · Google DeepMind · self_reported

动机 / Motivation

在长程求解任务中,控制面与宿主维护者在启用多轮探索与独立验收时,往往只能在粗糙的 Stop-Hook 兜底验证与同步逐工具拦截之间二选一;缺乏跨宿主的四边界验证 Hook 协同契约,也缺乏“子作用域须经独立 Oracle 回执且满足低重叠后才折叠”的 VerifiedClose 约束,因此本 PR 试图把验证接入收敛到既有 C1 与历史上下文边界之下。

如果不做任何改动,外部宿主(如 Codex、Claude Code、DSH、Antigravity)上的验证探测、子作用域折叠以及领域快尺(yardstick)试跑仍各自依赖局部协议或散落脚本,既难对齐能力协商档位,也容易让未验证的代理结果或跨作用域回执污染主干上下文。

  • 受影响对象(affected_caller_or_operator): 接入宿主 Hook 生命周期(启动、里程碑、压缩/子作用域与停止边界)并消费独立验收回执的 LoopX 控制面、宿主适配器与实验评估维护者。
  • 前后对比场景(before_after_scenario): 改动前,不同宿主各自实现启动上下文恢复、里程碑采样、压缩后恢复与停止验收,子工作折叠与快尺试跑缺少统一的不变式边界;理想改进是先合入合规的双语架构 RFC 再在真实拥有者上接线落地,而当前 PR 在最新精确头 72c77567b09f6ad69a0b56189db3ab3184086609 上虽然已修复 RFC 治理检查并补齐了 recommendVerifiedClose 的空身份与角色/作用域证据校验,但依然将没有任何生产调用方的 verifier_hook_contract.ts 与仅作编译期类型导出的 QuotaGoalBoundaryReference 放在控制面生产目录中,同时把 FoldToReceipt / KeepRaw 留在 turn_driver/ 而非既有拥有者 progressive_context.ts、保留零调用方零测试的平行 DomainPluginTrial 类型,且未在 docs/architecture/rfcs/README.md 声明当前无运行时交付边界。
  • 可观测结果(observable_outcome): 相对上一轮头 1b6514a6c1773855dcb1a0f921f62f899e6dd63a,最新头 72c77567b09f6ad69a0b56189db3ab3184086609 已使 scripts/generate_rfc_status_index.py --check 与 examples/docs-governance-smoke.py 双双实测通过(STATUS.md 更新为 Accepted (53)),并让 recommendVerifiedClose 在空身份和跨角色/错作用域证据下稳定返回 KeepRaw(单测 7/7 通过、全空身份实测返回 KeepRaw);但全仓生产代码对 verifier_hook_contract.ts 与 QuotaGoalBoundaryReference 仍只有 0 个生产运行时调用方,DomainPluginCandidate / DomainPluginTrial 仍无任何调用方与测试,FoldToReceipt 仍未归口 progressive_context.ts。
  • 非目标(non_goals): 本次变更不改变 C1 准入、传输或结算所有权,不实现具体宿主适配器(Codex、DSH、Claude Code、Antigravity)运行时代码,不启用新默认开关,也不开展跨宿主或同宿主模型效果/缓存对照实验。

改动思路 / Approach

本次对精确头 72c77567b09f6ad69a0b56189db3ab3184086609 执行全包独立复审(rereview_pull_request_exact_head),逐项核验上一轮(审查 6011852973、1b6514a6c1773855dcb1a0f921f62f899e6dd63a)指出的 3 项阻塞项在最新提交 Require role- and scope-bound verifier evidence 中的实际修复与残余边界。

本轮确认已实质修复的前轮阻塞项:

  1. RFC 状态索引与镜像治理(原 P1 #1 已解决): 作者在 verifier-hook-co-design-v0.md 与 .zh-CN.md 头部补齐 Accepted (upon merge)、Supersedes / closes: none(替代 / 关闭:无)及 semantic mirror / 语义镜像 互链,并重新生成 STATUS.md 与 STATUS.zh-CN.md(Accepted (53) / 已接受 (53));generate_rfc_status_index.py --check 与 docs-governance-smoke.py 均从上一轮的 exit 1 恢复为 exit 0 通过。
  2. recommendVerifiedClose 空身份与证据角色/作用域绑定(原 P1 #3 已解决): 作者将 VerifiedCloseReader 升级为 readReceipt + readEvidence => VerifiedScopeEvidence | undefined(要求 { ref, role, identity } 三元一致),并在 recommendVerifiedClose 入口(第 140–144 行)校验 VerifiedScopeIdentity 六个字段全部非空白且 request.receipt_ref 非空白后才读取回执与证据;最新反例实测空/空白身份返回 {"action":"KeepRaw"} 且不触发权限读回,单测增至 7/7 全过。

然而从架构与比例性(architecture_assessment)及仓库 Scope-Fit Review 规则审视当前完整精确头,原第 2 项结构性阻塞仍未消除:loopx/control_plane/turn_driver/verifier_hook_contract.ts(181 行)与 loopx/control_plane/quota/turn_envelope.ts 新增的 QuotaGoalBoundaryReference(第 74–77 行)在全仓生产代码中依然只有 0 个运行时调用方,FoldToReceipt / KeepRaw 仍停留在 turn_driver/ 而未接入既有上下文策略拥有者 quota/progressive_context.ts,DomainPluginCandidate / DomainPluginTrial(第 169–181 行)继续在测试外零引用地平行定义于 capabilities/goal_capability_organization.ts 之外,且 docs/architecture/rfcs/README.md 第 204–205 行未补充 Delivery on main / Current boundary 说明来隔离“提案设计”与“运行态契约”;因此当前 PR 仍需收敛为纯合规双语 RFC(移除未接线的生产 TS 契约、单测与占位类型)或真正接入至少一条真实生产调用链并清理孤立类型。 当前 PR 边界(current_pr_boundary):对本 PR 而言,最清洁且可立即合入的边界是“保留已修通治理检查的双语 RFC 与 STATUS.md 索引,补齐 docs/architecture/rfcs/README.md 的 Delivery on main: Proposal only / Current boundary 声明,并将未接线的 verifier_hook_contract.ts、单测及 QuotaGoalBoundaryReference 移出生产源码目录直到真实宿主或 progressive_context.ts 调用方同步落地”;宿主适配器实现、真实缓存收益与生产开关继续保留在后续切片。

与既有实现对比,仓库在 loopx/control_plane/quota/turn_envelope.ts 第 73 行已有 QUOTA_GOAL_BOUNDARY_ARTIFACT = "quota_should_run.goal_boundary" 并由 loopx/control_plane/quota/adaptive_children.ts 第 13、196 行在生产中实际消费;在 docs/architecture/rfcs/history-working-set-context-policy-v0.md §5.1 已明确将 {KeepRaw, FoldToReceipt, EpochReset} 归属给共享 TypeScript 投影拥有者 progressive_context.ts + context_delivery.ts + turn_envelope.ts;在 loopx/control_plane/capabilities/goal_capability_organization.ts 第 51 行已有 goal_capability_improvement_plan_v0;在 loopx/control_plane/work_items/yardstick_decision.ts 已有 WorkYardstickProfile。当前精确头在生产目录保留 185 行新增 TS 代码,却没有任何真实生产者或消费者触发其中任何一条函数或类型。

提案边界 RFC 设计职责 72c77567b0 代码与文档现状 既有所属拥有者与差距
Start / resume 通过原始 C1 capture 摘要与 /goal_boundary 读取作用域与停止条件 turn_envelope.ts 新增纯类型 QuotaGoalBoundaryReference(0 运行时调用),测试直接调用 capturedContextSelection adaptive_children.ts 已消费 QUOTA_GOAL_BOUNDARY_ARTIFACT,但新类型无生产调用者
Milestone probe 异步采样并回传平台期/快尺反转 仅联合类型 VerifierTransition(无生产实现) yardstick_decision.ts / stride_policy.ts
Compaction / subscope 独立非空作用域、角色/引用/身份均绑定的 FoldToReceipt / KeepRaw recommendVerifiedClose 校验逻辑与 7 条单测自洽,但 0 生产调用方 应归属 quota/progressive_context.ts(history-working-set-context-policy-v0.md §5.1)
Stop / Domain plugin 独立 Oracle 验收及内容寻址试跑准入 DomainPluginCandidate / DomainPluginTrial 0 生产调用方且 0 测试引用 平行重复 capabilities/goal_capability_organization.ts
RFC 索引治理 区分设计接受状态与 main 上真实交付边界 STATUS.md 与双语镜像检查已通过,但 README.md 缺 Delivery on main / Current boundary docs/architecture/rfcs/README.md 第 50–56、204–205 行

具体改动 / Changes

上一轮审查至本次精确头的增量变化(1b6514a6c1773855dcb1a0f921f62f899e6dd63a..72c77567b09f6ad69a0b56189db3ab3184086609)

增量提交(Require role- and scope-bound verifier evidence)修改 6 个文件(+100 / -27):

  1. RFC 头部与索引修复: 更新 docs/architecture/rfcs/verifier-hook-co-design-v0.md 与 .zh-CN.md(- **RFC status:** Accepted (upon merge)、**Supersedes / closes:** none、**Language mirror:** [中文版 — semantic mirror](...) 及正文第 44 行补充非空作用域与角色/引用/身份绑定要求),并同步更新 docs/architecture/rfcs/STATUS.md(Accepted (52) -> Accepted (53))与 STATUS.zh-CN.md(已接受 (52) -> 已接受 (53))。
  2. recommendVerifiedClose 强校验收口: 在 loopx/control_plane/turn_driver/verifier_hook_contract.ts 第 101–167 行引入 VerifiedScopeEvidence、scopeIdentityFields、matchesScope 与 matchesEvidence,在入口阻断空白 VerifiedScopeIdentity / receipt_ref,并要求 oracle_evidence、source、summary、counterexample 四类证据同时匹配 ref、role 与六元组 identity。
  3. 单测补齐: 在 tests/control_plane_ts/verifier_hook_contract.test.ts 第 108–145 行新增两条负向单测(跨角色/错引用/错作用域拒绝,以及空白身份不触发 readReceipt/readEvidence),使该文件单测从 5 条增至 7 条。

完整 PR 改动清单(相对基准 d38052695c2c8a2e67cdb2c1eb6f4c6651eabd4d,8 个文件,+478 / -2)

  1. 文档与索引(5 个文件,+122/-2): docs/architecture/rfcs/verifier-hook-co-design-v0.md(58 行)、docs/architecture/rfcs/verifier-hook-co-design-v0.zh-CN.md(58 行)、docs/architecture/rfcs/README.md(+2 行,第 204–205 行)、docs/architecture/rfcs/STATUS.md(+2/-1)、docs/architecture/rfcs/STATUS.zh-CN.md(+2/-1)。
  2. 控制面 TypeScript 源码(2 个文件,+185/-0): loopx/control_plane/quota/turn_envelope.ts 第 74–77 行新增 QuotaGoalBoundaryReference(+4 行);新增 loopx/control_plane/turn_driver/verifier_hook_contract.ts(181 行)。
  3. TypeScript 单测(1 个文件,+171/-0): 新增 tests/control_plane_ts/verifier_hook_contract.test.ts(7 条单测),也是全仓唯一导入 verifier_hook_contract.ts 的文件。

关键代码讲解

  • matchesScope 与 matchesEvidence(loopx/control_plane/turn_driver/verifier_hook_contract.ts#L120-L132): matchesScope 校验六元组身份字段逐一相等;matchesEvidence 先用 hasReference(ref) 过滤空白字符串,再通过 reader.readEvidence(ref) 核验返回对象的 evidence.ref === ref、evidence.role === role 且 matchesScope(identity, evidence.identity),消除了上一轮只判断布尔可读性而允许角色互换或跨作用域借用的问题。
  • recommendVerifiedClose(loopx/control_plane/turn_driver/verifier_hook_contract.ts#L136-L167): 入口第 140–144 行先核验 request.identity 六个字段和 request.receipt_ref 全量满足 hasReference(typeof ref === "string" && ref.trim().length > 0),否则直接返回 { action: "KeepRaw" },既不访问权威存储也不再把全空/空白身份折叠为 FoldToReceipt。通过入口后依次校验回执身份匹配、failed 分支的 counterexample 证据角色绑定,以及 passed + !open_obligations + overlap === "low" + 三类证据全部通过 matchesEvidence。残留结构问题是该函数及其导出的 14+ 个类型至今无任何生产路径调用,且 FoldToReceipt 归属在 turn_driver/ 而非 progressive_context.ts。
  • QuotaGoalBoundaryReference(loopx/control_plane/quota/turn_envelope.ts#L74-L77): 位于既有生产常量 QUOTA_GOAL_BOUNDARY_ARTIFACT 下方,但全仓除 verifier_hook_contract.ts 第 3 行以 import type 引入外没有任何生产者或运行时读取方,甚至 verifier_hook_contract.test.ts 第 152 行也是直接内联 { capture_sha256, pointer: "/goal_boundary" } as const 字面量并调用 context_selection.ts 的 capturedContextSelection。
  • DomainPluginCandidate 与 DomainPluginTrial(loopx/control_plane/turn_driver/verifier_hook_contract.ts#L169-L181): 定义了 staging / trial / adopted / retired 四态联合类型,不仅没有任何生产调用方,连 verifier_hook_contract.test.ts 也未引用它们,同时与既有能力组合模块 goal_capability_organization.ts 平行分叉。

规范基线映射(spec_basis)

依据基准 d38052695c2c8a2e67cdb2c1eb6f4c6651eabd4d 上的规范入口 docs/architecture/rfcs/README.md(及其引用的 docs/development/README.md Scope-Fit Review 与 history-working-set-context-policy-v0.md §5.1)映射精确头 72c77567b09f6ad69a0b56189db3ab3184086609:

  • RFC-INDEX-HEADER -> implemented:双语 RFC 头部已补齐 Accepted (upon merge)、Supersedes / closes 与 semantic mirror / 语义镜像,STATUS.md / STATUS.zh-CN.md 已同步为 Accepted (53),generate_rfc_status_index.py --check 与 docs-governance-smoke.py 均在当前头实测通过。
  • RFC-BILINGUAL-PAIR -> implemented:英文与中文 RFC 镜像成对更新,并通过 scripts/check_rfc_bilingual.py --base origin/main --head HEAD。
  • RFC-MATURITY-SEPARATION -> not_met:docs/architecture/rfcs/README.md 第 50–56 行要求以 Delivery on main 与 Current boundary 明确隔离设计接受状态与实际交付边界,docs/development/README.md 第 131–137 行明确禁止将无真实生产调用方、仅靠单测覆盖的新模块留置控制面生产源码目录;当前头 README.md 第 204–205 行仍缺这两个成熟度说明条目,RFC 第 5 行标注 Delivery maturity: TypeScript contract,生产目录仍保留 185 行零调用方的 .ts 代码与未接入拥有者的 FoldToReceipt / DomainPluginTrial 类型。

对主干的风险 / Risks

阻塞发现(Findings)

  1. [P1 · 阻塞] 控制面生产目录保留零生产调用方的 verifier_hook_contract.ts 与 QuotaGoalBoundaryReference 并分裂既有拥有者(原 Finding #2 仍未修复)

    • Problem: loopx/control_plane/turn_driver/verifier_hook_contract.ts(181 行)与 loopx/control_plane/quota/turn_envelope.ts 新增的 QuotaGoalBoundaryReference(第 74–77 行)仍然没有任何生产运行时调用者,且把属于 progressive_context.ts 与 goal_capability_organization.ts 的概念放在 turn_driver/。
    • Evidence: 在精确头 72c77567b0 执行全仓搜索 rg -n "verifier_hook_contract|QuotaGoalBoundaryReference|recommendVerifiedClose|negotiateVerifierHooks|verifier_hook" loopx tests packages apps scripts examples:生产代码仅有 turn_envelope.ts:74(定义)、verifier_hook_contract.ts:3(import type 引入 QuotaGoalBoundaryReference)、verifier_hook_contract.ts:20,136(导出函数定义),所有生产运行时模块(turn_driver/executor.py、turn_driver/loop_controller.ts、quota/progressive_context.ts、quota/adaptive_children.ts、capabilities/goal_capability_organization.ts、packages/、apps/)调用数为 0;唯一导入方仅是 tests/control_plane_ts/verifier_hook_contract.test.ts,其中第 169–181 行的 DomainPluginCandidate / DomainPluginTrial 连测试也未引用。同时 history-working-set-context-policy-v0.md §5.1 已将 FoldToReceipt / KeepRaw 归属 progressive_context.ts,goal_capability_organization.ts 已拥有 goal_capability_improvement_plan_v0。
    • Impact: 违反 scope_fit(无活跃生产调用方的纯测试覆盖模块不应进入生产路径,且无仓库/拥有者接受的 coverage-only 契约记录)、repository_reuse(unjustified_duplication)与 change_proportionality(simplify_now),会在没有真实消费者验证接口形状前冻结未接入的导出与双份生命周期类型。
    • Fix: 选择两条清晰路径之一完成收口:(a) 最简纯 RFC 方案(推荐): 移除 loopx/control_plane/turn_driver/verifier_hook_contract.ts、tests/control_plane_ts/verifier_hook_contract.test.ts 与 turn_envelope.ts 第 74–77 行无消费类型 QuotaGoalBoundaryReference,保留已过治理检查的双语 RFC 与 STATUS.md(若需示意签名可留在 RFC 正文中);或 (b) 端到端最小接线方案: 为 negotiateVerifierHooks / recommendVerifiedClose 接入至少一条真实生产读回路径(如 progressive_context.ts 与宿主能力协商读回),将 FoldToReceipt / KeepRaw 放回 progressive_context.ts,并删除零引用孤立类型 DomainPluginCandidate / DomainPluginTrial。
  2. [P2 · 阻塞(语义与交付边界隔离)] docs/architecture/rfcs/README.md 缺少 Delivery on main / Current boundary 说明,与 Delivery maturity: TypeScript contract 及 adopted/retired 命名不匹配

    • Problem: 新增 RFC 在索引页与成熟度声明上未按仓库约定隔离“已接受的设计提案”与“零生产调用方的当前现实”。
    • Evidence: docs/architecture/rfcs/README.md 第 50–56 行明确定义 Delivery on main 与 Current boundary 用来说明真实落地成熟度,第 190–220 行的同级 RFC 均包含这两项列表,唯独第 204–205 行的 [Verifier Hook Co-Design v0] 缺失;同时 verifier-hook-co-design-v0.md 第 5 行标注 Delivery maturity: TypeScript contract,verifier_hook_contract.ts 第 177–181 行导出 adopted / retired 阶段类型,但当前分支生产运行时调用为 0。
    • Impact: 导致 authority_semantics(命名/成熟度表述高于实际零运行代码能力)与 RFC-MATURITY-SEPARATION 不满足。
    • Fix: 在 docs/architecture/rfcs/README.md 第 204–205 行补齐 - **Delivery on \main`:** Proposal only; no runtime verifier hook adapter or caller is wired.与- Current boundary: ...;若按 Finding 1(a) 移除 .ts雏形,将verifier-hook-co-design-v0.md第 5 行及中文第 5 行同步改为Proposal(或若按 1(b) 接线,如实写明仅接线的精确范围),并重跑 generate_rfc_status_index.py --check与docs-governance-smoke.py`。

前轮修复确认与边界隔离检查

  • 已修复项复核:
    • scripts/generate_rfc_status_index.py --check:由 1b6514a6c1 的 exit 1 变为 PASS(exit 0)。
    • examples/docs-governance-smoke.py:由 1b6514a6c1 的 AssertionError 变为 PASS(docs-governance-smoke ok)。
    • recommendVerifiedClose 空白身份反例探测:传入全空/空白 VerifiedScopeIdentity 在 72c77567b0 实测返回 {"action":"KeepRaw"}(1b6514a6c1 曾误返回 FoldToReceipt),角色互换/错作用域/空引用负向单测均通过。
  • 默认关闭隔离(default_off_isolation): negotiateVerifierHooks({ enabled: false, pre_tool_use: true }, ...) 返回 null,且生产代码无任何路径导入 verifier_hook_contract.ts 或使用 QuotaGoalBoundaryReference,既有默认运行时行为保持不变(既有 TS 套件 175 条全部通过)。
  • 权限语义(authority_semantics): 尽管 RFC 声明观测不能篡改 C1/Todo/结算,但 Delivery maturity: TypeScript contract 与未测试零调用方的 DomainPluginTrial(adopted/retired)结合缺失的 README.md Delivery on main 声明,仍构成名实不符(misleading)。

语义与 CI 对齐

  • 语义词表扫描边界: scripts/generate_semantic_inventory.py --changed-from origin/main(基线 b375539271b4cb9f34386a77211a944ce6e05ffe)扫描 18 个快照报告 supported candidates: 0,examples/semantic-vocabulary-drift-smoke.py 通过(29/29 词表、56/56 拥有者符号均通过)。需提示 verifier_hook_contract.ts 使用内联 TS 字符串联合类型(tier、overlap、verdict、action、role、stage、kind、boundary),处于该脚本 AST 扫描盲区之外;如保留并接线 TS 代码,须与 progressive_context.ts 及 goal_capability_organization.ts 词表统一归口。
  • CI 策略说明(wait_for_ci: false): 本复审按仓库本地优先策略不轮询远端 GitHub Actions CI。canary premerge 执行 4/4 直接检查、9/9 目录金丝雀、8/8 风险烟雾与 1/1 公开边界检查全部通过(因缺少精确 diff 的 change-quality 回执返回 quality_receipt_missing,退出码 1)。

本地验证汇总(精确头 72c77567b09f6ad69a0b56189db3ab3184086609,wait_for_ci: false)

  • uv run --extra test python scripts/generate_rfc_status_index.py --check:PASS(exit 0)
  • uv run --extra test python examples/docs-governance-smoke.py:PASS(docs-governance-smoke ok)
  • uv run --extra test python scripts/check_rfc_bilingual.py --base origin/main --head HEAD:PASS
  • uv run --extra test python examples/semantic-vocabulary-drift-smoke.py:PASS(29/29 vocabularies, 56/56 owner symbols)
  • npm run typecheck:control-plane:PASS
  • node --no-warnings --experimental-sqlite --experimental-strip-types --test tests/control_plane_ts/verifier_hook_contract.test.ts:PASS(7/7 passed)
  • 关联 7 个 TS 套件联合执行(verifier_hook_contract、yardstick_decision、post_writeback_hook_transaction、context_delivery、progressive_context、turn_envelope、context_selection):PASS(182/182 passed)
  • 反例探测(recommendVerifiedClose 传入全空/空白 VerifiedScopeIdentity):PASS(返回 {"action":"KeepRaw"},未调用 readReceipt/readEvidence)
  • uv run --extra test python -m ruff check tests/control_plane_ts loopx/control_plane/turn_driver loopx/control_plane/quota docs/architecture/rfcs:PASS
  • uv run --extra test python -m mypy:PASS(17 source files)
  • uv run --extra test loopx check --scan-path ...(全部 8 个改动文件公开边界扫描):PASS(0 errors, 5 checks)
  • uv run --extra test python -m pytest -q tests/canary/test_rfc_bilingual.py tests/architecture/test_rfc_status_index.py tests/architecture/test_contributor_task_board.py tests/architecture/test_top_level_module_budget.py tests/architecture/test_control_plane_import_boundaries.py tests/architecture/test_content_digest_single_owner.py tests/architecture/test_semantic_vocabulary_drift.py:PASS(460 passed)
  • uv run --extra test loopx canary premerge --from-git-diff --git-diff-base origin/main:direct_checks 4/4、catalog_canaries 9/9、risk_profile_smokes 8/8、public_boundary 1/1 均 PASS(总状态 quality_receipt_missing,退出码 1)
  • 全仓生产调用方检查(rg -n "verifier_hook_contract|QuotaGoalBoundaryReference|recommendVerifiedClose|negotiateVerifierHooks|verifier_hook" loopx tests packages apps scripts examples):FAIL(verifier_hook_contract.ts 与 QuotaGoalBoundaryReference 在生产路径均为 0 调用方,DomainPluginCandidate / DomainPluginTrial 连测试也未引用)

我的整体评价 / Verdict

对精确头 72c77567b09f6ad69a0b56189db3ab3184086609 复审后确认,上一轮指出的 RFC 索引与双语镜像治理失败 以及 recommendVerifiedClose 空白身份/跨角色证据校验缺陷 已完全修复并通过本地全部对应测试与脚本;但 生产源码目录仍保留零生产调用方、分裂 progressive_context.ts / goal_capability_organization.ts 所有权的 verifier_hook_contract.ts 与编译期占位 QuotaGoalBoundaryReference(且 docs/architecture/rfcs/README.md 缺少 Delivery on main / Current boundary 声明),按控制面 scope_fit、repository_reuse 与 change_proportionality 门禁仍需先完成收口,建议 REQUEST_CHANGES。

  • 长程与用户体验影响(outcome_impact): long_horizon 为 not_yet_proven(verifier_hook_contract.ts 与 QuotaGoalBoundaryReference 仍无任何生产运行时调用方,DomainPluginTrial 也无任何执行/测试路径,尚未在真实 Turn 或上下文投影链路上验证成效);user_experience 为 not_applicable,且 visual_review 为 not_applicable(本次复审覆盖全部 8 个改动文件,未修改任何前端、Dashboard、Chat 或 CLI 渲染界面,无 UI 截屏遗漏)。
  • 可观测语义与代码体积(observable_semantics / code_volume / change_proportionality): 现有主干运行时行为与 RFC 文档治理检查均已确认无退化(175 条既有 TS 单测、460 条架构测试、RFC 治理脚本全通过),但因新增 TS 契约毫无生产调用方,其真实路径可观测语义仍属 not_yet_proven。185 行控制面生产目录 TS 代码与 171 行测试在零生产调用方与零宿主适配器的状态下属 partly_avoidable / simplify_now / disproportionate,其中 compatibility_assessment 为 not_applicable(纯新增未调用文件与纯编译期类型,不涉及存量持久化协议兼容)。
  • 词表归属(semantic_alignment): 当前词表仍停留在未调用 TS 文件中的 local_only 内联字符串联合(AST 扫描报 0 候选),正式接入生产时必须并入 progressive_context.ts 与 goal_capability_organization.ts 的注册词表。
  • 下一轮复审与合入所需证据: (1) 按 Finding 1 抉择其一:要么删除未接线的 verifier_hook_contract.ts、verifier_hook_contract.test.ts 与未消费类型 QuotaGoalBoundaryReference,使本 PR 成为纯粹的架构设计 RFC;要么至少接入一条真实生产调用方、把 FoldToReceipt 归口 progressive_context.ts 并移除零引用平行类型 DomainPluginTrial;(2) 按 Finding 2 在 docs/architecture/rfcs/README.md 第 204–205 行补充 Delivery on main 与 Current boundary 描述并统一 RFC 第 5 行成熟度标签;(3) 重跑 generate_rfc_status_index.py --check、docs-governance-smoke.py、check_rfc_bilingual.py 与精确 diff 的 canary premerge。
  • 声明与新鲜度: 本评审在绑定信息不可用(session_not_bound)的情况下以 self_reported 声明模型身份;未等待也未查询远端 GitHub Actions CI(wait_for_ci: false)。当前结果仅对应精确提交 72c77567b09f6ad69a0b56189db3ab3184086609。

英文简短结论:
English verdict: REQUEST_CHANGES at head 72c7756. Two prior blockers from 1b6514a are verified resolved: (a) scripts/generate_rfc_status_index.py --check and examples/docs-governance-smoke.py now pass with updated Accepted RFC headers, semantic-mirror links, and STATUS.md; (b) recommendVerifiedClose now rejects blank VerifiedScopeIdentity fields up front (returning KeepRaw in counterfactual probe without calling readReceipt/readEvidence) and binds VerifiedScopeEvidence by ref, role, and identity (7/7 unit tests pass; 182/182 across 7 TS suites pass). However, two blockers remain: (1) scope_fit / repository_reuse / change_proportionality (simplify_now): loopx/control_plane/turn_driver/verifier_hook_contract.ts (181 lines) and QuotaGoalBoundaryReference in turn_envelope.ts still have zero runtime production callers across loopx/, packages/, apps/, and scripts/, split FoldToReceipt/KeepRaw ownership away from progressive_context.ts, and leave unused DomainPluginCandidate/DomainPluginTrial outside goal_capability_organization.ts; (2) authority_semantics / RFC-MATURITY-SEPARATION: docs/architecture/rfcs/README.md lacks Delivery on main / Current boundary lines while RFC line 5 states Delivery maturity: TypeScript contract. Local checks: check_rfc_bilingual.py, semantic-vocabulary-drift-smoke.py, typecheck:control-plane, ruff, mypy (17 files), loopx check (8 files), 460/460 architecture pytest cases, and canary premerge (4 direct + 18 selected checks; exit 1 only on quality_receipt_missing) all passed.

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewer: model_agent · gpt-6.2-sol · OpenAI · runtime_reported · xhigh

动机 / Motivation

维护者需要知道当前 Hook 方案可检验的范围,以及未来由哪个已有机制接续。上一头的 RFC 治理和空身份折叠问题已实测修复。 当前需要准确展示已交付范围,并避免把尚无实际调用方的能力试跑阶段固化成并行公共契约。

状态索引和语义镜像已修复。架构入口在两条相邻 RFC 之间新增 Verifier Hook 链接,正文已有成熟度说明,但入口缺少规范要求的主干交付状态和当前边界,读者须进入正文才能知道两种 helper 尚无生产接线。 本次评审限于 RFC 与 TypeScript 契约,运行态接线另需验证。

改动思路 / Approach

保留能独立验证的协商和折叠条件。C1 管权限和结算,独立 Oracle 负责证据,工作集接线后才应用建议。在 RFC 清单条目补充 Delivery on main 与 Current boundary,指明已验证的 TypeScript 契约和仍待验证的 Host、Oracle 与历史工作集接线。 保留 RFC 的生命周期设计,将两个未使用的类型随实际能力组合消费方一起引入,并复用已有 trial basis;当前可执行的 tier 协商和 VerifiedClose 拒绝条件可以保留。

新增的 DomainPluginCandidate 和 DomainPluginTrial 只在声明处出现,现有测试也没有使用。已有 capability trial planner 从版本、配置、effect、rollback 与反馈绑定判断是否建议试跑;新增 staging、trial、adopted、retired 类型只携带自由字符串引用,当前没有生产者把它与已有 trial basis 建立关系。

具体改动 / Changes

完整评审头 72c77567b09f6ad69a0b56189db3ab3184086609,基线 d38052695c2c8a2e67cdb2c1eb6f4c6651eabd4d,共 8 个文件,+478/-2。状态索引和语义镜像已修复。架构入口在两条相邻 RFC 之间新增 Verifier Hook 链接,正文已有成熟度说明,但入口缺少规范要求的主干交付状态和当前边界,读者须进入正文才能知道两种 helper 尚无生产接线。 新增的 DomainPluginCandidate 和 DomainPluginTrial 只在声明处出现,现有测试也没有使用。已有 capability trial planner 从版本、配置、effect、rollback 与反馈绑定判断是否建议试跑;新增 staging、trial、adopted、retired 类型只携带自由字符串引用,当前没有生产者把它与已有 trial basis 建立关系。 当前索引 · 基线规范 · 既有能力试跑 owner

关键代码讲解

  • rfc-active-governance。Active RFC、新双语镜像和生成索引均可正常验证。
  • verified-close-exact-identity。拒绝不完整身份后才读取票据,并按引用、角色及作用域绑定证据。36 项空值、空白或缺失身份检查以及 12 项证据绑定负例全部保留原文。完整匹配仍能返回折叠建议,关闭策略返回空。RFC 生成索引及语义镜像通过。 折叠建议
  • verifier-negotiation-off。关闭分支返回空,现有 C1 和历史权威路径未接到新 helper。
  • rfc-delivery-boundary。架构入口缺少交付范围和当前边界。 规范
  • capability-trial-ownership。未使用的试跑阶段类型与已有决策的证据绑定须收口。 新类型

对主干的风险 / Risks

[P2] 架构索引缺少当前交付边界。 状态索引和语义镜像已修复。架构入口在两条相邻 RFC 之间新增 Verifier Hook 链接,正文已有成熟度说明,但入口缺少规范要求的主干交付状态和当前边界,读者须进入正文才能知道两种 helper 尚无生产接线。 在 RFC 清单条目补充 Delivery on main 与 Current boundary,指明已验证的 TypeScript 契约和仍待验证的 Host、Oracle 与历史工作集接线。

[P2] 暂缓没有生产者或消费者的试跑类型。 新增的 DomainPluginCandidate 和 DomainPluginTrial 只在声明处出现,现有测试也没有使用。已有 capability trial planner 从版本、配置、effect、rollback 与反馈绑定判断是否建议试跑;新增 staging、trial、adopted、retired 类型只携带自由字符串引用,当前没有生产者把它与已有 trial basis 建立关系。 保留 RFC 的生命周期设计,将两个未使用的类型随实际能力组合消费方一起引入,并复用已有 trial basis;当前可执行的 tier 协商和 VerifiedClose 拒绝条件可以保留。

当前八文件增量的 119 项 TypeScript、类型检查、双语和文档治理通过。预合并 4 项直接检查、18 项选定检查通过。严格资格为 quality_receipt_missing,真实宿主与成果/成本尚待验证。

我的整体评价 / Verdict

请求有界修改。文档状态和精确身份两项旧缺陷已修复。现有证据支持保留已测试的纯决策契约。先补索引与未使用的试跑类型边界,再在各自 owner 下交付未来的运行态接线。

English verdict: REQUEST_CHANGES at 72c7756. The former governance and blank-identity failures are fixed. Document the actual main-branch boundary in the RFC index and keep the unconsumed domain-trial lifecycle out of production exports until it can reuse the existing trial basis. Both tested pure decisions can remain.

C1–C9 connect concrete refactors, real host adoption and complete-cost
qualification without changing defaults or launching experiments.
- [Verifier Hook Co-Design v0](verifier-hook-co-design-v0.md)
([中文版](verifier-hook-co-design-v0.zh-CN.md))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[P2] 状态索引和语义镜像已修复。架构入口在两条相邻 RFC 之间新增 Verifier Hook 链接,正文已有成熟度说明,但入口缺少规范要求的主干交付状态和当前边界,读者须进入正文才能知道两种 helper 尚无生产接线。 在 RFC 清单条目补充 Delivery on main 与 Current boundary,指明已验证的 TypeScript 契约和仍待验证的 Host、Oracle 与历史工作集接线。


// These observations index the existing portfolio and verifier owners. The
// solver can propose staging only. Activated versions are read from configuration.
export type DomainPluginTrial =

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[P2] 新增的 DomainPluginCandidate 和 DomainPluginTrial 只在声明处出现,现有测试也没有使用。已有 capability trial planner 从版本、配置、effect、rollback 与反馈绑定判断是否建议试跑;新增 staging、trial、adopted、retired 类型只携带自由字符串引用,当前没有生产者把它与已有 trial basis 建立关系。 保留 RFC 的生命周期设计,将两个未使用的类型随实际能力组合消费方一起引入,并复用已有 trial basis;当前可执行的 tier 协商和 VerifiedClose 拒绝条件可以保留。

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

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewer: model_agent · Gemini · Google DeepMind · self_reported

动机 / Motivation

在长程求解任务中,控制面与宿主维护者在启用多轮探索与独立验收时,往往只能在粗糙的 Stop-Hook 兜底验证与同步逐工具拦截之间二选一;缺乏跨宿主的四边界验证 Hook 协同契约,也缺乏“子作用域须经独立 Oracle 回执且满足低重叠后才折叠”的 VerifiedClose 约束,因此本 PR 试图把验证接入收敛到既有 C1 与历史上下文边界之下。

如果不做任何改动,外部宿主(如 Codex、Claude Code、DSH、Antigravity)上的验证探测、子作用域折叠以及领域快尺(yardstick)试跑仍各自依赖局部协议或散落脚本,既难对齐能力协商档位,也容易让未验证的代理结果或跨作用域回执污染主干上下文。

  • 受影响对象(affected_caller_or_operator): 接入宿主 Hook 生命周期(启动、里程碑、压缩/子作用域与停止边界)并消费独立验收回执的 LoopX 控制面、宿主适配器与实验评估维护者。
  • 前后对比场景(before_after_scenario): 改动前,不同宿主各自实现启动上下文恢复、里程碑采样、压缩后恢复与停止验收,子工作折叠与快尺试跑缺少统一的不变式边界;理想改进是先合入合规的双语架构 RFC 再在真实拥有者上接线落地,而当前 PR 在最新精确头 4a67ad5a110ed7b73b715e2315334aa462a9cc44 上虽进一步将 candidate_sha 收口为复用 content_digest.ts 的规范 sha256:<64 hex> 摘要校验,却完全未触动上一轮已经明确阻塞的两大问题——docs/architecture/rfcs/README.md 第 204–205 行依然缺少 Delivery on main 与 Current boundary 声明,且控制面生产目录仍保留零运行时调用方的 verifier_hook_contract.ts、仅作编译期导出的 QuotaGoalBoundaryReference、以及零测试零调用方的平行类型 DomainPluginCandidate / DomainPluginTrial(FoldToReceipt 亦未归口 progressive_context.ts)。
  • 可观测结果(observable_outcome): 相对上一轮头 72c77567b09f6ad69a0b56189db3ab3184086609,最新提交 4a67ad5a110ed7b73b715e2315334aa462a9cc44 在 RFC §3 与 recommendVerifiedClose 中复用 ENVELOPED_SHA256_PATTERN 拦截非摘要的分支名或标签(verifier_hook_contract.test.ts 增至 8/8 通过,反例探测均在读取权威前返回 KeepRaw);但上一轮审查 6011989660 的两项阻塞以及两条仍未解决的评审线程(README.md:205 缺失主干交付边界、verifier_hook_contract.ts:180 存在未消费的 DomainPluginTrial 类型)均原封不动存在,全仓生产路径对 verifier_hook_contract.ts 与 QuotaGoalBoundaryReference 仍只有 0 个运行时调用方。
  • 非目标(non_goals): 本次变更不改变 C1 准入、传输或结算所有权,不实现具体宿主适配器(Codex、DSH、Claude Code、Antigravity)运行时代码,不启用新默认开关,也不开展跨宿主或同宿主模型效果/缓存对照实验。

改动思路 / Approach

本次对精确头 4a67ad5a110ed7b73b715e2315334aa462a9cc44 执行全包独立复审(rereview_pull_request_exact_head),先评估最新增量提交 Bind verified close to immutable candidate digests,再对 6011989660 及现有未解决评审线程涉及的全量阻塞项进行逐一复核。

本轮增量改动评估(72c77567b0 -> 4a67ad5a11):
作者将 VerifiedScopeIdentity.candidate_sha 明确约束为 sha256:<64 lowercase hexadecimal digits> 不可变内容摘要,并在 verifier_hook_contract.ts 第 3、144 行复用既有单一规范所有者 loopx/control_plane/content_digest.ts 的 ENVELOPED_SHA256_PATTERN(在 readReceipt / readEvidence 之前拒绝分支名、标签、裸 64 位十六进制串等输入),同时将 RFC 第 44 行双语同步并补齐第 8 条单测。这部分摘要单一所有者复用和防误读拒绝逻辑本身严谨且实测通过。

然而从架构与比例性(architecture_assessment)及仓库 Scope-Fit Review 规则审视当前完整精确头,最新提交并未解决上一轮已经指出的两项阻塞与两条未解决线程:loopx/control_plane/turn_driver/verifier_hook_contract.ts(184 行)与 loopx/control_plane/quota/turn_envelope.ts 新增的 QuotaGoalBoundaryReference(第 74–77 行)在全仓生产代码中依然只有 0 个运行时调用方,FoldToReceipt / KeepRaw 仍停留在 turn_driver/ 而未接入既有上下文策略拥有者 quota/progressive_context.ts,DomainPluginCandidate / DomainPluginTrial(第 172–184 行)依然没有任何测试或生产调用方并平行重复 capabilities/goal_capability_organization.ts,且 docs/architecture/rfcs/README.md 第 204–205 行仍缺少 Delivery on main / Current boundary 边界说明;因此本 PR 仍不能合入,应先移除未接线的生产 TS 代码、单测与未消费类型以纯 RFC 落地(或在当前 PR 中至少接入真实生产调用方、归口拥有者并删除孤立类型),同时在 README.md 补全交付成熟度边界。 当前 PR 边界(current_pr_boundary):对当前设计阶段的 PR 而言,唯一干净可立即合入的边界是“保留已通过治理检查与摘要约束对齐的双语 RFC 与 STATUS.md 索引,在 docs/architecture/rfcs/README.md 第 204–205 行补全 Delivery on main: Proposal only 与 Current boundary,并把零生产调用方的 verifier_hook_contract.ts、单测及占位类型 QuotaGoalBoundaryReference 移出生产源码目录直到真实宿主或 progressive_context.ts 调用方同步落地”(或者相反地在保留源码时至少打通一条真实生产调用方、将 FoldToReceipt 归口 progressive_context.ts 并删除未消费的 DomainPluginCandidate / DomainPluginTrial)。

与既有实现对比,本轮作者在 verifier_hook_contract.ts 第 3 行正确复用了 ../content_digest.ts 的 ENVELOPED_SHA256_PATTERN(避免正则分叉,test_content_digest_single_owner.py 通过),但围绕核心业务所有权的关键结构分裂仍然未变:QUOTA_GOAL_BOUNDARY_ARTIFACT 在 loopx/control_plane/quota/adaptive_children.ts 有真实生产消费而 QuotaGoalBoundaryReference 为 0 运行时调用;history-working-set-context-policy-v0.md §5.1 指定的 FoldToReceipt / KeepRaw 所有者是 progressive_context.ts 而非 turn_driver/;capabilities/goal_capability_organization.ts 已拥有试跑决策逻辑,而 DomainPluginCandidate / DomainPluginTrial 仍滞留在 verifier_hook_contract.ts 尾部无任何消费者。

提案边界 RFC 设计职责 4a67ad5a11 代码与文档现状 既有所属拥有者与差距
Start / resume 通过原始 C1 capture 摘要与 /goal_boundary 读取作用域与停止条件 turn_envelope.ts 新增纯类型 QuotaGoalBoundaryReference(0 运行时调用),测试直接调用 capturedContextSelection adaptive_children.ts 已消费 QUOTA_GOAL_BOUNDARY_ARTIFACT,新类型仍无生产调用方
Milestone probe 异步采样并回传平台期/快尺反转 仅联合类型 VerifierTransition(无生产实现) yardstick_decision.ts / stride_policy.ts
Compaction / subscope sha256:<64 hex> 不可变 candidate_sha、非空作用域与角色绑定的 FoldToReceipt / KeepRaw 本轮复用 ENVELOPED_SHA256_PATTERN 校验逻辑正确且 8 条单测通过,但全仓 0 生产调用方 应归属 quota/progressive_context.ts(history-working-set-context-policy-v0.md §5.1)
Stop / Domain plugin 独立 Oracle 验收及内容寻址试跑准入 DomainPluginCandidate / DomainPluginTrial(第 172–184 行)0 生产调用方且 0 测试引用 平行重复 capabilities/goal_capability_organization.ts(未解决线程 README 同步滞后)
RFC 索引治理 区分设计接受状态与 main 上真实交付边界 STATUS.md 与双语治理检查通过,但 README.md:204-205 仍缺 Delivery on main / Current boundary docs/architecture/rfcs/README.md 第 50–56、204–205 行

具体改动 / Changes

上一轮审查至本次精确头的增量变化(72c77567b09f6ad69a0b56189db3ab3184086609..4a67ad5a110ed7b73b715e2315334aa462a9cc44)

增量提交(Bind verified close to immutable candidate digests)修改 4 个文件(+28 / -4):

  1. 双语 RFC 摘要格式收敛: docs/architecture/rfcs/verifier-hook-co-design-v0.md 与 .zh-CN.md 第 44 行明确 candidate_sha 为 sha256:<64 lowercase hexadecimal digits>(sha256:<64 位小写十六进制字符>),并在读取回执前检查格式,分支名、标签等非摘要标识保持 KeepRaw。
  2. 复用单一摘要正则拥有者: loopx/control_plane/turn_driver/verifier_hook_contract.ts 第 3 行导入 ../content_digest.ts 的 ENVELOPED_SHA256_PATTERN,第 75 行补充 JSDoc,第 144 行在调用 reader.readReceipt 之前执行 ENVELOPED_SHA256_PATTERN.test(expected.candidate_sha)。
  3. 补充负向单测: tests/control_plane_ts/verifier_hook_contract.test.ts 更新合法夹具 candidate_sha 为 "sha256:" + "a".repeat(64),并新增第 8 条单测验证 "main"、"candidate:26"、裸 64 位 hex、63 位 hex、非 hex 与大写 hex 均在不触及 readReceipt/readEvidence 的前提下返回 KeepRaw。
  4. 未处理的上一轮阻塞与未解决线程: 未修改 docs/architecture/rfcs/README.md(对应上一轮 Finding #2 与未解决线程);未移除也未接线 verifier_hook_contract.ts、QuotaGoalBoundaryReference 及未使用的 DomainPluginCandidate / DomainPluginTrial(对应上一轮 Finding #1 与未解决线程)。

完整 PR 改动清单(相对基准 d38052695c2c8a2e67cdb2c1eb6f4c6651eabd4d,8 个文件,+506 / -2)

  1. 文档与索引(5 个文件,+122/-2): docs/architecture/rfcs/verifier-hook-co-design-v0.md(58 行)、docs/architecture/rfcs/verifier-hook-co-design-v0.zh-CN.md(58 行)、docs/architecture/rfcs/README.md(+2 行,第 204–205 行)、docs/architecture/rfcs/STATUS.md(+2/-1)、docs/architecture/rfcs/STATUS.zh-CN.md(+2/-1)。
  2. 控制面 TypeScript 源码(2 个文件,+188/-0): loopx/control_plane/quota/turn_envelope.ts 第 74–77 行新增 QuotaGoalBoundaryReference(+4 行);新增 loopx/control_plane/turn_driver/verifier_hook_contract.ts(184 行)。
  3. TypeScript 单测(1 个文件,+196/-0): 新增 tests/control_plane_ts/verifier_hook_contract.test.ts(8 条单测),是全仓唯一导入 verifier_hook_contract.ts 的文件。

关键代码讲解

  • ENVELOPED_SHA256_PATTERN 复用与 recommendVerifiedClose 入口门控(loopx/control_plane/turn_driver/verifier_hook_contract.ts#L1-L4, L138-L147): 复用 content_digest.ts 第 2 行的 /^sha256:[0-9a-f]{64}$/,在读取回执和证据前先确认 request.identity 六字段全部非空白、expected.candidate_sha 匹配 ENVELOPED_SHA256_PATTERN 且 request.receipt_ref 非空白,不满足直接返回 { action: "KeepRaw" },避免把可变分支名/tag 误当不可变候选摘要。
  • 尚未接线的控制面模块与类型集合(loopx/control_plane/turn_driver/verifier_hook_contract.ts#L1-L184 & loopx/control_plane/quota/turn_envelope.ts#L74-L77): 全文件 negotiateVerifierHooks、recommendVerifiedClose、QuotaGoalBoundaryReference 仍无任何生产调用方;尾部的 DomainPluginCandidate / DomainPluginTrial(第 172–184 行)甚至没有任何测试引用。

规范基线映射(spec_basis)

依据基准 d38052695c2c8a2e67cdb2c1eb6f4c6651eabd4d 上的规范入口 docs/architecture/rfcs/README.md(及其引用的 docs/development/README.md Scope-Fit Review 与 history-working-set-context-policy-v0.md §5.1)映射精确头 4a67ad5a110ed7b73b715e2315334aa462a9cc44:

  • RFC-INDEX-HEADER -> implemented:双语 RFC 头部已补齐 Accepted (upon merge)、Supersedes / closes 与 semantic mirror / 语义镜像,STATUS.md / STATUS.zh-CN.md 已同步为 Accepted (53),generate_rfc_status_index.py --check 与 docs-governance-smoke.py 均通过。
  • RFC-BILINGUAL-PAIR -> implemented:英文与中文 RFC 镜像成对更新(包括第 44 行摘要格式补充),scripts/check_rfc_bilingual.py --base origin/main --head HEAD 通过。
  • RFC-MATURITY-SEPARATION -> not_met:docs/architecture/rfcs/README.md 第 50–56 行要求在索引条目以 Delivery on main 与 Current boundary 隔离设计提案与已实现边界,docs/development/README.md 第 131–137 行禁止在没有真实调用方时把仅靠单测覆盖的新模块留置控制面生产源码目录;当前头 README.md 第 204–205 行仍缺这两项说明,RFC 第 5 行仍标注 Delivery maturity: TypeScript contract,且生产目录仍保留 188 行零生产调用方的 TS 代码、未归口的 FoldToReceipt 与零测试的 DomainPluginTrial 类型。

对主干的风险 / Risks

阻塞发现(Findings)

  1. [P1 · 阻塞] 控制面生产目录仍保留零生产调用方的 verifier_hook_contract.ts、QuotaGoalBoundaryReference 与零测试平行类型 DomainPluginTrial(原 Finding #1 未修复)

    • Problem: 尽管第 4 次提交强化了 candidate_sha 摘要格式检查,但 loopx/control_plane/turn_driver/verifier_hook_contract.ts(184 行)与 loopx/control_plane/quota/turn_envelope.ts 第 74–77 行的 QuotaGoalBoundaryReference 在全仓生产代码中依然没有任何运行时调用方,且 FoldToReceipt 与 DomainPluginTrial 继续脱离各自既有的真实拥有者。
    • Evidence: 在精确头 4a67ad5a110ed7b73b715e2315334aa462a9cc44 执行全仓检索 rg -n "verifier_hook_contract|QuotaGoalBoundaryReference|recommendVerifiedClose|negotiateVerifierHooks|DomainPluginTrial|DomainPluginCandidate" loopx tests packages apps scripts:命中仅限于 verifier_hook_contract.ts 自身导出、turn_envelope.ts:74(纯类型定义)与 tests/control_plane_ts/verifier_hook_contract.test.ts,全仓生产代码调用数为 0;其中 DomainPluginCandidate / DomainPluginTrial(第 172–184 行)连单测也完全没有引用。同时 history-working-set-context-policy-v0.md §5.1 已明确将 KeepRaw / FoldToReceipt 归属给 quota/progressive_context.ts,capabilities/goal_capability_organization.ts 已拥有试跑决策逻辑,远端评审线程 verifier_hook_contract.ts:180 亦保持未解决且未过时状态。
    • Impact: 违反 scope_fit(无活跃生产调用方的纯测试模块不应滞留生产路径)、repository_reuse(unjustified_duplication)与 change_proportionality(simplify_now),在没有真实生产消费者前提前冻结跨模块导出与并行生命周期类型。
    • Fix: 二选一彻底收口:(a) 最简纯 RFC 方案(推荐): 删除 loopx/control_plane/turn_driver/verifier_hook_contract.ts、tests/control_plane_ts/verifier_hook_contract.test.ts 与 turn_envelope.ts 第 74–77 行无消费类型 QuotaGoalBoundaryReference,保留已过治理检查的双语 RFC 与 STATUS.md;或 (b) 端到端最小接线方案: 将 negotiateVerifierHooks / recommendVerifiedClose 真正接入至少一条生产路径(如 progressive_context.ts 与宿主能力读回),将 FoldToReceipt / KeepRaw 归口 progressive_context.ts,并移除零调用零测试的 DomainPluginCandidate / DomainPluginTrial。
  2. [P2 · 阻塞] docs/architecture/rfcs/README.md 仍缺少 Delivery on main / Current boundary 声明,成熟度边界与命名语义失配(原 Finding #2 未修复)

    • Problem: 新增 RFC 在架构总索引条目中仍缺少仓库规范要求的当前主干交付范围与边界说明,使 README.md 与 Delivery maturity: TypeScript contract / adopted 生命周期命名之间继续存在口径错位。
    • Evidence: docs/architecture/rfcs/README.md 第 50–56 行明确定义 Delivery on main 与 Current boundary 用途,第 190–220 行同级条目均成对声明这两行,而第 204–205 行的 [Verifier Hook Co-Design v0] 仍为空白链接(对应远端未解决且未过时的评审线程);同时 verifier-hook-co-design-v0.md 第 5 行仍标注 Delivery maturity: TypeScript contract,verifier_hook_contract.ts 第 180–184 行仍导出无生产调用方的 adopted / retired 阶段。
    • Impact: 不满足 RFC-MATURITY-SEPARATION 与 authority_semantics(misleading),读者在索引入口无法获知当前在 main 上零生产接入的真实状态。
    • Fix: 在 docs/architecture/rfcs/README.md 第 204–205 行补充 - **Delivery on \main`:**与- Current boundary:两行(若采纳 Finding 1(a) 移出.ts文件则标为Proposal only,且同步将 EN/ZH RFC 第 5 行改为 Proposal;若采纳 1(b) 接线则如实写出已接线的精确范围与未验证项),随后重跑 generate_rfc_status_index.py --check与docs-governance-smoke.py`。

边界隔离与语义对齐

  • 本轮增量亮点(candidate_sha 摘要校验): recommendVerifiedClose 复用 content_digest.ts 的 ENVELOPED_SHA256_PATTERN 在进入存储读取前拒绝非规范 sha256:<64 hex> 字符串(5 条 digest_probe 反例均输出 {"action":"KeepRaw"} 且未访问权威存储),test_content_digest_single_owner.py(包含于 460 条架构测试)通过。
  • 默认关闭隔离(default_off_isolation): negotiateVerifierHooks({ enabled: false, pre_tool_use: true }, ...) 返回 null,生产代码对 verifier_hook_contract.ts 与 QuotaGoalBoundaryReference 调用数为 0,现有运行时默认行为保持完全隔离(既有 175 条控制面 TS 单测全通过)。
  • 语义词表扫描边界: scripts/generate_semantic_inventory.py --changed-from origin/main(基线 4ae2844cd03dd2d027eda68d5b870e2b652f6ac3)扫描 25 个快照报告 supported candidates: 0,examples/semantic-vocabulary-drift-smoke.py 通过(29/29 词表、56/56 拥有者符号)。因脚本仅扫描 Python Enum/Literal/集合与 TS as const 数组,若后续保留并接线 TS 代码,须将状态字面量与既有拥有者词表对齐。
  • CI 策略说明(wait_for_ci: false): 不等待或查询远端 GitHub Actions CI;本地 canary premerge 4 项直接检查、9 项金丝雀、8 项风险烟雾与 1 项公开边界扫描全通过(因缺乏精确 diff 的 change-quality 回执返回 quality_receipt_missing,退出码 1)。

本地验证汇总(精确头 4a67ad5a110ed7b73b715e2315334aa462a9cc44,wait_for_ci: false)

  • uv run --extra test python scripts/generate_rfc_status_index.py --check:PASS(exit 0)
  • uv run --extra test python examples/docs-governance-smoke.py:PASS(docs-governance-smoke ok)
  • uv run --extra test python scripts/check_rfc_bilingual.py --base origin/main --head HEAD:PASS
  • uv run --extra test python examples/semantic-vocabulary-drift-smoke.py:PASS(29/29 vocabularies, 56/56 owner symbols)
  • npm run typecheck:control-plane:PASS
  • node --no-warnings --experimental-sqlite --experimental-strip-types --test tests/control_plane_ts/verifier_hook_contract.test.ts:PASS(8/8 passed)
  • 关联 8 个 TS 套件联合执行(verifier_hook_contract、yardstick_decision、post_writeback_hook_transaction、context_delivery、progressive_context、turn_envelope、context_selection、content_digest):PASS(183/183 passed)
  • digest_probe 反例探测(""、" "、"main"、"candidate:26"、裸 64 位 hex):PASS(5/5 返回 {"action":"KeepRaw"} 且 0 权威读取)
  • uv run --extra test python -m ruff check tests/control_plane_ts loopx/control_plane/turn_driver loopx/control_plane/quota docs/architecture/rfcs:PASS
  • uv run --extra test python -m mypy:PASS(17 source files)
  • uv run --extra test loopx check --scan-path ...(全部 8 个改动文件公开边界扫描):PASS(0 errors, 5 checks)
  • uv run --extra test python -m pytest -q tests/canary/test_rfc_bilingual.py tests/architecture/test_rfc_status_index.py tests/architecture/test_contributor_task_board.py tests/architecture/test_top_level_module_budget.py tests/architecture/test_control_plane_import_boundaries.py tests/architecture/test_content_digest_single_owner.py tests/architecture/test_semantic_vocabulary_drift.py:PASS(460 passed in 59.26s)
  • uv run --extra test loopx canary premerge --from-git-diff --git-diff-base origin/main:direct_checks 4/4、catalog_canaries 9/9、risk_profile_smokes 8/8、public_boundary 1/1 均 PASS(总状态 quality_receipt_missing,退出码 1)
  • 全仓生产调用方扫描(rg -n "verifier_hook_contract|QuotaGoalBoundaryReference|recommendVerifiedClose|negotiateVerifierHooks|DomainPluginTrial|DomainPluginCandidate" loopx tests packages apps scripts):FAIL(verifier_hook_contract.ts 与 QuotaGoalBoundaryReference 均为 0 生产调用方,DomainPluginCandidate / DomainPluginTrial 连测试也未引用)

我的整体评价 / Verdict

对精确头 4a67ad5a110ed7b73b715e2315334aa462a9cc44 完成第 4 轮独立复审后确认,新提交补充的 candidate_sha 摘要格式门控复用 content_digest.ts 规范合理且本地全部 8 条单测与 460 条架构校验通过;但由于上一轮审查 6011989660 及两条尚未解决的评审线程所指核心问题——控制面生产源码目录仍保留 0 生产调用方且分裂拥有者的 verifier_hook_contract.ts / QuotaGoalBoundaryReference / DomainPluginTrial,以及 docs/architecture/rfcs/README.md 仍缺 Delivery on main / Current boundary 边界说明——均仍未修正,整体维持 REQUEST_CHANGES。

  • 长程与用户体验影响(outcome_impact): long_horizon 为 not_yet_proven(verifier_hook_contract.ts 与 QuotaGoalBoundaryReference 仍无任何生产运行时调用方,DomainPluginTrial 无任何测试或执行路径,尚无真实长程任务接线与成效证明);user_experience 为 not_applicable,且 visual_review 为 not_applicable(本次审查全部 8 个改动文件,未修改任何前端、Dashboard、Chat 或 CLI 渲染表面)。
  • 可观测语义与代码体积(observable_semantics / code_volume / change_proportionality): 现有主干运行时(175 条既有 TS 单测、460 条架构测试)与 RFC 文档治理检查均确认无退化,但新增 TS 契约毫无生产路径调用,故 observable_semantics 为 not_yet_proven。188 行控制面生产目录 TS 代码与 196 行测试在零生产调用方条件下仍属 partly_avoidable / simplify_now / disproportionate,compatibility_assessment 为 not_applicable(纯新增未调用文件与编译期类型,无存量协议兼容变更)。
  • 词表归属(semantic_alignment): candidate_sha 正则已正确复用 content_digest.ts 单一所有者;其余内联 TS 状态字面量仍属未接入生产的 local_only 类型,正式接线时需并入 progressive_context.ts 与 goal_capability_organization.ts 词表。
  • 下一轮复审与合入所需证据: (1) 解决未决阻塞线程与 Finding 1:删除零生产调用方的 verifier_hook_contract.ts、verifier_hook_contract.test.ts 与未消费类型 QuotaGoalBoundaryReference 以纯 RFC 合入,或者接入真实生产调用方、将 FoldToReceipt 归口 progressive_context.ts 并移除零测试零调用的 DomainPluginCandidate / DomainPluginTrial;(2) 解决未决线程与 Finding 2:在 docs/architecture/rfcs/README.md 第 204–205 行补充 Delivery on main 与 Current boundary 并校准 RFC 第 5 行成熟度声明;(3) 重跑 generate_rfc_status_index.py --check、docs-governance-smoke.py、check_rfc_bilingual.py 与精确 diff 的 canary premerge。
  • 声明与新鲜度: 本评审在绑定信息不可用(session_not_bound)的情况下以 self_reported 声明模型身份;未等待也未查询远端 GitHub Actions CI(wait_for_ci: false)。当前结果仅对应精确提交 4a67ad5a110ed7b73b715e2315334aa462a9cc44。

英文简短结论:
English verdict: REQUEST_CHANGES at head 4a67ad5. Commit 4a67ad5 cleanly reuses ENVELOPED_SHA256_PATTERN from content_digest.ts to reject non-digest candidate_sha strings before reading authority (8/8 unit tests, 183/183 across 8 TS suites, 5/5 digest counterfactual probes, generate_rfc_status_index.py --check, docs-governance-smoke.py, check_rfc_bilingual.py, semantic-vocabulary-drift-smoke.py, ruff, mypy, loopx check, 460/460 pytest checks, and canary premerge 4 direct + 18 selected checks all pass; exit 1 only on quality_receipt_missing). However, both remaining blockers from review 6011989660 and both open review threads remain unaddressed: (1) scope_fit / repository_reuse / change_proportionality (simplify_now): verifier_hook_contract.ts (184 lines) and QuotaGoalBoundaryReference in turn_envelope.ts still have zero runtime production callers, FoldToReceipt/KeepRaw sits outside progressive_context.ts, and DomainPluginCandidate/DomainPluginTrial remain unreferenced even in tests outside goal_capability_organization.ts; (2) RFC-MATURITY-SEPARATION / authority_semantics: docs/architecture/rfcs/README.md lines 204-205 still lack Delivery on main / Current boundary lines while RFC line 5 states Delivery maturity: TypeScript contract.

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

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewer: model_agent · gpt-6.2-sol · OpenAI · runtime_reported · xhigh

动机 / Motivation

面向接入宿主 Hook、需要保留子工作原始证据的控制面维护者。宿主使用独立回执折叠子工作时,需要在证据不可用或下轮仍有依赖时保留原始上下文。同一个合格回执和读取请求,返回 undefined 时得到 KeepRaw,实际文件读取抛出 ENOENT 时错误穿过推荐器。RFC §3 规定不可读引用须保留原始内容。 规范 digest 的检查先于证据读取;普通路径未激活新模块。 本次验证 RFC、源合同与实际本机文件错误。安装 Host Hook、模型缓存及匹配成本成果未实测。提案将验证归入 C1、历史工作集和 capability portfolio。实际宿主接入及匹配成本下的成果仍待验证。 历史工作集规范

改动思路 / Approach

C1 管控制面和结算;history/progressive 管上下文,portfolio 管采用。新增合同和 trial 类型尚未接入。 Propose RFC and qualify a minimal existing consumer before claiming a production source contract. 先交付双语设计并指明首个可验收的读取者。若本轮保留可执行切片,由已有 progressive context owner 接入读回、不可用回退和原回执重放。逐工具 Hook 仍须显式启用。

具体改动 / Changes

按现有投影所有权、证据不可用、关闭时保持现有行为三条核对。完整核查 f9aa58e 对共同祖先 d380526 的 9 个文件,+508/−2。相对前次评审,新校验已修复无版本候选。独立验证中,旧头对无版本输入读取四次并推荐折叠,当前头零次读取并返回 KeepRaw。前后均接受规范且证据匹配的 digest。最新提交只在架构测试登记两个 canonical digest 消费点,运行代码和 RFC 与前一头逐字节相同。 前一头到当前头

关键代码讲解

  • negotiateVerifierHooks 依据显式开关与已观察到的能力决定档位。关闭时没有新增路径,逐工具能力还需明确启用。 档位协商
  • recommendVerifiedClose 先查 digest,再根据作用域读取独立回执和 evidence。matchesEvidence 直接调用证据读者。 证据路径

对主干的风险 / Risks

[P2] 实际读取错误绕过 KeepRaw。 同一个合格回执和读取请求,返回 undefined 时得到 KeepRaw,实际文件读取抛出 ENOENT 时错误穿过推荐器。RFC §3 规定不可读引用须保留原始内容。 若错误归一化由适配器负责,请在首个真实读取者中明确执行并补回归。 规范

[P2] 新合同没有可验收的现有消费者。 新推荐器只由新增测试调用。DomainPluginTrial 没有 producer 或 consumer。建议本轮交付双语 RFC,或让一个已有 history owner 从实际受控来源读回原结果。 既有入口 试跑类型 前一头评审

[P2] 手工索引缺少交付与范围。 请补 Delivery on main 和 Current boundary,明确合同、待接入 Host 及首个验收切片。自动索引检查通过,手工条目仍只有两个链接。 当前条目

当前头含新合同及 canonical digest owner 的 156 项检查、TypeScript typecheck、RFC 双语、生成索引和 Docs Governance 通过。相同现有 owner 检查基线和候选各 131 项通过。 独立真实文件错误反例失败。本次验证 RFC、源合同与实际本机文件错误。安装 Host Hook、模型缓存及匹配成本成果未实测。

我的整体评价 / Verdict

请求修改。保留当前候选 digest 的修复。先明确实际读取失败的处理和已有 owner 的接入边界,再决定保留代码或缩到纯 RFC,同时让目录准确说明交付阶段。

English verdict: REQUEST_CHANGES at f9aa58e. The digest fix works. Actual reader failures still escape KeepRaw, the production contract has no live consumer, and the manual RFC entry lacks delivery and boundary rows.

ref: string,
role: VerifiedScopeEvidence["role"],
): boolean {
const evidence = hasReference(ref) ? reader.readEvidence(ref) : undefined;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[P2] 文件读取失败需要走 KeepRaw。使用同一条通过回执,证据读者返回 undefined 时会保留原始内容。读取缺失本地文件抛出 ENOENT 时,异常穿过推荐器。请在受控证据读取边界返回明确的不可用结果,并用该真实读取失败验证仍能保留原始内容。若由适配器转换,请在首个既有消费入口覆盖转换与读回。

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants