Monday 07:00, Persistent=true so a week missed to downtime fires on next boot rather than leaving a silently empty library. 30-minute timeout so a wedged run cannot hold the slot until the following week. The script is deliberately thin — it calls the API and reports — so it never needs changing when the harvest does. Auth is a long-lived operator session in /etc/clawmates/library.token (root-only, 600); rotate by replacing the file. Exit status follows `healthy`, not paper count. A mature library shelves nothing most weeks and that is success; a run that errored is a failure even if it shelved something. The first manual fire caught a real bug in this script, in the opposite direction to this week's usual: the harvest genuinely shelved 15 papers and pushed them, and the reporter crashed on an escaped quote inside an f-string, so systemd marked the unit FAILED. A false failure destroys trust in the signal exactly as a false success does. The reporter now avoids backslashes entirely (it is embedded in a single-quoted shell string) and was proved against the real response shape before being trusted. Verified end to end on gw-04: run 1: 25 candidates, 10 already held, 15 shelved, pushed run 2: 25 candidates, 25 already held, 0 shelved, no branch, healthy Co-Authored-By: Claude Opus 5 <[email protected]>
15 lines
421 B
Desktop File
15 lines
421 B
Desktop File
[Unit]
|
|
Description=Clawmates paper library harvest (arXiv -> shelf + vault catalogue)
|
|
Wants=docker.service
|
|
After=docker.service network-online.target
|
|
|
|
[Service]
|
|
Type=oneshot
|
|
ExecStart=/usr/local/bin/clawmates-library.sh
|
|
StandardOutput=journal
|
|
StandardError=journal
|
|
Nice=10
|
|
# A harvest downloads PDFs and pushes a branch; give it room but do not
|
|
# let a wedged run hold the slot until the next week.
|
|
TimeoutStartSec=30min
|