Skip to content

refactor(apps): move Harness handoff adapters into apps.handoff - #496

Open
zengchuang-hw wants to merge 2 commits into
InferMatrixLab:mainfrom
zengchuang-hw:codex/apps-490-handoff
Open

zengchuang-hw wants to merge 2 commits into
InferMatrixLab:mainfrom
zengchuang-hw:codex/apps-490-handoff

Conversation

@zengchuang-hw

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

Copy link
Copy Markdown
Contributor

Governing Issue and delivery slice

Refs #490
Refs #371

Apps execution binding and generation adapters still lived at the package root. This second #490 slice places them under apps.handoff, repoints active consumers, and preserves the registered old public imports and apps.api surface.

Scope is accepted in the #490 design decision, with the Apps owner's instruction to continue handoff after storage. Codex implements this slice under the Apps owner's account. Independent implementation and Harness-owner review are requested separately.

Changed artifacts and evidence

Requirement Actual change Verification
Handoff ownership Move bridge, context provider and candidate provider into apps/handoff/; adjust storage imports and API/fixed-view consumers All three non-import ASTs match their base definitions
Compatibility and public identity Three explicit static shims; seven actual migrations in the JSON inventory; apps.api.CandidateProvider exports the canonical class while EvaluationPort stays in API Mapping-driven export/consumer/pickle tests, canonical API identity, legacy delivered-context instance
Import behavior and storage direction Import-free handoff initializer; no data read, SQLite open, process launch or socket creation on cold import Audit-event probes and cold-import guards, positive controls; storage direct/transitive back-edge negative tests retained
Harness sealing and generation Migrate actual providers used by the #475 CPU sealing path and generation/binding/evidence tests Existing Apps and Harness sealing regression assertions retained; request digests, attempts, DTOs and retention ownership unchanged
Distribution and docs Installed canonical/shim checks and identity assertions; current directory/operation/output docs Fresh non-editable sdist-built wheel outside the checkout; all 930 resource digests match the checkout

Checks and dependencies

Current base is cf671a880ac8037e01922e1be0b701771fb9922f, integrated in head 3874328aa263f475118c032253cf552f13351c46. Local verification uses Windows and Python 3.12. The handoff diff against the new base is unchanged; the refresh brings in the upstream round-decision Dashboard resources and its browser coverage.

  • Ruff and diff checks passed.
  • All Apps tests, Harness generation sealing, module boundaries, target import gate, first-wave isolation, evidence-path and repository-pack checks produced 377 passed, 330 subtests passed. These include all 18 migration checks.
  • A fresh environment installed the sdist-built wheel with the skills extra and passed python -I check_installed.py outside the checkout.
  • Codex plugin suite, WorkSwarm native/shared launcher and both DSH entry checks produced 55 passed, with one existing tar extraction deprecation warning.
  • Previous-head ready CI passed all eight jobs on e7beb107, including Python 3.10/3.11 full-check and installed-package, browser and Windows/macOS lanes. Current head 3874328a is rerunning CI after the base refresh; focused handoff, Dashboard and distribution rechecks are in progress. The upstream Dashboard change owns its added browser coverage; this handoff slice adds no workflow, exception list or gate change.
  • Full Windows tests and native host installation/upgrade are not claimed. The existing Windows delivery-lock limitation is tracked by bug(apps): Windows busy delivery lock escapes as PermissionError #494.
  • Protected Knowledge paths are unchanged; knowledge admission should be Not applicable.

Storage dependency #493 is merged. Its approval-record correction remains explicit: the merge occurred with one eligible approval, and the requested post-merge independent review is still pending. That process gap is not represented as two valid pre-merge approvals.

Remaining work and Issue closure

Workflows, integrations and integrated acceptance remain in #490; it stays open. Apps and affected interface owners confirm whole-Issue completion.

Please have the Harness interface owner inspect the migrated #475 sealing path and public provider identities. This slice still requires two independent, current-head approvals from eligible accounts and passing CI before integration. A bot approval without the required account permission does not fill that requirement.

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

Copy link
Copy Markdown
Contributor Author

