Skip to content

P4b Runtime Surface Consolidation: prove-kept-or-delete 结论 + 路线图更新 + 归档#31

Merged
Li-Sanze merged 6 commits into
mainfrom
plan/p4b-runtime-surface-consolidation
May 9, 2026
Merged

P4b Runtime Surface Consolidation: prove-kept-or-delete 结论 + 路线图更新 + 归档#31
Li-Sanze merged 6 commits into
mainfrom
plan/p4b-runtime-surface-consolidation

Conversation

@Li-Sanze
Copy link
Copy Markdown
Collaborator

@Li-Sanze Li-Sanze commented May 9, 2026

概述

P4b Runtime Surface Consolidation 全生命周期交付。

交付内容

Phase 0: Test Re-audit

  • 653 hard gate / 31 soft gate 分类盘点

Phase 1: CI/Preflight 真实降载

  • ci.yml hard/soft gate 分离
  • release-preflight.sh 分层执行

Phase 2: Prove-kept-or-delete 全量扫描

  • AST-based 死代码扫描:runtime 全量 24,334 LOC 中仅 15 LOC 可安全删除
  • 删除 3 个死函数:_phase_for_route(engine.py)、_contains_intent + _runtime_skill(router.py)
  • 结论:<20K 目标在不改 distribution/installer contract 约束下不可达

路线图更新

  • 优先级表同步:P4b 标已完成,新增 P4b.5,P4c 前置改为 P4b.5
  • 新增 P4b.5/P4d/P5/P6 阶段定义
  • intake checklist 里程碑同步

归档

  • 方案包从 plan/ 移至 history/2026-05/
  • archive_ready: true

Hard Gate

653 passed, 31 deselected ✅

Li-Sanze added 6 commits May 9, 2026 14:24
主要修订:
- 新增 Phase 0(test inventory re-audit + hard/soft gate matrix)
- Phase 1 扩展为真实 CI/preflight 降载,不只改 preflight 文案
- gate.py action_proposal_retry 主路径移出删除候选(keep-list frozen)
- Phase 2 方法论改为 prove-kept-or-delete(keep-list 外默认整段删除)
- 消除 CI hard contract 自循环锚点,改为 keep-list/主链/distribution 投影
- 混合文件分类承载机制:@pytest.mark.implementation_mirror + -m 选择器
- 合并兜底改为非 LOC 驱动,优先继续发现语义死面
- distribution 补全到所有 hard gate 定义
- 预算合计同步调整(2,355-3,590 LOC)
Phase 0 re-audit: 校准测试分类边界,为 P4b Phase 2 删旧面建立干净基线。

文件级重标:
- test_runtime_config.py: contract → implementation-mirror
- fail_close_contract_entry.py: 补 implementation-mirror 标记

用例级标记(@pytest.mark.implementation_mirror):
- test_runtime_engine.py: 11 cases (bridge/compat/legacy archive/router classify)
- test_runtime_gate.py: 10 cases (preflight fallback/legacy helper/CLI text)
- test_runtime_failure_recovery.py: 5 cases (legacy recovery/v1 schema)
- test_runtime_message_templates.py: 4 cases (template fallback/rendering)
- test_runtime_router.py: 1 case (repo-local wording)

新增 tests/conftest.py 注册 implementation_mirror marker。

Hard gate (-m 'not implementation_mirror'): 653 tests
Soft gate (-m 'implementation_mirror'): 31 tests
全量: 684 passed

Context-Checkpoint: A
Context-Checkpoint: B
Context-Checkpoint: C
Phase 1 CI/preflight 真实降载:

ci.yml:
- hard gate (blocking): pytest -m 'not implementation_mirror' (653 tests)
- soft gate (advisory, continue-on-error): pytest -m 'implementation_mirror' (31 tests)
- 从 unittest discover 切换到 pytest(pip install pytest)

release-preflight.sh:
- hard gate (blocking): 同上
- soft gate (advisory, non-blocking): 失败仅 WARNING 不阻断发布

tasks.md: Phase 0 (0.1-0.4) + Phase 1 (1.1-1.4) 全部勾完

验证结果:
- hard gate: 653 passed, 31 deselected
- soft gate: 31 passed, 653 deselected

Context-Checkpoint: A
Context-Checkpoint: B
Context-Checkpoint: C

Release-Sync: yes

Release-Version: 2026-05-09.152019

Release-Date: 2026-05-09
…clusion

Phase 2 prove-kept-or-delete full scan result:
- Scanned all runtime/*.py (24,354 LOC, 20+ files)
- Tier 1 targets (bridge/preflight/orchestrator): 0 LOC deletable
  - vendored fallback = production path for bundle deployment
  - bridge files bound to distribution anchor (manifest/installer/smoke)
  - LEGACY_FALLBACK_SELECTED branch covered by 5 hard gate test files
- Tier 2 targets: 9 LOC dead code (router.py _contains_intent + _runtime_skill)
- Tier 3 engine.py: 6 LOC dead code (_phase_for_route)
- Total dead code: 15 LOC, deleted and hard gate verified (653 passed)

Conclusion: runtime is near minimal viable size under current contract
constraints. <20K LOC target not achievable without changing distribution/
installer contracts. P4b plan marked completed.

Final baseline: 24,334 LOC (from 25,534 at plan start, delta includes
prior measurement variance + 15 LOC dead code removal).

Context-Checkpoint: B
Context-Checkpoint: C

Release-Sync: yes

Release-Version: 2026-05-09.175537

Release-Date: 2026-05-09
- 优先级表:P4b 标已完成,新增 P4b.5 行,P4c 前置从 P4a 改为 P4b.5
- P4b section:标已完成,待归档,加归档说明
- P4b.5 section:新增(待开),定义宿主接入层级矩阵产出
- P4c section:排序改为 P4b.5 就绪后执行
- P4d/P5/P6:新增长期路线
- intake checklist:里程碑列表同步含 P6

Context-Checkpoint: blueprint
- plan/ → history/2026-05/20260509_p4b_runtime_surface_consolidation/
- tasks.md: archive_ready → true
- history/index.md: 新增 P4b 条目
- blueprint/tasks.md: P4b 引用改为归档路径

Context-Checkpoint: blueprint, plan
@Li-Sanze Li-Sanze merged commit f92d98b into main May 9, 2026
2 of 4 checks passed
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