Commit Graph
70 Commits
Author SHA1 Message Date
Peter Spark 4ccbfb0f5b docs(wdmi): runbook entry for BIT-899 ERRSIG:cb5a8d3411a9 (classic all_4)
Document ERRSIG:cb5a8d3411a9 as classic _upload_feed_via_api with feed_id
all_4; disambiguate from tier feed_all_4 (BIT-895). Add er-cli queries and
§5.16 mirroring BIT-898.

Paperclip-Agent: 0b1fcf92-5fe3-4ac0-9f29-df4ab72f5376
Paperclip-Issue: BIT-899
Paperclip-Run: a9e5302a-759e-499e-8567-457b62b341fb
Made-with: Cursor
2026-04-05 02:22:40 +00:00
Peter Spark 7f2264a0c9 docs(wdmi): runbook entry for BIT-898 ERRSIG:c79a3dfe2667 (classic ref_4)
Document Feed upload API no response for feed_id ref_4 / stage
_upload_feed_via_api in RUNBOOK_REPORTER_WDMI_FEED_UPLOAD: index fingerprint,
§5.15, and er-cli queries; distinguish from tier feed_ref_4 (BIT-894).

Paperclip-Agent: 0b1fcf92-5fe3-4ac0-9f29-df4ab72f5376
Paperclip-Issue: 4896a011-69b0-4e70-85b7-98ca16dec3cd
Paperclip-Run: bcd911f5-9d49-4e33-985c-d8817fb750ed
Made-with: Cursor
2026-04-05 02:21:36 +00:00
Peter Spark 69496ece8f docs(wdmi): runbook entry for BIT-897 ERRSIG:be2d7dd9daae (upload_feed_base)
Document Base feed upload failed / stage upload_feed_base (feed_op / op) in
RUNBOOK_REPORTER_WDMI_FEED_UPLOAD: index fingerprint + §5.14, distinct from
upload_feed_tier cases in §5.5+.

Paperclip-Agent: 0b1fcf92-5fe3-4ac0-9f29-df4ab72f5376
Paperclip-Issue: 28067e20-811f-43d6-b85a-825e737b40a2
Paperclip-Run: 8e2463e3-c39f-433f-87da-06214ab03eca
Made-with: Cursor
2026-04-05 02:19:22 +00:00
Peter Spark df7e972b63 docs(runbook): document BIT-896 feed_op_3 tier upload fingerprint
Add ERRSIG:bbbbd29bb0bc to RUNBOOK_REPORTER_WDMI_FEED_UPLOAD (index + §5.13),
linking tier upload_feed_tier to classic op_3 (BIT-892) for triage.

Paperclip-Agent: 0b1fcf92-5fe3-4ac0-9f29-df4ab72f5376
Paperclip-Issue: bd55c08c-ed95-42ec-ba71-cce9dfe8a85c
Paperclip-Run: 0cad46e5-95a3-4670-9338-ad2f13df2f1a
Made-with: Cursor
2026-04-05 02:17:32 +00:00
Peter Spark 2cd1a4a364 docs(wdmi): FlexIT runbook — BIT-926 ERRSIG:033b36032168 (tag mismatch)
- Index ERRSIG:033b36032168 in RUNBOOK_REPORTER_WDMI_FLEXIT_XML context
- Add §5.4 for FlexIT.XML parser mismatch (Record / ManufacturerPartNumber)
- Extend hub er-cli examples for the new signature

Paperclip-Agent: 11179220-3cec-4f0f-880d-2771ff64fce8
Paperclip-Issue: BIT-926
Paperclip-Run: 82a1cd5d-0a20-4a15-9dfa-26b480213c2c
Made-with: Cursor
2026-04-05 02:17:03 +00:00
Peter Spark 698d6d47b5 docs(wdmi): runbook entry for BIT-895 feed_all_4 tier upload (ERRSIG:ac1ccb189f6b)
- Index signature in RUNBOOK_REPORTER_WDMI_FEED_UPLOAD context list
- Add §5.12 with triage notes, relation to BIT-876, er-cli queries
- Extend hub linkage command block

