diff --git a/docs/superpowers/evidence/tutor-i3block-weekday-quota-2026-10-12.json b/docs/superpowers/evidence/tutor-i3block-weekday-quota-2026-10-12.json new file mode 100644 index 00000000..7c0bb4f3 --- /dev/null +++ b/docs/superpowers/evidence/tutor-i3block-weekday-quota-2026-10-12.json @@ -0,0 +1,30 @@ +{ + "intent": "The i3blocks tutor block shows progress against today's per-weekday tutor quota (15/30/50 minutes) instead of a fixed 60, matching earned_time 0.10.0.", + "scope": [ + "linux_configuration/i3blocks/tutor.sh (TARGET derived from the weekday)", + "Non-goals: no change to earned_time, the tutor ledger format, or any service; the table is a literal copy of earned_time's _quota.py" + ], + "changes": [ + "TARGET is now chosen per weekday via the printf %(%u)T builtin (fork-free): Tue-Thu 15, Mon/Fri 30, Sat/Sun 50 minutes, replacing the constant 60" + ], + "verification": [ + { + "command": "bash linux_configuration/i3blocks/tutor.sh (run on Monday 2026-10-12)", + "result": "pass", + "evidence": "Block printed '⚙ tutor 9/30' (Monday target 30)" + }, + { + "command": "shellcheck linux_configuration/i3blocks/tutor.sh", + "result": "pass", + "evidence": "Clean, no findings" + } + ], + "risks": [ + "The weekday table is duplicated from earned_time; a future quota change there must be mirrored here", + "Not run on every weekday; only Monday was observed live" + ], + "rollback": [ + "git revert the commit (restores readonly TARGET=60)", + "Confirm the i3bar tutor block renders N/60 again" + ] +} diff --git a/linux_configuration/i3blocks/tutor.sh b/linux_configuration/i3blocks/tutor.sh index e87a7c3a..51c43d75 100755 --- a/linux_configuration/i3blocks/tutor.sh +++ b/linux_configuration/i3blocks/tutor.sh @@ -18,7 +18,16 @@ set -euo pipefail readonly LEDGER="${TUTOR_LEDGER:-$HOME/.local/share/tutor/ledger.json}" # i3blocks' PATH has no ~/src: absolute path. readonly RUN="${TUTOR_RUN:-$HOME/src/tutor/run.sh}" -readonly TARGET=60 # earned_time daily cap, minutes +# Minutes that earn the full reward today: a literal copy of earned_time's +# per-weekday tutor quota (_quota.py, 0.10.0): Tue-Thu 15, Mon/Fri 30, +# Sat/Sun 50. A builtin strftime, so the tick stays fork-free. +printf -v weekday '%(%u)T' -1 +case $weekday in +2 | 3 | 4) TARGET=15 ;; +1 | 5) TARGET=30 ;; +*) TARGET=50 ;; +esac +readonly TARGET readonly YELLOW='#F1FA8C' readonly ORANGE='#FFB86C'