Commit Graph
21 Commits
Author SHA1 Message Date
nelson-baptista b8ca70709e fix(ingest): filter BIT-<id> smoke-test probes in noise policy (BIT-32681)
CI / Test ingest-api (pull_request) Successful in 24s
CI / Test api (pull_request) Successful in 26s
CI / Lint and typecheck admin-ui (pull_request) Successful in 1m58s
CI / Validate Docker build (pull_request) Successful in 3m33s
Hand-sent pipe-liveness probes referenced by a BIT task id (e.g.
`BIT-32663 smoke test` or `[BIT-30527] ... smoke test`) were not matched
by the ingest noise policy: they lack the reserved `BIT-SMOKE-` token and
the bracket-only fleet-audit regex, so they passed ingest and opened a
false-positive Error Loop issue (BIT-32681 / ERRCLUSTER a513bc4e4505).

- noisePolicy.ts: add `_BIT_ID_SMOKE_PROBE_RE` matching bare and bracketed
  `BIT-<id> ... smoke test` forms; filtered at every severity under the
  existing `bitreport_smoke_marker` rule. Bump ruleset 1.0.7 -> 1.0.8.
- noisePolicy.test.ts: cover bare, bracketed, critical-level, and a
  negative case (`Smoke detector sensor offline` stays unfiltered).
- paperclip_fleet_error_reporting_audit_once.py: relax `_SYNTHETIC_EVENT_RE`
  to the same bare/bracketed shape so ingest and fleet audit agree.
- docs/operations/ingest-hardening-runbook.md: document the new probe shape.

Verified locally: ingest-api vitest 44 passed | 14 skipped; typecheck clean;
reporter context contract ok; fleet audit py_compile ok.

Paperclip-Agent: José Alves (urlKey jos-alves; id 11179220-3cec-4f0f-880d-2771ff64fce8)
Paperclip-Issue: BIT-32681
Paperclip-Run: 64667793-6ac7-404b-80bc-f369f0c4f9e0
2026-11-20 09:42:08 +00:00
nelson-baptista 836d967aeb chore(runtime): BIT-31723 upgrade Node 20 → Node 24 LTS + audit PHP/TS code
CI / Test ingest-api (pull_request) Successful in 33s
CI / Test api (pull_request) Successful in 34s
CI / Lint and typecheck admin-ui (pull_request) Successful in 1m19s
CI / Validate Docker build (pull_request) Successful in 3m54s
- Dockerfiles (admin-ui, collector-worker, ingest-api): node:20-bookworm-slim → node:24-bookworm-slim
- CI (.gitea/workflows/ci.yml): node-version '20' → '24' in all 3 jobs
- package.json engines.node: '>=20' → '>=24.22.1' (admin-ui, api, collector-worker, ingest-api, web)
- @types/node: ^20/^22 → ^24 in all packages
- api: bcrypt ^5.1.1 → ^6.0.0 (Node 24 prebuilt binary compat)
- clients/php/ErrorReporter.php: PHP 8.4+ compat audit (no deprecated patterns)
- clients/node/errorReporter.mjs: Node 24+ doc update

All tests verified locally:
- api: 51/51 passed (vitest)
- ingest-api: 40 passed + 14 skipped (vitest)
- collector-worker: 12/12 passed (vitest)
- admin-ui: lint + typecheck clean
- web: lint + typecheck + build clean

Paperclip-Agent: Nelson Baptista (urlKey nelson-baptista; id e34f1b0f-62db-487c-8584-f6a47203f7b5)
Paperclip-Issue: BIT-31723
Paperclip-Run: 76d06689-1879-421f-ad2c-04f5fe85d21d
2026-10-23 17:30:13 +01:00
David Santos 308ff624cf fix(noise): remove stale_bundle_* rules — functions no longer exist (BIT-26793)
CI / Test ingest-api (push) Successful in 54s
CI / Test api (push) Successful in 58s
CI / Lint and typecheck admin-ui (push) Successful in 1m29s
CI / Validate Docker build (push) Successful in 5m0s
switchSelectionEditorTab and descriptionEditorReady are absent from the
current codebase; continuing to suppress ReferenceErrors for these names
would silently hide real errors if the names were ever reused. Ruleset
bumped to 1.0.7.
2026-07-17 23:02:36 +00:00
David Santos 23704d2e59 feat(ingest): label er_ingest_events_total skipped_noise by rule_id
CI / Test api (push) Successful in 54s
CI / Test ingest-api (push) Successful in 57s
CI / Lint and typecheck admin-ui (push) Successful in 1m48s
CI / Validate Docker build (push) Successful in 5m19s
Break down noise filter counters per noise policy rule for Prometheus observability.

Paperclip-Agent: David Santos (urlKey david-santos; id 0b1fcf92-5fe3-4ac0-9f29-df4ab72f5376)
Paperclip-Issue: BIT-26791
Paperclip-Run: cea24469-2886-457d-9f6f-09d83aaf9e4a
2026-07-17 23:01:35 +00:00
David SantosandCursor 8773f12b25 feat(hub): retire WDMI projects from error reporting (BIT-24704)
CI / Validate Docker build (pull_request) Failing after 12m46s
CI / Lint and typecheck admin-ui (pull_request) Failing after 13m16s
CI / Test api (pull_request) Failing after 13m20s
CI / Test ingest-api (pull_request) Successful in 15m35s
Block ingest for retired WDMI slugs, purge project data via migration,
remove WDMI runbooks, and add offboard-project helper for future retirements.

Co-authored-by: Cursor <[email protected]>
2026-06-08 14:26:06 +00:00
David Santos b7cbf528ee ingest-api: export error_hub_* Prometheus metrics for hub freshness alerts
CI / Test ingest-api (pull_request) Successful in 38s
CI / Test api (pull_request) Successful in 43s
CI / Lint and typecheck admin-ui (pull_request) Successful in 1m30s
CI / Validate Docker build (pull_request) Successful in 5m45s
Join er_projects in ingest auth to expose lowercase project slug. Record
error_hub_last_event_timestamp from stored events occurred_at and
error_hub_ingest_failures_total on HTTP 500 batches (BIT-4903 / BIT-4932).

Add integration assertion when ERROR_REPORTING_TEST_DATABASE_URL is set.

Paperclip-Agent: Tiago Neves (urlKey tiago-neves; id 5d084b36-f38f-42a5-a92a-520005afda4f)
Paperclip-Issue: BIT-4932
Paperclip-Run: 00b93610-8794-4264-81a9-6f4cb39a9d8d
Made-with: Cursor
2026-04-21 05:08:42 +00:00
David Santos 6c22dc8bb9 ingest-api: serialize idempotent ingest to fix SQLSTATE 23000 races
CI / Test ingest-api (push) Has been cancelled
CI / Test api (push) Has been cancelled
CI / Lint and typecheck admin-ui (push) Has been cancelled
CI / Validate Docker build (push) Has been cancelled
Concurrent POSTs with the same Idempotency-Key could pass the initial
SELECT and collide on INSERT into er_ingest_idempotency (unique on
ingest_key_id + idempotency_key), surfacing ER_DUP_ENTRY and risking
duplicate occurrences. Acquire a per-key MySQL named lock before the
idempotency read; on duplicate insert, roll back and replay the stored
response. Document 503 idempotency_busy when GET_LOCK times out.

Adds an integration test for parallel identical idempotent requests (BIT-2530).

Made-with: Cursor
2026-04-12 10:34:15 +00:00
Peter Spark a51b3e987a feat(clients): optional project_slug and gitea_repo on ingest context
PHP + Node reporters read ERROR_REPORTING_* env; ingest-api tests run contract on clients/.

Paperclip-Agent: 11179220-3cec-4f0f-880d-2771ff64fce8
Paperclip-Issue: BIT-1310
Paperclip-Run: 35ce1c21-9862-4c60-8b58-441d53b4b3bd
2026-04-07 02:12:55 +00:00
Peter Spark 70d52e1efc fix(ingest): normalize unicode hyphens for BIT-SMOKE noise (ruleset 1.0.5)
CRM /smoke/crm.php BIT-SMOKE-CRM-DIRECT-FWD and similar probes can carry
unicode hyphen/minus characters; normalize before substring scan so
bitreport_smoke_marker still matches (BIT-933).

Paperclip-Issue: BIT-933
Paperclip-Run: 699684ed-75aa-4850-81a0-84bd717627e7
2026-04-05 12:25:47 +00:00
Peter Spark 682f9cf5c8 ingest: filter deploy ingest live-check failure ribbon (noise 1.0.4)
The wdmi-store/CRM post-deploy probe reports failures with the exact message
BIT-SMOKE error hub ingest live check, which did not match BIT-SMOKE- and
opened hub incidents (BIT-931 / ERRCLUSTER churn). Treat it like other smoke
traffic: skip at every level with bitreport_smoke_marker.

Document in RUNBOOK_INGEST_DEBUG and ingest-hardening-runbook; add unit and
integration coverage.

