magicciv/scripts/regression_tests_status.sh
Natalie 74e1db8602 feat(@projects/@magic-civilization): finalize economy integration
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-04-17 02:16:11 -07:00

73 lines
2.5 KiB
Bash
Executable file

#!/usr/bin/env bash
# Snapshot the `regression-tests` team progress for the recurring executive report.
#
# Emits four sections to stdout:
# 1. Team members (non-lead) — from ~/.claude/teams/regression-tests/config.json
# 2. Task store (status + owner per task) — from ~/.claude/tasks/regression-tests/
# 3. Rust test files landed — ls of the test dirs the plan targets
# 4. GDScript test files landed — ls of the engine tests the plan targets
#
# Used by the 30-min cron report. Keep pure data — no narrative, no TTS.
# Argument-free, idempotent, safe on any host that has the task store mounted.
set -euo pipefail
TEAM="regression-tests"
TASKS_DIR="${HOME}/.claude/tasks/${TEAM}"
REPO="${PROJECT_ROOT:-/Users/natalie/Code/@projects/@magic-civilization}"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
echo "=== TEAM MEMBERS (${TEAM}) ==="
bash "${SCRIPT_DIR}/team_members.sh" "${TEAM}" 2>&1 | sed 's/^/ /'
echo
echo "=== TASK STORE (${TASKS_DIR}) ==="
if [[ ! -d "${TASKS_DIR}" ]]; then
echo " (team task dir not found)"
else
python3 - "${TASKS_DIR}" <<'PY'
import json, os, sys
from pathlib import Path
d = Path(sys.argv[1])
files = sorted(d.glob("*.json"), key=lambda p: int(p.stem) if p.stem.isdigit() else 10**9)
for f in files:
try:
obj = json.loads(f.read_text())
except Exception as e:
print(f" #{f.stem}: <unreadable: {e}>")
continue
subj = (obj.get("subject", "?") or "?")[:46]
owner = obj.get("owner", "-") or "-"
status = obj.get("status", "-") or "-"
print(f" #{f.stem:>3}: {subj:<46} | {owner:<18} | {status}")
PY
fi
echo
echo "=== RUST TEST FILES (plan-targeted crates) ==="
for crate in mc-mapgen mc-turn mc-climate mc-tech mc-combat mc-happiness; do
dir="${REPO}/src/simulator/crates/${crate}/tests"
if [[ -d "${dir}" ]]; then
entries=$(ls "${dir}" 2>/dev/null | tr '\n' ' ')
echo " ${crate}/tests: ${entries:-(empty)}"
else
echo " ${crate}/tests: (no tests/ dir)"
fi
done
echo
echo "=== GDSCRIPT TEST FILES (plan-targeted, disk presence) ==="
for rel in \
"src/game/engine/tests/unit/test_save_manager.gd" \
"src/game/engine/tests/unit/test_data_integrity.gd" \
"src/game/engine/tests/unit/test_climate_tile_sync.gd" \
"src/game/engine/tests/integration/test_gdextension_contract.gd" \
"src/game/engine/tests/integration/test_event_bus_signals.gd"; do
full="${REPO}/${rel}"
if [[ -f "${full}" ]]; then
size=$(wc -c <"${full}" | tr -d ' ')
echo " [present] ${rel} (${size} B)"
else
echo " [absent ] ${rel}"
fi
done