Skip to content

Commit 95b3880

Browse files
committed
phase-0: pre-flight cleanup — purge stale state, dead governance chain, rewrite project.md
Phase 0 of P8 Wave 3: eliminate contradictions between post-P8 2-file state model and residual pre-P8 artifacts before Qoder host proof. State cleanup: delete 4 legacy state files + sessions/ directory (121 entries). Only current_handoff.json remains; active_plan.json pending next managed plan creation. Dead governance chain removal (atomic): delete check-context-checkpoints.py + test_context_checkpoints.py; clean references from .githooks/commit-msg, .github/workflows/ci.yml, scripts/release-preflight.sh, tests/test_release_hooks.py, CONTRIBUTING.md, CONTRIBUTING_CN.md. project.md rewrite: §Runtime 实现与测试约定 → §Protocol Kernel 实现与测试约定; Develop 质量约定 updated (develop_callback_runtime.py retired). Plan package docs reconciliation: design.md §9 delete-list corrected (sopify_bundle.py + codex/claude adapters kept), §10 Host Proof updated, §11 rewritten (Qoder PROTOCOL_VERIFIED home-scope hybrid, 5-point full-capability criteria). plan.md Wave 3 restructured with Phase 0 + updated W3.1-W3.3 + Key Decisions #19-23. tasks.md Phase 0 P0.1-P0.6 added and completed, Wave 3 Gate updated to 5+2 criteria. Tests: 180 passed / 0 failed. Protocol smoke: 3/3 PASS.
1 parent dabfd8a commit 95b3880

12 files changed

Lines changed: 297 additions & 542 deletions

File tree

.githooks/commit-msg

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,5 @@ if [[ -f "$STATE_FILE" ]]; then
8181
upsert_trailer "$MESSAGE_FILE" "Release-Date" "$RELEASE_DATE"
8282
fi
8383

84-
CHECKPOINT_SCRIPT="$ROOT_DIR/scripts/check-context-checkpoints.py"
85-
if [[ -f "$CHECKPOINT_SCRIPT" ]]; then
86-
python3 "$CHECKPOINT_SCRIPT" commit-msg --root "$ROOT_DIR" --message-file "$MESSAGE_FILE"
87-
fi
88-
8984
trap - EXIT
9085
cleanup

.github/workflows/ci.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,12 @@ jobs:
5353
raise SystemExit(1)
5454
PY
5555
56-
- name: Check context checkpoints
57-
run: python3 scripts/check-context-checkpoints.py repo --root .
58-
5956
- name: Run hard gate tests (protocol + smoke + distribution)
6057
run: |
6158
pip install --quiet pytest
6259
python3 -m pytest \
6360
tests/protocol/test_convention_compliance.py \
6461
tests/test_check_readme_links.py \
65-
tests/test_context_checkpoints.py \
6662
tests/test_distribution.py \
6763
tests/test_golden_snapshots.py \
6864
tests/test_release_hooks.py \

.sopify-skills/plan/20260605_p8_protocol_kernel_runtime_retirement/design.md

Lines changed: 93 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: P8 Protocol Kernel & Runtime Retirement — Design
33
plan_id: 20260605_p8_protocol_kernel_runtime_retirement
4-
status: pending
4+
status: in_progress (W1 ✅ / W2 ✅ / Phase 0 ✅ / W3 next)
55
created: 2026-06-05
66
---
77

@@ -548,7 +548,9 @@ P8 里的 CLI 不是新 runtime,只是少量辅助入口:
548548
| `installer/payload.py` | payload 分发核心 |
549549
| `installer/validate.py` | 安装前校验 |
550550
| `installer/models.py` / `distribution.py` / `outcome_contract.py` | installer 基础设施 |
551-
| `installer/hosts/copilot/`(如仍在) | payload_capable 试点已验证 |
551+
| `installer/sopify_bundle.py`(W2.2b/W2.8 保留为 protocol-kernel payload syncer;`payload.py` 依赖其 `sync_payload_bundle`) | payload 分发核心 |
552+
| `installer/hosts/{codex,claude}.py`(W2.9 从 DEEP_VERIFIED 重分类为 PROTOCOL_VERIFIED;保留安装能力,不承诺 deep runtime glue) | 已验证宿主注册 |
553+
| `installer/hosts/copilot.py` | payload_capable 试点已验证 |
552554
| `sopify_writer/`(由 P6 writer 基础收敛/重命名) | 新真相源,新宿主唯一写路径 |
553555
| `sopify_contracts/`(P6 已切出) | contract schema 定义 |
554556
| `scripts/install_sopify.py` / `sopify_init.py`(解耦后) | 用户入口 |
@@ -557,14 +559,20 @@ P8 里的 CLI 不是新 runtime,只是少量辅助入口:
557559

