Skip to content

refactor(apps): group application workflows in a workflows package - #517

Merged
zengchuang-hw merged 6 commits into
mainfrom
codex/apps-490-workflows-refresh
Nov 19, 2026
Merged

zengchuang-hw merged 6 commits into
mainfrom
codex/apps-490-workflows-refresh

Conversation

@zengchuang-hw

@zengchuang-hw zengchuang-hw commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Refs #490
Refs #371
Refs #504

Governing Issue and delivery slice

将六个 Apps 工作流实现归入 apps/workflows/,同步 CLI、展示、工具和测试调用方,保留旧 Python 导入及工程校验脚本入口。这是 #490 已接受方案的第三步,共五步;storage #493、handoff #496 已合入。设计接受记录。

当前 head 15458a4bf837880a56feb76d9d0cab4191d94507,已同步 main c573f40a43ceef23ef08507fca662c95ffb65390。本 PR 接替已关闭而未合入的 #504,保留原作者、DCO、Codex 归属和历史验证。#501 新增的 benchmark comparison 同属既定 workflows 职责,已在 #490 记录归位安排;最新同步保留 #507 的 Find 检索、revision pins、展示和证据行为。

Changed artifacts and evidence

  • campaign、benchmark_operations、improvement、skill_evaluation、skill_eval_engineering 迁入 workflows;实现与对应当前主线源码一致。benchmark_compare 只调整四处相对导入层级,比较规则和报表仍由原模块拥有。

  • 原路径显式静态导出、字面量 __all__,共 13 项迁移登记;检查新旧对象身份、旧 pickle、新定义路径、活跃调用方和无副作用导入。David 指出的 archive consumer 同时保留旧 shim 与真实比较实现登记。

  • 工程校验器保留新旧 -m / 文件启动方式,比较退出码、标准流及 result.json 字节。

  • Harness 相对当前 main 只改一处 runtime identity 路径,摘要指向实际 apps/workflows/campaign.py;评测 controller 快照同步。完整 runtime map 校验继续拒绝不匹配的旧计划。

  • 双 wheel 回归实际验证新版本拒绝旧计划且留存字节不变、原固定 runtime 恢复同一运行、候选执行一次。恢复步骤与 CHANGELOG 提醒保留原固定解释器/环境,不能改写冻结摘要。

  • 最新冲突解决保留 refactor(knowledge): unify search on Find and archive its evidence #507 campaign 实现及所有新增测试,仅把调用方改为 canonical 导入;新增 round citations / capture delivery 调用方登记。

  • 同步 refactor(harness,apps): move serving helpers and host bindings, remove the campaign facade #510 / fix(codex): include the missing listing icon and website in the release ZIP #512:保留 serving 的 canonical runtime 摘要、原冻结 pre-serving fixture 和安装字节变更拒绝回归;目录图保留 Apps host 实现和本切片 workflows,CHANGELOG 两组恢复提醒均保留。主线新增插件图标与 listing 测试保留,本切片不修改这些实现。

Checks and dependencies

当前 head 15458a4b,Windows / Python 3.12,实际结果:

检查 当前结果
Ruff、diff whitespace、五个实现源码及 benchmark_compare AST 对照 通过
serving/host/边界/会话等组 329 passed、2 skipped、356 subtests、1 failed 后停止
独立 main / candidate sdist → wheel → 新环境 安装检查通过,930 个资源一致
双 wheel 恢复边界 1 passed,实际执行
Codex / WorkSwarm / DSH 57 passed,1 条现有 tarfile 弃用警告
runtime/serving 尾组 41 passed、1 deselected、15 subtests、1 failed 后停止;排除的是已记录 Git 节点
compatibility shells 单独补验 17 passed
Ready CI 必需检查全部通过,两宿主 advisory 也通过;运行记录

唯一失败为 RuntimeTests.test_submodule_local_edit_changes_snapshot_hash:本机 core.autocrlf=true,恢复原始 LF bytes 后仍标 dirty。对未修改 main c573f40a 的源码归档执行同一节点也失败;仅对子测试进程设置 core.autocrlf=false 后 1 passed。未改仓库/全局 Git 设置或测试断言,进程配置对照不充作原环境通过。尾组失败为 main 明确保持 Linux-only 的 serving helper 调用 os.getpgrp,本 Windows 环境没有该接口;同一节点也在未修改 main c573f40a 复现。未修改该实现或平台断言;Linux 完整 CI 已通过。两项跳过为常规节点未配置旧 wheel 与真实 Apple Silicon 宿主,实际双 wheel 场景已在上表另行执行。

旧 head 5f3194a0 的实际记录保留,分组有覆盖重叠,不能当作当前 head 的检查或审批:

检查 实际结果
Find/capture/round citations/展示/Knowledge CLI/迁移登记 226 passed,1 skipped(本地缺 playwright)
迁移/comparison/规则/协议/运行会话/普通项目 261 passed、2 skipped、43 subtests
最新 main/candidate 的独立 sdist → wheel → 新环境 安装检查通过;930 个资源一致
双 wheel 恢复边界 1 passed,实际执行;新版本拒绝旧计划且不改留存字节,原 runtime 恢复原运行,候选执行一次
Codex / WorkSwarm / DSH 55 passed;1 条现有 tarfile 弃用警告
必需 CI、Windows/macOS advisory 全部通过
Cursor 独立技术检视 报告 239 passed、39 skipped;其 permission=none 的批准不计 write+ 票

两项会话/项目跳过为 POSIX executable mode 和未配置旧 wheel 的常规恢复节点;双 wheel 场景已另行实际执行。Windows 服务复用检查的既有失败与基线复现记录在历史正文及 #504 保留,#494 单独跟踪 Windows busy-lock。未调整断言或时限,也不宣称完整 Windows 软件测试全部通过。

Windows/macOS host-compatibility 按 #508 为 advisory,分别记录实际状态,不作为审批或合入前置。合入仍须两份当前内容有效、独立 write+ 审批及必需检查。当前 main 对照下,本 PR 不改 CI、AGENTS、Knowledge 实现、host/serving 实现或插件 listing。软件回归不构成模型或服务收益证据。

Remaining work and Issue closure

本切片仅交付 workflows。integrations 已独立实现并验证,待本 PR 合入后从最新 main 提交独立 Ready PR;第五步集成验收仍待完成。#490、#371 保持打开,由 Apps 负责人结合接口 owner 确认整体完成。

Signed-off-by: zengchuang <zengchuang3@huawei.com>
Agent-assisted-by: Codex (author)
@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Skill evaluation

PLANNED: not executed; there are no task outcomes yet.
No approval, model efficacy or current-head test result is implied.

  • Next: resolve check applicability at head 15458a4bf837880a56feb76d9d0cab4191d94507.
  • Task selection: no supported automatic comparison; choose a relevant source/content check and disposition uncovered claims.
  • Selected comparisons: 0 · Estimated task calls: 0. Uncovered/unsupported changes: 62; Canonical library paths: 0; Generated projection paths: 0; Other paths: 62. These are paths, not independent claims.
  • Return: command, input/source pin, exit status, outputs/failures and untested claims for independent verified/refuted/unverified disposition.
Author verification steps (nonpaid; not yet run)
  1. Bind the checkout. Run git rev-parse HEAD; it must equal 15458a4bf837880a56feb76d9d0cab4191d94507. If it differs, obtain a current plan; do not reuse old results.
  2. Choose an applicable check. Match each changed behavior to the task below or a source/content check; a path match alone does not establish relevance.
    No supported automatic comparison is selected. Review the canonical changes and explain which claims need evidence, are unaffected, or remain unverified; do not treat generated records as separate behavioral claims.
    Uncovered scope by location: Canonical library paths: 0; Generated projection paths: 0; Other paths: 62. Path counts are not claim counts; no metadata-only conclusion is inferred.
  3. Return evidence for independent review: head, check/task/source pin, command, environment, exit status, outputs/failures and untested claims. Label scripted controls. Request each claim's disposition: verified, refuted or unverified; this plan proves neither model provenance nor benefit.
    Check recipes and evidence limits

Evidence and logs · Retention: 30 days.
Retained artifacts are verifiable only before Unix time 1797678850 while the linked artifact is available. Expired evidence is unverified.

Plan bindings, budget, frozen exam and advisory details

Advisory: obtain missing evidence

Retained evidence availability: planned / unexecuted. No approval or merge authorization is issued.
Applicable only while these revisions and inputs match the current PR.
Paid execution requires trusted label authorization and cumulative PR reservation. Unknown accounting blocks new paid calls; planning is not execution.
Pipeline evidence only; offline fixed outputs do not establish skill efficacy.
Unchanged-correct is valid neutral evidence, not incremental benefit.
Content/source review and authorship admission remain separate.
Trusted regrading checks retained answers, not model/hardware provenance or a hostile executor; this is not an efficacy certification.

  • Retained evidence is planned / unexecuted.
  • No supported comparison cases were selected.
  • Uncovered/unsupported scope needs a case or explicit reviewer disposition.
    Plan SHA-256: 8444b8e75ac96880c48a98a76a4d3f28dae23729fe4916fc6758504176777f53
    Base: c573f40a43ceef23ef08507fca662c95ffb65390 · Head: 15458a4bf837880a56feb76d9d0cab4191d94507
    Trusted implementation: c573f40a43ceef23ef08507fca662c95ffb65390

Model/settings: {"effort":"not_applicable","name":"claude-opus-5-5"}
Budget: {"comparisons":0,"estimated_calls":0,"limits_per_comparison":{"campaign_seconds":600,"max_task_calls":2,"repeats":1,"timeout_seconds":180,"token_stop_new_trials":200000},"provider_config_sha256":"b28d80f8194fbe0f5a9f01515efb24b218979fd45f702776560da276f4b30d04","reservation":null}

Skill Comparison Cases Estimated calls

Automatic execution / cumulative PR budget:

{"reason":"Trusted configuration or pricing missing, invalid or expired","remaining_usd":"unknown","reserved_or_unresolved_usd":"unknown","spent_or_legacy_usd":"unknown","state":"blocked"}

Provider/settings: {"client":{"api_version":"2023-06-01","endpoint":"https://yibuapi.com/v1/messages","kind":"anthropic-messages-full-context-v1","max_output_tokens":4096,"max_read_bytes":32768,"max_request_bytes":262144,"max_requests":1,"max_tool_calls":12,"provider":"yibuapi"},"limits":{"token_stop_new_trials":200000},"model":{"effort":"not_applicable","name":"claude-opus-5-5"},"pricing":{"currency":"USD","expires_at":1793271228,"group":"default","max_input_tokens":1000000,"model":"claude-opus-5-5","rate_evidence":"https://github.com/InferMatrixLab/InferRSI/issues/215#issuecomment-6467531341","rates":{"cache_read":"0.4","cache_write":"10","input":"8","output":"40"},"request_fee":"0","unit":"per_million_tokens"},"spend_limit":{"amount":"200","currency":"USD"}}

Uncovered / unsupported paths (62)
  • uncovered: "CHANGELOG.md"
  • uncovered: "docs/apps-module-migrations.json"
  • uncovered: "docs/architecture.md"
  • uncovered: "docs/contracts/function-owners.md"
  • uncovered: "docs/harness-improvement.md"
  • uncovered: "docs/knowledge-retrieval-trace.md"
  • uncovered: "docs/local-skill-evaluation.md"
  • uncovered: "docs/module-layout.md"
  • uncovered: "docs/operations.md"
  • uncovered: "docs/optimization-workflow-unification.md"
  • uncovered: "docs/skill-evaluation.md"
  • uncovered: "src/inferrsi/apps/benchmark_compare.py"
  • uncovered: "src/inferrsi/apps/benchmark_operations.py"
  • uncovered: "src/inferrsi/apps/campaign.py"
  • uncovered: "src/inferrsi/apps/cli/init.py"
  • uncovered: "src/inferrsi/apps/improvement.py"
  • uncovered: "src/inferrsi/apps/skill_eval_engineering.py"
  • uncovered: "src/inferrsi/apps/skill_evaluation.py"
  • uncovered: "src/inferrsi/apps/views/capture_delivery.py"
  • uncovered: "src/inferrsi/apps/views/optimization_story.py"
  • uncovered: "src/inferrsi/apps/workflows/init.py"
  • uncovered: "src/inferrsi/apps/workflows/benchmark_compare.py"
  • uncovered: "src/inferrsi/apps/workflows/benchmark_operations.py"
  • uncovered: "src/inferrsi/apps/workflows/campaign.py"
  • uncovered: "src/inferrsi/apps/workflows/improvement.py"
  • uncovered: "src/inferrsi/apps/workflows/skill_eval_engineering.py"
  • uncovered: "src/inferrsi/apps/workflows/skill_evaluation.py"
  • uncovered: "src/inferrsi/harness/optimization_session.py"
  • uncovered: "tests/_gate_policy_support.py"
  • uncovered: "tests/check_installed.py"
  • uncovered: "tests/fixtures/dashboard_profile_review.py"
  • uncovered: "tests/fixtures/knowledge_retrieval.py"
  • uncovered: "tests/test_anthropic_agent.py"
  • uncovered: "tests/test_apps_module_migrations.py"
  • uncovered: "tests/test_benchmark_compare.py"
  • uncovered: "tests/test_benchmark_operations.py"
  • uncovered: "tests/test_campaign_record_injection.py"
  • uncovered: "tests/test_campaign_task_selection.py"
  • uncovered: "tests/test_harness_improvement.py"
  • uncovered: "tests/test_knowledge_navigation_browser.py"
  • uncovered: "tests/test_optimization_session.py"
  • uncovered: "tests/test_optimization_story.py"
  • uncovered: "tests/test_package_root_inventory.py"
  • uncovered: "tests/test_project_optimization.py"
  • uncovered: "tests/test_round_citations.py"
  • uncovered: "tests/test_search_archive.py"
  • uncovered: "tests/test_search_attribution.py"
  • uncovered: "tests/test_search_capture_delivery.py"
  • uncovered: "tests/test_skill_eval_compare.py"
  • uncovered: "tests/test_skill_eval_engineering.py"
  • uncovered: "tests/test_skill_eval_generation.py"
  • uncovered: "tests/test_skill_eval_local.py"
  • uncovered: "tests/test_skill_eval_local_cli.py"
  • uncovered: "tests/test_skill_eval_pipeline.py"
  • uncovered: "tests/test_skill_evaluation.py"
  • uncovered: "tests/test_target_module_import_gate.py"
  • uncovered: "tools/skill_eval_cloud_replay.py"
  • uncovered: "tools/skill_eval_compare.py"
  • uncovered: "tools/skill_eval_improve.py"
  • uncovered: "tools/skill_eval_local.py"
  • uncovered: "tools/skill_eval_pilot.py"
  • uncovered: "tools/skill_eval_qualify.py"

Dong1017
Dong1017 previously approved these changes Nov 19, 2026

@Dong1017 Dong1017 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.

LGTM

PR review verdict — PASS
Reviewed base 8dcf5ad and head 8d414dd (full diff, first review). prior-reviews.md has no formal reviews on this head and no outstanding CHANGES_REQUESTED. This is Dong-bot (authorized delegate) acting as one independent review vote, not a substitute for other required approvals.

Verified by reading the diff:

  • Moves are byte-identical. The five implementations (campaign, benchmark_operations, improvement, skill_evaluation, skill_eval_engineering) go to apps/workflows/ with the same blob hashes as the old files, so signatures, return values and record schemas are unchanged. workflows/__init__.py is docstring-only.
  • Shims match the inventory. The old apps/*.py paths are now docstring + explicit import + literal __all__. Each export list and order matches the new docs/apps-module-migrations.json entries, and the relative-import form resolves to the canonical name.
  • skill_eval_engineering script entry. The shim uses a static absolute import plus an if __name__ == "__main__": main() guard, recorded as script_entry. test_shim_is_an_explicit_export_of_the_same_objects is extended to check that exact AST. New tests cover old and canonical paths, run with -m and by file. check_installed.py does the same against the installed wheel.
  • Callers are retargeted. cli/__init__.py, the views/* modules, tools/skill_eval_{cloud_replay,compare,improve,local,pilot,qualify}.py and the tests all point at the canonical modules.
  • Controller and fingerprint lists are updated. tools/skill_eval_compare.py, skill_eval_improve.py and skill_eval_pilot.py list the new source paths, so frozen snapshots hash the real code and not the shims.
  • Runtime-identity break is deliberate and documented. optimization_session._runtime_identity now fingerprints apps/workflows/campaign.py. Plans created before the move are rejected for status and recover. The PR documents this under "Release-boundary recovery" in optimization-workflow-unification.md, with the pinned-runtime recovery path, and cross-links it from operations.md and module-layout.md.
  • Tests cover the break. test_pre_move_runtime_identity_is_rejected_without_rewriting_plan checks the plan bytes stay unchanged and nothing is executed. The new identity test asserts the hash of the canonical file. The two-runtime wheel test skips unless INFERRSI_PRE_MOVE_PYTHON is set.
  • Cold-import test. It now runs for the workflows group. It relaxes the blocked-import list for workflows, which legitimately import benchmark and infra, and keeps the no-I/O, no-process and no-service checks.
  • Docs. The docs/ changes reflect the new layout (architecture tree, module-layout table, function-owners, and the recovery section).

Not verified here: I ran no tests and saw no CI results. I did not run the installed-wheel check, the cross-version recovery test (skipped without the pinned old wheel) or the cold-import test. Please confirm CI is green before merge, especially the new cold-import test for workflows and check_installed.py. I also could not check from the diff that every file in the inventory consumers lists is accurate.

Non-blocking: the pre-move break forces in-flight sessions to resume on the old pinned runtime. Mention it in the release notes.


Posted by Dong-bot, an automated agent acting on behalf of @Dong1017 (always-on-bot, model claude-sonnet-5-5).

@Dong1017 Dong1017 added area:harness Harness module: profile, A/B loop, quality gates, evidence reports kind:task Bounded delivery task with a delegated slice labels Nov 19, 2026

@david6666666 david6666666 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.

One migration-inventory detail to preserve while refreshing this branch against main.

Comment thread docs/apps-module-migrations.json Resolved
Signed-off-by: zengchuang <zengchuang3@huawei.com>
Agent-assisted-by: Codex (author)
Signed-off-by: zengchuang <zengchuang3@huawei.com>
Agent-assisted-by: Codex (author)

Copy link
Copy Markdown
Contributor Author

已进一步同步 #501(main 8dcf5ade),保留新的 benchmark comparison、CLI、策略/知识引用记录及归档 consumer。新加入的 benchmark_compare.py 同属用户工作流,已按 #490 的职责安排迁入 workflows,并保留旧路径公开函数和配置对象的静态导出。当前切片共六个实现、13 项迁移登记,未更改比较规则、协议或报表行为。

新增比较、报表、MoE 协议、迁移、导入边界及普通项目回归:234 passed、1 skipped、43 subtests passed。新比较实现除了相对导入层级之外 AST 完全一致。安装/双 wheel 恢复与三个插件检查正按当前提交继续验证。

前次测试中的 Windows 只读文件删除失败已在未改主线 9b81c9ba 复现;profile 时限用例在串行复跑中通过。保留这些实际结果,不以 advisory 宿主检查作为审批或合入前置。

Signed-off-by: zengchuang <zengchuang3@huawei.com>
Agent-assisted-by: Codex (author)

Copy link
Copy Markdown
Contributor Author

@Dong1017 @david6666666 @amy-why-3459 请复审当前 head 8d19587d3d18c97e8f6ef79a4cdc641eb9bf1649,base 8dcf5ade,保持 Ready。

David 的 archive consumer 意见已回复:旧 archive 兼容项与 #501 比较实现的 canonical consumer 同时登记,清单检查通过。比较实现已随第三步归入 workflows,旧 API/config 对象身份保留,新增相关组合回归 234 passed。Dong 提议的旧计划恢复 release note 已补 CHANGELOG。

当前源码的双 wheel 恢复边界、仓库外安装、13 项兼容导出及三个插件的 55 项检查都已实际通过,PR 正文已按最终六模块范围重写。请对当前内容给出独立正式结论;通过时提交首行 LGTM 的 Approve。合入核对两份 write+ 独立有效审批和必需检查,host-compatibility 按 #508 为 advisory,实际结果保留。

Dong1017
Dong1017 previously approved these changes Nov 19, 2026

@Dong1017 Dong1017 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.

LGTM

PR review verdict — PASS
Reviewed base 8dcf5ad and head 8d19587. This is a full re-review of the current head, not only the delta since the last Dong-bot Approve on 8d414dd3. That earlier Approve is DISMISSED and carries no weight here. The prior-reviews file shows no formal APPROVED review on this head and no outstanding CHANGES_REQUESTED. This is one independent review vote from Dong-bot (authorized delegate). It does not replace the second required write+ approval or the required checks.

Verified from the diff:

  • Five moves are content-identical.
    • campaign, benchmark_operations, improvement, skill_evaluation and skill_eval_engineering appear as new files under apps/workflows/.
    • Each new file has the same blob hash as the old file's pre-image (b30c2aef, 7770c3f5, 187329e7, 06482510, b907e9a5).
    • Signatures and record schemas are therefore unchanged.
  • benchmark_compare (#501) is re-homed correctly. I compared the new file with the old pre-image by reading both. The only differences are the relative-import levels: .delivery, .delivery.schema, .storage.archive and .views.comparison_report become .. forms. The rest of the 580 lines is unchanged. Config, validation, _prompt, _trial_result, report and compare_command behave as before.
  • Shims are explicit and static.
    • Each old path is a docstring, an explicit import and a literal __all__.
    • The benchmark_compare shim exports exactly the 10 names listed in docs/apps-module-migrations.json.
    • The skill_eval_engineering shim uses an absolute import and keeps the if __name__ == "__main__": main() guard. It is recorded as script_entry, and the test checks that exact AST.
    • tests/check_installed.py runs both the -m and file entries, for the old and the canonical module, against the installed wheel. It asserts the exit code, empty stdout/stderr and the result.json bytes.
    • workflows/skill_evaluation.py does from . import skill_eval_engineering, which resolves to the canonical sibling.
  • David's archive-consumer finding is resolved.
    • The archive entry now lists src/inferrsi/apps/workflows/benchmark_compare.py. That is the real implementation that imports storage.archive, so the #501 consumer is not dropped.
    • It also lists the legacy apps/archive.py.
    • Matching shim-path consumer rows were added for artifact_reader, result, evidence_layout, bridge, context_provider and candidate_provider.
    • The benchmark_compare entry registers its consumers: cli/__init__.py, check_installed.py and test_benchmark_compare.py.
  • Callers are retargeted. apps/cli/__init__.py (including the lazy imports for benchmark_compare and benchmark_operations), views/capture_delivery.py, views/optimization_story.py, the test fixtures and the doc references all use apps/workflows/*.
  • Runtime identity.
    • harness/optimization_session.py changes one path in _runtime_identity, from apps/campaign.py to apps/workflows/campaign.py. The change is scoped and fingerprints the real implementation instead of the shim.
    • The new "Release-boundary recovery" section in docs/optimization-workflow-unification.md and the CHANGELOG entry state that frozen pre-move sessions must use their pinned runtime for status and recover.
    • This matches the earlier release-note request.
  • Import-time side effects. workflows/__init__.py is docstring-only. The cold-import test is extended to the workflows group with the same blocked-IO guard.

Not verified here:

  • I did not run any tests, Ruff, wheel builds or the double-wheel recovery integration. The 234 passed / 55 passed / 1 passed results are the author's report for runtime commit b250620b. The PR text says the current head differs from it only by the CHANGELOG.
  • The seeded diff is truncated after tests/test_optimization_session.py. I read the new double-wheel recovery test and the remaining test edits only to the extent shown, and I did not review the rest.
  • The Windows-only failures the author recorded were reproduced on an unmodified main. I did not check that independently.
  • The skill-evaluation bot comment is PLANNED, with no selected comparisons. It is not evidence for or against this PR. The change is a pure relocation, so I see no behavioral claim that needs a model-based check.

Non-blocking, for the merge gate rather than this review:

  • Confirm the required checks and a second independent write+ approval before merge.
  • The Windows/macOS host-compatibility checks are advisory under #508.

Posted by Dong-bot, an automated agent acting on behalf of @Dong1017 (always-on-bot, model claude-sonnet-5-5).

Signed-off-by: zengchuang <zengchuang3@huawei.com>
Agent-assisted-by: Codex (author)

Copy link
Copy Markdown
Contributor Author

@Dong1017 @david6666666 @amy-why-3459 主线 #507 合入后产生冲突,已处理并推送 head 5f3194a0fdd466d6ccf8a9bcac667d6e44f5d38c,base 9c7b7b05042f54ca71d13b2897a7505d818d3429,请对当前内容独立复审。

当前变更保留 #507 的完整 Find 检索、revision pins、展示和证据行为:canonical workflows/campaign.py 与当前 main 的原 campaign 源码一致;旧路径继续静态导出。新增 capture delivery / round citations 调用方已切换并登记,合并后的其他新逻辑均保留,未改 Knowledge 实现。Ruff、diff 检查通过;受影响回归、独立 wheel/双 runtime 恢复和新 CI 正在刷新,完成后补结果。

旧 head 的 Ready 检查全部通过,但其审批和结果不当作新 head 结论。请检视 diff 的完整文件,尤其最新 conflict resolution 与旧计划恢复用例;若通过请正式 Approve,首个非空行单独写 LGTM。仍需两份独立 write+ 有效审批与必需 CI 后 squash 合入。

Dong1017
Dong1017 previously approved these changes Nov 19, 2026

@Dong1017 Dong1017 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.

LGTM

PR review verdict — PASS
Reviewed base 9c7b7b0 and head 5f3194a. This is a fresh read of the current diff. The earlier Dong-bot Approves on 8d414dd3 and 8d19587d are DISMISSED and carry no weight here. prior-reviews.md shows no APPROVED review on this head and no outstanding CHANGES_REQUESTED. This is one independent review vote from Dong-bot (authorized delegate). It does not replace the second write+ approval or the required CI.

Verified from the diff, focused on the #507 conflict resolution:

  • workflows/campaign.py is unchanged from main. The new file has blob ccb45d23, the same as the pre-image of apps/campaign.py at base. The #507 Find retrieval, revisions pins, _supplies_no_observation branch, save_retrieval and verify_capture bodies are all intact.
  • The campaign shim matches the inventory. It is a docstring, one explicit import and a literal __all__. The four names and their order equal the docs/apps-module-migrations.json entry.
  • The other four moves are byte-identical. benchmark_operations, improvement, skill_evaluation and skill_eval_engineering keep the blobs 7770c3f5, 187329e7, 06482510 and b907e9a5. skill_evaluation still imports from . import skill_eval_engineering, which resolves inside workflows/.
  • benchmark_compare is re-homed correctly. I compared the new file with the old one. The only differences are the four relative-import depths: ..delivery, ..delivery.schema, ..storage.archive and ..views.comparison_report. The comparison rules and report code are unchanged. The shim exports exactly the 10 inventory names.
  • The skill_eval_engineering script entry is preserved. The shim uses a static absolute import plus a __main__ guard. The migration test is extended to check that exact AST and the script_entry field. check_installed.py runs both the old and canonical paths with -m and by file. It asserts exit code 1, empty streams and the exact result.json bytes.
  • Callers are retargeted. cli/__init__.py, views/capture_delivery.py and views/optimization_story.py now import workflows.campaign. The dashboard_profile_review fixture patches inferrsi.apps.workflows.campaign.__version__, so the version patch hits the real definition.
  • The inventory is consistent. The archive consumers keep both apps/archive.py and workflows/benchmark_compare.py, which resolves David's earlier comment. The inventory now has 13 entries, 7 earlier plus 6 new, matching the PR body. The new campaign consumers include capture_delivery, optimization_story, test_round_citations and test_search_capture_delivery, the callers #507 added.
  • The runtime identity change is one line. harness/optimization_session.py now hashes apps/workflows/campaign.py instead of apps/campaign.py. New plans fingerprint the canonical source. A frozen pre-move plan fails the runtime map check, which is the intended behavior. The CHANGELOG and docs/optimization-workflow-unification.md#release-boundary-recovery say to use the original pinned runtime for status and recover and not to edit the plan. The anchor matches the heading.

Not verified here:

  • The seeded diff is truncated partway through tests/test_apps_module_migrations.py. I did not read the rest of the test changes. That includes the old-plan recovery test test_pinned_pre_move_wheel_recovers_its_original_plan in tests/test_optimization_session.py and the other test retargeting. I judged that behavior from the source and docs changes only.
  • I executed no tests. The only run results in the PR are for the earlier runtime b250620b. The PR says regressions, the dual-wheel recovery and CI are still refreshing for this head.

Non-blocking conditions before merge:

  • Required CI must be green on 5f3194a0.
  • The author should post the refreshed results for the affected regressions and the dual-runtime recovery case on this head.
  • Merge still needs a second independent write+ approval. Windows and macOS host-compatibility are advisory per #508.

Posted by Dong-bot, an automated agent acting on behalf of @Dong1017 (always-on-bot, model claude-sonnet-5-5).

Copy link
Copy Markdown
Contributor Author

已补当前 head 5f3194a0 的实际结果:Find/capture/round citations/展示/Knowledge CLI/迁移组 226 passed、1 skipped;comparison/协议/会话/项目组 261 passed、2 skipped、43 subtests。两个独立 sdist/wheel 的新环境安装检查通过,双 runtime 恢复 1 passed,已实际执行,旧计划与已留存文件字节不变、原 runtime 恢复原运行且候选执行一次。跳过项及环境限制已写入正文,浏览器另由 CI 验证。

@david6666666 请复核 archive consumer 已处理后的当前完整 diff,尤其 migration 测试及双 wheel 恢复用例;Dong 已于本 head 正式批准,仍缺第二份独立有效审批。若还有问题请指出,我先处理;通过请提交正式 Approve。当前 CI 和插件组继续跟进。

Copy link
Copy Markdown
Contributor Author

@david6666666 @amy-why-3459 当前 head 5f3194a0 已具备完整检视材料:必需 CI 全部通过,Ready run;三个插件当前源码的 55 项检查也已通过。Dong1017 对该 head 已正式 Approve,目前只差第二份有效独立审批。

请复核后给出正式结论,有意见我先处理,通过则请提交首行单独为 LGTM 的 Approve。保持 Ready;凑齐两份独立 write+ 有效审批后直接 squash 合入,随后提交已验证的 integrations 独立切片。

Copy link
Copy Markdown
Contributor Author

@david6666666 @amy-why-3459 再次请求复审:09:19 UTC 复核,head 仍为 5f3194a0fdd466d6ccf8a9bcac667d6e44f5d38c,Ready、无冲突,必需 CI 全部通过。Dong1017 于本 head 正式 Approve;目前仍只有 1/2 份有效独立审批,尚不能 squash 合入。

请检视后给出正式结论;有意见我先处理,通过请提交首个非空行单独写 LGTM 的 Approve。合入这一步已在第二份审批处停留约一小时,已按请求方约定提醒其协调。integrations 下一切片已完成 300 项回归、55 项插件检查和独立安装验证,等待本 PR 合入后单独提交。

cursor[bot]
cursor Bot previously approved these changes Nov 19, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM

PR review verdict — PASS
Reviewed base 9c7b7b05042f54ca71d13b2897a7505d818d3429 and head 5f3194a0fdd466d6ccf8a9bcac667d6e44f5d38c.

Moves six Apps workflow implementations under apps/workflows/ with thin compatibility re-exports at the prior module paths; CLI/tools/tests/docs updated. Local targeted suites (migrations, inventory, import gate, campaign/benchmark/skill-eval): 239 passed, 39 skipped. Ready green on tip (44484800530).

Pairs Dong1017 tip Approve on the same head. Technical/third-party verify only (cursor[bot] permission none) — not write+ dual tip / merge-ready. Leave merge to Dong always-on / write+ humans.

Signed-off-by: zengchuang <zengchuang3@huawei.com>
Agent-assisted-by: Codex (author)
@zengchuang-hw
zengchuang-hw dismissed stale reviews from cursor[bot] and Dong1017 via 15458a4 November 19, 2026 11:13

Copy link
Copy Markdown
Contributor Author

@Dong1017 @david6666666 @amy-why-3459 已处理主线 #510 / #512 合入带来的冲突,请复审当前 head 15458a4bf837880a56feb76d9d0cab4191d94507,base c573f40a43ceef23ef08507fca662c95ffb65390,保持 Ready。

解决了 CHANGELOG、架构图和 optimization-session 测试三处冲突:保留两套迁移/恢复说明,Apps 目录图同时展示 host 与 workflows,并保留 serving 的摘要断言、冻结 pre-serving fixture 和安装 server 字节变化时的拒绝用例。Harness 相对当前 main 仍只有 campaign 源码摘要路径的一行变更。五个实现源码完全一致,benchmark_compare 仅相对导入层级变化;Ruff、whitespace、源码/AST 对照已通过。

当前 head 的 serving/host/边界/会话回归、插件和独立双 wheel 验证正在刷新,Ready CI 已启动,完成后补实际结果。请读取完整的迁移与恢复测试文件;diff 截断时请继续读取对应文件,不沿用旧 head 的审批。此前 Cursor 为技术批准,permission none,不算第二份有效票。仍按两份当前有效、独立 write+ 审批加必需 CI squash 合入。

@Dong1017 Dong1017 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.

PR review verdict — DO NOT PASS (not a rejection of the change; the evidence for this head is incomplete)

Reviewed base c573f40a43ceef23ef08507fca662c95ffb65390 and head 15458a4bf837880a56feb76d9d0cab4191d94507. This is Dong-bot (authorized delegate). prior-reviews.md shows no APPROVED review on this head and no outstanding CHANGES_REQUESTED. All earlier Approves, including mine, are DISMISSED or on older heads, and I give them no weight. Cursor's approval was on 5f3194a0, and the author notes it does not count as a write+ vote.

Why I am not passing

  1. The diff I was given is incomplete (diffComplete: false). It stops partway through tests/test_apps_module_migrations.py. I did not see the rest of that file, the tests/test_optimization_session.py changes, or the remaining test files. Those are what the author specifically asked me to read: the migration tests, the frozen pre-serving fixture, the rejection case when installed server bytes change, and the double-wheel recovery test. I cannot approve content I have not read.
  2. No result yet for this head. The PR body and the 11:17 comment both say the serving, host, boundary and session regressions, the plugin checks, and the independent double-wheel recovery are still being refreshed. The Ready run had only just started. The results tabulated in the body are for old head 5f3194a0 and, as the author says, do not carry over.

What I verified in the visible part of the diff (no problems found)

  • Five moves are content-identical. Each new file under apps/workflows/ has the same blob hash as the old file's pre-image: campaign ccb45d23, benchmark_operations 7770c3f5, improvement 187329e7, skill_evaluation 06482510, skill_eval_engineering b907e9a5. This includes the #507 Find, revisions and _supplies_no_observation logic in campaign.py.
  • benchmark_compare (#501). I compared the 580-line body against the old file. Only the relative imports changed: .delivery, .delivery.schema, .storage.archive and .views.comparison_report become the .. forms.
  • Shims.
    • Each is a docstring, one explicit import and a literal __all__.
    • Export names and order match the new docs/apps-module-migrations.json entries (13 entries in total).
    • The skill_eval_engineering shim uses a level-0 absolute import plus an if __name__ == "__main__": main() guard, recorded as script_entry.
  • Inventory. The archive consumers list keeps both src/inferrsi/apps/archive.py and src/inferrsi/apps/workflows/benchmark_compare.py, which resolves David's inline comment. The 13 entries are present.
  • Callers and harness.
    • cli/__init__.py, views/capture_delivery.py and views/optimization_story.py now import the canonical modules.
    • harness/optimization_session.py has the single-line _runtime_identity path change to apps/workflows/campaign.py.
  • Tests visible so far.
    • check_installed.py now covers the 6 workflows entries and runs the engineering verifier both with -m and by file path, for the old and new modules.
    • The shim AST test handles script_entry.
    • The cold-import test is parametrised over handoff and workflows.
  • Docs. docs/operations.md, docs/module-layout.md, docs/architecture.md, CHANGELOG and the new "Release-boundary recovery" section are consistent with each other. Both CHANGELOG recovery notes appear to be present, but I only saw the first hunk of the CHANGELOG diff.

Not verified here

  • No tests were run. I have not seen the Ready CI result, the plugin checks, the Windows/macOS advisory jobs, or the independent sdist/wheel result for this head.
  • The truncated test files listed above.
  • Whether test_pinned_pre_move_wheel_recovers_its_original_plan actually executes. It skips when INFERRSI_PRE_MOVE_PYTHON is unset, so the author's reported run for this head matters.

To clear this

  • Post the completed Ready run and the double-wheel recovery result for 15458a4b, stating that the test ran and was not skipped.
  • If the tooling again cuts the diff, say so, and I will read the remaining test files by path.
  • On a re-request or a push I will re-read the head. If the visible findings hold and CI is green, I expect to approve.
  • Merge still needs two independent write+ approvals plus the required CI. My vote would be one of them and does not replace the second.

Posted by Dong-bot, an automated agent acting on behalf of @Dong1017 (always-on-bot, model claude-sonnet-5-5).

Copy link
Copy Markdown
Contributor Author

@Dong1017 已按 本轮检视 补齐当前 head 15458a4bf837880a56feb76d9d0cab4191d94507 的材料,也请 @david6666666 @amy-why-3459 独立复审。

当前提交的必需 CI 已全部通过: Ready run 44512874739。两个 Python 完整检查、两个独立安装检查和浏览器检查均通过;Windows/macOS advisory 也通过。知识策略状态为 success。

双 wheel 恢复测试已实际执行,1 passed,未跳过。 分别从未修改 main c573f40a 与当前 head 的源码构建 sdist,再各自由 sdist 构建 wheel、装入两个全新独立环境。设置 INFERRSI_PRE_MOVE_PYTHON 和 INFERRSI_POST_MOVE_PYTHON 执行 test_pinned_pre_move_wheel_recovers_its_original_plan:新 wheel 的 status/recover 均拒绝原计划,全部留存字节不变;原 wheel 恢复原运行与原 attempt,候选仅执行一次;新计划摘要指向 canonical 实现。该实际运行是 1 passed / 8.46s。安装检查及 930 个资源一致性也通过。当前 head 的三个插件检查为 57 passed。

已确认本次给你的 diff 被截断;请按以下固定 head 的完整文件继续读取:

本地 Windows 扩展结果也已完整写入正文:首组 329 passed、2 skipped、356 subtests、1 个 Git 换行配置相关失败;尾组 41 passed、15 subtests、1 deselected、1 个 Linux-only server 接口失败;compatibility shells 单独 17 passed。两个失败均在未修改 base 复现,没有修改断言或全局配置,也未当作 Windows 全组通过。它们不替代已通过的 Linux 必需 CI。

请基于完整文件和当前结果重新给出结论;有问题我先处理,通过请提交首个非空行单独为 LGTM 的正式 Approve。保持两份当前有效独立 write+ 审批加必需 CI 的合入条件。

Copy link
Copy Markdown
Contributor Author

补一份可直接读取的关键测试差异,解决本轮 diffComplete:false 截断。以下为 base c573f40a → head 15458a4b 的原始 diff,包含完整 migration 测试增量、Apps runtime identity / 实际双 wheel 恢复增量,以及新旧工程脚本入口校验。当前 head 没有变化。

main 已有的 serving 拒绝用例 _refused、test_a_plan_from_before_the_serving_move_is_refused_and_left_unchanged、test_changed_installed_server_bytes_refuse_an_untouched_plan 的 AST 与 base 完全一致,冻结 fixture 的 blob 也一致;完整文件的固定 head 链接见上条答复。这是作者的源码对照,供独立检视,不是作者预填审批。

三个关键测试文件的完整增量(292 行)
diff --git a/tests/test_apps_module_migrations.py b/tests/test_apps_module_migrations.py
index 606297e0..4582c3ca 100644
--- a/tests/test_apps_module_migrations.py
+++ b/tests/test_apps_module_migrations.py
@@ -22,10 +22,21 @@ MIGRATIONS = json.loads((REPO / "docs/apps-module-migrations.json").read_text(en
 def test_shim_is_an_explicit_export_of_the_same_objects(entry):
     path = REPO / "src" / (entry["old"].replace(".", "/") + ".py")
     tree = ast.parse(path.read_text(encoding="utf-8"))
-    docstring, imported, declared = tree.body
+    if entry.get("script_entry"):
+        docstring, imported, declared, guard = tree.body
+        assert ast.dump(guard) == ast.dump(ast.parse(
+            f'if __name__ == "__main__":\n    {entry["script_entry"]}()\n'
+        ).body[0])
+    else:
+        docstring, imported, declared = tree.body
     assert isinstance(docstring, ast.Expr) and isinstance(docstring.value, ast.Constant)
-    assert isinstance(imported, ast.ImportFrom) and imported.level == 1
-    assert "inferrsi.apps." + imported.module == entry["canonical"]
+    assert isinstance(imported, ast.ImportFrom)
+    if entry.get("script_entry"):
+        # This former file entry must also work without a package context.
+        assert imported.level == 0 and imported.module == entry["canonical"]
+    else:
+        assert imported.level == 1
+        assert "inferrsi.apps." + imported.module == entry["canonical"]
     assert sorted((name.name, name.asname) for name in imported.names) == sorted(
         (name, None) for name in entry["exports"]
     )
@@ -148,7 +159,7 @@ def test_storage_dependency_check_rejects_a_handoff_back_edge(tmp_path, indirect
 
 
 def test_migrated_initializers_import_nothing_and_module_bodies_do_no_io():
-    packages = ["inferrsi.apps.storage", "inferrsi.apps.handoff"]
+    packages = ["inferrsi.apps.storage", "inferrsi.apps.handoff", "inferrsi.apps.workflows"]
     for package in packages:
         path = REPO / "src" / package.replace(".", "/") / "__init__.py"
         tree = ast.parse(path.read_text(encoding="utf-8"))
@@ -212,13 +223,15 @@ def test_delivered_context_draft_loads_a_legacy_instance_pickle():
     assert type(restored) is DeliveredContextDraft and restored == value
 
 
-def test_cold_handoff_imports_do_not_read_data_probe_or_launch_services():
+@pytest.mark.parametrize("group", ["handoff", "workflows"])
+def test_cold_handoff_and_workflow_imports_do_not_read_data_probe_or_launch_services(group):
     script = """
 import builtins, importlib, importlib.abc, io, json, socket, sqlite3, subprocess, sys, warnings
 from unittest.mock import patch
-blocked = ('inferrsi.apps.api', 'inferrsi.infra', 'inferrsi.benchmark', 'inferrsi.model',
-           'inferrsi.harness.api', 'inferrsi.harness.run_store', 'inferrsi.harness.generation',
-           'torch', 'numpy', 'PIL', 'vllm')
+blocked = ('inferrsi.apps.api', 'inferrsi.harness.api', 'inferrsi.harness.run_store',
+           'inferrsi.harness.generation', 'torch', 'numpy', 'PIL', 'vllm')
+if sys.argv[2] == 'handoff':
+    blocked += ('inferrsi.infra', 'inferrsi.benchmark', 'inferrsi.model')
 class Block(importlib.abc.MetaPathFinder):
     def find_spec(self, name, path=None, target=None):
         if any(name == item or name.startswith(item + '.') for item in blocked):
@@ -228,7 +241,7 @@ def deny(*args, **kwargs):
     raise AssertionError('unexpected data read, device probe, process or service')
 with warnings.catch_warnings(record=True) as caught:
     warnings.simplefilter('always')
-    importlib.import_module('inferrsi.apps.handoff')
+    importlib.import_module('inferrsi.apps.' + sys.argv[2])
     parent_only = sorted(name for name in sys.modules if name.startswith('inferrsi.apps'))
     with patch.object(builtins, 'open', deny), patch.object(io, 'open', deny), \\
          patch.object(subprocess, 'Popen', deny), patch.object(sqlite3, 'connect', deny), \\
@@ -242,8 +255,8 @@ with warnings.catch_warnings(record=True) as caught:
 print(json.dumps({'parent_only': parent_only, 'warnings': [str(w.message) for w in caught],
                   'control': control}))
 """
-    modules = [entry[key] for entry in MIGRATIONS if ".handoff." in entry["canonical"]
+    modules = [entry[key] for entry in MIGRATIONS if f".{group}." in entry["canonical"]
                for key in ("old", "canonical")]
-    result = _fresh(script, json.dumps(modules))
-    assert result == {"parent_only": ["inferrsi.apps", "inferrsi.apps.handoff"],
+    result = _fresh(script, json.dumps(modules), group)
+    assert result == {"parent_only": ["inferrsi.apps", f"inferrsi.apps.{group}"],
                       "warnings": [], "control": True}
diff --git a/tests/test_optimization_session.py b/tests/test_optimization_session.py
index fe8010e8..073237f0 100644
--- a/tests/test_optimization_session.py
+++ b/tests/test_optimization_session.py
@@ -1,6 +1,9 @@
 """Run the current-Agent protocol using real child processes and synthetic work."""
 
 import json
+import os
+import subprocess
+import sys
 from pathlib import Path
 
 import pytest
@@ -411,7 +414,7 @@ def test_child_argument_error_keeps_its_cli_message_at_start(task, tmp_path, cap
 
 
 def test_task_runner_does_not_expose_harness_as_top_level_modules(task, tmp_path):
-    from inferrsi.apps.benchmark_operations import run_task
+    from inferrsi.apps.workflows.benchmark_operations import run_task
 
     output = tmp_path / "imports.json"
     (task / "benchmark.py").write_text(
@@ -426,7 +429,7 @@ def test_task_runner_does_not_expose_harness_as_top_level_modules(task, tmp_path
 
 
 def test_knowledge_delivery_is_retained_and_bound_to_round(session, capsys):
-    from inferrsi.apps.campaign import verify_capture
+    from inferrsi.apps.workflows.campaign import verify_capture
     from inferrsi.knowledge.knowledge_find import installed_skill_root
     from inferrsi.knowledge.knowledge_operations import KnowledgeReader
 
@@ -468,6 +471,8 @@ def test_runtime_identity_covers_migrated_process_domain_and_not_removed_executo
     assert "harness/artifact_primitives.py" in identity
     # #412 R3: the protocol child entry runs every task protocol operation.
     assert "harness/protocol_child.py" in identity
+    assert "apps/workflows/campaign.py" in identity
+    assert "apps/campaign.py" not in identity
     assert "infra/executors/local.py" not in identity
     for name in identity:
         assert (root / name).is_file(), name
@@ -479,6 +484,9 @@ def test_runtime_identity_covers_migrated_process_domain_and_not_removed_executo
     server = (root / "harness/serving/server.py").read_bytes()
     assert identity["harness/serving/server.py"] == hashlib.sha256(server).hexdigest()
 
+    from inferrsi.harness.artifact_primitives import sha256
+
+    assert identity["apps/workflows/campaign.py"] == sha256(root / "apps/workflows/campaign.py")
 
 PRE_SERVING = (Path(__file__).resolve().parent / "fixtures" / "optimization-session"
                / "pre-serving-runtime-identity.json")
@@ -535,3 +543,114 @@ def test_changed_installed_server_bytes_refuse_an_untouched_plan(
     output = _refused(session, capsys, "status")
     assert "Optimization runtime changed" in output.out + output.err
     assert path.read_bytes() == before
+
+
+@pytest.mark.parametrize("action", ["status", "recover"])
+def test_pre_move_runtime_identity_is_rejected_without_rewriting_plan(session, action):
+    path = session / "plan.json"
+    plan = json.loads(path.read_text(encoding="utf-8"))
+    plan["runtime_identity"]["apps/campaign.py"] = plan["runtime_identity"].pop(
+        "apps/workflows/campaign.py"
+    )
+    # A prior release used the old key. Even equal bytes cannot admit that runtime map.
+    frozen = json.dumps(plan, indent=2).encode("utf-8")
+    path.write_bytes(frozen)
+    with pytest.raises(SystemExit):
+        main(["benchmarks", "session", action, "--session", str(session)])
+    assert path.read_bytes() == frozen
+    assert not (session / "calls.log").exists()
+
+
+@pytest.fixture
+def pre_move_python():
+    executable = os.environ.get("INFERRSI_PRE_MOVE_PYTHON")
+    if not executable:
+        pytest.skip("Set INFERRSI_PRE_MOVE_PYTHON to an isolated, pinned pre-move wheel runtime")
+    assert Path(executable).is_file()
+    return executable
+
+
+def test_pinned_pre_move_wheel_recovers_its_original_plan(
+    tmp_path, task, pre_move_python,
+):
+    """Two independent runtimes; no patched identity map or rewritten frozen plan."""
+    driver = """
+import json, sys
+from pathlib import Path
+if sys.argv[1]:
+    sys.path.insert(0, sys.argv[1])
+from inferrsi.apps.cli import main
+from inferrsi.benchmark import registry
+from inferrsi.harness import optimization_session
+registry._library_root = lambda: Path(sys.argv[2])
+arguments = sys.argv[3:]
+if arguments[0] == 'interrupt':
+    arguments.pop(0)
+    execute = optimization_session._session_execute
+    def interrupt(*args):
+        execute(*args)
+        raise KeyboardInterrupt('synthetic interruption after the retained execution')
+    optimization_session._session_execute = interrupt
+    try:
+        main(arguments)
+    except KeyboardInterrupt:
+        print(json.dumps({'interrupted': True}))
+    else:
+        raise AssertionError('execution was not interrupted')
+else:
+    raise SystemExit(main(arguments))
+"""
+    post_move_python = os.environ.get("INFERRSI_POST_MOVE_PYTHON", sys.executable)
+    current_source = "" if "INFERRSI_POST_MOVE_PYTHON" in os.environ else str(
+        Path(__file__).resolve().parents[1] / "src"
+    )
+
+    def run(python, source, arguments, expected=0):
+        result = subprocess.run(
+            [python, "-I", "-c", driver, source, str(task.parent), *arguments],
+            cwd=tmp_path, capture_output=True, text=True, timeout=60,
+        )
+        assert result.returncode == expected, result.stderr
+        return result
+
+    def start(root):
+        return ["benchmarks", "session", "start", task.name, "--session", str(root),
+                "--rounds", "3", "--max-minutes", "5", "--evaluation-timeout-seconds", "15",
+                "--condition", "synthetic-release-boundary", "--evaluation-args", ""]
+
+    old = tmp_path / "old-session"
+    run(pre_move_python, "", start(old))
+    frozen = (old / "plan.json").read_bytes()
+    old_identity = json.loads(frozen)["runtime_identity"]
+    assert "apps/campaign.py" in old_identity
+    assert "apps/workflows/campaign.py" not in old_identity
+    candidate = old / "work/candidate.py"
+    candidate.write_text("FACTOR = 2\n", encoding="utf-8")
+    interrupted = run(pre_move_python, "", [
+        "interrupt", "benchmarks", "session", "round", "--session", str(old),
+        "--candidate", str(candidate), "--hypothesis", "Synthetic release recovery control",
+    ])
+    assert json.loads(interrupted.stdout)["interrupted"]
+    retained = {p.relative_to(old): p.read_bytes() for p in old.rglob("*") if p.is_file()}
+    for action in ("status", "recover"):
+        rejected = run(post_move_python, current_source,
+                       ["benchmarks", "session", action, "--session", str(old)], expected=2)
+        assert "Optimization runtime changed" in rejected.stderr
+        after = {p.relative_to(old): p.read_bytes() for p in old.rglob("*") if p.is_file()}
+        assert after == retained
+    recovered = json.loads(run(pre_move_python, "", [
+        "benchmarks", "session", "recover", "--session", str(old),
+    ]).stdout)
+    assert recovered["completed_rounds"] == 1 and recovered["best"]["score"] == 2
+    run(pre_move_python, "", ["benchmarks", "session", "status", "--session", str(old)])
+    assert (old / "plan.json").read_bytes() == frozen
+    assert (old / "calls.log").read_text().splitlines() == ["2"]
+
+    new = tmp_path / "new-session"
+    run(post_move_python, current_source, start(new))
+    new_identity = json.loads((new / "plan.json").read_bytes())["runtime_identity"]
+    assert "apps/workflows/campaign.py" in new_identity and "apps/campaign.py" not in new_identity
+    from inferrsi.harness.artifact_primitives import sha256
+
+    canonical = Path(__file__).resolve().parents[1] / "src/inferrsi/apps/workflows/campaign.py"
+    assert new_identity["apps/workflows/campaign.py"] == sha256(canonical)
diff --git a/tests/test_skill_eval_engineering.py b/tests/test_skill_eval_engineering.py
index c0b0434f..c5cab497 100644
--- a/tests/test_skill_eval_engineering.py
+++ b/tests/test_skill_eval_engineering.py
@@ -1,5 +1,6 @@
 import copy
 import json
+import os
 import signal
 import subprocess
 import sys
@@ -8,7 +9,7 @@ from unittest import mock
 
 import pytest
 
-from inferrsi.apps import skill_eval_engineering as artifact_check
+from inferrsi.apps.workflows import skill_eval_engineering as artifact_check
 from inferrsi.benchmark import skill_eval_engineering as engineering
 from inferrsi.harness import artifact_sandbox as sandbox
 
@@ -17,6 +18,26 @@ TASK = {"id": "serving-parser", "split": "development", "request": engineering.R
 ANSWER = {"artifact": "parser.py", "summary": "Repair", "artifact_source": engineering.STARTER}
 
 
+@pytest.mark.parametrize("module", [
+    "inferrsi.apps.skill_eval_engineering", "inferrsi.apps.workflows.skill_eval_engineering",
+])
+@pytest.mark.parametrize("by_file", [False, True])
+def test_old_and_canonical_script_entries_write_the_same_result(tmp_path, module, by_file):
+    task, output, result = (tmp_path / name for name in ("task.json", "output.json", "result.json"))
+    task.write_text(json.dumps(TASK), encoding="utf-8")
+    output.write_text("{}", encoding="utf-8")
+    source = Path(__file__).resolve().parents[1] / "src"
+    arguments = [str(source / (module.replace(".", "/") + ".py"))] if by_file else ["-m", module]
+    environment = {**os.environ, "PYTHONPATH": str(source), "INFERRSI_RESULT_PATH": str(result)}
+    executed = subprocess.run(
+        [sys.executable, *arguments, str(task), str(output)], cwd=tmp_path,
+        env=environment, capture_output=True, text=True, timeout=30,
+    )
+    assert executed.returncode == 1, executed.stderr
+    assert executed.stdout == executed.stderr == ""
+    assert result.read_bytes() == b'{"passed": false, "assertions": {"artifact_schema": false}}'
+
+
 def test_starter_matches_frozen_fixture():
     fixture = Path(__file__).parent / "fixtures/skill_eval_engineering/parser.py"
     assert fixture.read_text() == engineering.STARTER

Copy link
Copy Markdown
Contributor Author

@Dong1017 针对你提出的 diff 截断,已在这条评论 内嵌三个关键测试文件的完整 292 行增量;当前 head 仍是 15458a4b,不需要依赖截断的 seed diff 来判断这部分内容。main 的两个 serving 拒绝测试及 helper AST、冻结 fixture blob 均未改,完整文件的固定版本链接也已提供。

当前必需 CI 全绿、57 项插件通过,实际双 wheel 恢复 1 passed(已执行、未跳过),详见结果答复。请据这些完整材料复审并提交正式结论;若还有无法读取的具体文件或未解决问题,请指出路径/问题,我继续补齐。当前仍在等待有效独立审批。

@zengchuang-hw
zengchuang-hw requested review from Dong1017 and removed request for Dong1017 November 19, 2026 12:04
@Dong1017

Copy link
Copy Markdown
Collaborator

Posted by an agent on behalf of @Dong1017 (incremental review only; points already raised by others are not repeated).

PR review verdict — PASS

Reviewed base c573f40a43ceef23ef08507fca662c95ffb65390 and head 15458a4bf837880a56feb76d9d0cab4191d94507. This is the incremental re-review of my earlier DO NOT PASS (#pullrequestreview-5974083790). Both blockers from that review are cleared.

Blocker 1 — incomplete diff (cleared)

I no longer depend on the handed diff. I read the files at the reviewed head by path:

  • tests/test_apps_module_migrations.py (262 lines) and tests/test_optimization_session.py (656 lines) read in full, plus the base versions diffed against them.
  • The three untruncated test diffs in the 11:32 comment match what is actually at 15458a4b.
  • tests/fixtures/optimization-session/pre-serving-runtime-identity.json is blob 6b99b95b on both base and head — the frozen fixture is unchanged, as claimed.

The migration-test delta is what it says: the script_entry branch adds a level-0 import and an if __name__ == "__main__": main() guard assertion, workflows joins the initializer-package list, and the cold-import test is parametrised over handoff/workflows. The cold-import blocklist for the workflows group drops inferrsi.infra, inferrsi.benchmark and inferrsi.model — correct, not a weakening: every module in that group imports inferrsi.benchmark by design (composition layer), and the parent_only assertion still pins the import to inferrsi.apps.workflows.

I also re-checked the 13 manifest entries against the shim files with an AST pass: every shim's exports and __all__ match docs/apps-module-migrations.json exactly, and only inferrsi.apps.skill_eval_engineering carries the guard its script_entry field declares. The five plain moves remain blob-identical to their pre-images; benchmark_compare.py differs only in its four relative imports.

Blocker 2 — no result for this head (cleared)

Ready run 44512874739 is now completed/success on 15458a4b, finished 11:24:51 UTC. full-check on both 3.10 and 3.11, both installed-package jobs, dashboard-browser, pr-references, declarations and both advisory host jobs all pass; the knowledge policy status context is success. The 3.11 unit run records 5525 passed, 31 skipped.

On the double-wheel recovery: the author's statement that it executed and did not skip is confirmed independently, not accepted on trust. I built the two runtimes myself — base c573f40a installed as a wheel into a fresh virtualenv (apps/campaign.py present, no apps/workflows/), and the reviewed head as an editable install — then ran the node with both INFERRSI_PRE_MOVE_PYTHON and INFERRSI_POST_MOVE_PYTHON set:

tests/test_optimization_session.py::test_pinned_pre_move_wheel_recovers_its_original_plan PASSED
tests/test_optimization_session.py::test_pre_move_runtime_identity_is_rejected_without_rewriting_plan[status] PASSED
tests/test_optimization_session.py::test_pre_move_runtime_identity_is_rejected_without_rewriting_plan[recover] PASSED
3 passed

So the new runtime refuses the old plan for both status and recover leaving the retained bytes untouched, and the pre-move runtime recovers its own run with the candidate executed once.

Optional follow-ups (not blocking)

  • The double-wheel node is skipped in CI. full-check runs plain pytest -rs, so test_pinned_pre_move_wheel_recovers_its_original_plan shows up as SKIPPED [1] tests/test_optimization_session.py:573 on both matrix legs. That matches the documented contract (it skips without a pinned pre-move runtime), and the default regression still covers the rejection path and the canonical-key assertion — which is why this does not block. But the strongest evidence for this change currently lives outside CI. A job that builds the base wheel and sets INFERRSI_PRE_MOVE_PYTHON would keep it from silently regressing to an unverified skip.
  • The two Windows local failures described in the body (a Git line-ending config case and a Linux-only server interface case) are advisory and reproduced on the unmodified base; they are not counted as passes here and do not affect the required Linux lane.

Merge state

My assessment covers the reviewed revision only. Merge still needs two independent write+ approvals plus the required CI; this comment is not an approval and does not replace either.

检查范围:read at 15458a4b — full PR body and every comment after 11:03 along with inline review comments, the complete diff file list (62 files), tests/test_apps_module_migrations.py and tests/test_optimization_session.py in full against their base versions, the frozen pre-serving fixture blob on base and head, all 13 shims against docs/apps-module-migrations.json, the five moves' blob hashes, benchmark_compare.py against its pre-image, .github/workflows/ci-ready.yml, and the CHANGELOG plus docs/module-layout.md/architecture.md entries. Ran test_pinned_pre_move_wheel_recovers_its_original_plan and test_pre_move_runtime_identity_is_rejected_without_rewriting_plan[status|recover] locally in two independent environments (3 passed). Did not run the full suite locally — the 5525-passed figure is read from the Ready run log — and did not re-run the Windows/macOS advisory jobs.

Copy link
Copy Markdown
Contributor Author

@Dong1017 已收到完整复审结论:两项阻塞解除,你已完整读取测试并独立执行 3 个恢复/拒绝节点通过。请把该结论提交为同一 head 15458a4bf837880a56feb76d9d0cab4191d94507 的正式 Approve,首个非空行单独写 LGTM。当前讨论区 PASS 不计有效审批,列表中尚无该 head 的正式批准。

@david6666666 @amy-why-3459 请独立复审并给正式结论,有问题我先处理,通过请 Approve。源码自材料补齐后未变,必需 CI 全绿;仍需两份独立 write+ 有效批准后 squash 合入。可选的双 wheel CI 固化建议已记录,不扩展当前目录切片。

@Dong1017 Dong1017 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.

LGTM

PR review verdict — PASS
Reviewed base c573f40a43ceef23ef08507fca662c95ffb65390 and head 15458a4bf837880a56feb76d9d0cab4191d94507. This converts my incremental PASS on this exact head (comment 7008837278) into the formal review state; the head has not changed since, so this is the same content, not a new approval of new code. It is one independent write+ vote from Dong-bot (authorized delegate) and does not replace the second required approval.

Earlier blockers on this head

My DO NOT PASS (pullrequestreview-5974083790) raised two blockers and nothing else:

  1. the handed diff was cut at tests/test_apps_module_migrations.py;
  2. no result existed yet for this head.

(2) is closed by the completed Ready run 44512874739 on 15458a4b — full-check on 3.10 and 3.11, both installed-package jobs, dashboard-browser, pr-references, declarations, plus the advisory host jobs; 5525 passed / 31 skipped on 3.11. (1) was closed by reading the files at this head by path and executing three recovery/rejection nodes (3 passed). Neither is a code objection, and both were satisfied without a push.

Verified from the seeded diff this session

  • Five moves are byte-identical. Each new apps/workflows/<name>.py carries the pre-image blob of its old path: benchmark_operations 7770c3f53, campaign ccb45d236, improvement 187329e74, skill_eval_engineering b907e9a53, skill_evaluation 064825104. Signatures, return values and retained-record schemas are therefore unchanged.
  • benchmark_compare differs only in relative-import depth — .delivery, .delivery.schema, .storage.archive, .views.comparison_report become .. forms. DEFAULT_CONFIG, resolve_config/_validate_config, _manifest, prepare, _prompt, status/_status, dispatch, _trial_result, collect, report, compare_command are textually identical, so comparison rules and report ownership are untouched.
  • All six shims match the inventory. Docstring, explicit import and literal __all__, with names and order equal to the docs/apps-module-migrations.json entries. skill_eval_engineering is the only one with a level-0 absolute import and an if __name__ == "__main__": main() guard, exactly what its script_entry field declares and what the extended AST assertion checks (four body elements; guard dump equality).
  • David's archive-consumer ask is kept. The archive entry now lists both src/inferrsi/apps/archive.py and src/inferrsi/apps/workflows/benchmark_compare.py; the old apps/benchmark_compare.py entry is dropped because the shim no longer imports storage.archive itself — the direct consumer is the canonical module.
  • Callers are retargeted: apps/cli/__init__.py, views/capture_delivery.py, views/optimization_story.py, tests/fixtures/dashboard_profile_review.py, tests/fixtures/knowledge_retrieval.py, tests/test_anthropic_agent.py.
  • Runtime identity is one line. _runtime_identity() names apps/workflows/campaign.py; the test asserts that key is present, that apps/campaign.py is not, and re-hashes the file through artifact_primitives.sha256. The frozen pre-serving fixture is untouched.
  • The __version__ patch follows its owner. The campaign shim no longer defines __version__, and the dashboard fixture now patches inferrsi.apps.workflows.campaign.__version__ — a stale patch would fail loudly rather than silently pass.
  • Test deltas read as described. workflows joins the import-free-initializer list; the cold-import test is parametrised and the workflows blocklist drops inferrsi.infra/inferrsi.benchmark/inferrsi.model (these are the composition imports, by design), while inferrsi.apps.api, harness.api, run_store, generation, torch, numpy, PIL, vllm stay blocked, the open/Popen/sqlite3.connect/socket denials stay, and parent_only still pins exactly inferrsi.apps + inferrsi.apps.workflows. check_installed.py adds the workflows rows to the shim-identity inventory and runs both the old and canonical engineering entries via -m and by file, asserting exit 1, empty stdout/stderr and byte-identical result.json.

No defect found in the visible portion; docs/*, CHANGELOG.md and tests/_gate_policy_support.py changes are consistent references to the canonical paths.

What I could not see here, and why the verdict still holds

The seeded diff is cut (diffComplete: false) inside tests/test_apps_module_migrations.py, and the three-file snippet quoted in comment 7007871904 is also cut inside test_pre_move_runtime_identity_is_rejected_without_rewriting_plan. So in this session I did not re-read the tail of that file, the remaining test_optimization_session.py delta, tests/test_skill_eval_engineering.py, or the tools/ snapshot deltas. Those were read at this head in the incremental review above, and they are exercised by the green required run — which is why the truncation is a limit of this workspace, not an open question about the change. I am not claiming to have re-read them today.

Not verified in this session: no test execution locally, no re-run of the Windows/macOS advisory jobs. The two local Windows failures in the body (Git line-ending config, Linux-only os.getpgrp helper) reproduce on unmodified c573f40a and are not counted as passes.

Follow-up (non-blocking)

Pinning the double-wheel node in CI — a job that builds the base wheel and sets INFERRSI_PRE_MOVE_PYTHON — would stop test_pinned_pre_move_wheel_recovers_its_original_plan from silently regressing to a skip in full-check. Recorded as optional, not part of this slice.

Merge state

My assessment covers 15458a4b only. Merge still needs a second independent write+ approval alongside the required checks; this Approve is 1 of 2.


Posted by Dong-bot, an automated agent acting on behalf of @Dong1017 (always-on-bot, model claude-sonnet-5-5).

Copy link
Copy Markdown
Contributor Author

@david6666666 @amy-why-3459 当前 head 15458a4bf837880a56feb76d9d0cab4191d94507 已获 Dong 的正式 Approve,有效审批 1/2,必需 CI 全绿。Dong 已完整回读关键测试并在独立环境实际重跑恢复/拒绝节点,之前两项阻塞已解除。

请独立复审后给出正式结论。有问题我先处理;通过请 Approve,首个非空行单独写 LGTM。David 的 archive consumer finding 已修复并有清单测试,当前完整源码链接、292 行关键测试增量和双 wheel 实测结果均在上方。拿到第二份有效独立 write+ 审批后立即 squash 合入,再提已完成 319 项回归、57 项插件检查和独立安装验证的 integrations 切片。

@Dong1017

Copy link
Copy Markdown
Collaborator

Posted by Dong-bot, an automated agent acting on behalf of @Dong1017 (always-on-bot, model claude-sonnet-5-5).

这条要求的正式结论已经落在同一 head 上了,不再重复提交第二份。

15458a4b 现有一条 APPROVED 正式复核(pullrequestreview-5974954344,12:24:46Z),也就是 12:16 那份增量 PASS 的正式化;head 未变,所以它不是对新代码的再次批准。prior-reviews.md 显示该 head 无 outstanding CHANGES_REQUESTED,我 11:23 的 DO NOT PASS 两项阻塞均已解除(完整文件按路径读取、Ready run 44512874739 在该 head success)。同账号在同一 head 上再提一次 Approve 不增加有效票,只会在列表里造成重复。

本轮给我的 seed diff 仍是 diffComplete:false(截断在 tests/test_apps_module_migrations.py),所以我不对未读到的尾部内容另发新结论。可见部分的复核未发现新增问题:

  • 六个实现落位正确。 五个 move 与各自 pre-image blob 一致:campaign ccb45d236、benchmark_operations 7770c3f53、improvement 187329e74、skill_evaluation 064825104、skill_eval_engineering b907e9a53;benchmark_compare.py 相对旧文件只有四处相对导入层级变化(.delivery、.delivery.schema、.storage.archive、.views.comparison_report 变为 .. 形式)。
  • 旧路径是纯静态兼容层。 docstring + 显式导入 + 字面量 __all__;skill_eval_engineering 使用 level-0 绝对导入加 if __name__ == "__main__": main(),与清单里的 script_entry 声明一致,文件入口在没有包上下文时仍可运行。
  • David 的 archive consumer 意见已闭合。 docs/apps-module-migrations.json 里 storage.archive 的直接使用方现登记为 src/inferrsi/apps/workflows/benchmark_compare.py;旧 src/inferrsi/apps/benchmark_compare.py 只是静态导出,消费关系未丢。
  • 运行时摘要改指 canonical 实现。 harness/optimization_session.py 的 identity 列表改成 apps/workflows/campaign.py,test_optimization_session.py 同时断言新路径在表内、旧 apps/campaign.py 不在表内,并校验其 sha256。
  • 安装物校验覆盖双入口。 tests/check_installed.py 对旧/新 skill_eval_engineering 各跑 -m 与文件两种方式,比较退出码 1、空 stdout/stderr 和 result.json 精确字节。
  • 文档与 CHANGELOG 一致。 module-layout、architecture、operations、function-owners、optimization-workflow-unification 的路径同步,两组恢复提醒均保留。

验证边界:本轮没有重跑任何测试,也没有重新执行双 wheel 节点;结论依据是该 head 上已完成的 Ready run 和先前在独立环境实际执行的恢复/拒绝记录,不是你贴出的 292 行增量单独成立。

当前合入只卡在第二份独立 write+ 审批(David 或 Amy),这不是作者侧要补的材料。双 wheel 恢复节点在 CI 里仍显示为 skip,把该节点固化成独立 job 仍是可选跟进项,不阻塞本切片。— Dong-bot(授权代理)

Copy link
Copy Markdown
Contributor Author

@david6666666 @amy-why-3459 再次请求独立复审。13:25 UTC 核对当前 head 15458a4bf837880a56feb76d9d0cab4191d94507 未变,Ready、无冲突、无未解决检视线程,必需 CI 全绿。Dong 于 12:24:46 UTC 的正式 Approve 有效,当前仍为 1/2 份独立 write+ 审批。

第二份审批已一小时没有进展,已按请求方约定提醒其协调。请基于当前完整材料给出正式结论:有问题我先处理,通过请提交首个非空行单独为 LGTM 的 Approve。下一步 integrations 已完成 319 项回归、57 项插件检查和独立安装验证,等待本 PR 合入后提交独立 Ready PR。

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM

PR review verdict — PASS
Reviewed base c573f40a43ceef23ef08507fca662c95ffb65390 and head 15458a4bf837880a56feb76d9d0cab4191d94507.

Re-verify after tip moved past evening cursor Approve on 5f3194a0… (dismissed). Tip pair: Dong1017 Approve on this head + this cursor technical verify.

Verified:

  • Six Apps workflows under apps/workflows/ with static compatibility re-exports; runtime identity points at canonical apps/workflows/campaign.py; #504 superseded cleanly.
  • Local targeted migrations/inventory/import-gate/session/benchmark-compare/skill-eval: 231 passed, 3 skipped (43 subtests).
  • Ready green on tip: full-check 3.10/3.11 (44512874739).

Eligibility: technical/third-party verify only (permission none). Not write+ eligible / dual-tip / merge-ready. Merge left to Dong always-on / write+ humans.

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

Labels

area:harness Harness module: profile, A/B loop, quality gates, evidence reports kind:task Bounded delivery task with a delegated slice

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants