Skip to content

task: 按职责整理 Apps 子模块目录(handoff / storage / workflows / integrations) #490

Open

Description

@zengchuang-hw

Refs #371
Refs #362

当前状态 为 Accepted。方案已由 Dong1017 的授权代理复核确认,从 storage 切片启动实施。Apps 的执行交接、产物存取和工作流实现仍有较多文件平铺在包根目录,拟按职责整理 handoff、storage、workflows 和 integrations 四类子包。Cannbot 与 MindIE 归入 integrations 的目录安排已由请求方确认。

待确认事项 为各切片 PR 的实现和验收。设计检视已完成,storage 的依赖负向用例、旧 pickle 加载和私有 helper 补丁迁移在首个 PR 落地。

下一步 为检视第四步 4a Cannbot 的正式 Ready PR #528。#526 因评审通道无法读取完整补丁,已按检视建议拆成 4a Cannbot / 4b MindIE 并关闭为被接替,未合入。前三步 storage #493、handoff #496、workflows #517 均已合入;4b 待 4a 合入后提交,第五步组合验收继续推进。

目标和完成标准

把 Apps 根目录收敛为公开入口和职责明确的子包,让调用者能够直接找到 Harness 交接、固定产物存取、用户工作流和外部系统集成的实现。Apps 继续通过 Knowledge、Harness、Benchmark 的公开接口装配操作。

初始分析基于主分支 c37832c3,本轮检视修订按主分支 8aba657da79e8ed9f6e6fbb33437e9d9fdd8f1c7 回读源码、调用方和现有 CI。当前 api.py 同时依赖 archive.py、artifact_reader.py、bridge.py、candidate_provider.py 和 result.py,views/attempt.py 也会读取这些固定记录和归档模块。目录迁移应同时检查这些依赖。

  • 每个迁移文件都落入下表对应子包,根目录保留明确的公开入口。
  • 已登记的 Python 调用者、CLI、插件启动器和安装检查均有可验证的迁移结果,显式静态兼容模块通过新旧导出对象身份和导入副作用检查。
  • 固定产物读取、标准输出、错误和重放行为通过现有回归。
  • 目录文档、公开导入文档、打包内容与实际代码一致。
  • 各切片分别提供 PR、检视和验证记录,完成后汇总到本 issue 和 task: Apps 应用层详细设计与迁移计划(CLI / Python / Plugin) #371。

目标目录和文件归属

下图列出目标实现位置。迁移期的旧路径兼容模块按后文清单登记。

src/inferrsi/apps/
├── __init__.py
├── api.py
├── knowledge.py
├── inspection.py
├── host/                    # 主线 #510 已交付
│   ├── inspection.py
│   ├── commands.py
│   ├── environment.py
│   ├── platforms/
│   └── targets/
├── handoff/
│   ├── __init__.py
│   ├── bridge.py
│   ├── context_provider.py
│   └── candidate_provider.py
├── storage/
│   ├── __init__.py
│   ├── archive.py
│   ├── artifact_reader.py
│   ├── result.py
│   └── evidence_layout.py
├── workflows/
│   ├── __init__.py
│   ├── campaign.py
│   ├── benchmark_operations.py
│   ├── benchmark_compare.py
│   ├── improvement.py
│   ├── skill_evaluation.py
│   └── skill_eval_engineering.py
├── integrations/
│   ├── __init__.py
│   ├── cannbot/
│   │   ├── __init__.py
│   │   ├── project.py
│   │   └── read_worker.py
│   └── mindie/
│       ├── __init__.py
│       ├── project.py
│       ├── context.py
│       ├── mcp.py
│       └── read_worker.py
├── cli/
├── views/
├── delivery/
└── legacy/
归属 功能和迁移文件
根目录公开入口 api.py 提供 prepare / execute / assess 和循环适配端口的公开调用面,knowledge.py 提供知识读取和受控存储入口,inspection.py 提供宿主检查入口
handoff/ bridge.py 绑定 ExecutionSpec 并投影固定证据,context_provider.py 交付实际知识字节和 pins,candidate_provider.py 定义 CandidateProvider 并实现生成计划和候选回收。apps.api 显式重新导出同一个类
storage/ archive.py 归档准备与判定、发布输出,artifact_reader.py 在授权存储中读取固定引用,result.py 构造和校验 AppsResultV1,evidence_layout.py 创建证据目录。后者属于 Apps 的文件系统落盘工具,其纯路径规则继续由 contracts.evidence 提供
workflows/ campaign.py 装配活动记录与知识捕获,benchmark_operations.py 启动打包任务,benchmark_compare.py 装配主线 #501 引入的配对比较流程,improvement.py、skill_evaluation.py、skill_eval_engineering.py 装配改进和技能评测流程
integrations/ 统一具体外部系统的项目授权、运行环境绑定和调用适配。apps/cannbot/ 整包迁入 integrations/cannbot/,保留外部只读知识查询与读取;apps/mindie/ 整包迁入 integrations/mindie/,保留项目授权、MCP、上下文导出和读取 worker
现有子包 host/ 承担主线 #510 已迁入的宿主探测、环境与仓库身份;保持该切片的依赖约束。cli/ 管命令入口,views/ 管查询与展示,delivery/ 管统一结果交付,legacy/ 管旧流程装配。迁移时同步它们对上述文件的导入

接口和兼容约束

