diff --git a/packages/trueforge/AGENTS.md b/packages/trueforge/AGENTS.md index 79d9a3071..13d58867a 100644 --- a/packages/trueforge/AGENTS.md +++ b/packages/trueforge/AGENTS.md @@ -1,4 +1,4 @@ -- `withTransaction` callbacks MUST only do local DB work: no `await` of `fetch`, an SDK client, Redis, or other remote I/O (including through helpers). Finish remote work before opening the txn. +- `withTransaction` callbacks MUST only do local DB work by default: no `await` of `fetch`, an SDK client, Redis, or other remote I/O (including through helpers), remote network calls can be done in rare cases only if it is bounded by strict timeout. - `withTransaction` is `db.transaction().execute(callback)`: commits on resolve, rolls back on throw. Return domain data from the callback; build success `c.json(...)` after it. Failures that must undo writes MUST `throw` (e.g. `HTTPException`); MUST NOT `return c.json({ error: ... }, status)` inside — a returned Response commits while the client still sees an error. ### OpenAPI naming convention