@Dong1017 @david6666666 请独立检视当前 head e7beb107ef60090a26045cd20bbf5a3669ba781c,base 为 76ca44a8b77553b2cb7f08b9f861399a72736fe2。本轮请求的动作是检视并记录结论,集成由本会话在资格和检查条件满足后执行。

请 Dong1017 以 Harness 接口 owner 角色检查 #475 的 CPU 封存调用路径、原 attempt 与 request_digest 保留、apps.api.CandidateProvider / 旧路径 / canonical 类的同一对象身份,以及 EvaluationPort 仍定义于 API。请 david6666666 检查三个静态 shim、迁移 JSON 中的七项实际交付与调用方、旧 pickle、无副作用导入和 storage → handoff 的负向依赖测试。原实现的非导入 AST 已比对一致。

本地 Apps/Harness 等回归 377 项和 330 个子用例通过;三个插件相关验证 55 项通过;sdist 构建的 wheel 在仓库外新环境安装检查通过,930 项资源摘要一致。当前提交 CI 正在运行,Windows 已有文件锁限制仍由 #494 跟踪。发现问题后先修正;达到条件时请提交首行 LGTM、明确 PASS 且覆盖当前提交的 Approve。

按请求方要求,需两份来自独立且有 write 或更高权限账号的有效审批和通过的 CI 才执行 squash。Cursor 的技术意见可以参考,permission: none 的账号批准不计为有效第二票。#493 的合入审批差异及其更正留在该 PR,不作为本 PR 已满足审批条件的依据。

@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 18, 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 76ca44a and head e7beb10 (full diff, first review). prior-reviews.md seeds no formal reviews and no outstanding CHANGES_REQUESTED, so this is the first formal review on this head.

Verified from the diff:

  • Pure move, no behavior change.
    • handoff/context_provider.py has blob 58fdc682, identical to the old apps/context_provider.py blob.
    • handoff/bridge.py matches the removed body line for line. The only change is the imports: .storage.* became ..storage.*.
    • handoff/candidate_provider.py differs from the old file only in import ordering and relative paths. .bridge now resolves inside handoff, which keeps the private-helper imports valid.
  • Shims.
    • apps/bridge.py, apps/context_provider.py and apps/candidate_provider.py re-export the registered public names with explicit __all__.
    • Classes keep canonical __module__, so old-path pickles resolve through the shim. test_delivered_context_draft_loads_a_legacy_instance_pickle covers this.
  • Single class identity. apps.api now imports CandidateProvider from handoff.candidate_provider. EvaluationPort stays defined in apps.api. Both are asserted in check_installed.py and in test_public_candidate_provider_is_the_one_canonical_class.
  • Layering. handoff imports storage, and storage does not import back. handoff/__init__.py is docstring-only.
  • Consumers and docs. views/attempt.py, api.py and the tests moved to canonical paths. docs/apps-module-migrations.json has the three new entries (bridge, context_provider, candidate_provider) and the updated consumer lists. The architecture, module-layout, operations and apps-output docs describe the move and keep the Harness ownership boundaries.
  • Tests.
    • The initializer/no-I/O test is generalized to cover both storage and handoff.
    • The cold-storage test is filtered to storage entries.
    • A new cold-handoff test checks that import performs no file reads, process launches, sqlite or socket use.

Not verified here (no execution environment):

  • I did not run the test suite and I have no CI results.
  • I did not run the installed-wheel check in check_installed.py. It assumes packaging picks up apps/handoff automatically, as it did for storage. pyproject.toml is not in the diff.
  • I did not grep the full repo for other consumers of the old private names (inferrsi.apps.bridge._*). The shims intentionally re-export only the registered public names.

Non-blocking: confirm CI is green, including the installed-wheel job, before merge. The ruleset's second qualifying approval is still required.


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 对当前提交的独立 diff 检视,感谢确认迁移、类身份和 Harness 边界。安装包 CI 的 Python 3.10/3.11 两条检查均已通过,仓库外本地 sdist→wheel 检查也已通过;其余当前提交 CI 继续跟进。