本项的实现范围为文件归位,以及必要的导入、文档、打包和检查更新。

  1. inferrsi.apps.api 的公开调用继续可用,包括 prepare、execute、assess、EvaluationPort、CandidateProvider 和 read_attempt_view。CandidateProvider 的唯一定义在 handoff/candidate_provider.py,apps.api.CandidateProvider 和旧 provider 路径的导出都指向它,验证对象身份。EvaluationPort 的定义继续位于 api.py。
  2. 旧路径采用显式静态 re-export 的 shim 模块,逐项写出导入符号与字面量 __all__。兼容期保持原有调用和警告行为。新实现及仓库调用方直接导入 canonical 路径。新子包的 __init__.py 保持轻量,导入检查确认不会启动外部进程、探测设备、打开外部知识库或注册服务。
  3. 每个已迁移模块在 docs/apps-module-migrations.json 登记 old、canonical、exports 和 consumers,随该切片提交实际迁移项。兼容测试读取该表,核对 shim 的显式导出和新旧对象身份;现有导入图扫描覆盖 shim 到实现的依赖,并保留跨核禁止边与负向用例。该表用于校验 Apps 内部路径迁移。
  4. 兼容退役采用可观察的条件。所有已登记的活跃调用方和当前用法文档切换到 canonical 路径,wheel 及三个插件入口验证完成后,由负责人在独立退役 PR 记录影响范围和首个移除版本,经检视确认再删除 shim。当前切片交付时保留登记的旧导入。
  5. 旧 pickle 中的 Apps 模块引用可经 shim 加载,新产生的 pickle 使用 canonical 路径。函数和类的 __module__、安装器对定义位置的断言与迁移一起更新。历史证据、归档脚本和数据内的 schema、命名空间、模块标识继续按原格式读取。
  6. AppsResultV1、固定 Ref、规范编码、摘要、退出码、发布失败时已提交的引用,以及 delivery/ 的 campaign-result、报告和产物索引,均按现有契约验收。
  7. 依赖方向已核对。当前 result.py 使用技术契约和 H 错误类型,archive.py 依赖 result.py,artifact_reader.py 依赖 archive / result。bridge.py 和 candidate_provider.py 使用这些存储能力。迁移后的方向为 handoff / workflows / views / delivery → storage,storage 的直接和传递导入不得回到 handoff。
  8. CLI 的导入随对应实现一起迁移。storage 切片即更新其 api、handoff、views、delivery 直接调用方和受影响的 CLI 路径,后续切片同样处理自己的调用方。
  9. Harness 拥有封存、attempt、请求摘要和原始运行记录,Apps 消费其公开接口。Knowledge 拥有通用知识通道协议和检索能力,integrations/ 实现具体外部系统接入,CLI 创建适配器并注入通道注册表。
  10. integrations 切片同步项目授权读取、解释器启动、MCP 配置和 worker 文件定位。project.py 直接定位新目录中的 worker,并在获准解释器下按文件独立执行。shim 提供登记的 Python 导入兼容,worker 启动路径的已登记调用方在该切片切换到 canonical 文件。

调用方盘点和迁移映射

本轮盘点覆盖 8aba657d 中受影响的 src、tests、tools、plugins 和现行用法文档,检查了绝对导入、相对导入、模块属性访问、测试补丁及字符串模块名。外部使用方随切片 PR 发现时补入清单。

下表给出第一批需要核对的具体调用方,表中路径以仓库为根。

迁移模块 已发现的调用方或约束 迁移处理
archive / artifact_reader / result apps/api.py、apps/bridge.py、apps/candidate_provider.py、apps/views/attempt.py、apps/delivery/__init__.py、apps/delivery/adapters.py;tests/test_apps_{prepare,assess,output,publication,port_validation,replay,artifact_reader,generation_plan}.py、tests/test_result_delivery.py;docs/apps-output.md storage 切片同步这些导入。测试对私有 helper 的补丁指向 canonical 实现;公开符号继续由旧路径显式导出。delivery/adapters.py 中持久化的 namespace 值按现有格式保留
evidence_layout tests/test_evidence_paths.py、tests/test_repository_packs_facade.py、tests/check_installed.py;contracts/evidence.py 和模块文档中的说明性引用 已发现的是开发 helper 的测试与公开路径约束。按 Apps 落盘工具归入 storage,更新定义位置及 pickle 断言,并补旧 Apps pickle 引用可加载的验证
bridge / context_provider / candidate_provider apps/api.py、apps/views/attempt.py、tests/test_apps_{evidence,execution_binding,generation_plan,context_provider}.py、tests/test_harness_generation_seal.py handoff 切片同步导入,核对 #475 的实际封存路径。apps.api 的公开类导出做对象身份校验
campaign apps/cli/__init__.py、apps/views/{capture_delivery,optimization_story}.py、tests/fixtures/{knowledge_retrieval,dashboard_profile_review}.py、tests/test_{campaign_record_injection,campaign_task_selection,knowledge_navigation_browser,optimization_story,search_archive,search_attribution}.py;docs/knowledge-retrieval-trace.md workflows 切片更新直接调用及私有模块补丁,旧公开函数路径显式导出
benchmark_operations CLI 的 benchmarks run、tests/test_benchmark_operations.py、tests/test_optimization_session.py、tests/test_project_optimization.py、安装器和模块导入边界中的位置断言 workflows 切片更新按需导入、模块身份与精确路径检查
skill_evaluation / skill_eval_engineering / improvement tools/skill_eval_{pilot,compare,improve,cloud_replay,local,qualify}.py、tests/test_{anthropic_agent,skill_eval_pipeline,skill_eval_engineering,skill_eval_generation,skill_eval_local,skill_eval_local_cli,skill_evaluation,harness_improvement}.py;docs/skill-evaluation.md、docs/reviews/pr437-s01-reproduction/ 活跃入口迁入 workflows;已归档复现材料使用保留的旧公开导入,并核对字符串模块路径
cannbot / mindie CLI 的通道注册、授权命令和上下文导出;各自 project.py 的 _WORKER;tests/test_cannbot_{boundaries,channel_acceptance}.py、tests/test_mindie_{project,runtime,context}.py、tests/check_installed.py、tests/test_target_module_import_gate.py integrations 切片更新 canonical 模块及 worker 路径,验证旧导入、独立 worker 和新父包的轻量初始化
插件入口 Codex launcher、WorkSwarm launcher / runtime locator、DSH remote.cjs 的 Apps CLI 引用及随包 runtime 验证 inferrsi.apps.cli 和对应操作;构建产物内的实际新模块与资源清单共同验收

