#!/bin/bash # test_structure.sh - Verify expected repo state after task-1-clean-old-files # RED: Run before changes (should fail) # GREEN: Run after changes (should pass) REPO=/home/ken/workspace/research-workbench PASS=0 FAIL=0 check_absent() { if [ ! -e "$REPO/$1" ]; then echo "PASS: '$1' is absent" ((PASS++)) else echo "FAIL: '$1' should be absent but exists" ((FAIL++)) fi } check_dir() { if [ -d "$REPO/$1" ]; then echo "PASS: directory '$1' exists" ((PASS++)) else echo "FAIL: directory '$1' should exist but is missing" ((FAIL++)) fi } check_gitignore_line() { if grep -qF "$1" "$REPO/.gitignore"; then echo "PASS: .gitignore contains '$1'" ((PASS++)) else echo "FAIL: .gitignore is missing '$1'" ((FAIL++)) fi } echo "=== Checking old car-help files are removed ===" check_absent "search.py" check_absent "guide.py" check_absent "sites.yaml" check_absent "app.py" check_absent "static" check_absent "results" check_absent "Dockerfile" check_absent "entrypoint.sh" check_absent "pyproject.toml" check_absent "uv.lock" echo "" echo "=== Checking new directories exist ===" check_dir "backend" check_dir "tests" check_dir "bundle/behaviors" check_dir "bundle/agents" check_dir "bundle/context" check_dir "frontend/src" check_dir "artifacts" check_dir "docs/plans" echo "" echo "=== Checking .gitignore contents ===" # Python check_gitignore_line ".venv/" check_gitignore_line "__pycache__/" check_gitignore_line "*.pyc" check_gitignore_line "*.egg-info/" # Node/Frontend check_gitignore_line "frontend/node_modules/" check_gitignore_line "frontend/dist/" # Runtime check_gitignore_line "artifacts/" # IDE check_gitignore_line ".idea/" check_gitignore_line ".vscode/" check_gitignore_line "*.swp" echo "" echo "==============================" echo "Results: $PASS passed, $FAIL failed" echo "==============================" [ $FAIL -eq 0 ] && exit 0 || exit 1