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
This commit is contained in:
1 parent
6c01679310
commit
b082bc716a
4 files changed
+62
-5
No files matched your search
@@ -258,6 +258,43 @@ describe.skipIf(!_testUrl)("two-project passive ingest (BIT-179)", () => {
|
||||
expect(Number((after[0] as { c: number }).c)).toBe(_nBefore);
|
||||
});
|
||||
|
||||
it("skips BIT-SMOKE- in stack_trace when message omits marker (CRM-style payload)", 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:05:00.000Z",
|
||||
level: "error",
|
||||
message: "Exception",
|
||||
stack_trace: "Error: BIT-SMOKE-CRM-MAIN-DIRECT\n#0 smoke",
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
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: [
|
||||
|
||||
Reference in new issue
Block a user