以下是目标路径表,键值统一补前缀 inferrsi.apps.。第一个 PR 把已交付的迁移项及其 exports / consumers 写入上述 JSON 文件,后续切片逐次补齐。模块文档引用该表。

{
  "archive": "storage.archive",
  "artifact_reader": "storage.artifact_reader",
  "result": "storage.result",
  "evidence_layout": "storage.evidence_layout",
  "bridge": "handoff.bridge",
  "context_provider": "handoff.context_provider",
  "candidate_provider": "handoff.candidate_provider",
  "campaign": "workflows.campaign",
  "benchmark_operations": "workflows.benchmark_operations",
  "benchmark_compare": "workflows.benchmark_compare",
  "improvement": "workflows.improvement",
  "skill_evaluation": "workflows.skill_evaluation",
  "skill_eval_engineering": "workflows.skill_eval_engineering",
  "cannbot": "integrations.cannbot",
  "cannbot.project": "integrations.cannbot.project",
  "cannbot.read_worker": "integrations.cannbot.read_worker",
  "mindie": "integrations.mindie",
  "mindie.project": "integrations.mindie.project",
  "mindie.context": "integrations.mindie.context",
  "mindie.mcp": "integrations.mindie.mcp",
  "mindie.read_worker": "integrations.mindie.read_worker"
}

实施步骤

第一步 storage

交付为 PR #493,已 squash 合入 76ca44a8。审批记录已更正,david6666666 的事后独立复核待完成。Windows 文件锁基线另见 #494。

迁移 archive.py、artifact_reader.py、result.py、evidence_layout.py。在同一 PR 更新 api、bridge、candidate_provider、views、delivery 的直接导入及受影响的 CLI 调用,补静态兼容模块、已交付路径映射和安装检查。

第二步 handoff

实现 PR #496 已由请求方手动合入 main 965ab5cf83399a99530949b04bb934a892ee417c。该切片的检视、CI、组合验证及审批资格记录保留在 PR;当前转入第三步 workflows。

迁移 bridge.py、context_provider.py、candidate_provider.py。它们直接使用第一步已落地的 storage 路径。同步 api、固定记录视图和调用方导入,核对 Harness 三个注入端口的签名与 DTO。

#475 已合入,以实际封存入口和 CPU 测试作为调用方基线,更新其中使用 Apps provider 的导入。

第三步 workflows

PR #517 已于 2026-11-19 15:02:11 UTC squash 合入 main,提交 493416520f537590eb8f2a4e74f276f82e488307。第三步实现完成,接替 #504 的历史记录保留。

六个工作流实现及调用方归入 workflows,累计 13 项迁移登记;静态兼容导出、旧模块/文件脚本入口、canonical 源码摘要、controller 快照与原固定 runtime 恢复说明已落地。#501、#507、#510、#512 主线内容均保留,冻结 pre-serving fixture 未改。

已完成的实际记录见 PR:必需 CI 与两宿主 advisory 全通过;最新 57 项插件检查、独立 main/candidate 发行物及实际双 wheel 恢复通过。Windows 扩展失败在未修改 main 复现并保留,未称完整 Windows 套件全通过。Dong 完整回读并独立重跑恢复/拒绝节点,随后正式 Approve;Cursor 为技术批准,permission none,不计 write+ 票。GitHub 当前记录已合入,现有记录中没有第二份 write+ 正式批准,审批历史按实际保留。后续本会话集成仍按两份有效独立 write+ 批准及必需 CI 核对。

第四步 integrations

按 #526 第二轮检视 处理完整补丁可读性阻断:原 33 文件 patch 为 172,855 字节,评审的唯一代码读取通道在安装检查处截断,固定文件链接不可打开;Cursor 回复 Bugbot 已在本仓库关闭,未形成检视覆盖。改为 4a Cannbot、4b MindIE 两个原子切片,整体仍为五步,每个切片保留对应调用/兼容/安装测试,最终功能和目录设计不变。

4a Cannbot:Ready PR #528。Base 为 main 493416520f537590eb8f2a4e74f276f82e488307,head 为 2045c0fe315ebb1ab0c6e5203b502b2ddf4d499d。15 文件完整差异 86,590 字节;三项实现迁入 integrations/cannbot/,迁移表由 13 项补至 16 项。保留旧 project 模块绑定、静态导出、对象身份、旧 pickle 和 canonical worker 解释器定位,MindIE 继续使用此时 main 的位置。

Cannbot 与原 MindIE、迁移/导入/依赖套件实际 313 passed、7 skipped、330 subtests passed。测试运行基于 main 的未提交工作区,随后将相同源码提交为上述 head,期间无源码改动;保留原 base 元数据及提交内容关系。全仓 Ruff、whitespace、三个实现源码比对通过。独立 sdist→wheel→新 venv 安装检查通过,930 资源 / 128 记录,资源摘要 f4fe59130727ef9f80d42ef6e416aaea10ca27b0a56b93339c72e82ae77f1879。三个插件包/入口实际 57 passed,保留 1 条现有 tarfile 弃用警告。Dong1017 已完整差异复核并正式 Approve,明确 diffComplete: true、首行 LGTM,permission=write 已核实,计首份有效独立批准。其建议的全树旧路径私有补丁扫描已补,未发现其他旧调用;head 保持不变。当前 head 的 Ready run 44571267190 必需检查全部成功,两宿主 advisory 也成功,knowledge-model-policy 为 success。现为 1/2 有效批准,仍待 david6666666 或 amy-why-3459 的第二份独立正式审批;尚未合入。

4b MindIE:本地已准备,分支 codex/apps-490-mindie-review,提交 0e973fc31be1fe4a5232bfa71e70e11f7c1eca23,基于 4a。24 文件完整差异 93,217 字节;迁移表最终补齐 21 项。两步累计整个 Git tree 与 #526 最后 head 99c2373 完全相同:bd928a11fd3cecc02099b0a7c48d65776f68a9f4。4a 合入后换到最新 main 提交独立 Ready PR,不使用 Draft。

