mirror of
https://github.com/kuhyx/testsAndMisc.git
synced 2026-11-10 18:07:06 +01:00
i3blocks/tutor: target follows earned_time 0.10.0 weekday quota (15/30/50)
Some checks failed
dependency freshness / dependencies on newest stable (push) Has been cancelled
md-naming / markdown naming convention (push) Has been cancelled
Pre-commit checks / pre-commit (${{ matrix.group }}) (mypy, mypy) (push) Has been cancelled
Pre-commit checks / pre-commit (${{ matrix.group }}) (pylint, pylint) (push) Has been cancelled
Pre-commit checks / pre-commit (${{ matrix.group }}) (rest, ) (push) Has been cancelled
Pre-commit checks / pre-commit (${{ matrix.group }}) (shellcheck, shellcheck) (push) Has been cancelled
repo-contract / repo contract (push) Has been cancelled
Shell tests / shell-tests (push) Has been cancelled
Shell tests / lib-tests (push) Has been cancelled
Shell tests / arch-tests (push) Has been cancelled
Some checks failed
dependency freshness / dependencies on newest stable (push) Has been cancelled
md-naming / markdown naming convention (push) Has been cancelled
Pre-commit checks / pre-commit (${{ matrix.group }}) (mypy, mypy) (push) Has been cancelled
Pre-commit checks / pre-commit (${{ matrix.group }}) (pylint, pylint) (push) Has been cancelled
Pre-commit checks / pre-commit (${{ matrix.group }}) (rest, ) (push) Has been cancelled
Pre-commit checks / pre-commit (${{ matrix.group }}) (shellcheck, shellcheck) (push) Has been cancelled
repo-contract / repo contract (push) Has been cancelled
Shell tests / shell-tests (push) Has been cancelled
Shell tests / lib-tests (push) Has been cancelled
Shell tests / arch-tests (push) Has been cancelled
Claude-Session: https://claude.ai/code/session_01E57caQF4KXwEvqEnKtJiHM Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
1c50cfb028
commit
70df11f306
@ -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"
|
||||
]
|
||||
}
|
||||
@ -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'
|
||||
|
||||
Loading…
Reference in New Issue
Block a user