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
This commit is contained in:
Peter Spark committed 2026-04-05 12:21:33 +00:00
1 parent fe0c5fb122
commit 682f9cf5c8
5 files changed
+63 -3

No files matched your search

+1 -1
View File
@@ -18,7 +18,7 @@
3. **Credentials:** `Authorization: Bearer <token>` or `X-Api-Key`; key must be **active** and **unexpired** in `er_ingest_keys` (§2).
4. **HTTP codes:** `401` / `429` / `5xx` / timeouts — use sections below; CRM cURL timeouts are short (e.g. 4s) — slow proxies can fail smokes before the hub responds.
5. **HTTP 400 from schema validation** should be rare; the hub ignores unknown **event-level** JSON keys and unknown **top-level** keys on the batch object (only `events` is required). Required per event: `schema_version`, `occurred_at`, `level`, `message`.
6. **Intentional throw smokes (`BIT-SMOKE-*`)** — some reporters POST a deliberate error (e.g. `BIT-SMOKE-WDMI-DIRECT-INGEST`) to prove the pipe works. The ingest API **noise-filters** these when `BIT-SMOKE-` appears in the event `message` or client `stacktrace` (`noise_ruleset_version` from `noisePolicy.ts`; see [ingest-hardening-runbook](operations/ingest-hardening-runbook.md)). Expect `skipped: true` / `rule_id: bitreport_smoke_marker` and **no** new incident. If [BIT-309](/BIT/issues/BIT-309) reopens a closed smoke ticket after the hub change merged, treat as **production ingest not yet running that build** ([BIT-942](/BIT/issues/BIT-942)).
6. **Intentional throw smokes (`BIT-SMOKE-*`)** — some reporters POST a deliberate error (e.g. `BIT-SMOKE-WDMI-DIRECT-INGEST`) to prove the pipe works. The ingest API **noise-filters** these when `BIT-SMOKE-` appears in the event `message` or client `stacktrace` (`noise_ruleset_version` from `noisePolicy.ts`; see [ingest-hardening-runbook](operations/ingest-hardening-runbook.md)). Expect `skipped: true` / `rule_id: bitreport_smoke_marker` and **no** new incident. The **deploy live-check failure** title `BIT-SMOKE error hub ingest live check` (exact message; uses a space, not `BIT-SMOKE-`) is filtered the same way from ruleset **1.0.4** onward so ERRCLUSTER loops on that signature stop once production runs the new build. If [BIT-309](/BIT/issues/BIT-309) still reopens after that deploy, treat as **stale nodes or a different root cause** ([BIT-942](/BIT/issues/BIT-942)).
**After the root cause is fixed**
+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`) — those are skipped at every level (`rule_id`: `bitreport_smoke_marker`).
- **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`) — those are skipped at every level (`rule_id`: `bitreport_smoke_marker`). 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`.
## Rate limits
@@ -295,6 +295,42 @@ describe.skipIf(!_testUrl)("two-project passive ingest (BIT-179)", () => {
expect(Number((after[0] as { c: number }).c)).toBe(_nBefore);
});
it("skips deploy ingest live-check failure ribbon without inserting rows", async () => {
const [before] = await _pool.execute<RowDataPacket[]>(
`SELECT COUNT(*) AS c FROM er_incidents WHERE project_id = ?`,
[_projectIdA],
);
const _nBefore = Number((before[0] as { c: number }).c);
const _res = await _app.inject({
method: "POST",
url: "/v1/ingest/events",
headers: { authorization: `Bearer ${_tokenA}` },
payload: {
events: [
{
schema_version: 1,
occurred_at: "2026-04-05T10:10:00.000Z",
level: "critical",
message: "BIT-SMOKE error hub ingest live check",
},
],
},
});
expect(_res.statusCode).toBe(200);
const _body = JSON.parse(_res.body) as {
noise_filtered_count: number;
results: Array<{ skipped?: boolean; rule_id?: string }>;
};
expect(_body.noise_filtered_count).toBe(1);
expect(_body.results[0]?.skipped).toBe(true);
expect(_body.results[0]?.rule_id).toBe("bitreport_smoke_marker");
const [after] = await _pool.execute<RowDataPacket[]>(
`SELECT COUNT(*) AS c FROM er_incidents WHERE project_id = ?`,
[_projectIdA],
);
expect(Number((after[0] as { c: number }).c)).toBe(_nBefore);
});
it("replays identical idempotent requests", async () => {
const _payload = {
events: [
+13
View File
@@ -115,4 +115,17 @@ describe("evaluateNoise", () => {
reason: "filtered_intentional_smoke_event",
});
});
it("matches wdmi-store / CRM deploy ingest live-check failure ribbon (BIT-931 family)", () => {
const _r = evaluateNoise({
level: "critical",
message: "BIT-SMOKE error hub ingest live check",
filePathHint: "",
});
expect(_r).toEqual({
matched: true,
ruleId: "bitreport_smoke_marker",
reason: "filtered_deploy_ingest_probe_failure",
});
});
});
+12 -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.3";
export const NOISE_RULESET_VERSION = "1.0.4";
export type NoiseEvaluation =
| { matched: false }
@@ -130,6 +130,10 @@ const _RULES: NoiseRule[] = [
* Exception: reserved `BIT-SMOKE-` markers are intentional end-to-end probes (e.g. wdmi-store
* `/smoke/wdmi.js`, CRM `/smoke/crm-main.php`) and are filtered at every ingest level so they do
* not open incidents. Some PHP reporters put the marker only in `stack_trace`, not in `message`.
*
* Deploy probes also emit a fixed failure ribbon `BIT-SMOKE error hub ingest live check` (space, not
* hyphen) when the live ingest check fails — documented in `docs/RUNBOOK_INGEST_DEBUG.md` §0. Treat
* like other smoke traffic so ERRCLUSTER loops do not churn on that canonical title alone.
*/
export function evaluateNoise(input: {
level: string;
@@ -141,6 +145,13 @@ export function evaluateNoise(input: {
}): NoiseEvaluation {
const _msg = input.message.trim();
const _stack = (input.stackText ?? "").trim();
if (_msg === "BIT-SMOKE error hub ingest live check") {
return {
matched: true,
ruleId: "bitreport_smoke_marker",
reason: "filtered_deploy_ingest_probe_failure",
};
}
if (_msg.includes("BIT-SMOKE-") || _stack.includes("BIT-SMOKE-")) {
return {
matched: true,