feat(harness): integrate walkinglabs 5-subsystem model with templates

- Add .harness/ directory with 6 templates:
  init.sh (unified startup entry)
  PROGRESS.md (session progress tracking)
  feature_list.json (machine-readable feature status)
  clean-state-checklist.md (end-of-session cleanup)
  session-handoff.md (cross-session handoff)
  evaluator-rubric.md (review scoring)
- Update AGENTS.md: 5-subsystem model (Instruction/Tools/Environment/State/Feedback)
- Add Init-Plan-Implement-Verify-Cleanup workflow cycle
This commit is contained in:
2026-05-28 15:05:20 +08:00
parent d3ebbf9a3c
commit 1396e4b4d2
7 changed files with 286 additions and 263 deletions

29
.harness/PROGRESS.md Normal file
View File

@@ -0,0 +1,29 @@
# 进度日志
## 当前已验证状态
- 仓库根目录:`/root/.openclaw/workspace/his-repo`
- 后端路径:`openhis-server-new/`
- 前端路径:`openhis-ui-vue3/`
- 分支:`develop`
- 标准启动路径:`cd openhis-server-new && mvn compile -pl openhis-application -am`
- 标准验证路径:`mvn compile -pl openhis-application -am`
- 当前最高优先级未完成功能:
- 当前 blocker
## 会话记录
### Session 001
- 日期2026-05-28
- 本轮目标:建立 Harness Engineering 基础设施
- 已完成:
- 重构 AGENTS.md853 → 400 行Harness 框架)
- 创建 5 个 Codex 技能
- 创建通用 AGENTS.md 模板
- 安装 harness-engineering 插件
- 创建项目级 Harness 模板
- 运行过的验证mvn compile ✅
- 提交记录d3ebbf9a3
- 已知风险或未解决问题:
- 下一步最佳动作:

View File

@@ -0,0 +1,13 @@
# 干净状态检查清单
会话结束前逐项检查:
- [ ] 标准启动路径仍然可用mvn compile 通过)
- [ ] 标准验证路径仍然可运行
- [ ] 当前进度已记录到 PROGRESS.md
- [ ] 功能状态真实反映 passing 和未验证的边界
- [ ] feature_list.json 已更新
- [ ] 没有任何半成品步骤处于未记录状态
- [ ] 临时文件和调试代码已清理
- [ ] 提交信息清晰描述了变更内容
- [ ] 下一轮会话无需人工修复即可继续

View File

@@ -0,0 +1,22 @@
# 评审评分表
| 维度 | 问题 | 0-2分 | 备注 |
|---|---|---|---|
| 正确性 | 实现的行为是否符合目标功能? | | |
| 验证 | 编译检查是否通过?数据流是否完整? | | |
| 范围纪律 | 是否保持在选定功能范围内? | | |
| 可靠性 | 结果能否在重启后继续工作? | | |
| 可维护性 | 代码是否遵循项目规范? | | |
| 交接准备度 | 下一轮能否只靠仓库内文件继续推进? | | |
## 结论
- [ ] Accept
- [ ] Revise
- [ ] Block
## 后续动作
- 缺失的证据:
- 必须补的修复:
- 下次复审触发条件:

View File

@@ -0,0 +1,50 @@
{
"project": "OpenHIS",
"last_updated": "2026-05-28",
"rules": {
"single_active_feature": true,
"passing_requires_evidence": true,
"do_not_skip_verification": true
},
"status_legend": {
"not_started": "功能还没开始做",
"in_progress": "当前唯一正在进行的任务",
"blocked": "有已记录的阻塞问题",
"passing": "验证已通过,证据已记录",
"done": "已完成并合入主干"
},
"features": [
{
"id": "harness-001",
"priority": 1,
"area": "infrastructure",
"title": "Harness Engineering 基础设施搭建",
"user_visible_behavior": "Codex 具备完整的约束/反馈/控制/持久执行能力",
"status": "passing",
"verification": [
"AGENTS.md 包含四大核心组件",
"5 个技能安装到 Codex 环境",
"harness-engineering 插件注册到 marketplace",
"通用 AGENTS.md 模板可用"
],
"evidence": ["AGENTS.md restructured", "skills created", "plugin validated"],
"notes": "初始搭建完成,可继续迭代"
},
{
"id": "harness-002",
"priority": 2,
"area": "infrastructure",
"title": "WalkingLabs 实战模式整合",
"user_visible_behavior": "项目具备完整的 5 子系统 Harness指令/工具/环境/状态/反馈)",
"status": "in_progress",
"verification": [
".harness/ 目录包含所有模板文件",
"init.sh 可正常运行",
"PROGRESS.md 记录当前状态",
"feature_list.json 跟踪所有功能"
],
"evidence": [],
"notes": ""
}
]
}

43
.harness/init.sh Executable file
View File

@@ -0,0 +1,43 @@
#!/usr/bin/env bash
# Harness Init — 统一启动与验证入口
# 每次新会话开始前运行
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$ROOT_DIR"
echo "==> 当前目录: $PWD"
echo "==> Git 状态"
git status --short 2>/dev/null || true
git log --oneline -3 2>/dev/null || true
echo ""
echo "==> 编译检查"
cd openhis-server-new
mvn compile -pl openhis-application -am -q 2>/dev/null && echo " ✅ 编译通过" || echo " ❌ 编译失败"
echo ""
echo "==> 读取进度"
if [ -f .harness/PROGRESS.md ]; then
head -20 .harness/PROGRESS.md
else
echo " (无进度文件)"
fi
echo ""
echo "==> 读取功能清单"
if [ -f .harness/feature_list.json ]; then
python3 -c "
import json
with open('.harness/feature_list.json') as f:
data = json.load(f)
features = [f for f in data.get('features', []) if f.get('status') == 'in_progress']
if features:
print(f\" 当前进行中: {features[0].get('title', 'unknown')}\")
else:
print(' 当前无进行中的功能')
" 2>/dev/null || echo " (无法解析)"
fi
echo ""
echo "==> 环境就绪 ✅"

View File

@@ -0,0 +1,29 @@
# 会话交接
## 当前已验证
- 现在明确可用的部分:
- 本轮实际跑过的验证:
## 本轮改动
- 新增了哪些代码或行为:
- Harness 发生了哪些变化:
## 仍损坏或未验证
- 已知缺陷:
- 未验证路径:
- 下一轮需要注意的风险:
## 下一步最佳动作
- 最高优先级未完成功能:
- 为什么它是下一步:
- 什么结果才算 passing
## 命令速查
- 编译:`cd openhis-server-new && mvn compile -pl openhis-application -am`
- 打包:`mvn clean package -DskipTests`
- 启动:`mvn spring-boot:run`