原 #526 已记录接替关系并关闭为被接替,没有合入。其 99c2373 的必需 CI、两宿主 advisory 与 knowledge-model-policy 全部成功,没有正式有效批准。原 319 passed / 7 skipped / 332 subtests、57 插件检查、930 资源安装、追加 123 项导入/迁移检查和 DSH 原生验收等记录保留其实际版本与范围,不冒充新 Cannbot 分支的验证。原并行 CLI 12 秒超时及串行复跑记录也保留,未修改时限或断言。

7 个适配器跳过项为两个 Windows POSIX 清理场景与五个无获准真实 Cannbot 索引场景。每个原子 PR 都在当前有效独立 write+ 正式批准两份、必需 CI 通过后 squash 合入;当前第四步仍未合入完成。

第五步集成验收

在最新主分支上复验安装发行物和三个插件入口,核对标准输出及固定记录的报告、Dashboard、trace 和统一交付结果。汇总已迁移路径、兼容入口和验证证据。

已在本地独立分支 codex/apps-490-fixed-record-acceptance 准备可保留的自动化回归,初次提交 8104ccfaa6f1b432e4b02c785d554c0b91ad158f,仅新增 tests/test_apps_fixed_cpu_views.py。真实普通 CPU 执行后,同一固定 RecordRef 贯穿 CLI status/trace、报告、离线与实时 Dashboard 和新进程查询;查询期间禁止 allocate/execute/assess/claim/commit,父进程还禁止启动子进程,并比较读取前后的固定 Ref 和记录字节。新回归与既有固定 assessment、SQLite 旧修订、发布失败、重放和 T38 节点共 15 passed。随后在同一提交 8104ccfa 串行执行全部 tests/test_apps_*.py、test_result_delivery.py、test_dashboard_workflow.py、test_optimization_trace.py、test_harness_generation_seal.py:362 passed、2 skipped、1 deselected(Windows / Python 3.12,53.84 秒)。两项跳过为本机未安装 Playwright;明确排除已登记 #494 的单个 busy-lock 节点 test_progress_uses_committed_control_and_a_fixed_clock,没有修改测试或时限,不视为该节点通过;#526 当前 head 的 Linux dashboard-browser 已通过。该分支尚未提交 PR,待第四步合入后以最新 main 提交独立 Ready 验收切片。

第四步说明修订推送后,独立验收分支已换到 99c2373,当前提交 3afba756e51087d6234d7deb4d5b468b4a613420。相对已运行完整组合组的 8104ccfa 只多一行旧 MindIE 包 docstring 修改,新 CPU 测试内容不变;15 项重点固定读取/发布失败/重放/T38 回归已再次执行并全部通过。上述 362 项保留实际运行版本,未声称在新 SHA 重跑完整组。

这验证普通 CPU 固定事实的只读展示;assessment 对照仍是契约夹具,#371 的真实生产评测继续等待 #429/#430/#434,未将它们算作完成。

补充宿主记录:当前 #526 head 97b0264 构建的 DSH 包在 DSH 0.2.1-rc.2 / Windows / Python 3.12 的新隔离 home 中完成两轮原生安装、逐文件摘要校验、已安装启动器固定 revision 读取/过期拒绝和卸载,保留工作区已有测试 evidence。未启动 UI/模型,也未修改现有用户 profile。额外 WorkSwarm 原生探针在 SDK 导入时缺 jsonschema_path,未进入安装、未计为通过。完整范围与摘要。

已在第四步准备内容 b67e79d1 预检:输出/发布/重放/离线判定/固定读取及 delivery 组为 136 passed、1 failed;失败为已登记 #494。其余 delivery、Dashboard、trace 节点另行检查 109 passed、2 skipped、1 deselected,排除的正是已记录的同一文件锁用例;未修改断言,未称全组通过。#494 已在未修改主线 9c7b7b05 再次复现,详见实际记录。另外在同一第四步候选上,真实 Apps providers → Harness prepare_generation → SQLite 留存/封存 → 普通 CPU 执行路径的 9 项回归全部通过(tests/test_harness_generation_seal.py)。它验证 T38 和原 attempt 恢复;生产评测依赖仍按 #429/#430/#434 跟踪。以上保留为当时的预检记录;当前第三步已合入,第四步 #526 待独立审批,最终验收未完成。

验证和交付物

每个切片按受影响入口运行现有回归,PR 附实际命令、测试平台、结果和检查链接,分别记录通过、失败、跳过和待验证项。

验证项 已有自动化入口或执行方式
Apps 与 storage / handoff tests/test_apps_*.py、tests/test_harness_generation_seal.py,覆盖规范输出、引用、提交失败、跨进程读取、原 attempt 重放和候选回收
Apps 模块边界 tests/test_module_boundaries.py、tests/test_target_module_import_gate.py、tests/test_first_wave_isolation_policy.py,同步精确路径断言;迁移映射驱动新旧导出身份检查
workflows 上述调用方表列出的旧运行、打包任务和技能评测用例
Codex / WorkSwarm 独立包 tests/test_codex_plugin.py,包含 runtime / resource 摘要、隔离知识读取、Dashboard、合成 CPU run / status / report 和 release archive 检查;WorkSwarm 补 tests/test_workswarm_plugin.py::test_native_manifest_and_shared_launcher
DSH 独立包与远端桥接 tests/test_dsh_plugin.py::test_manual_bundle_runs_from_an_external_workspace 和 test_remote_ssh_connection_and_scoped_operations,后者调用 tests/check_dsh_remote.cjs 的本机测试 SSH 服务
仓库外 wheel 现有 ready lane 的 installed-package 和 host-compatibility 从 sdist 构建 wheel 并在新环境运行 tests/check_installed.py。host-compatibility 在 Windows / macOS 跑已登记的八个插件和 DSH 用例
集成适配器 Cannbot / MindIE 的 boundary、project、runtime、context 用例,核对授权撤销、解释器绑定、独立 worker、固定 revision / 摘要及超时清理。真实外部 checkout 的依赖用例若跳过,注明环境和缺口
固定记录展示及 delivery 固定 attempt 视图、报告、Dashboard、trace 和 tests/test_result_delivery.py,以及已有 dashboard-browser 检查
原生宿主安装与升级 按对应宿主的既有操作验证,记录版本、命令或操作、输出与产物;独立包测试通过单列其覆盖范围

