Skip to content

refactor: dedupe diagnostics fallback helpers#6

Merged
Li-Sanze merged 2 commits into
mainfrom
feature/plan-b1-diagnostics-dedupe
Apr 2, 2026
Merged

refactor: dedupe diagnostics fallback helpers#6
Li-Sanze merged 2 commits into
mainfrom
feature/plan-b1-diagnostics-dedupe

Conversation

@Li-Sanze
Copy link
Copy Markdown
Collaborator

@Li-Sanze Li-Sanze commented Apr 2, 2026

摘要

这个 stacked PR 是接在 runtime outcome diagnostics surface 之上的一轮去重收口。

目标不是再改一轮 diagnostics contract,而是在不破坏已安装 payload / vendored runtime 自包含约束的前提下,把重复的 outcome 逻辑尽量收回到一处。

现在 repo-local 路径优先复用 installer/outcome_contract.py 里的共享 helper;只有安装态 / vendored 仍然必须独立运行的地方,才保留最小 fallback
mirror。

改动内容

  • 调整 runtime/gate_output.py,复用共享 outcome summary 渲染
  • 调整 installer/bootstrap_workspace.py,优先走共享 outcome annotation 逻辑,不再维持一套 repo-local 独立分支
  • 在 bootstrap_workspace.py 中保留最小自包含 fallback mirror,确保安装后的 helper 仍可独立执行
  • 在 runtime/workspace_preflight.py 中明确 vendored fallback 的边界和约束
  • 新增 standalone parity tests,确保 fallback helper 与 canonical outcome contract 不漂移
  • 新增 fallback 对齐回归覆盖:
    • bootstrap_workspace.py
    • runtime/workspace_preflight.py
    • runtime/gate_output.py

为什么要做

上一轮 diagnostics surface 已经把结果 contract 收口了,但 fallback 路径和部分渲染路径里,仍然保留了重复的 primary_code / action_level / summary 逻
辑。

这会让下面几层之间继续存在漂移风险:

  • repo-local runtime
  • 已安装 payload helper
  • vendored fallback 代码

这个 PR 的作用就是在不破坏 standalone 执行前提的情况下,把这层漂移面继续压小。

范围边界

这个 PR 不追求“不惜代价的零重复”。

原因是安装态 bootstrap helper 和 vendored fallback 仍然必须满足“脱离源码仓库包结构也能执行”的约束,所以仍需要保留一层窄镜像。

这一轮的收口定义是:

  • repo-local 代码 canonical-first
  • 只有 standalone execution 必需的地方才保留最小 fallback mirror
  • 用显式 parity tests 防止后续静默漂移

验证

提交前本地已通过:

  • python3 -m unittest
  • python3 scripts/check-install-payload-bundle-smoke.py --target codex:zh-CN
  • python3 scripts/check-install-payload-bundle-smoke.py --target claude:zh-CN

commit hook / preflight 也已通过:

  • 全量 runtime / unit 测试
  • runtime smoke
  • skill eval gate
  • release sync

Li-Sanze added 2 commits April 2, 2026 14:06
Release-Sync: yes

Release-Version: 2026-04-02.140640

Release-Date: 2026-04-02
Release-Sync: yes

Release-Version: 2026-04-02.162241

Release-Date: 2026-04-02
@Li-Sanze Li-Sanze merged commit 711384f into main Apr 2, 2026
2 of 4 checks passed
@Li-Sanze Li-Sanze deleted the feature/plan-b1-diagnostics-dedupe branch April 15, 2026 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant