fix(api): non-empty stack_trace on recent-errors for legacy rows

When occurrence.stack_trace is null/blank, synthesize the same text as
ingest-api (BIT-796) at read time so CRM / Paperclip always get a stable
contract (BIT-1008, ERRPAYLOAD:5d26a50c83c0). Add unit tests and document
in HTTP_CONTRACTS + ERROR_MONITORING_PUBLIC_API.

Paperclip-Agent: 0b1fcf92-5fe3-4ac0-9f29-df4ab72f5376
Paperclip-Issue: BIT-1008
Paperclip-Run: 4c4da0dd-38ab-4f32-86d7-f2502c7cceca
Made-with: Cursor
This commit is contained in:
Peter Spark committed 2026-04-05 10:49:24 +00:00
1 parent eaa326e2bb
commit 6971b7669c
5 files changed
+71 -4

No files matched your search

+2
View File
@@ -51,6 +51,8 @@ Alias: `GET /v1/paperclip/recent-errors`
Each row includes CRM-compatible fields. For non-resolved incidents, `status` is always `"open"` (including `investigating`) so Paperclip `error_loop` continues to treat rows as open.
**`stack_trace`:** Non-empty for every row: missing client stacks are synthesized on ingest; legacy DB rows with null/blank `stack_trace` get the same synthesis when serializing this endpoint (BIT-1008).
**Example**
```bash