Actions and automations
What the factory can run (actions: a script, an agent, an edit of a record) and what runs by itself (automations: an event, a reaction, limits); checks that an action has something to run it and that an automation has an event, a reaction and a limit.
About the package
Two collections. Actions are what the factory can run: a program (a script or a command), an agent, a move or an edit of a record. Automations are an event and a reaction: when trigger fires, reaction runs, no more often than the limits limits allow.
The page format is the same one the Shtukbase node reads: type: Action with kind, type: Automation with trigger, reaction, limits, mode. So without a node a page is an instruction for a person and an agent (mode: manual), and with a node it is something the node runs by itself (mode: auto).
Norms: ACT-R01 says an action has something to run it (check action); ACT-R02 says an automation states when, what and how many times (check automation).
Boundary: the node's sensors (Sensor) and events (Event) are not part of the package; the event is written straight into trigger. Commit gates and agent hooks are not automations: they stop work from passing, they do not react to an event after it. The run log is the runs package.
Norms 2
| ID | Norm | Level | Mode | Enforcer |
|---|---|---|---|---|
| ACT-R01 | A program has a script in place or a command; an agent action has an existing agent |
SHOULD | blocks | check |
| ACT-R02 | An automation has an event, a reaction to an existing page and a mode; one that runs by itself has limits |
SHOULD | blocks | check |
"Blocks": the enforcer stops a violation. "Observes": it only notes it. Level MUST means required; SHOULD means yes by default.
Actions 3
| Name | What it does | File | When |
|---|---|---|---|
| place | Add the Action and Automation kinds to the placement map | bin/place.ts | after install after update |
| action | An action has a script in place or an existing agent norm ACT-R01 | checks/t01_action.ts | check |
| automation | An automation has an event, a reaction and a limit norm ACT-R02 | checks/t02_automation.ts | check |
shtuk check runs the checks; shtuk run automations <name> runs any action. "After install" actions run by themselves only if the package comes from a trusted source.
Pages 4
They go into the project at these paths.
- /
- Actions collection
- Automations collection
- /norms/rules/automations/
- An action has something to run it ACT-R01
- An automation says when, what and how many times ACT-R02
Package files 4
They go into .shtukbase/packages/automations/; actions run from there.