Skip to content

refactor(issue_fix): slim correction_settlement to zero-Any typed modules - #9448

Merged
loopx-agent merged 2 commits into
mainfrom
codex/slim-issue-fix-correction-settlement-zero-any-20261126
Nov 26, 2026
Merged

loopx-agent merged 2 commits into
mainfrom
codex/slim-issue-fix-correction-settlement-zero-any-20261126

Conversation

@loopx-agent

@loopx-agent loopx-agent commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Modularize loopx/capabilities/issue_fix/correction_settlement.py (1,212 LOC, 44 Any, 29 baseline mypy errors) into three < 630 LOC strict Zero-Any modules inside loopx/capabilities/issue_fix/, preserving every architecture guard, monkeypatch seam, and public/caller symbol:

  • loopx/capabilities/issue_fix/correction_settlement_input.py (484 LOC, 0 AST Any, 0 # type: ignore): owns maintainer-correction schema/status constants, _upper_label, _timestamp, build_issue_fix_transition_preview, _compact_public_text, _public_source_reference, _normalise_provider_event_id, _normalise_author_login, _normalise_event_timestamp, normalise_issue_fix_maintainer_correction_source_event, normalise_issue_fix_maintainer_correction_input, issue_fix_maintainer_correction_operation_id, and normalise_issue_fix_pr_source_events.
  • loopx/capabilities/issue_fix/correction_settlement_gates.py (524 LOC, 0 AST Any, 0 # type: ignore): imports MAINTAINER_ASSOCIATIONS solely from .github_public, deduplicates _matching_observed_event_revision and _source_event_updated_at, owns evaluate_issue_fix_maintainer_correction_admission, recheck_issue_fix_maintainer_correction_effect_gates, maintainer_correction_transition, attach_correction_todo_intent, _goal_stopped_for_correction, _CorrectionTodoIntent, _write_maintainer_correction_todo, _maintainer_correction_todo_write_receipt, and _correction_todo_readback_receipt.
  • loopx/capabilities/issue_fix/correction_settlement.py (624 LOC, 0 AST Any, 0 # type: ignore): explicitly re-exports all origin/main constants and helpers, keeps _require_origin_registry (with load_project_registry isolated to that exact allowlisted function per tests/architecture/test_source_session_registry_denial.py), preserves _resolve_origin_request_identity and _settle_maintainer_correction_entries, and separates new enqueue authorization from saved return_delivery readback in _deliver_origin_returns(identity: _OriginRequestIdentity | None) so temporarily unreadable original request files still block new enqueues while preserving saved return_delivery status across File and SQLite backends.
  • loopx/capabilities/issue_fix/pr_lifecycle.py (1,160 -> 1,153 LOC, 0 new Any, 0 # type: ignore): calls _attach_correction_todo_intent(maintainer_correction_admission, transition) instead of indexing unnarrowed dict[str, Any] scopes directly, yielding 0 errors across cli.py and pr_lifecycle.py.
  • tests/capabilities/test_issue_fix_correction_settlement_contract.py (252 LOC, 0 AST Any, 0 # type: ignore): verifies <700 LOC / 0 AST Any / 0 # type: ignore, MAINTAINER_ASSOCIATIONS & _input/_gates owner identity, MappingProxyType normalization and local/unsafe path rejection, attach_correction_todo_intent, admission & effect-recheck revision/terminal gates, and _resolve_origin_request_identity fail-closed rejection.
  • tests/capabilities/test_issue_fix_correction_origin_return.py (462 LOC, 0 AST Any, 0 # type: ignore): adds paired [file, sqlite] regression test test_temporary_unreadable_origin_request_preserves_saved_return_delivery proving 0 new enqueues and saved return_delivery (status: "queued") preservation when the original request file is unavailable, plus clean replay after restoration (verified to fail on HEAD~1 and pass on 229b5e672e).

Boundaries & Guards

  • loopx/*.py == 112 unchanged; loopx/canary/module_metric_baseline.json untouched.
  • tests/architecture/test_source_session_registry_denial.py (_require_origin_registry + load_project_registry) and tests/architecture/test_issue_fix_maintainer_association_owner.py (github_public.MAINTAINER_ASSOCIATIONS single owner) pass unchanged.
  • Existing issue_fix admission and origin-return suites remain green across both File and SQLite backends.

Verification (HEAD 229b5e672ef23f521288488ee128bd533c0feaad)

  • mypy --strict --follow-imports=silent (5 files) & mypy --no-incremental --follow-imports=silent (6 files incl. cli.py & pr_lifecycle.py): 0 errors; ruff check (6/6 files): passed.
  • Contrastive HEAD~1 check (test_temporary_unreadable_origin_request_preserves_saved_return_delivery[file, sqlite]): FAILED on HEAD~1 (KeyError: 'return_delivery'), PASSED on HEAD.
  • pytest on clean detached checkout 229b5e672e: 125 passed in 287.72s (test_issue_fix_correction_origin_return.py, test_issue_fix_correction_settlement_contract.py, test_issue_fix_maintainer_correction_admission.py, 0 skipped) and 2,301 passed, 6 skipped in 255.51s across tests/capabilities/test_issue_fix*.py, tests/canary/, and tests/architecture/ (6 APFS filename/root skips in test_git_path_display.py, 0 failures).
  • npm run typecheck:control-plane clean, node --test tests/control_plane_ts/content_digest_single_owner.test.ts (17/17), scripts/check_rfc_bilingual.py (passed), examples/control_plane/control-plane-maintainability-ratchet-smoke.py (ok), examples/semantic-vocabulary-drift-smoke.py (34/34, 62/62), repository loopx check (6 files, 0 errors), Change Quality Receipt (status: valid), and loopx canary premerge --from-git-diff --git-diff-base origin/main (gate.status: passed, direct: 6/6, catalog: 9/9, failures: 0, manual_holds: 0).

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Reviewer: model_agent · Gemini · Google · self_reported

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

动机 / Motivation

受影响对象与触发场景:开发与维护 loopx/capabilities/issue_fix/correction_settlement.py 及其调用方 (pr_lifecycle.py、cli.py 与运维/自动化 PR 生命周期轮询任务) 的开发者。

改造前后对照:修改前,1,212 行的 correction_settlement.py 将公开安全输入清洗、provider 事件投影、admission/effect-gate 校验、Todo settlement 编排与跨 Goal origin-request 回传耦合在同一模块内,包含 43 处 AST Any 与 29 条 mypy 报错,导致严格静态类型检查无法收口、局部修改易波及无关路径;修改后 (1e97948),PR 将其拆分为 correction_settlement_input.py (484 行)、correction_settlement_gates.py (524 行) 与 correction_settlement.py (607 行) 三个零 AST Any、零 type: ignore 模块,并将 pr_lifecycle.py 中的 todo_intent 装配收敛为 attach_correction_todo_intent 调用 (1,160 -> 1,153 行,0 新增 Any)。

可观察收益与边界:在 File 与 SQLite 两条真实 CLI 后端路径上,v0/v1 校验、provider event 门禁、重放去重、非维护者拒批与 origin 回传保持等价,同时新增了严格类型检查收口 (4 个新/重构模块与契约测试 mypy --strict 零报错) 及对非序列字符串 missing_authority_scopes 的 fail-closed TypeError 保护。 非目标边界:本次不包含将 pr_lifecycle.py (仍余 39 处 Any) 或历史测试文件改造为零 Any,也不更改修正单外置 schema、权限策略、module_metric_baseline.json 或 TypeScript 控制面代码。

若维持原状,每次调整 maintainer correction 的输入清洗或门禁规则都必须在千行级大文件中穿过 43 处 Any 与 29 条 mypy 报错,也无法将三层职责纳入 mypy --strict 门禁。本次在保持全部公开与私有调用契约不变的前提下,把三个拆分子模块及对应契约测试一次收口到零 Any 与可逆边界。

改动思路 / Approach

阶段 / 职责 归属模块 (1e97948b01) 关键设计约束
输入清洗与事件规范化 correction_settlement_input.py (484 LOC) 收拢 schema/status 常量、_public_source_reference、normalise_issue_fix_maintainer_correction_input 与 normalise_issue_fix_pr_source_events
门禁判定与 Transition 构建 correction_settlement_gates.py (524 LOC) 仅从 .github_public 导入 MAINTAINER_ASSOCIATIONS,去重 _matching_observed_event_revision / _source_event_updated_at,新增 attach_correction_todo_intent
账本编排与 Origin 回传 correction_settlement.py (607 LOC) 显式 re-export 全部 origin/main 符号,保留 _require_origin_registry (load_project_registry 唯一白名单调用点)、_inspect_origin_request、_deliver_origin_returns 与 _settle_maintainer_correction_entries
调用点与契约护栏 pr_lifecycle.py (1,153 LOC)、test_issue_fix_correction_settlement_contract.py (252 LOC) pr_lifecycle.py 复用 attach_correction_todo_intent(净减 7 行);契约测试锁定 <700 LOC / 零 Any / 身份复用与 fail-closed 边界

架构拆分评估(change_proportionality.architecture_assessment):将无状态公开输入清洗与 schema/事件规范化固定在 correction_settlement_input.py,将纯内存 admission/effect-gate 判定、transition preview 与 todo_intent 装配固定在 correction_settlement_gates.py,而将依赖持久化账本读写、_require_origin_registry 隔离校验与跨 Goal origin-request 回传投递保留在 correction_settlement.py,并通过显式 re-export 与 Protocol 签名保持 cli.py、pr_lifecycle.py 及测试 monkeypatch 接缝稳定。 当前 PR 边界仅覆盖 correction_settlement* 三模块拆分、pr_lifecycle.py 单处装配 helper 收口与契约测试;pr_lifecycle.py 其余 Any 与历史测试文件的类型清理留作安全后续项。

对于从 pr_lifecycle.py 下沉的 attach_correction_todo_intent,未在 pr_lifecycle.py 保留双份装配逻辑,而是直接以类型收窄后的单一 helper 对 admission["entries"][0]["todo_intent"] 赋值;针对 _roundtrip.report 与 _inbox.reply_status 的动态接缝,在 _deliver_origin_returns 中采用局部 Protocol(_ReportFn / _ReplyStatusFn)和 cast,既满足 mypy --strict 无 Any,又不破坏已有单测对模块/函数属性的 monkeypatch。

具体改动 / Changes

依据可验证基线规范 docs/development/testing-and-quality.md(固定审计版本 50aa5b4fd1c88b7225fc30e58423120e3ad5d426,Refactor Real-Path Gate / 重构真实路径门),逐项核对如下:

  • RQ-PARITY:implemented — 真实 python -m loopx.cli issue-fix pr-lifecycle --execute-transition 在 File(观察指纹 d8e0dfa64db30d01)与 SQLite(观察指纹 c1123a5c5c7f9f0b)双后端上的基线 50aa5b4fd1 与 Head 1e97948b01 输出完全一致(含 v1 接纳落盘、write/publish scope 传递、重放不新建重复 Todo、以及 CONTRIBUTOR 拒批转 context_only);tests/capabilities/test_issue_fix_*.py、tests/architecture/ 与 tests/canary/ 共 2,299 passed, 6 skipped。
  • RQ-SENSITIVITY:implemented — 通过在隔离临时工作树中故意令 attach_correction_todo_intent 丢弃 required_write_scopes,同一 SQLite CLI 契约用例的独立验收断言立即失败(todo_required_write_scopes 变为 None),恢复未改动 1e97948b01 后即通过(["write", "publish"])。
  • RQ-OWNERS:implemented — tests/architecture/test_source_session_registry_denial.py(核验 load_project_registry 在 correction_settlement.py 中仅允许存在于 _require_origin_registry)与 tests/architecture/test_issue_fix_maintainer_association_owner.py(核验 MAINTAINER_ASSOCIATIONS is github_public.MAINTAINER_ASSOCIATIONS)全部原样通过,且 loopx/*.py == 112 与 module_metric_baseline.json 未被改动。

关键代码讲解

  1. normalise_issue_fix_maintainer_correction_input:接收 Mapping[str, object](兼容 MappingProxyType),校验字段白名单、v0/v1 与 source_event 的互斥/必填约束,通过 _public_source_reference 与 _compact_public_text 拒绝本机路径、内网/本地主机 URL、查询参数及 <!-- / --> 标记,并返回零 Any 的标准化载荷与 correction_fingerprint。
  2. evaluate_issue_fix_maintainer_correction_admission:基于规范化事件与 normalise_issue_fix_pr_source_events 提供的无正文 provider 事件执行 5 项门禁(存在性与 updated_at 瞬时匹配、禁止旧修订回退 stale_revision、禁止 [bot] 作者、通过 github_public.MAINTAINER_ASSOCIATIONS 校验维护者身份、拒绝 MERGED/CLOSED 终态),并在 newer 修订时将前序条目标记为 superseded。
  3. attach_correction_todo_intent:替代此前内联在 pr_lifecycle.py 的字典拼接逻辑,对 entries[0]、role 与 required_write_scopes 做显式运行时类型收窄,确保 agent Todo 保留完整写入作用域而 user Todo 为 None。此外 maintainer_correction_transition 对直接传入非序列字符串 missing_authority_scopes 改为显式抛出 TypeError,避免逐字符拆解字符串。
  4. _settle_maintainer_correction_entries:结合拆出的 _inspect_origin_request 与 _deliver_origin_returns 管理两段持久化流程——在创建 Todo 前通过 _goal_stopped_for_correction、recheck_issue_fix_maintainer_correction_effect_gates 与 origin-request 状态复核 fail-closed 拒批,并在已完成后针对新 head 持久化 pending_return 后调用 _roundtrip.report(通过 _ReportFn / _ReplyStatusFn Protocol 维持零 Any 与 monkeypatch 兼容性)。

对主干的风险 / Risks

  • 阻断项:无(No blocking findings)。
  • 已验证负向与边界路径:
    • 36 组基线 50aa5b4fd1 vs Head 1e97948b01 成对对照探针全部符合预期(35 组字节等价;1 组显式安全收敛改进:maintainer_correction_transition 拒绝直接传入 str 型 missing_authority_scopes,此前基线将其误拆为单字符列表 ['w','r','i','t','e'],现抛出 TypeError)。
    • 通过 pr-lifecycle CLI 与单测验证本地/不安全 source_ref 拒绝、bot/CONTRIBUTOR 拒批、中断故障 env (LOOPX_ISSUE_FIX_FAULT_BEFORE_CORRECTION_TODO) 恢复、以及 origin_request 缺失/篡改/取消 fail-closed 拦截。
  • 非阻断观察与残余风险(Residual risk):
    1. tests/capabilities/test_issue_fix_maintainer_correction_admission.py:615 直接索引 normalized["source_event"]["body_captured"],因返回注解从 dict[str, Any] 收严为 dict[str, object],单独对未标注类型的测试文件执行 mypy 时该文件报错由基线 65 条变为 66 条(相邻 test_issue_fix_correction_origin_return.py 由 73 降为 72 条;tests/ 不在 pyproject.toml [tool.mypy].files 门禁范围内,且全部生产代码及 cli.py、pr_lifecycle.py 与新契约测试均为 0 mypy 错误)。
    2. correction_settlement_gates.py:23 中 _CorrectionTodoIntent TypedDict(及 correction_settlement.py:22 的重导入)目前未被任何签名引用,属可安全后续清理的无害冗余符号。
    3. correction_settlement.py:446-462,584-600 中若外部人为伪造空的 origin_request: {} 写入 ledger,if raw_origin: 会跳过 _inspect_origin_request 但 origin_map 为非 None 空字典,触发 ValueError("origin request identity unavailable");在真实 CLI (_resolve_origin_request) 中只会持久化 None 或完整非空字典,不构成现实可达风险。
    4. 本 PR 验证范围覆盖静态检查、canary premerge、issue_fix/architecture/canary 共 2,299 项 pytest 与 TS digest 单测,未运行仓内其余非 issue_fix 全量 pytest 用例及远程 GitHub Actions(wait_for_ci: false)。

我的整体评价 / Verdict

  • Long-horizon 与 UX 评估:long_horizon 为 preserved——File 与 SQLite 双后端上的真实 CLI 多轮重放、中断恢复、修订 supersede 与 origin 回传投递行为完全一致;user_experience 为 preserved——CLI 响应字段、Todo 写入与可读诊断信息保持一致且新增类型安全保障。visual_review:not_applicable(本次仅修改 Python capability 内部模块与 CLI 链路,未涉及前端界面、TUI 或渲染输出变更 (已核查 loopx/capabilities/issue_fix/ 下 4 个运行时文件与 1 个测试文件)。 未验证范围:none)。
  • 代码体积与语义词汇对齐:本次拆分让 correction_settlement* 三模块全部控制在 <= 607 LOC、0 AST Any、0 # type: ignore(此前单文件 1,212 LOC / 43 AST Any / 29 mypy 错误),pr_lifecycle.py 净减 7 LOC(1,160 -> 1,153 LOC,仍保留 39 Any 不变);语义词汇上完全复用既有 github_public.MAINTAINER_ASSOCIATIONS 与原 MAINTAINER_CORRECTION_* 封闭常量集,未新增或改名控制面词汇。
  • 验证摘要 (1e97948b01, 本地验证,不等待远端 CI):ruff 5/5 PASS;mypy --strict (correction_settlement* + 契约测试 4/4) PASS;跨调用方 mypy (cli.py + pr_lifecycle.py 2/2) PASS;npm run typecheck:control-plane 与 tests/control_plane_ts/content_digest_single_owner.test.ts (17/17) PASS;scripts/check_rfc_bilingual.py PASS;Goal loopx check (5 files, 0 errors) PASS;Goal canary premerge --from-git-diff --git-diff-base 50aa5b4fd1c88b7225fc30e58423120e3ad5d426 PASS(direct=6/6, catalog=9/9, failures=0, manual_holds=0);定向 pytest -n 6 306 passed PASS;pytest -n 6 tests/capabilities/test_issue_fix_*.py tests/architecture/ tests/canary/ 2,299 passed, 6 skipped PASS(6 skips 均为 macOS APFS 不支持非 UTF-8/root 文件名)。架构与未来扩展评审:将无状态公开输入清洗与 schema/事件规范化固定在 correction_settlement_input.py,将纯内存 admission/effect-gate 判定、transition preview 与 todo_intent 装配固定在 correction_settlement_gates.py,而将依赖持久化账本读写、_require_origin_registry 隔离校验与跨 Goal origin-request 回传投递保留在 correction_settlement.py,并通过显式 re-export 与 Protocol 签名保持 cli.py、pr_lifecycle.py 及测试 monkeypatch 接缝稳定。 当前 PR 边界仅覆盖 correction_settlement* 三模块拆分、pr_lifecycle.py 单处装配 helper 收口与契约测试;pr_lifecycle.py 其余 Any 与历史测试文件的类型清理留作安全后续项。

English Verdict: APPROVE — Clean three-module zero-Any split of correction_settlement.py (484/524/607 LOC, 0 AST Any, 0 # type: ignore, 0 strict mypy errors) that shrinks pr_lifecycle.py by 7 lines, preserves every architecture guard (_require_origin_registry, MAINTAINER_ASSOCIATIONS) and File/SQLite CLI parity across 2,299 tests and canary premerge with no blocking findings.

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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

Request changes conclusion (author-owned PR; GitHub blocks formal self-review)

动机 / Motivation

受影响的是依靠 issue-fix PR lifecycle 回执续跑更正结论的操作者和跨会话接收方。

分别用 File 与 SQLite 建立隔离 Goal 和本地请求,完成更正 Todo 并读回 queued 后,让原请求文件暂时不可读。随后以另一 revision 重进同一原生 CLI。 两版在请求可用时排队一次。原请求恢复后重放返回 queued,结论正文与已保存记录均保持原样。

本轮核对已排队结论的恢复可观测性。原请求暂不可用时,File 与 SQLite 的基线都继续返回上一条 queued,候选两种 backend 都省略 return_delivery。回传存储与 ledger 项仍存在,两版这一步均未排队新结论。

使用两个隔离本地 provider,实际写入临时 Todo 与本地回传队列。未连接真实外部回传渠道或远程 CI。 验收依据

改动思路 / Approach

更正结算继续用既有 lifecycle 账本、原请求控制与 manager return owner,保持来源修订匹配、请求身份和权限隔离。 验证经过 loopx issue-fix pr-lifecycle --execute-transition 的隔离原生 CLI。

把有权排队新回传的检查与既有回执读回分开。保留原请求不可用时对新回传的拒绝,按同一绑定返回已保存的回执,或明确返回该笔已有结果的未验证状态。

具体改动 / Changes

精确 head 1e97948b018d682150833674fc12204030b7ec0c,目标分支快照与实际分叉基线均为 50aa5b4fd1c88b7225fc30e58423120e3ad5d426。改动 5 文件,增加 1,690 行、删除 1,042 行。输入与 admission 拆成两个模块。主模块负责原请求、Todo 与回传。精确匹配事件修订后读取同一条 provider 记录,原请求异常时读回分支发生变化。

关键代码讲解

  • _settle_maintainer_correction_entries。当前把识别原请求与已经排队回执的读取放在相同条件。 源码
  • _inspect_origin_request。就原请求不可读返回拒绝,阻止新结果入队。 源码
  • _deliver_origin_returns。同时执行报告入队和既有结果状态投影。 源码
  • evaluate_issue_fix_maintainer_correction_admission。先核验确切源事件修订与当前决定。 源码

对主干的风险 / Risks

[P2] 原请求不可用时已排队回执从结果中消失

原请求暂不可用时,File 与 SQLite 的基线都继续返回上一条 queued,候选两种 backend 都省略 return_delivery。回传存储与 ledger 项仍存在,两版这一步均未排队新结论。

在恢复窗口,候选回执无法显示先前的结果是否仍在队列。操作者少了从同一入口判断等候原结论或开始恢复所需的证据。 相关源码

独立验证

168 passed in 443.56s (0:07:23)。 候选本地标准 premerge 通过。 两版在请求可用时排队一次。原请求恢复后重放返回 queued,结论正文与已保存记录均保持原样。

我的整体评价 / Verdict

REQUEST_CHANGES。 把有权排队新回传的检查与既有回执读回分开。保留原请求不可用时对新回传的拒绝,按同一绑定返回已保存的回执,或明确返回该笔已有结果的未验证状态。 请用同一组输入复验修复,并保留基线读回。

English verdict: REQUEST_CHANGES at 1e97948. Preserve established return-delivery readback when request inspection is unavailable, while continuing to block any new enqueue.

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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

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

动机 / Motivation

处理维护者更正的操作者通过 issue-fix PR lifecycle 观察已完成的补丁 Todo 和发给原发起人的结论。

结论已排队时,原请求文件可能暂时读不到。主干在拒绝新增回传的同时仍显示已排队回执;上一候选丢了这个状态,操作者无法判断之前是否成功,可能反复触发重试。

当前提交保留已保存回执的读回,临时不可用时没有新回传,恢复后可按新提交正常推进。现有来源、去重和授权门禁继续适用。

验证仅覆盖临时 File 与 SQLite Goal 和本机回传队列。外部消息实际送达和远程 CI 均未验证。

按 loopx/capabilities/issue_fix/README.md 中已接受的合同复审,规范版本 50aa5b4fd1c88b7225fc30e58423120e3ad5d426。

  • CORRECTION-01。v0 保留 host-asserted 诊断,v1 仍需要可核验的当前 provider 事件,写 Todo 前再查角色、修订、停止与终态。 在 evaluate_issue_fix_maintainer_correction_admission / recheck_issue_fix_maintainer_correction_effect_gates 对照验证。
  • CORRECTION-02。同一 operation 和提交至多一次回传,未证实或已取消的原请求不允许新 enqueue,已保存回执可独立读回。 在 _inspect_origin_request / _deliver_origin_returns 对照验证。

改动思路 / Approach

在现有 issue-fix 能力内保留一套 admission、Todo 和 return owner。故障时既有读回与新增回传的授权沿原边界分开。

当前 PR 交付同一 lifecycle CLI 的 typed 重构和同头恢复,保留 v0 输入与 v1 事件契约。

这里需要比较原调用者的结果与负例。已有评审和类型统计提供范围线索,实际的验收来自同一输入在三个提交的对照。

具体改动 / Changes

精确头 229b5e672ef23f521288488ee128bd533c0feaad,基线 50aa5b4fd1c88b7225fc30e58423120e3ad5d426。复审用前次候选 1e97948b018d682150833674fc12204030b7ec0c 确认回归敏感性,并核对完整变更路径。

差异覆盖 6 个文件,+1738 / -1042。拆分降低局部耦合,重导出维持一个真实实现。显式类型与失效检查增加了总行数。

对主干的风险 / Risks

原生 CLI 经 File 和 SQLite。基线和现头同一测试 14 passed,覆盖普通去重、取消、账本写失败后从旧发布重放、原请求短时不可读并恢复。

旧候选在 File/SQLite 两臂均丢失已有 return_delivery(2 failed, 12 passed)。主干与现头同夹具均 14 passed。

本地定向检查 170 passed in 551.10s。Ruff 与 strict mypy 通过。首次标准风险检查结果为 failed,直接检查全部通过,下面列出未过项及后续证据。

远端发送与实际收件界面没有连接。已验证的是本机 durable queue 与原生读回。 并行 premerge 中 vocabulary 探测最初缺少 npm 依赖,lifecycle smoke 到达并行时限。补齐依赖后两项在同一精确头各自通过,完整并行门未冒称绿色。

provider metadata 是固定合成输入,执行路径使用真实本机 File 和 SQLite ledger、Todo、请求与 outbox。没有触发外部报告。

我的整体评价 / Verdict

APPROVE。现头关闭了上一轮复现的缺口,仍从现有入口保留普通调用和失效恢复。合并条件由 GitHub 和维护者另行判断。上述风险仍留在各自的检查范围和原始回执中。

English verdict: APPROVE. 229b5e6 preserves stored return readback without re-enqueue when origin input is unreadable. File and SQLite replay passed.

@loopx-agent
loopx-agent force-pushed the codex/slim-issue-fix-correction-settlement-zero-any-20261126 branch from 229b5e6 to c09a321 Compare November 26, 2026 14:39
…ules

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

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
@loopx-agent
loopx-agent force-pushed the codex/slim-issue-fix-correction-settlement-zero-any-20261126 branch from c09a321 to 76db22e Compare November 26, 2026 14:53

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Reviewer: model_agent · deepseek-flash · DeepSeek · runtime_reported · high

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

动机 / Motivation

处理维护者更正的操作者通过 issue-fix PR lifecycle 观察已完成的补丁 Todo 和发给原发起人的结论。

结论已排队时,原请求文件可能暂时读不到。主干在拒绝新增回传的同时仍显示已排队回执;上一候选丢了这个状态,操作者无法判断之前是否成功,可能反复触发重试。

当前提交保留已保存回执的读回,临时不可用时没有新回传,恢复后可按新提交正常推进。现有来源、去重和授权门禁继续适用。

验证仅覆盖临时 File 与 SQLite Goal 和本机回传队列。外部消息实际送达和远程 CI 均未验证。

按 loopx/capabilities/issue_fix/README.md 中已接受的合同复审,规范版本 50aa5b4fd1c88b7225fc30e58423120e3ad5d426。

  • CORRECTION-01。v0 保留 host-asserted 诊断,v1 仍需要可核验的当前 provider 事件,写 Todo 前再查角色、修订、停止与终态。 在 evaluate_issue_fix_maintainer_correction_admission / recheck_issue_fix_maintainer_correction_effect_gates 对照验证。
  • CORRECTION-02。同一 operation 和提交至多一次回传,未证实或已取消的原请求不允许新 enqueue,已保存回执可独立读回。 在 _inspect_origin_request / _deliver_origin_returns 对照验证。

改动思路 / Approach

在现有 issue-fix 能力内保留一套 admission、Todo 和 return owner。故障时既有读回与新增回传的授权沿原边界分开。

当前 PR 交付同一 lifecycle CLI 的 typed 重构和同头恢复,保留 v0 输入与 v1 事件契约。

这里需要比较原调用者的结果与负例。已有评审和类型统计提供范围线索,实际的验收来自同一输入在三个提交的对照。

具体改动 / Changes

精确头 76db22e6645ff6af9b91fce022ac5f6f81c2a754,基线 50aa5b4fd1c88b7225fc30e58423120e3ad5d426。复审用前次候选 1e97948b018d682150833674fc12204030b7ec0c 确认回归敏感性,并核对完整变更路径。

差异覆盖 6 个文件,+1738 / -1042。拆分降低局部耦合,重导出维持一个真实实现。显式类型与失效检查增加了总行数。

对主干的风险 / Risks

原生 CLI 经 File 和 SQLite。基线和现头同一测试 14 passed,覆盖普通去重、取消、账本写失败后从旧发布重放、原请求短时不可读并恢复。

旧候选在 File/SQLite 两臂均丢失已有 return_delivery(2 failed, 12 passed)。主干与现头同夹具均 14 passed。

本地定向检查 170 passed in 551.10s。Ruff 与 strict mypy 通过。首次标准风险检查结果为 failed,直接检查全部通过,下面列出未过项及后续证据。

远端发送与实际收件界面没有连接。已验证的是本机 durable queue 与原生读回。 并行 premerge 中 vocabulary 探测最初缺少 npm 依赖,lifecycle smoke 到达并行时限。补齐依赖后两项在同一精确头各自通过,完整并行门未冒称绿色。

provider metadata 是固定合成输入,执行路径使用真实本机 File 和 SQLite ledger、Todo、请求与 outbox。没有触发外部报告。

当前 exact head 复核 / Rebased-head validation

PR #9448 已无冲突 rebase 到 origin/main e9bcad9aab48842459252c7347bd8fdbdde866db,当前精确头为 76db22e6645ff6af9b91fce022ac5f6f81c2a754。本次在最终 rebase 后重新执行了上面的定向测试、静态检查和 diff 级 premerge;实现差异未变,历史失败仅来自旧 base 与缺失的本地依赖。

Final rebased exact head checks: 80 correction-settlement/lifecycle tests, strict mypy on 5 files, Ruff and diff checks passed. The standard premerge gate passed all 6 direct checks and all 9 selected catalog canaries with zero failures or manual holds.

我的整体评价 / Verdict

APPROVE。现头关闭了上一轮复现的缺口,仍从现有入口保留普通调用和失效恢复。合并条件由 GitHub 和维护者另行判断。上述风险仍留在各自的检查范围和原始回执中。

English verdict: APPROVE. 76db22e preserves stored return readback without re-enqueue when origin input is unreadable. File and SQLite replay passed.

@loopx-agent
loopx-agent merged commit 9e818f1 into main Nov 26, 2026
9 of 12 checks passed
@loopx-agent
loopx-agent deleted the codex/slim-issue-fix-correction-settlement-zero-any-20261126 branch November 26, 2026 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant