Skip to content

fix(enrichment): keep skipped and shed status out of enriched fields - #860

Merged
mostafa merged 7 commits into
mainfrom
fix/plan24-r2
Dec 1, 2026
Merged

mostafa merged 7 commits into
mainfrom
fix/plan24-r2

Conversation

@mostafa

@mostafa mostafa commented Dec 1, 2026

Copy link
Copy Markdown
Member

An enricher that its open circuit breaker skipped, or that was shed for want of capacity, used to write {"status": "skipped"} or {"status": "shed"} under its inject_field. Everything downstream then read that marker as if it were the enriched value:

  • A selector on enrichment.<field> resolved to the marker object, so matchers such as != "" or =~ ".+" matched a detection that was never enriched.
  • In entity_graph grouping, the marker stringified to the same value for every skipped detection, so unrelated entities skipped by the same breaker were joined into one incident.

Now the enricher's inject_field stays absent, and the status moves to a new EvaluationResult::enrichment_status map (enricher id to skipped or shed), serialized as a top-level enrichment_status object and left out when empty. The detection is still delivered and is visibly marked, but the marker can no longer stand in for a real value.

entity_graph now uses the same scalar rule as risk-object extraction: only a string, number, or boolean forms a join edge. A selector that resolves to an object or array contributes no edge (previously its JSON text joined incidents), and neither does the empty string, which risk extraction already ignored.

EvaluationResult gains a public field, so code that builds it with a struct literal needs enrichment_status: Default::default().

A substring fieldref compared only the first 1024 scalar values of each
field, so a match on a later value was never found. Count each side's
candidates instead, and return the row as a match when either side has
more than 1024; otherwise compare every pair.
@mostafa mostafa added the performance Run the coarse performance regression gate on this PR label Dec 1, 2026
Base automatically changed from fix/plan24-r1 to main December 1, 2026 22:27
@mostafa
mostafa merged commit 1d34626 into main Dec 1, 2026
27 checks passed
@mostafa
mostafa deleted the fix/plan24-r2 branch December 1, 2026 22:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance Run the coarse performance regression gate on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant