Production CT225 has uncommitted changes not in master:
- recentErrors.ts: add slimContext() to trim large context_data blobs
and expose context_data in the recent-errors response
- admin-ui resolve-by-pattern/route.ts: new endpoint
- admin-ui resolve-fixed-patterns/route.ts: new endpoint
This commit preserves the drift so it can be PR-reviewed and merged
over 7bc04e8 (PR20).
Paperclip-Issue: BIT-33338
- php-error bridge: accept paperclip_project_id / paperclipProjectId in
CrmPhpPayload and promote into event context alongside project_slug/gitea_repo
- recent-errors: extract paperclip_project_id from context_json and emit as
top-level field so error loop can route issues to the correct project board
column without falling back to PAPERCLIP_ERROR_LOOP_PROJECT_ID_BY_SLUG
- Add tests for include/omit behaviour (mirrors gitea_repo coverage)
- Update ERROR_MONITORING_PUBLIC_API.md to document both optional fields
No DB migration required: field is stored in existing context_json column.
Co-Authored-By: Paperclip <[email protected]>
Top KPI cards used the paginated incidents list, so totals stuck near the API list cap. When operational stats load, sum byProject rollups from GET /v1/stats/summary instead.
Paperclip-Issue: BIT-2202
Paperclip-Run: 4c8f9b0e-4283-4fd7-9c20-f032f14f3719
Translates CRM-shaped ErrorMonitoringReporter payloads (project_slug,
gitea_repo at top level) to ingest-api /v1/ingest/events format. Both
routing fields are promoted into the event context so they are persisted
in context_json and surfaced by GET /api/error-monitoring/recent-errors,
unblocking ERRSIG routing validation for CasamentoWeb.
Auth: X-Error-Monitoring-Key is forwarded as Bearer to the ingest-api;
the key must be registered in er_ingest_keys for the target project.
Paperclip-Issue: BIT-1541
Co-Authored-By: Paperclip <[email protected]>
Extend GET /v1/stats/trend with granularity=hour (UTC buckets) and granularity=day
response envelope. Enrich GET /v1/stats/summary per-project totals and critical
counts. Add GET /v1/stats/recurrence for top incidents by occurrence volume in
a sliding window. Add index on er_incident_occurrences(occurred_at) for range
queries. Wire admin dashboard to summary, 24h/14d trends, and recurrence table.
Document contract in docs/ADMIN_STATS_API.md.
Paperclip-Agent: Pedro Alves (urlKey pedro-alves; id d706f4e6-5d05-4cec-b6e8-f8fb1f203aae)
Paperclip-Issue: BIT-728
Paperclip-Run: 948904bb-20d7-4d29-9cd7-4c22544f7570
Made-with: Cursor
Add POST /api/error-monitoring/resolve, bulk-resolve, and purge-resolved with
resolve key or admin JWT (errors:triage / errors:delete). Extend GET
recent-errors with status, severity, project_slug, q, offset, and stable
ordering. Document contracts in api/docs/ERROR_MONITORING_PUBLIC_API.md;
add vitest for public auth helpers. Proxy new routes and widen admin-ui
middleware for /api/error-monitoring/*.
Paperclip-Issue: BIT-726
Paperclip-Run: 3fbf92be-736e-4b11-8e90-cf993d8cd5ca
Paperclip-Agent: Pedro Alves (id d706f4e6-5d05-4cec-b6e8-f8fb1f203aae)
Made-with: Cursor
Register the same handler as /v1/paperclip/recent-errors so NPM and direct
API probes (e.g. :3200) match Paperclip default PAPERCLIP_ERROR_API_QUERY.
Admin UI proxy now calls the Fastify path for a single contract end-to-end.
Paperclip-Agent: David Santos (urlKey david-santos; id 0b1fcf92-5fe3-4ac0-9f29-df4ab72f5376)
Paperclip-Issue: BIT-702
Paperclip-Run: 4ba525c4-3929-475c-a845-400c49eda817
Made-with: Cursor
Add Fastify GET /v1/paperclip/recent-errors returning CRM-compatible JSON (data
envelope, project_slug per row, status open for open/investigating incidents).
Admin UI proxies the public path /api/error-monitoring/recent-errors to the API
base; middleware bypasses the session redirect for that path only.
Auth matches CRM env names: ERROR_RESOLVE_API_KEY or ERROR_REPORTING_API_KEY for
?api_key=, DEBUG_VIEW_ERRORS_KEY for ?view_errors=.
Paperclip-Agent: David Santos (urlKey david-santos; id 0b1fcf92-5fe3-4ac0-9f29-df4ab72f5376)
Paperclip-Issue: BIT-684
Paperclip-Run: cf7cb964-6953-4476-af09-3feb5d10da17
Made-with: Cursor
- Add middleware redirecting unauthenticated users to /login unless dev+demo
- Disable demo incident data when NODE_ENV=production
- Forward __Host-access cookie on SSR fetches to admin API
- Document NPM /admin/ proxy to Fastify api (§14.2.2)
Co-Authored-By: Paperclip <[email protected]>