#!/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 "==> 环境就绪 ✅"