Tide · API

tide.ingest

tide.ingest records a fact: a write the host made, or an external signal. It stores one row in the ledger and returns the fact as stored. No reflex is matched and no effect executes until the next advance.

Reflex
{
  id: 'booking.confirm',
  intent: 'Confirm a booking the moment it is made.',
  on: { fact: { entity: 'bookings', op: 'insert' } },
  effect: {
    name: 'mail.send',
    input: {
      to: { $ref: '$.row.member' },
      night: { $ref: '$.row.night' },
    },
  },
}
Fact
{
  kind: 'write',
  entity: 'bookings',
  op: 'insert',
  row: {
    id: 'B-2038',
    member: 'mia',
    night: '2026-10-23',
    seats: 2,
  },
  at: 1792653120000,
}
Stored fact and mail sent
{
  stored: {
    kind: 'write',
    entity: 'bookings',
    op: 'insert',
    row: {
      id: 'B-2038',
      member: 'mia',
      night: '2026-10-23',
      seats: 2,
    },
    at: 1792653120000,
    depth: 0,
  },
  mailedBeforeAdvance: [],
  mailedAfter: [{ to: 'mia', night: '2026-10-23' }],
}
Output matches the expected value

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