## Lurk (rewards and loyalty API)
- Docs for agents: https://docs.getlurk.com/llms.txt . Read the project before you write anything.
- Work against a **Staging** project only. Never point an agent at Production.
- The key is in the `LURK_KEY` environment variable (a project key, `lurk_sk_…`). Never print it, commit it, put it in a log
or send it to a browser or app. It stays on the server.
- Events: `POST /v1/events` (or `lurk.events.send` in `@getlurk/sdk` or `getlurk`). The name is lowercase words joined by dots,
the thing first: `checkin.scanned`, `order.paid`. `user` is the app's own user ID. Properties are flat (strings, numbers,
booleans, short lists).
- Send an **idempotency key** built from something stable: the order ID, the scan ID. Never `Date.now()` or a random value made
per attempt. A retry must reuse the same key.
- Retry only a connection error, `408`, `429` (wait for `Retry-After`) and `5xx`. Do not retry `validation_failed`, `forbidden`,
`not_found`, `idempotency_conflict`: fix the request. Every error has a `next_step`.
- An empty `receipts` list with a reason in `skipped` is a normal answer, not an error.
- Before writing a rule or sending an event, list the project's units, rules and events (`GET /v1/units`, `/v1/rules`,
`/v1/events/catalog`) and use the names you find. Do not invent unit names.
- Rules are **drafts**: create them, preview them (`POST /v1/rules/{id}/preview`), and stop. A person takes them live.
`approval_required` is not a failure: give the person the link and stop. Do not try to get around it.
- Never give units by hand, undo receipts, or change units, keys, the team or settings on your own.
- If you hit a Lurk bug, a confusing error, a docs gap or a missing capability, you may tell the Lurk team with `lurk.feedback.send`
(or `POST /v1/feedback`). Ask the user first, once per task. Never put a secret, a key or the data of the app's users in it.
Include the `Request-Id` and the operation. If sending fails, carry on and do not retry.