Tide · Errors

unguarded_cycle

load fails with code unguarded_cycle when reflexes form a trigger cycle on which no reflex has a when or a select. The example is a reflex triggered by writes to a table whose effect writes that table: it would trigger itself indefinitely. A cycle guarded by either is loaded and listed under cycles in the load report.

Reflex
{
  id: 'box.fill',
  intent: 'When a booking changes, fill the box from the waiting list.',
  on: { fact: { entity: 'bookings' } },
  effect: { name: 'bookings.fill' },
}
Writes of bookings.fill
['bookings']
Error
unguarded_cycle
tide refused to load:
  unguarded cycle: box.fill → box.fill — no selection and no `when` anywhere on the loop, so it diverges by construction
Output matches the expected value

Runs in this page on the installed package. The input and the expected output are defined by the example.