Paperclip-Agent: 0b1fcf92-5fe3-4ac0-9f29-df4ab72f5376
Paperclip-Issue: BIT-895
Paperclip-Run: c981a377-5568-4da7-9fe3-a20cade60c47
Made-with: Cursor
2026-04-05 02:16:02 +00:00
Peter Spark 3556ba9797 docs: runbook for wdmi-store CacheFilesystem mkdir File exists
Add RUNBOOK_REPORTER_WDMI_CACHE_MKDIR.md (BIT-924 / ERRSIG:db6f9979f37d) and
link it from RUNBOOK_TRIAGE related-docs.

Correção de código no host wdmi-store (Importer) segue o runbook §3–§4.

Paperclip-Issue: BIT-924
Paperclip-Run: e863f155-c122-442f-9f29-b4b8abac6ce6
Paperclip-Agent: 11179220-3cec-4f0f-880d-2771ff64fce8
Made-with: Cursor
2026-04-05 02:15:43 +00:00
Peter Spark ae6b74e14c docs(runbook): document BIT-894 feed_ref_4 tier upload (ERRSIG:69f837d90ccd)
- Add §5.11 to RUNBOOK_REPORTER_WDMI_FEED_UPLOAD mirroring BIT-891/BIT-876 tier
  upload guidance for ref_4 fingerprint and recurrence under BIT-309.
- Extend hub er-cli query list and signature index line for operators.

Paperclip-Agent: 0b1fcf92-5fe3-4ac0-9f29-df4ab72f5376
Paperclip-Issue: BIT-894
Paperclip-Run: df04be4f-4e5e-4119-bcf1-1f33b2777db0
Made-with: Cursor
2026-04-05 02:14:32 +00:00
Peter Spark 9e4975a6f2 docs(runbook): add BIT-920 / ERRSIG:948b0236b852 to Flexit XML runbook
Document wdmi-store Flexit recurrence (NAVPN fragment in error text) in
RUNBOOK_REPORTER_WDMI_FLEXIT_XML.md §5.3 with er-cli queries.

Paperclip-Issue: BIT-920
Paperclip-Run-Id: 32681c3a-d36a-4616-807d-883ad688e469
Made-with: Cursor
2026-04-05 02:13:57 +00:00
Peter Spark 7ba1c80aea docs(runbook): document BIT-892 ERRSIG 29f07be05c94 (WDMI feed upload op_3)
Add §5.10 for classic _upload_feed_via_api with feed_id op_3, extend §5
er-cli queries, and index the fingerprint in the opening context
paragraph.

Paperclip-Agent: david-santos
Paperclip-Issue: BIT-892
Paperclip-Run: 5437b35d-3544-4d45-bdf1-cfd6821bc778
Made-with: Cursor
2026-04-05 02:13:11 +00:00
Peter Spark a6178deb84 docs: document BIT-891 ERRSIG 10f9b242106e in WDMI feed upload runbook
Add §5.9 for feed_ref_5 / ref_5 tier upload (same class as BIT-888/BIT-876),
extend §5 hub er-cli queries, and index the fingerprint in the opening
context paragraph.

Paperclip-Agent: david-santos
Paperclip-Issue: BIT-891
Paperclip-Run: c0b4b925-5684-44e1-a90a-4ae92057a5a7
Made-with: Cursor
2026-04-05 02:12:09 +00:00
Peter Spark 7e102296ca docs(runbook): document BIT-890 ERRSIG 0da47a1df495 (oauth2 DNS / product overwrite)
Add section 5.4 for _maintenance_sync_product_overwrite.php, er-cli query, and fix
the DNS summary cross-refs to point at OAuth token sections (5.3/5.4) instead of 5.2.

Paperclip-Agent: 0b1fcf92-5fe3-4ac0-9f29-df4ab72f5376
Paperclip-Issue: BIT-890
Paperclip-Run: e1985c94-73be-4bf0-b14f-7150afad45e4
Made-with: Cursor
2026-04-05 02:10:35 +00:00
Peter Spark 92d9e9f24d docs(runbook): document BIT-889 ERRSIG c53fefa72645 (feed_op_1 / upload_feed_tier)
Add section 5.8, er-cli queries, and context summary cross-link for the feed tier
upload failure fingerprint (same operational class as BIT-888 / BIT-883).

Paperclip-Agent: 0b1fcf92-5fe3-4ac0-9f29-df4ab72f5376
Paperclip-Issue: BIT-889
Paperclip-Run: 811f217d-1e7f-4862-8220-cf098f676b78
Made-with: Cursor
2026-04-05 02:09:15 +00:00
Peter Spark 7d1004b026 docs: document BIT-888 ERRSIG b2b46538613b in WDMI feed upload runbook
Add §5.7 for feed_op_2 / op_2 tier upload (same class as BIT-883/BIT-876),
extend §5 hub er-cli queries, and index the fingerprint in the opening
context paragraph.

