Repository navigation
docs,cli,control_plane: distill C1 ledgers and slim CLI context adapters - #8882
loopx-agent wants to merge 3 commits into
Conversation
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent; model=gpt-6.1-sol; provider=OpenAI; declaration=runtime_reported; effort=max.
Request changes conclusion (author-owned PR; GitHub blocks formal self-review)
审阅精确头 8c1b9b23e08fa38dba0de9870ade6f6b0396ad4c,实际目标为 codex/c1-work-contract-review-20261107,比较基准 e29bd8aa50b9aeba7cf30260bd55195e25c61f90。这不是直接面向 main 的独立 C1 验收。
动机 / Motivation
需要定位 C1 历史反例和维护原生 context recovery 的开发者与后续 Agent。原来同类预算、失败输出和恢复验证散落在多个辅助函数;现在共用小 helper,可减少下一次修复的同步点。独立 CLI 对照和回归验证支持 Python 去重,但四份历史账本被整体改写为短摘要,原记录没有保留为可达冷路径。该 PR 不完成 #8266 的统一契约切换、安装采用或真实模型与完整成本验收。修复历史保留后再判断此维护切片;#8266 的长期/安装和原始 quota 全成本缺口继续存在。不把代码量或测试数当成果收益。
改动思路 / Approach
预算钳制和“首个能容纳的输出”仍留在最近的 CLI reader owner;失败输出复用它们,原 capture/回执和恢复顺序不变。native history 只提取来源校验,全文与 selected resume 仍保留各自覆盖条件,TypeScript 仍是领域决策 owner。这些小 helper 的位置有真实 caller 依据,不必再增加状态、provider 或新兼容层。helper 继续位于最近 CLI/历史 reader owner,未新增领域决策或默认策略;文档保留问题由其既有材料 owner 单独修复。保留行为相同的 CLI/helper 维护切片;完整历史必须沿原合同继续可读。当前摘要可以另设入口,不必覆盖证据原件。
具体改动 / Changes
10 条路径、763 行新增/7660 行删除:5 个 Python 模块、4 份双语 ledger 和 1 个测试文件。测试删除的三段同名定义原本已被后面的定义覆盖;我逐个比较了实际生效函数 AST,内容完全相同。
关键代码讲解
quota_context_reader.py::_clamp_budget统一 page/output 取小值;非正预算的严格拒绝仍由原 caller 执行。quota_failure_report.py::_bounded_quota_transport_failure复用 serializer 和候选选择,保留原失败→locator→带原 digest 的简化恢复路径,不把新诊断当成原 capture 或新准入。quota_capture.py::_handle_context_hook从原 dispatcher 提取相同分支:off 保持空结果,合法 exact typed Host preparation 才进入原 owner;没有从传输可用性推导执行权。codex_context_history.py::_verified_replay_capture复用物理 replay interval 与原文件摘要校验,完整读取和选区覆盖仍分别判断,不能借部分输出建立完整 baseline。
规范:docs/architecture/rfcs/controller-executor-unified-contract-v0.md,修订 e29bd8aa50b9aeba7cf30260bd55195e25c61f90,并核对其技术 annex。ORIGINAL_CAPTURE、EXPLICIT_OFF 的所验路径已实现;LEDGER_APPEND_ONLY 未满足;OUTCOME_COST 继续留给原 #8266/C1 验收。
对主干的风险 / Risks
[P2] 请保留原历史条目,再提供摘要。 未改动的 RFC Appendix A 明确要求历史 entries append-only,并让 ledger 承载详细 chronology。四个文件却从 7149 行变成 399 行聚合 checkpoint,完整 10 路径 diff 没有增加历史归档或指向完整原记录的冷路径。本页以“Historical failures retained”列范围与汇总,不能替代原逐版本验证、失败和归因条目。Git 可回看旧提交,也不等于当前约定的证据入口已经保留。保留完整历史条目并另加当前摘要/索引;如需归档,先按既有保留契约建立可达完整原记录和引用,不能只把原账本覆盖成摘要。 这项修复不要求撤销 Python 去重,也不要求扩大为整个 C1 重构。
PASS:同一长 UTF-8 捕获包含大整数、负零、整数浮点和停止条件的 12 对真实 CLI,对照完整 stdout/stderr 和退出码;覆盖 full、selected、list、缺指针批次、错 digest、重叠非法参数、小预算以及合法 config/hook on/off。只归一化解释器、checkout、夹具路径。私有副本故意让 reader 拒绝只返回 ok:false,同一公开入口的独立诊断 oracle 立即失败;原 head 保留完整 reason。文件字节未变。
另外 868 项回归通过,保留 15 项平台/条件 skip;Ruff、17 根 mypy 和双语门通过。标准 premerge 总体通过:6 direct、10 catalog、8 risk-profile,原生报告 1 项 inherited advisory;没有将该历史诊断改判为已修复。初始探针的宿主 runtime 歧义和缺失隔离 native 目录保留为 fixture 失败,修正后实际配置成功且 base/head 一致。没有查询或等待远端 CI。
语义与 CI 对齐
局部 _REPLAY_ERRORS、_CARRIED_RECEIPT_KEYS 与 helper 不创建新共享词表;五模块的行为承载字符串集合未改,公开 caller 对照也支持代码文本等价。历史证据保留却违反当前规范,是文档语义问题;功能绿测、anchor 存在或行数缩减都不能证明其等价。最小修复后应核完整历史可达性,并重跑双语门和已有 CLI 对照。
我的整体评价 / Verdict
REQUEST_CHANGES。代码去重具有可审阅的维护价值,所验 CLI user_experience 保持;long_horizon 的证据保留出现回归,需要按原规范修复四份 ledger。没有修改产品界面布局,本次不以浏览器截图认证 Markdown 语义。实际安装、原生 Windows、模型理解及 #8266 的长期成果/完整成本仍未验;本评审不授予合并或采用资格。
English verdict: REQUEST_CHANGES — the exercised CLI refactor preserves behavior, but replacing the historical ledgers violates the unchanged append-only evidence contract.
| `45`–`6,161` TypeScript cases across checkpoints; isolated `1,815`–`1,914` | ||
| file wheel runs with zero checkout core contamination; default 17-root strict | ||
| Mypy and changed-path Ruff pass; control-plane TypeScript typecheck passes. | ||
| - **Historical failures retained:** broad historical mypy runs (`4,809`–`4,831` |
There was a problem hiding this comment.
[P2] 保留完整历史条目后再提供摘要。改动前及当前 RFC Appendix A 都明确要求 historical entries append-only,并让 ledger 保存 detailed chronology;本 PR 将四份 7149 行原账本覆盖为 399 行聚合摘要,完整路径清单没有新增历史归档或可达原记录。这里汇总失败范围并不能让后续 reviewer 从既有入口核验原逐版本验证和归因。请保留原条目并另增当前摘要/索引,或按既有保留合同提供可达完整归档;Python helper 去重本身可以保留,不需要扩大为整个 C1 重构。核验应包含历史条目完整可达性,而非仅 anchor 和代码绿测。
|
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/codex/c1-work-contract-review-20261107
# 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 |
8c1b9b2 to
5f88174
Compare
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent; gpt-6.1-sol; OpenAI; runtime_reported; effort=max
Request changes conclusion (author-owned PR; GitHub blocks formal self-review)
精确 head:5f88174d738b93525c152ebe0715fe00247ee169;实际 base:codex/c1-work-contract-review-20261107@4b3b96e95c5d2c0c5694f42eeb461e74c6614aa8,merge base 相同。
动机 / Motivation
维护 C1 捕获恢复链路、并需追溯此前验收与失败原因的开发者和 Agent。辅助函数去重可以减少同一预算和回执规则的重复维护;但把完整历史替换成短摘要,会让后续恢复与评审失去原始上下文。当前 Python 调用方对照保持,重复测试定义已清理;四份账本的完整历史仍未保留,上一轮 P2 尚未修复。不把维护切片当作完整 C1 安装或长程效果/全成本资格,也不改当前 Goal 的权威状态。保留完整历史后再判断此维护切片;原 C1 同单会话原 quota 对照、正式安装和长期资格仍属既有验收。
改动思路 / Approach
预算、序列化与物理来源校验共享同层 helper,配置和 hook 只搬迁原 IO;没有第二个领域决策 owner。当前 PR 边界:五个 Python 调用方维护与死测试清理可独立交付;账本摘要必须保留完整历史,不能凭净删行数放宽保真义务。 我按真实目标分支重新审了五个 Python 文件全部改动、完整当前四账本和测试变化,没有把作者仍列旧 head 的正文当成当前证据。配置、hook、错误预算与 native replay 保留各自调用边界;共享的是序列化、预算和来源校验,不把部分读取变成完整读取证明,也不在失败后重新准入。
具体改动 / Changes
共10条路径,+764/-7661。按 docs/architecture/rfcs/controller-executor-unified-contract-v0.md(revision 4b3b96e95c5d2c0c5694f42eeb461e74c6614aa8)及其 Appendix A 核对:LEDGER_APPEND_ONLY not_met;ORIGINAL_CAPTURE implemented;EXPLICIT_OFF implemented;OUTCOME_COST deferred。四账本按文件分别为734→109、541→84、3377→112、2497→94行,总计7149→399行;没有新增保存原完整内容的冷路径。当前摘要和链接不能替代 append-only 原记录。
关键代码讲解
_clamp_budget复用原 page/output 最小预算;非正预算等入口拒绝仍由原 caller 负责。_handle_context_hook只抽出原 typed preparation 流程,显式 off、原事件与同 Turn 恢复不因搬迁获得新权限。_verified_replay_capture共用物理区间、digest 和 source 检查,保留 full 与 selected 的不同覆盖义务。
测试清理删了三个更早、实际被后定义覆盖的副本;25个有效测试/辅助函数的 AST(含 decorator)与目标分支一致,原3项 F811 已消失。这是有效简化,不要求恢复死副本。
对主干的风险 / Risks
[P2] 完整历史仍被摘要覆盖。 沿用现有历史保留发现,不重复制造同一 inline thread。后来读者需要原阶段的来源、反例、验证限制和归因时,只能读到压缩后的版本;Git 中曾有原文不等于当前账本契约保留了可达历史。最小修复是恢复原正文,或保留完整、稳定可达的历史冷归档并让摘要只承担导航。没有逐句读完7149行历史删文,因此不会宣称摘要全文语义等价;已验证的 append-only 违例本身足以保留该发现。
| 验证 | 本轮结果 |
|---|---|
| 同 UTF-8 夹具的真实 context-read/config/hook 正负例 | PASS:12组 stdout、stderr、退出码完整对照,捕获不变 |
| 9个完整 runtime 模块 | PASS:773;29 skip 保留 |
| 2个完整 Host preparation/lifecycle 模块 | PASS:185;0 skip |
| 默认 workflow Ruff、17-root mypy | PASS;原3项 F811 已解决 |
| 额外五个改动根 mypy | 诊断 FAIL:base15项、head1项;剩余同一未改函数的 Any-return,非新回归 |
| 真实 CLI 的诊断丢失故障注入 | PASS:独立 oracle 抓到 mutation;正常 head 保留 reason/原捕获恢复 |
| 标准 premerge | 技术项6 direct+10 catalog+8 risk+1 public-boundary通过;1条既有维护 advisory;总体 FAIL:quality_receipt_missing |
语义与 CI 对齐
新增 TypeVar 是本地 helper 类型,不新建共享词汇或领域 owner。真实 on/off、非法事件、错误摘要、缺失 pointer 和重叠选择对照保持拒绝顺序与恢复文本;无额外确认、claim 或调度副作用。29个 skip 是14项显式 native/loopback、4项 PowerShell7、10项 Windows launcher 和1项临时路径 depth12 条件,不能计作通过。额外 mypy 的剩余函数主体在 base/head 未改,仅行号373→372;其错误身份与详情相同。没有查询或等待远端 CI,也没有把缺失 current-scope CQR receipt 写成 gate 通过。
我的整体评价 / Verdict
交付判断为 justified_increment;运行时重用和死测试清理合理,user_experience preserved,但 long_horizon regression:可追溯历史仍违反既有约束。没有第二份领域状态机,最小剩余修复是完整历史冷路径;修好之前维持 REQUEST_CHANGES。默认输出/副作用的对照不证明实际模型采纳、正式安装或 C1 同单会话原 quota 的成果与完整成本收益。
检查的是 CLI/Host 恢复辅助函数及 Markdown 账本,没有产品渲染页面或界面布局改动;没有验收正式安装或网站呈现,历史删文也未做完整逐句等价审计。保留未测范围,不把测试数、净删行数或镜像存在当成完整交付。未合并或安装。
English verdict: REQUEST_CHANGES — runtime parity and duplicate-test cleanup are verified, but complete append-only ledger history is still missing.
|
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/codex/c1-work-contract-review-20261107
# 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 |
5f88174 to
e002ada
Compare
|
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/codex/c1-work-contract-review-20261107
# 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 |
e002ada to
5373b68
Compare
|
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/codex/c1-work-contract-review-20261107
# 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>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
…eader mypy return Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
5373b68 to
227fb7d
Compare
|
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/codex/c1-work-contract-review-20261107
# 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 |
Goal & Scope
Keep C1 (
codex/c1-work-contract-review-20261107) lean, typed, and conflict-free without losing any historical ledger chronology, counterexamples, or validation bounds:loopx/cli_commands/quota_capture.py,quota_context_reader.py,quota_failure_report.py,quota_presentation.py) andloopx/control_plane/turn_driver/codex_context_history.py, including exactboolreturn typing inquota_context_reader.py.tests/control_plane/test_refresh_settle_turn.py.Rebase & Verbatim Archive Integrity (
ae04b1e311->5373b68f19)Rebased cleanly onto
codex/c1-work-contract-review-20261107(ae04b1e3115db3f99ff8102057e2d68984d3d2c0), picking up#8902storage compatibility,benchmark/runtime/{RUNTIME,SETTINGS}.md, and the caller-retirement update (build_turn_envelopedirect TypeScript forwarding andmodel_behavior_corpus.pydeduplication):docs/architecture/rfcs/ledger/controller-executor-unified-contract-v0/2026-10-30-c1-source-convergence.raw-archive.md:3,414lines (sha256: 8f60f3cbd2d4e11a78e92e1461f0b7106b9a856fa863243092ae47bead76dc0b), verified byte-identical toae04b1e311docs/architecture/rfcs/ledger/controller-executor-unified-contract-v0/2026-10-30-c1-source-convergence.raw-archive.zh-CN.md:2,525lines (sha256: b371a2b464e88401615ee78fd93fd36d54bba08f836a86322ae7b717b8a1325c), verified byte-identical toae04b1e311docs/architecture/rfcs/ledger/controller-executor-unified-contract-v0/2026-10-28-packaged-heartbeat.raw-archive.{md,zh-CN.md}:734/541lines preserved verbatim2026-10-30-c1-source-convergence.{md,zh-CN.md}to reflect the retainedbuild_turn_envelopecomparison boundary fromae04b1e311.Verification
5373b68f1937b8490c53a4fbb647936efb3289b4:cmp -sbyte-identity check of both2026-10-30raw archives againstae04b1e311: passeduv run --extra test ruff check loopx/cli_commands/quota_capture.py loopx/cli_commands/quota_context_reader.py loopx/cli_commands/quota_failure_report.py loopx/cli_commands/quota_presentation.py loopx/control_plane/turn_driver/codex_context_history.py tests/control_plane/test_refresh_settle_turn.py:All checks passed!uv run --extra test mypy --follow-imports=silent loopx/cli_commands/quota_capture.py loopx/cli_commands/quota_context_reader.py loopx/cli_commands/quota_failure_report.py loopx/cli_commands/quota_presentation.py loopx/control_plane/turn_driver/codex_context_history.py:Success: no issues found in 5 source filesuv run --extra test python scripts/check_rfc_bilingual.py --base ae04b1e3115db3f99ff8102057e2d68984d3d2c0 --head 5373b68f1937b8490c53a4fbb647936efb3289b4:RFC bilingual diff check passed.tests/control_plane/test_refresh_settle_turn.py,test_cli_output_budget.py,test_quota_decision_capture.py) on identical Python changes (79202e3dcbbase; zero Python edits between79202e3dcband5373b68f19):262 passed, 15 skipped in 288.70s(with CI re-running full matrix on5373b68f19).