#!/usr/bin/env bash
# CHECK -- sol: working-tree triage (modified tracked files vs HEAD).
# Exit 0 iff the committed manifest re-derives from each recorded path and
# every frozen path still exists as a real file under the repo.
set -u

HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Resolve the repo root (this script may live inside wizard-work/sol/ or at the
# repo root, so walk up to the directory that holds .git).
ROOT="$(git -C "$HERE" rev-parse --show-toplevel 2>/dev/null)" \
    || { echo "CANNOT GRADE: no git toplevel above $HERE" >&2; exit 2; }
cd "$ROOT" || { echo "CANNOT GRADE: cannot cd to $ROOT" >&2; exit 2; }

exec python3 wizard-work/sol/verify_working_tree_triage_2026_11_02.py