Made-with: Cursor
2026-04-05 12:21:33 +00:00
Peter Spark b082bc716a ingest: filter BIT-SMOKE- when marker appears in stack_trace only
CRM PHP smoke (BIT-SMOKE-CRM-MAIN-DIRECT) can send the reserved token in
stack_trace while message stays generic, so the prior message-only noise
check missed it. Pass client stack text into evaluateNoise and bump
noise_ruleset_version to 1.0.3.

Paperclip-Agent: 0b1fcf92-5fe3-4ac0-9f29-df4ab72f5376
Paperclip-Issue: BIT-957
Paperclip-Run: d61f6d49-e43c-4ff6-a694-cbc8edff0d33
Made-with: Cursor
2026-04-05 07:22:23 +00:00
Peter Spark 82f549adbc ingest: filter BIT-SMOKE- intentional probe events
Reserved BIT-SMOKE- messages (e.g. wdmi-store /smoke/wdmi.js direct-ingest
checks) are skipped at every ingest level so they do not open incidents or
trigger BIT-309 loops. Bump noise ruleset to 1.0.2; extend unit and integration
tests and ingest hardening runbook.

Paperclip-Issue: BIT-942
Made-with: Cursor
2026-04-05 05:23:32 +00:00
Peter Spark 1c65ed3158 ingest-api: allow unknown top-level keys on ingest batch (BIT-933)
The Fastify JSON Schema for POST /v1/ingest/events used
additionalProperties:false on the root object. CRM direct-forward
smokes that attach batch metadata beside events were rejected with
HTTP 400 before the handler.

- ingestJsonSchemas.ts: shared event and batch schemas
- ingestJsonSchemas.test.ts: Ajv regression without MySQL
- integration.twoProjects.test.ts: end-to-end case when DB URL set
- docs/RUNBOOK_INGEST_DEBUG.md: document batch-level forwards

Paperclip-Agent: 0b1fcf92-5fe3-4ac0-9f29-df4ab72f5376
Paperclip-Issue: BIT-933
Paperclip-Run: f027c017-4cbf-4819-84bb-85922e5c0407
Made-with: Cursor
2026-04-05 04:35:50 +00:00
Peter Spark d47a061399 ingest-api: allow unknown event JSON fields for forward-compatible clients
- Relax Fastify/AJV schema on ingest events (additionalProperties: true)
  so CRM/deploy smokes sending extra keys no longer fail validation with 400.
- Add integration test when ERROR_REPORTING_TEST_DATABASE_URL is set.
- Document BIT-SMOKE / BIT-931 triage in RUNBOOK_INGEST_DEBUG; note in
  ingest-hardening-runbook.

Paperclip-Agent: 0b1fcf92-5fe3-4ac0-9f29-df4ab72f5376
Paperclip-Issue: 35542fda-44d4-4154-b95d-1a7de3566204
Paperclip-Run: 3682ff13-02fc-4749-a460-6414830dccc7
Made-with: Cursor
2026-04-05 04:33:08 +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
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
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 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
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
1sonhadorandPaperclip 4604606033 feat(errors): migrate error-reporting stack from PostgreSQL to MariaDB (BIT-255)
Replace Postgres with MariaDB 11 in docker-compose; convert all
database/error_reporting and db/migrations SQL to InnoDB-friendly syntax
(DATETIME(6), AUTO_INCREMENT, ON DUPLICATE KEY). Run admin portal DDL in the
same migrate one-shot as error_reporting.

Switch ingest-api, collector-worker, and api from pg to mysql2 (pools,
parameterized queries, transactions). Align ingest writes with
er_incident_occurrences and include project_id on idempotency inserts.

Add scripts/run-mysql-migrations.sh for host-side applies; update LXC
run-migrate/verify, deployment docs, and .env.example (mysql://, ER_MYSQL_*).

Verified: npm run build + npm test in ingest-api and collector-worker;
npm run build in api. Full docker compose not run here (no local daemon).

Co-Authored-By: Paperclip <[email protected]>
2026-03-22 19:29:11 +00:00
1sonhadorandPaperclip b0b733d5e1 feat(BIT-247): consolidate error reporting repo from OTT
Merge ingest-api, collector-worker, admin-ui, database/error_reporting, deploy/lxc,
docker-compose, and deployment docs into the dedicated repository. Paths updated
for repo root (ER_REPO_ROOT, systemd WorkingDirectory). Root README documents layout.

Co-Authored-By: Paperclip <[email protected]>
2026-03-22 18:20:27 +00:00