screen-locker/scripts/finish_2026_08_24.sh
Krzysztof kuhy Rudnicki fc5453495c
Some checks are pending
dependency freshness / dependencies on newest stable (push) Waiting to run
md-naming / markdown naming convention (push) Waiting to run
pre-commit / pre-commit (${{ matrix.group }}) (flutter, flutter-analyze, ) (push) Waiting to run
pre-commit / pre-commit (${{ matrix.group }}) (mypy, mypy, ) (push) Waiting to run
pre-commit / pre-commit (${{ matrix.group }}) (pylint, pylint, ) (push) Waiting to run
pre-commit / pre-commit (${{ matrix.group }}) (rest, , mypy,pylint,flutter-analyze) (push) Waiting to run
Tests / test (push) Waiting to run
Tests / lock-popup-safety (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (0) (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (1) (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (2) (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (3) (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (4) (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (5) (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (6) (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (7) (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (8) (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (9) (push) Waiting to run
Tests / flutter-coverage (push) Blocked by required conditions
Tests / web-coverage (push) Waiting to run
repo-contract / repo contract (push) Waiting to run
drop the weekly shutdown bonus entirely; every bonus stops at the shutdown ceiling
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-10 08:59:50 +02:00

101 lines
2.6 KiB
Bash
Executable File

#!/bin/bash
# ============================================================================
# Finish the 2026-08-24 "workout not found" recovery, end to end.
#
# Everything Claude could not run itself, in the one order that works. The
# ordering is not cosmetic: `sick_day` fires BEFORE `already_logged` in the
# lock chain, so while the sick day stands it short-circuits the decision and
# hides whether the workout credit actually landed. Credit first, revoke
# second, re-arm last.
#
# Safe to re-run: every step is idempotent, and the script stops at the first
# failure rather than pressing on to re-arm a locker that cannot see today's
# workout.
#
# Usage:
# ./scripts/finish_2026_08_24.sh # do everything, then re-arm
# ./scripts/finish_2026_08_24.sh --no-arm # ...but leave enforcement off
# ============================================================================
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
readonly SCRIPT_DIR
readonly PY="$SCRIPT_DIR/.venv/bin/python"
readonly TARGET_DATE="2026-08-24"
ARM=1
usage() {
echo "Usage: $(basename "$0") [--no-arm]"
echo " --no-arm Run every step but leave enforcement disarmed"
exit 0
}
step() {
echo ""
echo "=============================================================="
echo " $1"
echo "=============================================================="
}
validate_requirements() {
if [[ ! -x $PY ]]; then
echo "Error: no venv interpreter at $PY — run ./run.sh once first" >&2
exit 1
fi
}
main() {
validate_requirements
cd "$SCRIPT_DIR"
step "1/6 Test suite (must be green before touching live state)"
"$PY" -m pytest screen_locker/tests/ -q --no-cov
step "2/6 Lint + type gate"
"$PY" -m pre_commit run --all-files
step "3/6 Sync: recover Firebase, then ingest today's workout"
# --sync-only never locks, so this is safe to run while disarmed.
./run.sh --sync-only
step "4/6 Did $TARGET_DATE actually land in the log?"
# Gate, don't warn: if the credit is not on disk there is nothing to
# revoke a sick day against, and re-arming here would lock you out again.
"$PY" scripts/verify_workout_credited.py --date "$TARGET_DATE"
step "5/6 Revoke the sick days that this workout disproves"
"$PY" scripts/revoke_sick_day.py --date "$TARGET_DATE" --date 2026-06-12
if ((ARM)); then
step "6/6 Re-arm enforcement"
./arm.sh --rearm
else
step "6/6 Skipped re-arm (--no-arm); enforcement stays OFF"
echo "Re-arm later with: ./arm.sh --rearm"
fi
echo ""
echo "✓ Done."
}
while [[ $# -gt 0 ]]; do
case $1 in
--no-arm)
ARM=0
shift
;;
-h | --help)
usage
;;
*)
echo "Unknown option: $1" >&2
exit 1
;;
esac
done
main "$@"