ธีม
Session notes — claude-2026-10-18
One person's notes, never rewritten by anyone else. docs/state/HANDOFF.md §17 and §22 hold what is NOT done, and STATE.md holds what is true now (the deployed sha's only home is its ✅ DEPLOYED line). This file records WHY each thing was done, and how it was checked.
▶ HANDOFF — night agent re-armed for tasks 8–12, and it obeys the Claude booking board
What the owner asked, in order: "give task 8-12 for claude night agent to do". Then: check the Claude booking before working. Then, by example, how bookings and the agent share the quota. Then: "fair, … make use of the token the most, according to common sense". Then: two /scrutinize passes, and "update docs and handoff properly".
Where it stands: armed on the VM. The live gate waits on tonight's 21:30–00:00 booking (100%; the booker had used 81% by 23:55). After the reporter's first sample past 00:00 (~00:10), the 00:27 tick starts on whatever the board then offers, until the 02:40 reset. Nothing the agent writes reaches production without a human: samo-dev only, no push, no deploy.
What was built, and why it is shaped like that
| Piece | Why |
|---|---|
A new queue (server/night-agent/NIGHT-TASKS.md), fresh branch agent/2026-10-18, migrations 0229–0233 | The old queue's reservations 0225–0228 were used by the owner's 2026-10-14 session. Its facts were re-measured on production (no pg_cron; the shop has no samo_year_be). The owner's 2026-10-14 overrides are listed as not to be re-decided |
| The agent takes what the board offers an unbooked person | The owner's examples (booking 13–15 @70%: start 08:00 → all, 08:30 → 30%) were already claude_free_now()'s own cases (0159). Obeying the board means one rule for people and agent; any copy would drift |
The reporter copies the rail (free_windows) + bookings | "How much if I start now" changes at each booking's start − 5 h. A single right_now goes stale within the minute. get_claude_board() raises without permission, so the empty-list-means-nobody-booked trap cannot occur |
| The allowance is fixed at task start, re-taken at each 5-hour reset | "they book too soon": a booking made mid-task does not stop the task. A booking known at the start, or at a reset, keeps its share |
No model handoff after giving way; not counted against Budget | The handoff would spend the booker's share. On a busy board, counting give-backs would end the queue with quota unused. Until still ends it |
Bugs found and fixed (write-up: docs/mistakes/tooling-proofs.md, the 2026-10-18 entry)
- The first design missed the booking entirely (the reason for all of this). Then I got it wrong twice before obeying the board: first a hand-written copy of the window rule, then "a booking only blocks starts", which ignored the shared window.
- Older runner bugs:
- task REPORTS were grepped as error lines, so "quota" / "401" in a summary read as a cut or as an auth failure
- systemd's 5 h limit could kill a late run before WIP, cut or spend
- a checkout with no git identity lost commits silently
- Scrutinize fixes:
- a reset left the new window with no stop line
- a between-task refusal for a booking still ran the handoff
- give-backs spent
Budget - the identity refusal spammed Discord every tick
- the resume prompt and the end alert named the wrong cause
- the reset checkpoint keyed on
pct > 0
- Mine, caught by CI after a deploy: a bare
<sha>in markdown broke the VitePress build (md-raw-tags.test.jsexists for exactly that). I had run only two test files before that commit.
How it was checked
src/js/night-queue.test.js: 69 tests. Each new rule was MUTATED once and shown red. One gap was found that way (a reset with a booking ON was passing only through another rule) and closed.- Three scratch rehearsals on the VM (
NIGHT_HOME/NIGHT_REPO/NIGHT_QUIET- a stub
claude), covering:
- done, quota cut, resume
- a booking during a task, and a report full of "quota/429/401"
- an unreadable board, and no git identity
- a 70% booking → 30% allowance → give-back at 27%
- a reset → new allowance 25 → give-back at 26, handoff skipped, Budget untouched
- a stub
- The live board copy on the VM: 4 bands, no names or purposes in the file; the live gate refused with the real booking.
NOT verified
- A REAL
claude -pbeing stopped by the watcher (only the stub was).timeoutleads its own process group, so the tree goes too (checked separately); what a half-finished real task leaves is for the morning review. - Behaviour across the weekly reset (Wed 16:00 ICT): the board's rail ends there, so the agent waits for the first copy after it. Reasoned, not run.
Owed
HANDOFF §17 (morning checklist, known limits) and §22 rows 8–12 (the agent's own tasks; review its branch before applying anything).