558560
**Delete-list(激进删除)**:
559561

560-
| 模块 | 理由 |
561-
|---|---|
562-
| `runtime/` 全目录(~16K LOC / 37 文件) | runtime 退场主线目标 |
563-
| `installer/sopify_bundle.py` | 完整 runtime 打包器,runtime 删除后无意义 |
564-
| `installer/hosts/{codex,claude}/`(deep adapter) | deep host legacy glue,蓝图 design.md 已拍板 2026-05-22 停止维护 |
565-
| 所有 `*_bridge.py` / `*_renderer.py` / `*_bundle.py` legacy deep script | 同上 |
566-
| `state/current_run.json` / `current_plan.json` / `current_clarification.json` / `current_decision.json` / `current_archive_receipt.json` / `last_route.json` | State 极简 cutover(§4.4) |
567-
| `plan/_registry.yaml` + registry code/tests | 非用户可读、非接续必需,P8 删除 |
562+
| 模块 | 理由 | W2 实际处置 |
563+
|---|---|---|
564+
| `runtime/` 全目录(46 tracked files / ~15.6K LOC) | runtime 退场主线目标 | ✅ W2.10 已删除 |
565+
| `scripts/runtime_gate.py` / `sopify_runtime.py` / `check-bundle-smoke.sh` / `check-prompt-runtime-gate-smoke.py` | runtime 入口脚本 | ✅ W2.8 已删除 |
566+
| 所有 `test_runtime_*.py` + `runtime_test_support.py`(~20 文件 / ~13K LOC) | runtime-coupled 测试 | ✅ W2.7 已删除 |
567+
| `state/current_run.json` / `current_plan.json` / `current_clarification.json` / `current_decision.json` / `current_archive_receipt.json` / `last_route.json` | State 极简 cutover(§4.4) | ✅ W2.4/W2.5 已删除 |
568+
| `plan/_registry.yaml` + registry code/tests | 非用户可读、非接续必需,P8 删除 | ✅ W2.6 已删除 |
569+
570+
**原 Delete-list 修正**:
571+
572+
| 模块 | 原计划 | 实际处置 | 理由 |
573+
|---|---|---|---|
574+
| `installer/sopify_bundle.py` | 删除 | **保留** → 移入 Keep-list | W2.2b 重构为 protocol-kernel payload syncer;`payload.py` 依赖其 `sync_payload_bundle` |
575+
| `installer/hosts/{codex,claude}.py` | 删除(deep adapter) | **保留** → 移入 Keep-list | W2.9 从 DEEP_VERIFIED 重分类为 PROTOCOL_VERIFIED;保留安装能力声明,deep runtime glue 已随 runtime/ 退场 |
568576

569577
**迁移-list(先解耦后删)**:
570578