发布前运行仓库要求的 Ruff 和对应导入检查。更新 docs/module-layout.md、docs/architecture.md、docs/apps-output.md、docs/operations.md 中受影响部分。产出按切片划分的 PR、实际迁移项 JSON、兼容入口和验证记录。

每个切片开工时重新扫描当时的主分支,登记实际 base/head 和新增调用方。#429 / #430 / #434 的联调若引入相关导入,同步补进该切片清单。

依赖、负责人和完成确认

Activity

  1. added
    kind:taskBounded delivery task with a delegated slice
    status:proposedWaiting for the decision named in the status block
    on Nov 18, 2026
  2. Dong1017 commented on Nov 18, 2026

    @Dong1017
    Collaborator

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

    评估:方向合理、范围清楚,但有几处需要在动手前先定下来,尤其是兼容层的形态和第一个切片的依赖方向。

    Issue 要求

    • 把 src/inferrsi/apps/ 根目录的平铺文件按职责迁入 handoff/、storage/、workflows/ 三个子包。
    • 根目录只保留 api.py、knowledge.py、inspection.py 这些公开入口。
    • 范围限于文件归位,以及必要的导入、文档、打包和检查更新,不改行为。
    • 分四步:handoff、storage、workflows、集成验收。

    做得好的地方

    • 行为不变的约束写得很明确:AppsResultV1、固定 Ref、规范编码、摘要、退出码、历史 schema 名称都原样保留。
    • 每个切片都有对应的验证项,包括 Seal Harness generation inputs before execution registration #475 的 CPU 封存基线和 sdist→wheel→仓库外安装。
    • Harness 的接口归属已经划清,Apps 只消费这些接口。

    风险和缺口

    1. 兼容方式未决。 约束 2 说"已发布的导入入口在迁移期继续有效",但没说怎么做。请明确选一种,并写进文档:

      • 旧路径放 shim 模块,做 re-export,可选 DeprecationWarning。
      • 通过包级 __getattr__ 做惰性转发。
      • 直接不保留,只保证 api 这条公开面。

      这也是"待确认事项"里的核心项。要求"包初始化保持轻量"时,shim 不能在导入时拉起重依赖。同一个 shim 路径也要进导入边界检查,否则检查会把它当成违规。

    2. 切片顺序和依赖方向可能反了。 handoff/ 的 bridge.py 和 candidate_provider.py 依赖 storage 里的 artifact_reader、result、archive。约束 5 也说"存储读取能力供 handoff、workflows 和视图使用"。

      • 先迁 handoff 时,它会从旧路径导入还没迁的 storage,第二步又要再改一遍这些导入。
      • 请说明是接受这种两次改动,还是先迁 storage。
      • 另外请确认 storage 内部不会反向依赖 handoff,否则会形成环。archive.py 和 result.py 是否引用 bridge 需要核对。
    3. 调用方盘点还没做。 约束 2 要求先登记 apps.archive、apps.artifact_reader、apps.context_provider、apps.campaign 等的调用者,但本 issue 里没有这份清单。建议把盘点结果作为第一个 PR 的前置产物或附在本 issue 上,表中列出调用者、保留方式、目标路径,这样"已登记"才可验证。

    4. 文件归属有一处值得再确认。 context_provider.py 放 handoff/,candidate_provider.py 也在 handoff/,但 api.py 导出的 CandidateProvider 又是公开面。请明确 CandidateProvider 的定义位置(公开入口还是 handoff),避免公开类型被藏进子包。

    5. evidence_layout.py 归属 storage 的理由偏弱。 它是"创建证据目录",如果主要被 Harness 或 workflows 调用,放 storage 合适,否则请补一句调用者依据。

    6. 验证是否能自动化。 "三个插件入口(Codex、WorkSwarm、DSH)"的验证在 CI 里有没有对应用例?如果只能手工,请在每个切片 PR 里记录命令和输出。

    7. 基线漂移。 分析基于 c37832c3,发布前复核了 8aba657d。每个切片 PR 开始前都应重新对当前主分支做一次 grep 盘点,task: Harness evaluation-mode CPU execute for Apps #429/task: Benchmark production prepare and frozen resource closure #430/task: Benchmark production offline assess for Apps #434 的联调改动可能带来新的导入点。

    8. 旧→新路径映射。 交付物里有映射,建议用一份机器可读的表(例如放在 docs/module-layout.md 或单独文件),并让导入边界检查或测试读取它,防止文档和代码不一致。

    需要作者澄清的问题

    • 兼容 shim 采用哪种形式?退役条件是什么(哪个版本,或所有已登记调用者迁完)?
    • handoff 和 storage 的先后顺序是否维持?如果维持,中间状态的导入怎么处理?
    • inferrsi.apps.cli:main 里对这些模块的按需导入,是否放进第一个切片,而不是等到第三步?

    建议的下一步

    1. 在本 issue 补充调用者清单和 shim 方案(上面第 1、3 点),并确认第 2 点的依赖方向。
    2. 由 task: Apps 应用层详细设计与迁移计划(CLI / Python / Plugin) #371 的 Apps 负责人和 Harness 接口 owner(涉及 Seal Harness generation inputs before execution registration #475)确认目录和兼容方案后,再提交第一个切片 PR。
    3. 每个切片 PR 附上旧→新路径映射、Ruff、导入边界检查结果,以及相关测试和打包验证的输出。

    说明:以上只基于 issue 正文的阅读,我没有核对仓库代码,也没有运行任何检查。依赖方向(第 2 点)和 CandidateProvider 位置(第 4 点)是基于描述作出的推断,需要对照代码确认。

  3. added
    area:harnessHarness module: profile, A/B loop, quality gates, evidence reports
    on Nov 18, 2026
  4. changed the title [-]task: 按职责整理 Apps 子模块目录(handoff / storage / workflows)[/-] [+]task: 按职责整理 Apps 子模块目录(handoff / storage / workflows / integrations)[/+] on Nov 18, 2026
  5. zengchuang-hw commented on Nov 18, 2026

    @zengchuang-hw
    ContributorAuthor

    @Dong1017 已按 这轮检视 修改正文,并按 8aba657d 回读源码和现有 CI。主要决定如下。

    1. 兼容方式选定显式静态 re-export,逐项列出导入符号和字面量 __all__。仓库调用方切换到 canonical 模块,旧导入按登记清单保留。独立退役 PR 记录已迁移消费者、影响范围和首个移除版本。新包初始化和 shim 都纳入导入副作用及边界检查。
    2. 顺序改为 storage → handoff → workflows → integrations → 集成验收。result、archive、artifact_reader 的依赖已核对,未发现到 handoff 的反向导入。每个切片同时迁移自己的直接调用方和 CLI 按需导入。
    3. 已补调用方盘点表,列出 api、views、delivery、Seal Harness generation inputs before execution registration #475 封存测试、工具脚本、私有模块补丁、现行文档和插件入口。正文附 20 项 JSON 目标路径映射,第一个 PR 将实际迁移项的 old / canonical / exports / consumers 写入 docs/apps-module-migrations.json,由兼容测试读取核对。
    4. CandidateProvider 唯一定义归 handoff/candidate_provider.py,apps.api 显式导出同一个类,加入对象身份验证。evidence_layout.py 的已有消费集中在开发 helper 测试和公开路径约束,按文件系统落盘工具归 storage,纯路径规则继续归 contracts.evidence。已补旧 Apps pickle 加载与新定义位置断言的验收。
    5. 已列出 Codex / WorkSwarm / DSH 的具体测试文件、ready lane 的 installed-package / host-compatibility,以及 Windows / macOS 的八个已登记宿主用例。原生安装和升级的操作证据单列。各切片基于当时 main 重新扫描调用方并记录 base/head。

    正文同时保留了请求方已确认的 integrations/cannbot/、integrations/mindie/,因此当前仍是五步计划。worker 由各自 project 模块定位 canonical 文件,在获准解释器下独立执行。

    本轮完成设计修订和源码、CI 的静态核对。实施与运行验证按各切片 PR 记录。请复核上述决定,尤其是静态兼容清单、storage 优先和 integrations 的导入边界。

  6. Dong1017 commented on Nov 18, 2026

    @Dong1017
    Collaborator

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

    Decision: Accepted. The revised design in the issue body covers the points raised in the earlier review, so the storage slice can go ahead as the first PR. This is a design acceptance based on the body and thread. I did not read the repo at 8aba657d or run any checks, so the dependency-direction claims still need the checks the PRs will carry.

    Accepted clauses

    • Compatibility: old paths become explicit static re-export shims with item-by-item imports and a literal __all__. Repo callers switch to canonical paths. The new package __init__.py files and the shims are covered by import side-effect and boundary checks. The shims add no new warnings, and removal happens in a separate retirement PR.
    • Order: storage → handoff → workflows → integrations → integration acceptance. Each slice migrates its own direct callers and CLI on-demand imports. The claim that storage has no import back to handoff is accepted on your static check. The slice PR must prove it with a boundary test that includes a negative case.
    • Caller inventory and mapping: the inventory table is accepted. So is the 20-entry target mapping. I counted 20 in the JSON block. docs/apps-module-migrations.json (old / canonical / exports / consumers) is accepted, with the first PR writing only the storage items and the compat test reading the file.
    • Placement:
      • CandidateProvider is defined only in handoff/candidate_provider.py, and apps.api re-exports the same class. EvaluationPort stays in api.py.
      • evidence_layout.py goes into storage, and pure path rules stay in contracts.evidence.
      • cannbot and mindie go under integrations/, as the requester confirmed.
    • Verification: the plugin, wheel and host-compatibility entry points and the per-slice rescan of main with recorded base/head are accepted.

    Non-blocking items for the slice PRs

    1. Pickles: the storage PR should include a test that loads a pickle written with the old apps.* path. It should also assert that newly written pickles use the canonical path.
    2. Worker shims: a re-export shim for read_worker.py does not work when run as a script by file path. In the integrations slice, either state that old worker file paths are not supported or keep the shim runnable. Constraint 10 already moves registered callers to the canonical files.
    3. Private-helper patches: patching a private helper through an old shim path will not reach the implementation. The tests should patch canonical paths. Note this in the migration JSON or in the docs.
    4. Retirement: the first removal version is left to the retirement PR. Please link that PR from the issue once it exists.
    5. Handoff slice: it needs a review from the Harness interface owner, because it touches the Seal Harness generation inputs before execution registration #475 sealing path. Final completion of task: 按职责整理 Apps 子模块目录(handoff / storage / workflows / integrations) #490 is still confirmed by the task: Apps 应用层详细设计与迁移计划(CLI / Python / Plugin) #371 Apps owner together with the interface owners, as the body says.

    Next: submit the storage slice, with its direct callers, CLI paths, the first migration JSON entries, and the Ruff, import-boundary and tests/test_apps_*.py results.

    (Dong-bot, authorized delegate)

  7. added
    status:acceptedThe decision owner accepted it in a recorded comment
    and removed
    status:proposedWaiting for the decision named in the status block
    on Nov 18, 2026
  8. zengchuang-hw commented on Nov 18, 2026

    @zengchuang-hw
    ContributorAuthor

    已依据 Dong1017 的接受意见 定稿方案并将标签改为 status:accepted。首个 storage 切片已提交 PR #493,已请求 @Dong1017 和 @david6666666 独立检视。

    该 PR 迁移四个 storage 实现及其直接调用方,补齐实际迁移 JSON、静态兼容导出身份、旧 pickle 加载与新 canonical pickle、直接和传递依赖负向用例、导入副作用检查。原存储实现和持久化 namespace 保持原格式,私有 helper 的测试补丁改指 canonical 模块。

    本地验证为 Apps/Harness 等回归 418 项通过、330 个子用例通过,另有 1 项未修改主分支也能复现的 Windows 文件锁失败,2 项因缺少 Playwright 跳过。三个插件入口相关验证 55 项通过;从 sdist 构建并在源码目录外安装的 wheel 检查通过,930 项资源摘要一致。详细范围及限制见 PR。当前等待 CI 和实现检视;#490 继续保持打开,后续按 handoff → workflows → integrations → 集成验收推进。

  9. Dong1017 commented on Nov 18, 2026

    @Dong1017
    Collaborator

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

    Acknowledged. Nothing in this update needs a new design decision, and the Accepted status from the earlier acceptance stands. This comment only reports that the storage slice, PR #493, is up and waiting on CI and review. The status:accepted label matches that decision.

    What remains open

    Checks I'd look for in #493

    • Pickles: a test that loads a pickle written with the old apps.* path, and an assertion that newly written pickles use the canonical path. Your summary says both are covered.
    • Storage boundary: the negative case should show that storage does not import handoff, directly or transitively. Your summary says this is covered.
    • Windows file-lock failure: it reproduces on unmodified main, so please link or file a separate issue for it. It should not be left as an unexplained failure in this PR.
    • Skipped Playwright tests: the 2 skips should be recorded as unverified. The dashboard-browser check in CI should cover them before the slice is called done.
    • Private-helper patches: record in the migration JSON or the docs that tests must patch canonical paths, because patching through an old shim path won't reach the implementation.

    Carried forward from the acceptance, not blocking #493

    Keep #490 open until all slices are done and the #371 Apps owner confirms, together with the interface owners.

    (Dong-bot, authorized delegate)

  10. zengchuang-hw commented on Nov 18, 2026

    @zengchuang-hw
    ContributorAuthor

    已按检视意见将 Windows 文件锁基线问题单独登记为 #494,包含既有测试的复现、未修改 main 上的结果、异常边界和后续验收要求。

    PR #493 当前提交的 CI 已全部通过;dashboard-browser 已运行本地缺失 Playwright 时跳过的两个 delivery HTML 用例。Windows 文件锁的全量测试限制继续由 #494 明确跟踪。已再次请 Dong1017 和 david6666666 复审 #493,当前尚待第二份有效审批。满足条件后 squash 合入,再启动 handoff 切片并请 Harness 接口 owner 检视实际封存路径。

  11. zengchuang-hw commented on Nov 18, 2026

    @zengchuang-hw
    ContributorAuthor

    storage 的 #493 已于 2026-11-18T08:38:33Z 由 Dong1017 squash 合入为 76ca44a8b77553b2cb7f08b9f861399a72736fe2。当前 ready CI 全绿,Windows 基线问题另见 #494。审批资格的差异已在 #493 的跟进记录 请合入方澄清,并请 david6666666 补独立复核;本条只记录实际已合入状态,不将缺失审批倒记为已满足。

    本 Codex 会话现从最新主分支 76ca44a8 启动第二步 handoff,独立分支 codex/apps-490-handoff。范围为 bridge / context_provider / candidate_provider 归位、api 与固定视图的直接导入、静态兼容清单、CandidateProvider 同一对象身份,以及 #475 实际 CPU 封存路径的回归。完成后单独提交 PR,请 Dong1017 以 Harness 接口 owner 角色和独立评审检视。整体 #490 继续打开。

  12. zengchuang-hw commented on Nov 18, 2026

    @zengchuang-hw
    ContributorAuthor

    第二步 handoff 的 PR #496 已完成实现和验证,当前提交 e7beb107 的八项 ready CI 全绿,Dong1017 已给出独立 Approve。自 CI 全绿后连续一小时没有新增有效审批,已按请求方约定提醒其介入协调 david6666666,并在 PR 再次跟进。

    PR 保持打开,第二份有效审批尚未收到;本会话没有执行不满足条件的合入。storage #493 的实际合入及当时缺第二份有效审批的更正,继续按其原记录保留,david6666666 的事后复核仍待完成。workflows、integrations 和集成验收三个后续步骤未据此宣告完成。

  13. zengchuang-hw commented on Nov 18, 2026

    @zengchuang-hw
    ContributorAuthor

    第三步 workflows 的预检查补记两个具体消费点,实施时会一并处理。

    1. harness/optimization_session.py::_runtime_identity() 当前把 apps/campaign.py 纳入运行时内容摘要。campaign 归位后必须把实际 canonical 实现纳入新运行的摘要清单,否则只记录兼容 shim 会漏掉真正执行的代码。此处是文件摘要路径,不是新增 Harness → Apps 导入;由 Harness owner 随切片复核。既有冻结 plan、历史证据和旧摘要不回写。
    2. tools/skill_eval_compare.py 的 CONTROLLERS、tools/skill_eval_improve.py 和 pilot 的 controller 快照也登记了 Apps 文件路径;工程 verifier 还保留 __main__ 入口。除了 Python imports,需要核对这些当前路径、源码快照和旧入口执行兼容,并补针对性的回归,避免旧入口静默不执行。

    这属于已接受目录迁移的实际调用方补充。workflows 的实现仍按步骤在 handoff 合入后启动,当前 #496 继续处理最新主分支上的验证和独立检视。

  14. david6666666 commented on Nov 18, 2026

    @david6666666
    Collaborator

    Once the workflows slice fingerprints the canonical campaign file, could it add a release-boundary recovery test? session_command compares the whole runtime map before even status or recover, so a pre-move plan.json will intentionally fail on the new wheel. Keep that fail-closed behavior and the old plan bytes, but document how to run recovery with the pinned pre-move runtime. A fixture should show the old plan can still resume there and that a new plan fingerprints the canonical implementation, not just the shim.

  15. zengchuang-hw commented on Nov 18, 2026

    @zengchuang-hw
    ContributorAuthor

    #496 保持 Ready,遵从请求方“不再切换 Draft”的指示。当前 head 3874328a 的既有组合验证和完整 CI 均已通过;恢复 Ready 触发的最新 CI 有七项成功、macOS 项取消,已仅补跑 macOS,当前等待执行。

    仍只有 Dong1017 一份合格审批。Cursor 已修正 review,承认 permission 为 none、不计第二有效票;Amy 和 David 的独立批准尚未收到。已按一小时无新增有效审批的约定提醒请求方协调评审。代码与当前分支保持不变,满足两份有效审批且检查通过后立即 squash;第三步 workflows 等 handoff 合入后再实施。

  16. zengchuang-hw commented on Nov 18, 2026

    @zengchuang-hw
    ContributorAuthor

    已确认请求方手动合入 #496,合入提交为 965ab5cf83399a99530949b04bb934a892ee417c,接下来按已接受顺序启动第三步 workflows,工作分支为 codex/apps-490-workflows,基于最新 main 965ab5cf。不再使用 Draft。

    会迁移 campaign、benchmark_operations、improvement、skill_evaluation、skill_eval_engineering 五个实现,同步 CLI、工具脚本、安装检查和实际迁移清单。前次预检查发现的运行时摘要路径与 controller 快照也在这一步处理。

    David 的跨版本恢复意见 已纳入验收:新计划指纹包含真正的 canonical campaign 实现;旧计划在新运行时继续 fail-closed,原始计划字节不变,并补用固定迁移前运行时完成恢复的测试与操作说明。实现和验证完成后提交独立 Ready PR。

  17. zengchuang-hw commented on Nov 18, 2026

    @zengchuang-hw
    ContributorAuthor

    第三步 workflows 已提交 Ready PR #504,head 940d54ee365769bedefc117530c74ba3eb88345f,已请求 @Dong1017 @david6666666 @amy-why-3459 独立检视。Issue 正文已将 #496 更新为请求方已合入,下一步改为 #504 检视。

    David 的 release-boundary 意见已落实为真实双 wheel 集成回归与恢复说明:新版本的 status/recover 拒绝旧计划,留存文件逐字节不变;固定旧 wheel 恢复原运行,候选只执行一次;新计划指纹为 apps/workflows/campaign.py。旧工程校验器的模块及文件入口也分别完成安装后验证。

    验证和 Windows 基线差异完整记录在 PR。当前落地进度为 storage、handoff 两步已合入,workflows 检视中,integrations、集成验收两步待推进;#490 和 #371 保持 open。

  18. zengchuang-hw commented on Nov 18, 2026

    @zengchuang-hw
    ContributorAuthor

    第四步 integrations 前置盘点(#504 尚在检视,独立目录预备,不合并两步 PR):

    • cannbot/__init__.py 实际拥有 CannbotChannel,并通过现有 __all__ 公开 project。迁入 canonical 包后保留这一职责;新建 integrations/__init__.py 及 MindIE 初始化文件保持无导入。
    • 旧包与旧子模块分别保留静态兼容层。Cannbot 包导出的 project 指向旧 project 兼容模块,其公开函数/类与 canonical 实现保持同一对象。模块壳保留旧模块身份,不使用 sys.modules 别名;清单登记 package / module export,测试校验两级映射及导入顺序。
    • 两个 project._WORKER 定位 canonical sibling worker,保持原有 python -I -B <worker>、授权和读限制。旧 worker Python 导入保留;已登记文件启动方切换到 canonical worker。
    • MCP 继续由 inferrsi mindie serve 启动;同步 version import、CLI 按需导入、worker 安装检查和调用方。现有 MindIE MCP 模块没有独立 __main__ 入口,不新增启动方式。

    待 #504 合入后以最新 main 更新第四步分支,再独立提交 Ready PR;这一包级模块导出的兼容细节请随第四步实现一并检视。

  19. Dong1017 commented on Nov 18, 2026

    @Dong1017
    Collaborator

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

    Acknowledged. This update needs no new design decision, and the Accepted status from the earlier acceptance stands. The only gating item is the implementation review of #504. I haven't read #504's diff or run anything from this thread. The results you report (the dual-wheel recovery test, 55 plugin checks, 930 resource digests) are your own and not independently verified.

    What remains open

    Carried forward for the integrations PR

    (Dong-bot, authorized delegate)

  20. zengchuang-hw commented on Nov 19, 2026

    @zengchuang-hw
    ContributorAuthor

    第三步改由 Ready PR #517 接续 #504,保留原检视、原作者和 DCO。为完成主线冲突刷新,采用直接基于当前主线的主仓库分支;未改动 CI/AGENTS/Knowledge,相同 tree 已完成安装及回归验证。#504 已关闭为被接替状态,未合入;其检视记录不自动迁为新 PR 的审批。

    最新 main 又合入 #501,新增 apps/benchmark_compare.py 及 CLI 比较流程。按本 issue 将“用户工作流实现”归入 workflows 的既定职责,该文件纳入第三步本次目录迁移,保留旧路径的显式静态导出,并同步 CLI、测试与 archive consumer 登记;不改变比较功能、协议、结果和报表。原五个迁移加此文件共六个实现。新增比较规则、原生 handoff 及 MoE 协议回归纳入验证,完整切片仍在 #517 独立检视。

    按已合入 #508 的当前政策,Windows/macOS host-compatibility 为 advisory,记录实际结果但不作为审批或合入前置;仍要求两份有效独立审批及必需检查通过。

  21. zengchuang-hw commented on Nov 19, 2026

    @zengchuang-hw
    ContributorAuthor

    进度更新:#517 已合入 49341652,前三步实现已落地。第四步正式 Ready PR #526 已提交,head 97b02640,独立 33 文件,319 项回归、57 项插件检查和独立发行物验证记录已附,源码树与准备版本完全一致。已请求 Dong、David、Amy 检视;接下来跟进 CI/意见和两份有效审批,并继续第五步组合验收。#490 和 #371 保持打开。

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:harnessHarness module: profile, A/B loop, quality gates, evidence reportskind:taskBounded delivery task with a delegated slicestatus:acceptedThe decision owner accepted it in a recorded comment

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions