fix historical alert flow packet resolution #6

Merged
dirtydishes merged 1 commit from lavender/flow-packet-persistence into main 2026-05-20 07:09:51 +00:00
Owner

what changed

this updates the terminal alert-detail flow packet lookup so historical alerts resolve persisted flow packets semantically instead of assuming evidence_refs[0] is always the packet id.

that resolver is now reused for:

  • selected alert flow packet lookup
  • alert underlying inference
  • visible alert flow-packet prefetch
  • pinned flow-packet retention keys
  • classifier-hit to alert matching

it also adds focused terminal tests for alerts where a smart-money event id appears before the flow packet id in evidence_refs.

why this changed

older and replayed alerts could show "persisted flow packet is not available for this alert" after the redis hot cache aged out, even though clickhouse-backed alert context had already hydrated the packet and print evidence.

the root cause was that compute-generated alerts can store a smart-money event id before the packet id, while the web client was still treating the first evidence ref as the packet.

intended effect for end users

historical and replayed alerts should keep showing their flow packet summary and related context after redis retention drops the hot copy.

that makes alert investigation feel consistent between live and historical data instead of degrading once the packet leaves cache.

validation

  • bun test apps/web/app/terminal.test.ts
  • bun --cwd=apps/web run build

notes

there is a matching turn document in docs/turns/2026-05-20-fix-alert-flow-packet-history.html with the full implementation record.

## what changed this updates the terminal alert-detail flow packet lookup so historical alerts resolve persisted flow packets semantically instead of assuming `evidence_refs[0]` is always the packet id. that resolver is now reused for: - selected alert flow packet lookup - alert underlying inference - visible alert flow-packet prefetch - pinned flow-packet retention keys - classifier-hit to alert matching it also adds focused terminal tests for alerts where a smart-money event id appears before the flow packet id in `evidence_refs`. ## why this changed older and replayed alerts could show "persisted flow packet is not available for this alert" after the redis hot cache aged out, even though clickhouse-backed alert context had already hydrated the packet and print evidence. the root cause was that compute-generated alerts can store a smart-money event id before the packet id, while the web client was still treating the first evidence ref as the packet. ## intended effect for end users historical and replayed alerts should keep showing their flow packet summary and related context after redis retention drops the hot copy. that makes alert investigation feel consistent between live and historical data instead of degrading once the packet leaves cache. ## validation - `bun test apps/web/app/terminal.test.ts` - `bun --cwd=apps/web run build` ## notes there is a matching turn document in `docs/turns/2026-05-20-fix-alert-flow-packet-history.html` with the full implementation record.
dirtydishes added 1 commit 2026-05-20 07:07:59 +00:00
dirtydishes merged commit fb25b5ac97 into main 2026-05-20 07:09:51 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: dirtydishes/islandflow#6
No description provided.