Paperclip-Issue: BIT-888
Made-with: Cursor
2026-04-05 02:07:49 +00:00
Peter Spark 5307fcddee docs: document BIT-887 ERRSIG 90a47beec0d7 in CRM due_time runbook
Extend RUNBOOK_REPORTER_CRM_TASKS_DUE_TIME with the recurrence linked to
BIT-887 (same empty-string TIME bind as BIT-885), er-cli query, and §5.2.

Paperclip-Issue: BIT-887
Made-with: Cursor
2026-04-05 02:06:28 +00:00
Peter Spark 76d436e57a docs(wdmi): document ERRSIG 7c4f662f5151 classic op_4 feed upload (BIT-886)
- Extend RUNBOOK_REPORTER_WDMI_FEED_UPLOAD with §5.6 and er-cli queries
- Cross-link BIT-883 (tier feed_op_4) vs BIT-886 (classic _upload_feed_via_api)

Paperclip-Agent: 0b1fcf92-5fe3-4ac0-9f29-df4ab72f5376
Paperclip-Issue: BIT-886
Paperclip-Run: 12016482-5ebb-48ab-883b-d0c6159a9960
Made-with: Cursor
2026-04-05 02:05:06 +00:00
Peter Spark 91b9a9da1f docs: runbook for CRM crm_tasks.due_time empty string (BIT-885)
Add RUNBOOK_REPORTER_CRM_TASKS_DUE_TIME.md for ERRSIG:3be5c05002bd:
MySQL rejects '' for TIME columns; normalize to NULL in CRM before bind.
Link from RUNBOOK_TRIAGE related docs.

Paperclip-Agent: 0b1fcf92-5fe3-4ac0-9f29-df4ab72f5376
Paperclip-Issue: BIT-885
Paperclip-Run: 6b1f0af9-ac3e-4eb8-9a53-cc22e64f15c4
Made-with: Cursor
2026-04-05 02:03:45 +00:00
Peter Spark 1f21128745 docs(wdmi): document ERRSIG 3a9267fb1478 (BIT-884) in feed upload runbook
- Index BIT-884 in runbook intro and hub CLI §5 queries
- Add §5.4 case (feed_id op_2, classic upload path) alongside BIT-882

Paperclip-Agent: 0b1fcf92-5fe3-4ac0-9f29-df4ab72f5376
Paperclip-Issue: BIT-884
Paperclip-Run: d2064b65-2953-4f13-b572-87b7f351402d
Made-with: Cursor
2026-04-05 02:01:51 +00:00
Peter Spark e42df98416 docs(runbook): document BIT-883 feed_op tier upload signature
Add §5.4 and intro cross-ref for ERRSIG:1a8be255a9c2 (upload_feed_tier / feed_op_*).

Paperclip-Agent: 0b1fcf92-5fe3-4ac0-9f29-df4ab72f5376
Paperclip-Issue: BIT-883
Paperclip-Run: 50b3378e-3cea-4d33-9820-1db1e765b381
Made-with: Cursor
2026-04-05 02:00:21 +00:00
Peter Spark cdf1d44bb4 docs: document BIT-863 ERRSIG 9b4561a43025 (Sheets Portes / supplier fees)
Add hub runbook section 5.2 for cURL 35 on sheets.googleapis.com from
_maintenance_sync_product_supplier_fees.php, cross-link BIT-862, and note
recurrence as deploy or persistent network/TLS.

Paperclip-Agent: david-santos
Paperclip-Issue: BIT-863
Paperclip-Run: b924d445-99ed-429c-b1a2-950c0978781a
2026-04-05 01:58:57 +00:00
Peter Spark 2f81db5573 docs(wdmi): document BIT-882 ERRSIG 0981a9d165e5 in feed upload runbook
Add §5.3 for the classic feed upload fingerprint seen on wdmi-store recurrence
loops; clarify parity with BIT-875 triage and er-cli queries.

Paperclip-Agent: 0b1fcf92-5fe3-4ac0-9f29-df4ab72f5376
Paperclip-Issue: BIT-882
Paperclip-Run: a95c759f-916c-4ba8-9327-e61c552394c2
Made-with: Cursor
2026-04-05 01:57:46 +00:00
Peter Spark 674d11c5c4 docs: extend Google reporter runbook for DNS / CURLE 6 (BIT-880)
- Document CURLE_COULDNT_RESOLVE_HOST (oauth2.googleapis.com) vs TLS 35
- Add DNS reproduction commands and checklist ordering (classify errno first)
- Add ERRSIG:c67961dfa92a and stack via _maintenance_sync_product_supplier_fees.php
- Update RUNBOOK_TRIAGE cross-reference for cURL 6

Paperclip-Issue: BIT-880
Paperclip-Run-Id: a53625bf-b8e7-49f2-bb9a-0b121d5aca61
Made-with: Cursor
2026-04-05 01:54:13 +00:00
Peter Spark 016511b15f docs: extend CRM Logger mkdir runbook for BIT-879 / ERRSIG aa30e641f164
Document recurrence alongside BIT-878: same stack and root cause (CRM host
permissions / log path), distinct hub fingerprint. Add er-cli query for the
new signature and a small table in §5.1.

Paperclip-Agent: 0b1fcf92-5fe3-4ac0-9f29-df4ab72f5376
Paperclip-Issue: BIT-879
Paperclip-Task: 2134c338-de72-41d1-8aad-9e287910b69c
Paperclip-Run: 18910b59-5b0b-4cc0-8e1e-d80c27a6f798
Made-with: Cursor
2026-04-05 01:52:46 +00:00
Peter Spark a467b28e38 docs: runbook for CRM Logger mkdir permission denied (BIT-878)
Add RUNBOOK_REPORTER_CRM_LOGGER_MKDIR.md for ERRSIG:76ad405bed13:
triage on host (Logger path, PHP user, permissions), infra and code
mitigations, and er-cli queries. Link from RUNBOOK_TRIAGE.

Paperclip-Agent: 0b1fcf92-5fe3-4ac0-9f29-df4ab72f5376
Paperclip-Issue: BIT-878
Paperclip-Run: f47e59b9-c7a3-49e6-96b0-b2ad7bac70fd
Made-with: Cursor
2026-04-05 01:51:40 +00:00
Peter Spark 0adaea93cd docs: triage runbook for wdmi feed tier upload (BIT-876)
Document upload_feed_tier / Feed tier upload failed alongside legacy _upload_feed_via_api.
Clarify that incident "ingest host" metadata is the error hub, not the feed upload URL.
Add §1.1 when the configured target is errors.bitreport.pt (JSON ingest only).
Cross-link from RUNBOOK_TRIAGE.

Paperclip-Agent: 0b1fcf92-5fe3-4ac0-9f29-df4ab72f5376
Paperclip-Issue: BIT-876
Paperclip-Run: ada7140f-8269-4098-98b1-1e642014766b
Made-with: Cursor
2026-04-05 01:50:14 +00:00
Peter Spark 80366ae870 docs: runbook for wdmi-store feed upload API failures (BIT-875)
Add RUNBOOK_REPORTER_WDMI_FEED_UPLOAD.md for ERRSIG:51107371e21a and
_upload_feed_via_api / clients.wdmi.pt triage. Cross-link from triage
and Flexit runbooks.

Paperclip-Task: 3eeb15eb-2f4c-40f9-b5b6-f3c13eef1393
Paperclip-Run: 169957f9-f53f-4420-8f8e-e7408319e358
Made-with: Cursor
2026-04-05 01:48:40 +00:00
Peter Spark f828f08235 ingest: filter Alpine _x_refreshXForScope teardown as noise (BIT-874)
Treat ERRSIG:3057b44e2230 (crm-wdmi / wdmi-store JS capture) as transient
frontend noise: Alpine v3 internal during scope teardown. Bump noise ruleset
to 1.0.1; critical level still bypasses noise rules.

Paperclip-Task-Id: 5f3e304a-63e9-4088-9625-0972a811456d
Made-with: Cursor
2026-04-05 01:47:26 +00:00
Peter Spark 550a5cdd3f docs: runbook for CRM View @errormonitoring/dashboard (BIT-873)
Add RUNBOOK_REPORTER_CRM_ERRORMONITORING_VIEW.md for ERRSIG:f51049a03fba
(View.php missing module view on crm.pmx.bet). Cross-link from RUNBOOK_TRIAGE
and RUNBOOK_OPERATIONS.

