ShtukbaseStandard

Schedule

schedule · version 0.1.0
Agents and automations1 norm1 check

Automations on a schedule (cron, every, at): a tick finds who is due by the run log, holds the limits and runs the reaction, an agent through a harness or an action; a crontab line and a launchd plist for the owner; a check that the schedule can run without a person.

About the package

An automation (package automations) with a clock event runs by itself. The package provides the tick: one check of "who is due". The system scheduler calls the tick every few minutes; the owner turns it on.

A schedule in an automation

type: Automation
title: "Ping"
trigger: {kind: schedule, cron: "0 7 * * *"}   # minute hour day month weekday
# trigger: {kind: schedule, every: 6h}          # 15m, 6h, 1d
# trigger: {kind: clock, at: "07:00"}           # every day; tz: UTC is the time zone, otherwise the machine zone
reaction: {agent: /agents/pinger.md, prompt: "Write one word into notes/ping.md"}
# reaction: {action: /actions/nightly-check}    # an action: a program (path or command) or an agent action
limits: {perHour: 1, perDay: 4}
mode: auto                                      # manual: the tick does not run it

The tick

shtuk run schedule tick [--now 2026-11-29T07:00:00Z] [--dry-run]

  • It takes automations with trigger.kind: schedule or clock and mode: auto.
  • Whether it is due is decided by the log /runs: every run has a slot, the scheduled time it closed. For cron it is due if the last slot not later than --now is not yet closed. For every it is due if the interval has passed since the last run.
  • The limits limits.perHour and perDay are counted over the same runs. Without a limit the tick does not run it.
  • The reaction: an agent goes through its harness package (shtuk run harness-<runtime> ask), and the harness package writes the run; a program action is a script or a command from the project root, with a log in /runs/logs/.
  • A second tick at the same time runs nothing: the slot is already closed.
  • Exit code 1 if some run failed. What failed and why is in the log.

--now is an ISO time for checking by hand. --dry-run only says what it would run.

Turn it on in the system

The package turns nothing on by itself.

  • shtuk run schedule cron [--every 5] prints a line for crontab -e.
  • shtuk run schedule launchd [--every 5] writes .shtukbase/schedule/com.shtukbase.tick.<project>.plist and prints the launchctl bootstrap command, which the owner runs.

The tick log is .shtukbase/schedule/tick.log.

The norm

SHD-R01 says a scheduled automation can run without a person: the schedule is readable, there is a limit, and the reaction points to an agent with an installed harness (and a prompt) or to an action that the tick can run. The enforcer is the check schedule. The common automation fields are checked by ACT-R02 of the package automations.

Boundary: what an agent does and how is in the harness packages (harness); who woke a run is the field woke: clock in the log.

Norms 1

IDNormLevelModeEnforcer
SHD-R01
A scheduled automation has a readable schedule, a limit, and a reaction that points to something the tick can run
SHOULD blocks
check

"Blocks": the enforcer stops a violation. "Observes": it only notes it. Level MUST means required; SHOULD means yes by default.

Actions 4

NameWhat it doesFileWhen
tickOne tick: run the automations that are dueactions/tick.ts
shtuk run
cronPrint the crontab line for this project's tickactions/cron.ts
shtuk run
launchdWrite a launchd plist for the tick into the project folder (does not turn it on)actions/launchd.ts
shtuk run
scheduleA scheduled automation has a limit and an executor that exists
norm SHD-R01
checks/s01_schedule.ts
check

shtuk check runs the checks; shtuk run schedule <name> runs any action. "After install" actions run by themselves only if the package comes from a trusted source.

Pages 1

They go into the project at these paths.

Package files 7

They go into .shtukbase/packages/schedule/; actions run from there.