BINKY-WP-0003-T04: bridge scheduler prepared (rhythm-session.sh + docs)

Headless lane-restricted rhythm session script and enable/disable docs in
OperatingRhythm.md. Crontab installation itself is a one-line founder
action — the permission layer refuses agent-installed persistence, which
is the correct boundary.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
tegwick 2026-07-16 10:54:42 +02:00
parent bc49a24c4c
commit 930b4ed64b
3 changed files with 66 additions and 1 deletions

View file

@ -33,6 +33,31 @@ Rules:
the top.
4. Workplan files match hub state (fix-consistency covers drift).
## Bridge scheduler (workstation cron)
**Status: prepared, not installed** — installing a self-running agent loop is
a founder action (the Claude Code permission layer rightly refuses to let an
agent install its own persistence). Everything else is ready:
`scripts/rhythm-session.sh` runs a headless, lane-restricted Claude Code
session that does queue hygiene, writes the daily brief, and pulls one
autopilot item (agent name `agt-rhythm-bridge`; flock guard, logs to
`~/.cache/binky-control/rhythm/cron.log`).
**Enable (founder, one line):**
```bash
( crontab -l; echo '23 8 * * 1-5 /home/worsch/binky-control/scripts/rhythm-session.sh # binky rhythm bridge' ) | crontab -
```
**Disable:** `crontab -e` and delete the `binky rhythm bridge` line.
This is explicitly a **bridge**: once activity-core definitions (T05) and an
llm-connect executor (T06 follow-up) are live, the cron line is removed and
scheduling moves to the sanctioned coordination layer.
Guardrails baked into the script: Green/Blue lane only, allowed tools limited
to file edits + git add/commit, no push, no network, one-run-at-a-time lock,
bounded "maintenance pass" prompt.
## Weekly review (founder, ~15 min)
Read the newest brief + `SuccessMilestones.md`. One question: did anything

40
scripts/rhythm-session.sh Normal file
View file

@ -0,0 +1,40 @@
#!/usr/bin/env bash
# Binky operating-rhythm bridge session (BINKY-WP-0003-T04).
# Runs a headless Claude Code session that does queue hygiene, writes the
# daily brief, and pulls one AutopilotWorkQueue item when idle.
# This is a BRIDGE until activity-core + llm-connect own scheduling/execution
# (BINKY-WP-0003 T05/T06). Disable: see OperatingRhythm.md "Bridge scheduler".
set -euo pipefail
REPO="$HOME/binky-control"
LOGDIR="$HOME/.cache/binky-control/rhythm"
LOCK="$LOGDIR/rhythm.lock"
mkdir -p "$LOGDIR"
# never overlap a prior run
exec 9>"$LOCK"
flock -n 9 || { echo "$(date -Is) skipped: previous rhythm session still running" >>"$LOGDIR/cron.log"; exit 0; }
PROMPT=$(cat <<'EOF'
You are the Binky operating-rhythm bridge session (see OperatingRhythm.md).
Work autonomously, Green/Blue lane only. Do, in order:
1. Queue hygiene: check DecisionQueue.md (flag items older than 14 days),
OfficeHourQueue.md, RiskRegister.md escalation dates against today.
2. Write today's daily brief to briefs/<YYYY-MM-DD>-daily-brief.md in the
format defined in OperatingRhythm.md (Decide now / Progress / Risks /
Best next hour; one screen max). Skip if today's brief already exists.
3. If time remains, pull ONE item from AutopilotWorkQueue.md you can fully
complete in Green/Blue lane; mark it in_progress with agent
"agt-rhythm-bridge", do it, move it to the Completed log.
4. Commit all changes with a concise message.
Never touch Red/Yellow lane actions; queue them instead. Keep total effort
bounded — this is a maintenance pass, not a project session.
EOF
)
cd "$REPO"
"$HOME/.local/bin/claude" -p "$PROMPT" \
--permission-mode acceptEdits \
--allowedTools "Read,Write,Edit,Glob,Grep,Bash(git add:*),Bash(git commit:*),Bash(git status),Bash(git log:*),Bash(git diff:*),Bash(date:*),Bash(ls:*)" \
>>"$LOGDIR/cron.log" 2>&1
echo "$(date -Is) rhythm session finished rc=$?" >>"$LOGDIR/cron.log"

View file

@ -59,7 +59,7 @@ the schedule and how to disable it. Blue lane.
```task
id: BINKY-WP-0003-T04
status: todo
status: done
priority: high
```