Paperclip-Issue: BIT-873
Paperclip-Run: 4e3500e4-fdbf-4386-b3f1-bd001356b769
Paperclip-Agent: david-santos
Made-with: Cursor
2026-04-05 01:46:05 +00:00
Peter Spark 4f4a66b925 docs: document BIT-903 Flexit ERRSIG 5278058355a5 in wdmi runbook
- Add hub query example and §5.2 case (malformed/truncated XML pattern)
- Cross-link Paperclip [BIT-903](/BIT/issues/BIT-903)

Paperclip-Agent: jos-alves
Paperclip-Issue: BIT-903
Paperclip-Run: e12cefbe-7e98-4c17-b9f9-30328af3fbcf
Made-with: Cursor
2026-04-05 01:45:33 +00:00
Peter Spark bafe573cbc docs: runbook for wdmi-store Flexit simplexml_load_file (BIT-877)
Add RUNBOOK_REPORTER_WDMI_FLEXIT_XML.md with triage for ERRSIG:6f82e20ec332
(_flexit.php / __maintenance_build.php). Link from RUNBOOK_TRIAGE.

Paperclip-Issue: BIT-877
Paperclip-Run: 2cc00999-26eb-466e-8a13-0bb214a07349
Paperclip-Agent: jos-alves
Made-with: Cursor
2026-04-05 01:43:25 +00:00
Peter Spark 249b839de8 docs: extend Google TLS runbook for Sheets API (BIT-867)
Document ERRSIG:d7787d22e1a5 and sheets.googleapis.com:443 failures
distinct from oauth2 token path; add curl/openssl checks, er-cli
queries, and wdmi-store maintenance sync playbook.

Verification: npm test -- --run in ingest-api (26 passed, 6 skipped).

Paperclip-Board-Issue: BIT-867
Paperclip-Run-Id: b1095be5-1d7f-4502-a0c4-44e298924ced
Made-with: Cursor
2026-04-05 01:42:34 +00:00
Peter Spark 4a3ecc1088 docs: add runbook for Google OAuth TLS failures on PHP reporters
New RUNBOOK_REPORTER_GOOGLE_TLS.md documents triage for cURL error 35 /
SSL_connect reset to oauth2.googleapis.com from Guzzle/Google client stacks
(e.g. wdmi-store Importer). Cross-linked from RUNBOOK_TRIAGE and
RUNBOOK_OPERATIONS.

Paperclip-Agent: 0b1fcf92-5fe3-4ac0-9f29-df4ab72f5376
Paperclip-Issue: BIT-866
Paperclip-Run: acd11e33-7d18-468f-a2c1-2e15647f2fd4
Made-with: Cursor
2026-04-05 01:40:51 +00:00
David Santos bd6e3805ec fix(ingest): non-empty stack_trace for hub occurrences (BIT-796)
Accept stack_trace as an alias for stacktrace. When both are absent, store a
synthesized stack line derived from context so recent-errors always exposes
dedupe-friendly text. Fingerprints still ignore synthesized stacks so grouping
matches legacy omit-stack payloads.

PHP ingest client: fatal shutdown handler now sends a minimal stack line.

Paperclip-Agent: David Santos (id 0b1fcf92-5fe3-4ac0-9f29-df4ab72f5376)
Paperclip-Issue: BIT-796
Paperclip-Run: 7f4a8c69-7b5b-47f2-9fc9-c99e6d57f2d2
Made-with: Cursor
2026-04-04 18:26:15 +00:00
David Santos b41f17886a chore(deploy): include Apr 2026 ingest migrations in LXC run-migrate
Add occurred_at stats and ingest key rate limit SQL to deploy/lxc/run-migrate.sh
so fresh and repeat LXC installs match docker-migrate ordering (BIT-771).

Paperclip-Agent: Tiago Neves (urlKey tiago-neves; id 5d084b36-f38f-42a5-a92a-520005afda4f)
Paperclip-Issue: BIT-771
Paperclip-Run: 9d930ca7-5aba-4b1b-906c-80677815557c
Made-with: Cursor
2026-04-04 01:03:10 +00:00
Peter Spark 0d2bd5eb95 feat: add Node.js and PHP error reporter client libraries (BIT-750)
Lightweight drop-in clients for sending errors to the ingest API:
- clients/node/errorReporter.mjs (ESM) and .cjs (CommonJS)
- clients/php/ErrorReporter.php (PHP 8+)

