Skip to content

fix: rules without detection logic never trigger - #359

Merged
Sanjay Singh (san360) merged 1 commit into
microsoft:mainfrom
pcbeingused333:fix/rule-without-detection-never-triggers
Nov 3, 2026
Merged

Sanjay Singh (san360) merged 1 commit into
microsoft:mainfrom
pcbeingused333:fix/rule-without-detection-never-triggers

Conversation

@pcbeingused333

Copy link
Copy Markdown
Contributor

Description

Part of #344 (first bullet). A rule with no detect block, an empty one, or one without match: or check: ran as match-all: executePipeline falls back to () => true and checkPipelineTrigger fires on any match, so Test Rule and detection reported TRIGGERED for every request. This contradicts the comment in parsePipeline ("default pipeline that never triggers"). executePipeline now returns an empty emission when the pipeline has neither matchExpr nor checkExpr. Rules with only match: or only check: behave as before, and every built-in rule has one of the two.

Not covered here: applying # Filter / # Trigger / metric: and extends: inheritance of detection logic, which the issue also lists.

Related Issues

Part of #344 (first bullet only; the issue stays open for the rest)

Checklist

  • Changes are covered by tests: new src/core/rule-pipeline.test.ts (fails on main, passes with the fix)
  • npm run check not run in full; the rule-pipeline, rule-engine, rule-equivalence, antipatterns-e2e and rule-loader suites pass (120 tests)

This change was prepared with Claude (an AI agent) and submitted on Alex's behalf.

A rule with no detect block, or a detect block with neither match: nor
check:, ran as match-all and triggered on every request, contradicting
the comment in parsePipeline. executePipeline now returns an empty
emission for such a pipeline.

Part of microsoft#344
@san360
Sanjay Singh (san360) merged commit cb9d3c9 into microsoft:main Nov 3, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants