Skip to content

fix(semaino): ingest a trigger signal before detecting its convergence - #365

Merged
forkwright merged 2 commits into
mainfrom
fix/224-convergence-race
Aug 9, 2026
Merged

fix(semaino): ingest a trigger signal before detecting its convergence#365
forkwright merged 2 commits into
mainfrom
fix/224-convergence-race

Conversation

@forkwright

Copy link
Copy Markdown
Owner

What was wrong

The pipeline fanned each GeoSignal down two independent, unsynchronized channels (aggregator scoring vs. grid ingestion) and consumed them with a biased select! that always favored the aggregator branch. Convergence could therefore be evaluated against a grid that did not yet contain the very signal that produced the anomaly, undercounting domain_count and downgrading severity (Critical->High, Medium->Low). Under a sustained burst the bias also unconditionally starved the grid-ingest branch, blinding detection during exactly the flood the pipeline exists to catch.

What changed

handle_aggregated now ingests its trigger signal into the grid before running detection — idempotent (calling detect()'s domain-count computation dedups by domain discriminant regardless of duplicate hits), so it is safe whether or not the ordinary signal_rx delivery already landed. The select! is no longer biased, removing the starvation half of the defect.

A follow-up commit scopes the suppression sink's MutexGuard, which had been held across the whole assertion block (clippy::significant_drop_tightening), and reads the first alert via .first() instead of [0] (clippy::indexing_slicing, denied workspace-wide) in the trigger test.

Refs #224

The pipeline fanned each GeoSignal down two independent,
unsynchronized channels (aggregator scoring vs. grid ingestion) and
consumed them with a biased select! that always favored the
aggregator branch. Convergence could therefore be evaluated against
a grid that did not yet contain the very signal that produced the
anomaly, undercounting domain_count and downgrading severity
(Critical->High, Medium->Low). Under a sustained burst the bias also
unconditionally starved the grid-ingest branch, blinding detection
during exactly the flood the pipeline exists to catch.

handle_aggregated now ingests its trigger signal into the grid
before running detection -- idempotent given the bounded per-domain
DomainSlots storage, so it is safe regardless of whether the
ordinary signal_rx delivery already landed. The select! is no longer
biased, removing the starvation half of the defect.

Refs #224
…gger test

Held the suppression sink's MutexGuard across the whole assertion
block (clippy::significant_drop_tightening) and indexed the alert
Vec directly (clippy::indexing_slicing, denied workspace-wide).
Extracts the two values the assertions need inside a scoped block
so the guard drops immediately, and reads the first alert via
.first() instead of [0].

Refs #224
@forkwright
forkwright merged commit de0b8ae into main Aug 9, 2026
8 checks passed
@forkwright
forkwright deleted the fix/224-convergence-race branch August 9, 2026 00:37
forkwright pushed a commit that referenced this pull request Aug 9, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.1.23](v0.1.22...v0.1.23)
(2026-08-09)


### Bug Fixes

* **akroasis-server:** bound request timeout, concurrency, and body size
([#362](#362))
([d77876d](d77876d)),
closes [#194](#194)
* **kerykeion:** escalate background task failures to a clean shutdown
([#363](#363))
([0a468f1](0a468f1)),
closes [#205](#205)
* **semaino:** bound per-cell convergence storage to one hit per domain
([#364](#364))
([cba9170](cba9170)),
closes [#223](#223)
* **semaino:** ingest a trigger signal before detecting its convergence
([#365](#365))
([de0b8ae](de0b8ae)),
closes [#224](#224)

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

1 participant