Both use Bearer auth against /v1/ingest/events, fire-and-forget,
zero external dependencies.

Paperclip-Agent: peter-spark
Paperclip-Issue: BIT-750
Paperclip-Run: c2c29aef-e79f-4e69-98ed-3353d04b7a6d
2026-04-04 00:18:52 +00:00
Peter Spark 3b175eec86 fix(admin-ui): proxy ingest API through Next.js rewrites (BIT-750)
The single-domain deployment (errors.bitreport.pt) routed all traffic
through the admin-ui, whose auth middleware redirected /v1/ingest/events
and /health to /login — making the ingest API unreachable from outside.

- middleware.ts: pass through /v1/* and /health without auth redirect
- next.config.ts: rewrite /v1/* and /health to ingest-api backend
  (INGEST_API_URL env, default http://127.0.0.1:3041)
- docker-compose.yml: set INGEST_API_URL=http://ingest-api:3041
- env examples: document INGEST_API_URL
- scripts/onboard-project.sh: generate project + ingest key SQL

Paperclip-Agent: peter-spark
Paperclip-Issue: BIT-750
Paperclip-Run: dc5b7949-b24d-4867-a2cd-cf4f47477ef8
2026-04-03 10:01:55 +00:00
Peter Spark c8adcac393 merge: BIT-736 operational tooling — HTTP contracts, runbooks, Prometheus docs
Paperclip-Issue: BIT-736
2026-04-02 21:41:44 +00:00
Peter Spark 8767e40bb6 docs(ops): hub parity tooling — HTTP contracts, runbooks, Prometheus
Add canonical HTTP_CONTRACTS with curl for hub + ingest endpoints, operator
runbooks for ingest debugging and five common hub flows, and Grafana/Prometheus
scraping notes. Extend ERROR_MONITORING_PUBLIC_API with stats + curl examples;
align purge and resolve-by-pattern docs with the Fastify implementation.
Add optional smoke scripts under scripts/examples/.

Paperclip-Agent: 5d084b36-f38f-42a5-a92a-520005afda4f
Paperclip-Issue: BIT-736
Paperclip-Run: ad2c5129-df54-44aa-afd4-6f9f7486c1a1
Made-with: Cursor
2026-04-02 20:36:57 +00:00
spark ae9fb2a20b Merge pull request 'feat(ingest-api): ingestion hardening — fingerprints, per-key rate limits (BIT-735)' (#2) from task/BIT-735-ingest-hardening into master
Reviewed-on: #2
2026-04-02 20:47:57 +01:00
Peter Spark f5f62571fd feat(ingest-api): ingestion hardening — fingerprints, per-key rate limits (BIT-735)
- Migration: er_ingest_keys.rate_limit_max and rate_limit_window_ms (nullable overrides).
- Fingerprint policy v2: server-side digest includes normalized stacktrace (UUID/hex/line noise).
- In-memory fixed-window limits: per API key after auth; per-IP for unauthenticated POSTs
  (INGEST_ANON_IP_*). Removed @fastify/rate-limit dependency.
- OpenAPI documents 429; runbook at docs/operations/ingest-hardening-runbook.md.

Paperclip-Agent: 0b1fcf92-5fe3-4ac0-9f29-df4ab72f5376
Paperclip-Issue: BIT-735
Paperclip-Run: 0a91be22-6f8f-4c60-b889-44b99048d3a2
Made-with: Cursor
2026-04-02 19:45:27 +00:00
Peter Spark acac2ba034 merge: BIT-734 operational observability (stats, Prometheus, SLO, Grafana)
Paperclip-Issue: BIT-734
2026-04-02 19:41:23 +00:00
Peter Spark c6e4305c79 feat(observability): stats endpoint, Prometheus metrics, SLO tracking, Grafana dashboard (BIT-734)
- GET /api/error-monitoring/stats: 24h ingestion volume, severity
  distribution, per-project metrics with resolution rates, hourly trend
- Prometheus /metrics on both api (port 3200) and ingest-api (port 3041)
  with HTTP request duration histograms, ingest SLO latency (p50/p95/p99),
  event throughput counters, domain gauges
- Grafana dashboard JSON (deploy/grafana/) with SLO panels, error volume,
  severity/state distribution, per-project charts, Node.js process metrics
- SLO runbook (docs/RUNBOOK_SLO.md): alert rules, scrape config,
  triage procedures for latency, error rate, and availability breaches

Paperclip-Agent: Peter Spark (urlKey peter-spark; id 49ce66f8-6be6-4644-afd3-eb6d8d0d4b3e)
Paperclip-Issue: BIT-734
Paperclip-Run: f45bcdc4-4757-4829-8e75-b60a8f9a7be4
2026-04-02 18:26:24 +00:00
spark a0f305300a Merge pull request 'feat(api): resolve-by-pattern endpoint, purge threshold, contract tests (BIT-732)' (#1) from task/BIT-732-mutation-api-parity into master
Reviewed-on: #1
2026-04-02 19:22:06 +01:00
Peter Spark dee670ef9f feat(api): resolve-by-pattern endpoint, purge threshold, contract tests (BIT-732)
Add POST /api/error-monitoring/resolve-by-pattern with advanced filters:
severity, project_slug, fingerprint, message_pattern, time range.

Enhance purge-resolved with optional older_than_days threshold so only
stale resolved incidents are deleted.

27 contract tests (vitest) cover all four mutation endpoints: auth gating,
validation, response shapes, and CRM-compatible behaviour.

Paperclip-Agent: peter-spark
Paperclip-Issue: BIT-732
Paperclip-Run: 749dfb41-182b-48c8-b6e7-74f14bdb9d41
2026-04-02 18:16:01 +00:00
David Santos 5c97326d11 feat(ops): tooling CLI + runbook canónico de triagem
- scripts/er-cli.sh: CLI operacional sem UI com comandos list-open,
  export, resolve, resolve-by-pattern e purge; idempotente, dry-run
  em resolve-by-pattern e purge, autenticação via ERROR_RESOLVE_API_KEY
- docs/RUNBOOK_TRIAGE.md: runbook completo de triagem, resolução, deploy
  e fecho com checklist de validação pós-deploy e tabela de escalada

Paperclip-Issue: BIT-730
Paperclip-Run: f06292f3-5ab7-4715-9b61-6dee07a47ad7
2026-04-02 18:03:23 +00:00
David Santos de68f68103 feat(admin): operational stats — hourly trends, recurrence, dashboard
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
2026-04-02 11:00:51 +00:00
David Santos c4e0b03ed8 ingest-api: versioned noise rules and CRM-style fingerprint normalization
- Add NOISE_RULESET_VERSION 1.0.0 with CRM/WDMI parity (external resource,
  ResizeObserver, WDMI media prefix, stale-bundle and transient JS strings).
- Skip ingest for matched noise; never suppress when level maps to critical.
- FINGERPRINT_POLICY_VERSION 1: NFKC/whitespace-normalized first line plus
  project_slug|message|file|line basis (SHA-256) when client omits fingerprint.
- Response includes noise_filtered_count and policy version fields; OpenAPI
  documents stored vs skipped result shapes.

Paperclip-Issue: BIT-727
Paperclip-Run-Id: ae412312-f71a-4efd-93e0-ca7289c93362
Made-with: Cursor
2026-04-02 10:55:11 +00:00
David Santos 7b2be679cd feat(api): harden error-monitoring mutations (audit, rate limit, 403)
Document the public CRM-shaped API matrix, emit audit rows for resolve,
bulk-resolve, and purge (including dry run), apply a dedicated per-IP
rate limit on mutation routes, and return 403 when a valid session lacks
RBAC for the action. Add Vitest coverage for authorizeMutation.

Paperclip-Agent: Tiago Neves (urlKey tiago-neves; id 5d084b36-f38f-42a5-a92a-520005afda4f)
Paperclip-Issue: BIT-731
Paperclip-Run: 7d0edfac-5676-41fa-85c2-86d01a808894
Made-with: Cursor
2026-04-02 10:52:40 +00:00
David Santos 8b0044be82 feat(api): CRM parity mutations and recent-errors filters (BIT-726)
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
2026-04-02 10:50:06 +00:00
David Santos e0af92eda1 fix(admin-ui): allow public recent-errors API path without login redirect
Keep /api/error-monitoring/recent-errors reachable for Paperclip error loop (including path variants) so central hub returns JSON instead of 307 /login.
2026-04-02 08:50:21 +00:00