@@ -647,45 +655,104 @@ P8 收口后,Sopify 是一个**审计资产协议内核 + 文件资产 + 轻
647655
| Writer | `sopify_writer/` | 唯一写 state/receipt 的代码路径 |
648656
| Contracts | `sopify_contracts/` | schema 与共享数据结构 |
649657
| Installer | payload/bootstrap/inspection/doctor | 把协议资产装到宿主,不再打包 runtime |
650-
| Host Proof | Qoder payload-capable | 证明不跑 runtime 也能消费审计资产、跨 session 接续并写回证据 |
658+
| Host Proof | Qoder PROTOCOL_VERIFIED (full-capability, home-scope hybrid) | 证明宿主只消费协议文件与审计资产即可维持证据链;跨 session 接续是资产可携带性的硬验收 |
651659
652660
不再存在:
653661
654662
- `runtime/`
655-
- `scripts/runtime_gate.py`
656-
- `scripts/sopify_runtime.py`
657-
- `installer/sopify_bundle.py`
658-
- deep host adapters for Codex/Claude
663+
- `scripts/runtime_gate.py` / `sopify_runtime.py` / `check-bundle-smoke.sh` / `check-prompt-runtime-gate-smoke.py`
664+
- deep runtime glue(bridge / renderer / session state machine)
659665
- `plan/_registry.yaml`
660666
- `state/current_run.json` / `current_plan.json` / `current_clarification.json` / `current_decision.json` / `current_archive_receipt.json` / `last_route.json`
661667
668+
**仍存在的**(W2 实际保留,非 deep legacy):
669+
670+
- `installer/sopify_bundle.py`(protocol-kernel payload syncer)
671+
- `installer/hosts/{codex,claude}.py`(PROTOCOL_VERIFIED 注册;安装能力声明,不依赖 runtime)
672+
662673
## 11. 新宿主试点(P8 验收项)
663674
664-
**宿主候选**:**Qoder**(Cursor / Windsurf 放后续)。
675+
### 11.1 宿主与裁定
676+
677+
**宿主**:**Qoder CLI**(Cursor / Windsurf 放后续;Qoder IDE 文件面与 CLI 一致,不作为独立认证路径)。
665678
666679
**选择 Qoder 理由**:
667680
668681
- 用户正在自用,反馈闭环最快;P8 需要真实接续证据,不需要先追求覆盖面
669-
- Qoder 自带 repo wiki / 项目文档配置(`.qoder/`),但 P8 不复用它做 Sopify 状态层,避免把宿主私有文档机制变成协议依赖
682+
- Qoder 自带 Bash / Read / Write / Grep 工具链 + Python 执行能力,可直接调 sopify_writer 库 API
683+
- Qoder 支持 `AGENTS.md`(项目级)+ `~/.qoder/AGENTS.md`(用户级)+ `.qoder/rules/`(项目级高优先级覆盖),入口面丰富
670684
- 已有 Copilot P7 payload_capable 经验可复用
671685
672-
**接入档位**:payload_capable + 接续增强(消费 active_plan / plan.md / current_handoff / receipts)。**不做 deep_verified**。
686+
### 11.2 接入 tier 与架构决策
687+
688+
**接入 tier**:`PROTOCOL_VERIFIED`(与 Codex/Claude 同级)。**不做** `BASELINE_SUPPORTED` 或 `payload_capable` 降级。
689+
690+
**接入形态**:**home-scope hybrid**——用 `~/.qoder/` 做全局安装入口,但不照抄 Codex/Claude 的每个目录约定。
691+
692+
| 决策项 | 裁定 | 理由 |
693+
|---|---|---|
694+
| Host of record | Qoder CLI only | CLI 和 IDE 文件面一致(同一引擎消费 AGENTS.md / rules / ~/.qoder/),但 proof transcript 在 CLI 上跑闭环最干净 |
695+
| Prompt 入口 | `~/.qoder/AGENTS.md`(用户级)| 与 Codex `~/.codex/AGENTS.md` / Claude `~/.claude/CLAUDE.md` 同级 home-scope 入口 |
696+
| Payload root | `~/.qoder/sopify/` | 与 Codex `~/.codex/sopify/` / Claude `~/.claude/sopify/` 同级 |
697+
| `.qoder/rules/` | **不接管** | Qoder rules 优先级高于 AGENTS.md,是用户/项目的高优先级 override 层;Sopify 只拥有 AGENTS.md + payload,rules 留给用户自定义 |
698+
| Home skill tree | **不宣称消费** `~/.qoder/skills/sopify/` | Qoder 未证实有 home-scope skills 消费面;P8 只承诺 AGENTS.md + payload + writer 闭环 |
699+
| Writer 调用 | sopify_writer 库 API 直调;仅 installed payload 场景下调不通时才允许极薄 wrapper | 已验证 repo-local import 可行;installed payload 场景需在 W3.2 中正式证明 |
700+
| Thin wrapper 边界 | wrapper 只能透传 writer 写入,不得做路由或执行 | 防止 wrapper 扩大成 runtime CLI |
701+
702+
### 11.3 全能力接续原则
703+
704+
**核心原则**:宿主接法可以不同,但 Sopify 的能力合同应该尽量相同。差异压在 adapter 层,不跑到产品能力层。
705+
706+
**5 条全能力接续闭环**(Qoder 与 Codex/Claude 对齐标准):
707+
708+
| # | 能力 | 验收标准 |
709+
|---|---|---|
710+
| 1 | Request admission | prompt 明确请求分类(consult / quick_fix / new_plan / continue / finalize / ask_user),不把所有请求硬路由到 active plan |
711+
| 2 | 4 步续接读链 | 按 active_plan → plan.md → current_handoff → receipts 恢复上下文 |
712+
| 3 | Writer 写回 | 通过 sopify_writer 写 active_plan / current_handoff / receipts / finalize |
713+
| 4 | 跨 session proof | A session 写 → B session 仅通过 4 步读链恢复 → B 继续写新 receipt |
714+
| 5 | 默认工作流消费 | 能继续 Sopify analyze / design / develop / finalize 主流程,不只是读 prompt |
715+
716+
### 11.4 验收口径
717+
718+
**Go**:5 条全能力闭环全过 + installed payload 路径验证通过。
673719
674-
**验收口径(不是"跑通安装")**:
720+
**Conditional Go**:5 条全过但 writer 只能通过 thin wrapper(需记录为已知限制)。
675721
676-
1. Qoder 在 fixture repo 上完成 `~go` 风格的启动
722+
**No-Go**:Qoder 只能读 prompt 不能稳定写 handoff / receipts,或 prompt 强制自动路由无法覆盖,或需要重新引入 runtime-like orchestration。
723+
724+
### 11.5 验收场景
725+
726+
1. Qoder 在 fixture repo 上完成 request admission(不自动接续 active plan)
677727
2. Qoder 按 4 步读顺序接续:active_plan → plan.md Plan Snapshot(缺失则完整 plan.md)→ current_handoff → latest receipts
678-
3. Qoder 按需读取 plan / tasks / design / receipts 中的审计资产继续工作
679-
4. Qoder 通过 `sopify_writer` 写 `state/current_handoff.json` + `plan/<id>/receipts/*.json` 后退出,再由 Qoder 新 session 接续
728+
3. Qoder 通过 `sopify_writer`(installed payload 路径)写 `state/current_handoff.json` + `plan/<id>/receipts/*.json`
729+
4. Qoder 新 session 仅通过 4 步读链恢复上下文并继续写新 receipt
680730
5. 整条链路**不依赖 runtime 进程**——只消费 protocol 文件 + sopify_writer
681731
682-
**产出物**:
732+
### 11.6 Prompt 资产约束
733+
734+
Qoder prompt 资产必须满足:
683735
684-
- `installer/hosts/qoder/` adapter(payload 级,非 deep)
685-
- `docs/hosts/qoder-onboarding.md` 接入文档
736+
- 不提 `runtime_gate.py`
737+
- 不要求默认全量读 protocol.md
738+
- 明确 request admission 分类(consult / quick_fix 不自动进入 4 步读链)
739+
- continuation 只走 active_plan → plan.md → current_handoff → receipts
740+
- 不指示 LLM 在检测到 `.sopify-skills/` 时总是自动接续 active plan
741+
742+
### 11.7 产出物
743+
744+
- `installer/hosts/qoder.py`(PROTOCOL_VERIFIED home-scope hybrid adapter)
745+
- `installer/hosts/__init__.py` 注册 qoder
746+
- Qoder prompt asset(渲染到 `~/.qoder/AGENTS.md`)
747+
- `install.sh --target qoder` 安装路径
686748
- 一个端到端验收 transcript 作为 P8 收口证据
687749
688-
**Checkpoint 不作为硬验收**:Qoder 只要能完成 mainline 接续即可;checkpoint(clarify/decide 分叉)最多作为 bonus evidence。
750+
### 11.8 不在 W3
751+
752+
- Qoder IDE 独立认证(文件面与 CLI 一致,不重复验证)
753+
- `.qoder/rules/` 集成(留给用户 override)
754+
- Cursor / Windsurf 试点(放 P9)
755+
- Copilot workspace protocol uplift(W4 独立任务)
689756
690757
## 12. Document Narrative Cutover(文档叙事切换)
691758

0 commit comments

Comments
 (0)