Merge pull request 'fix(ingest): filter BIT-<id> smoke-test probes in noise policy (BIT-32681)' (#19) from fix/BIT-32681-smoke-probe-noise-filter into master
CI / Test ingest-api (push) Successful in 23s
CI / Test api (push) Successful in 24s
CI / Lint and typecheck admin-ui (push) Successful in 52s
CI / Validate Docker build (push) Successful in 3m23s

This commit was merged in pull request #19.
This commit is contained in:
spark committed 2026-11-20 10:03:24 +00:00
commit baac48a632
4 files changed
+71 -3

No files matched your search

+1 -1
View File
@@ -32,7 +32,7 @@ Per-key overrides: set `rate_limit_max` and/or `rate_limit_window_ms` on the key
- Rules live in `ingest-api/src/lib/noisePolicy.ts`; ruleset id: `noise_ruleset_version` in the ingest response.
- **Check:** send a known-noise payload (for example ResizeObserver message at non-fatal level); expect `skipped: true`, `noise_filtered_count` incremented, and no new `er_incidents` row.
- **Check:** send the same pattern at `fatal` / `critical` level; expect **not** skipped (noise rules do not hide critical), **except** when the **message** or **client-provided stacktrace** contains reserved substring `BIT-SMOKE-` (intentional reporter smoke, e.g. wdmi-store `/smoke/wdmi.js`, CRM `/smoke/crm-main.php`, CRM `/smoke/crm.php` direct-forward `BIT-SMOKE-CRM-DIRECT-FWD`) — those are skipped at every level (`rule_id`: `bitreport_smoke_marker`). Matching treats unicode hyphen/minus characters as ASCII `-` (ruleset **1.0.5+**). The exact deploy-probe failure ribbon `BIT-SMOKE error hub ingest live check` (space after `BIT-SMOKE`, see [RUNBOOK_INGEST_DEBUG.md](../RUNBOOK_INGEST_DEBUG.md) §0) is also skipped at every level with the same `rule_id`.
- **Check:** send the same pattern at `fatal` / `critical` level; expect **not** skipped (noise rules do not hide critical), **except** when the **message** or **client-provided stacktrace** contains reserved substring `BIT-SMOKE-` (intentional reporter smoke, e.g. wdmi-store `/smoke/wdmi.js`, CRM `/smoke/crm-main.php`, CRM `/smoke/crm.php` direct-forward `BIT-SMOKE-CRM-DIRECT-FWD`) — those are skipped at every level (`rule_id`: `bitreport_smoke_marker`). Matching treats unicode hyphen/minus characters as ASCII `-` (ruleset **1.0.5+**). The exact deploy-probe failure ribbon `BIT-SMOKE error hub ingest live check` (space after `BIT-SMOKE`, see [RUNBOOK_INGEST_DEBUG.md](../RUNBOOK_INGEST_DEBUG.md) §0) is also skipped at every level with the same `rule_id`. Hand-sent pipe-liveness probes referenced by a BIT task id — `BIT-<id> smoke test` (bare) or `[BIT-<id>] ... smoke test` (bracketed) — are likewise skipped at every level (ruleset **1.0.8+**, BIT-32681), aligning ingest with the fleet audit synthetic-event exclusion.
## Rate limits
+48
View File
@@ -143,6 +143,54 @@ describe("evaluateNoise", () => {
});
});
it("matches bare 'BIT-<id> smoke test' pipe-liveness probe (BIT-32681)", () => {
const _r = evaluateNoise({
level: "error",
message: "BIT-32663 smoke test",
filePathHint: "",
});
expect(_r).toEqual({
matched: true,
ruleId: "bitreport_smoke_marker",
reason: "filtered_intentional_smoke_event",
});
});
it("matches bracketed '[BIT-<id>] ... smoke test' probe (fleet-audit synthetic form)", () => {
const _r = evaluateNoise({
level: "error",
message: "[BIT-30527] paperclip-chat pipe-liveness smoke test",
filePathHint: "",
});
expect(_r).toEqual({
matched: true,
ruleId: "bitreport_smoke_marker",
reason: "filtered_intentional_smoke_event",
});
});
it("suppresses 'BIT-<id> smoke test' probe even at critical level", () => {
const _r = evaluateNoise({
level: "critical",
message: "BIT-32663 smoke test",
filePathHint: "",
});
expect(_r).toEqual({
matched: true,
ruleId: "bitreport_smoke_marker",
reason: "filtered_intentional_smoke_event",
});
});
it("does not match a real error that merely contains 'smoke' without the BIT-<id> probe shape", () => {
const _r = evaluateNoise({
level: "error",
message: "Smoke detector sensor offline",
filePathHint: "",
});
expect(_r).toEqual({ matched: false });
});
it("matches CRM deploy ingest live-check failure ribbon (BIT-931 family)", () => {
const _r = evaluateNoise({
level: "critical",
+17 -1
View File
@@ -4,7 +4,7 @@ import { normalizeLevelToSeverity } from "./normalize.js";
* Versioned ruleset id (document in release notes when rules change).
* Rule inventory and validation steps: `docs/operations/ingest-hardening-runbook.md`.
*/
export const NOISE_RULESET_VERSION = "1.0.7";
export const NOISE_RULESET_VERSION = "1.0.8";
export type NoiseEvaluation =
| { matched: false }
@@ -12,6 +12,15 @@ export type NoiseEvaluation =
const _DEPLOY_INGEST_PROBE_MESSAGE = "BIT-SMOKE error hub ingest live check";
/**
* Hand-sent pipe-liveness probes referenced by a BIT task id (e.g. `BIT-32663 smoke test`
* or `[BIT-30527] paperclip-chat pipe-liveness smoke test`). The fleet audit already
* treats the bracketed form as synthetic (`_SYNTHETIC_EVENT_RE`); ingest must agree so
* these probes do not open Error Loop issues. Matched at every severity, like `BIT-SMOKE-`.
* BIT-32681 / ERRCLUSTER a513bc4e4505.
*/
const _BIT_ID_SMOKE_PROBE_RE = /\[?BIT-\d+\]?\s+.*smoke test/i;
/**
* CRM / editor copy-paste sometimes inserts unicode hyphens (U+2011 etc.) in the reserved
* `BIT-SMOKE-` token; strip ZW* / BOM so probes still match `bitreport_smoke_marker` (BIT-933).
@@ -155,6 +164,13 @@ export function evaluateNoise(input: {
reason: "filtered_intentional_smoke_event",
};
}
if (_BIT_ID_SMOKE_PROBE_RE.test(_msg) || _BIT_ID_SMOKE_PROBE_RE.test(_stack)) {
return {
matched: true,
ruleId: "bitreport_smoke_marker",
reason: "filtered_intentional_smoke_event",
};
}
const _sev = normalizeLevelToSeverity(input.level);
if (_sev === "critical") {
return { matched: false };
@@ -43,7 +43,11 @@ from urllib.error import HTTPError, URLError
# hand while investigating a "stale" finding, per BIT-30273/BIT-30527). These are real
# hub rows but not production traffic — counting them as "fresh" masks genuine staleness
# for as long as they remain the newest row for a slug. Excluded from freshness scoring.
_SYNTHETIC_EVENT_RE = re.compile(r"^\[BIT-\d+\]\s+\S+.*smoke test", re.IGNORECASE)
# Accepts both the bracketed form (`[BIT-30527] ... smoke test`) and the bare form
# (`BIT-32663 smoke test`), matching the ingest noise policy `_BIT_ID_SMOKE_PROBE_RE`
# (BIT-32681). Anchored to start so a real error mentioning the phrase mid-sentence is not
# misclassified.
_SYNTHETIC_EVENT_RE = re.compile(r"^\[?BIT-\d+\]?\s+.*smoke test", re.IGNORECASE)
# ---------------------------------------------------------------------------
# Env helpers