补充消费者核对范围:迁移测试逐个解析 src / tests / tools / plugins 的静态导入,禁止活跃代码导入已迁移旧模块,并要求 canonical 消费者登记在 JSON。完整相关回归中的该项检查已通过。原私有 bridge helper 只在 canonical handoff/candidate_provider.py 内导入;仓库 API 和 view 已切换 canonical,兼容 shims 只保留登记的公开符号。历史证据和旧格式命名空间继续按原约定保留。

目前仍等待 david6666666 的独立实现复核。当前只有一份符合账号权限条件的审批,暂不执行合入。

Copy link
Copy Markdown
Contributor Author

@david6666666 当前提交 e7beb107ef60090a26045cd20bbf5a3669ba781c 的 ready CI 已全部通过,含 Python 3.10/3.11 全量及安装包、浏览器、Windows/macOS 宿主检查。Dong1017 已给出当前提交的独立 Approve。

现在仍需你对该提交的实现复核和结论,有意见先处理。通过时请用当前提交的 Approve 和首行 LGTM 明确记录;当前有效审批数为一份。在第二份有效审批到位前保持 PR 打开。#493 的事后独立复核也仍待补充,审批历史不会倒改为合入前满足。

Copy link
Copy Markdown
Contributor Author

@david6666666 再跟进一次。截至 2026-11-18T10:07:10Z,自本轮 CI 全绿后已连续 1 小时没有新增有效审批。当前 head 仍为 e7beb107ef60090a26045cd20bbf5a3669ba781c,ready CI 八项检查全部通过,当前仅 Dong1017 的独立 Approve 符合账号权限条件。

请复核当前实现,有问题先处理,通过后请提交符合项目格式的 Approve。请求方约定的“一小时无进展提醒介入”已在会话中触发,现等待协调完成第二份有效审批,PR 保持打开,尚未执行合入。#493 的事后独立复核也仍待补充,之前的合入审批历史保持如实记录。

@zengchuang-hw

Copy link
Copy Markdown
Contributor Author

@amy-why-3459 PTAL

Copy link
Copy Markdown
Contributor Author

@amy-why-3459 请补充独立检视当前 head e7beb107ef60090a26045cd20bbf5a3669ba781c,base 为 76ca44a8b77553b2cb7f08b9f861399a72736fe2。请求方此前已请你参与 #371 的 Apps 设计检视,本轮沿用该 Apps 工作范围,请检视 #490 的第二个 handoff 切片。已确认你的仓库权限为 write;你不是本切片作者或 Apps 交付负责人。本轮委托范围是检查实现、提出意见并提交实际结论。

请重点核对 ContextProvider 的 Knowledge → Harness 交付字节和 pins、DeliveredContextDraft 旧 pickle 兼容、CandidateProvider 的公开与 canonical 类身份、三份静态 shim 和迁移 JSON。代码是三个实现归位及导入调整,非导入 AST 保持不变。Dong1017 已完成当前提交的 diff 检视并批准,H 的 #475 封存回归包含在 377 项本地回归中;三个插件 55 项及仓库外 wheel 验证也通过,当前 ready CI 全绿。

@david6666666 你的复审请求继续保留,请复核 #496,并补充 #493 的事后实现复核。有意见先处理;通过时请用当前提交的 Approve、首行 LGTM 和明确 PASS 记录。集成由本会话在核验两份独立、当前有效且有 write 或更高权限的审批和 CI 后执行 squash,机器人无资格的票不计入。

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

Copy link
Copy Markdown
Contributor Author

已同步最新 main cf671a88(#495 的逐轮决策 Dashboard),当前 head 更新为 3874328aa263f475118c032253cf552f13351c46。对新 base 的 handoff diff 仍是同一组 21 个文件,三个实现没有新的业务行为修改。同步的原因是新 Dashboard 模板和随包资源需要在组合代码上复验,不能把旧 head 的发行物和 CI 当成本次集成证据。

当前 CI 和聚焦的 handoff、Dashboard、独立包检查正在重跑。旧审批已因提交更新而失效,当前审批数重新按新 head 计算。@Dong1017 @amy-why-3459 @david6666666 请检视新提交,原有检视可结合此次 main 合入增量复核;请以新 head 的实际结论记录 Approve / Request changes。满足两份独立有效审批且检查通过后由本会话 squash 合入。

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.

2 participants