Skip to main content

Module hooks

Module hooks 

Source
Expand description

Hooks: a person’s own commands around a run. A gate can stop a tick or a pull request — only exit 0 lets it through; an observer hears what speccoder decided and never changes it. The pure parts live here: the [hooks.<name>] grammar, the gate outcome rule, the two public events and the sentence each carries.

Structs§

Count
k of n.
GateExit
How a gate’s run ended.
GateMark
A gate’s mark on an event: its name and how it ended.
GateRecord
One gate’s run at its point, as a report and the evidence carry it.
HookDef
One [hooks.<name>] table.
HookEntry
One hook as speccoder hooks shows it.
HookFile
A file a hook runs, and its content’s digest.
HookRun
One run of a hook.
HookTested
How speccoder hooks test went.
HooksReport
speccoder hooks: every hook, and what a trust, test or deliver just did.
TaskStopped
task.stopped: an attempt saved without a tick.
TaskTicked
task.ticked: a tick commit on a unit’s branch.

Enums§

GateOutcome
A gate’s verdict on its point.
GateState
How one gate ended at its point.
Point
Where a gate stands.
Role
A gate or an observer.
Runner
What a hook runs.
TrustState
Whether a hook may run.

Constants§

EVENTS
The events an observer can hear.
MAX_REASON
The longest gate reason kept, in characters.
MAX_TIMEOUT
The longest timeout a hook may ask for, in seconds.

Functions§

canonical
The value with every object’s keys sorted, so key order and comments in the configuration never change a digest.
clean
One line, control characters shown as \u{…}, at most MAX_REASON characters.
first_block
The first gate that blocked, if one did.
parse
Parses [hooks.<name>] (as JSON).
stopped_summary
T006 blocked by licence in 001-md2csv · T005 stopped in 001-md2csv: verification failed (CHECK-FAILED).
ticked_summary
T004 verified in 001-md2csv — 3 scenarios, held-out 2 of 2.
url_allowed
Whether a webhook may go to url: https, or plain http only to this machine.
valid_name
Whether name may name a hook: [a-z0-9_-]+.