From 48095fce3bd265ea22e5a6abea6e9db8db46e1a7 Mon Sep 17 00:00:00 2001 From: dirtydishes Date: Mon, 18 May 2026 09:04:03 -0400 Subject: [PATCH] fix(api): remove duplicate alert context import --- .../2026-05-18-fix-alert-context-import.html | 193 ++++++++++++++++++ services/api/src/index.ts | 1 - 2 files changed, 193 insertions(+), 1 deletion(-) create mode 100644 docs/turns/2026-05-18-fix-alert-context-import.html diff --git a/docs/turns/2026-05-18-fix-alert-context-import.html b/docs/turns/2026-05-18-fix-alert-context-import.html new file mode 100644 index 0000000..bfa2afa --- /dev/null +++ b/docs/turns/2026-05-18-fix-alert-context-import.html @@ -0,0 +1,193 @@ + + + + + + 2026-05-18 09:02 EDT - Fix alert context import regression + + + +
+

Fix alert context import regression

+

Completed 2026-05-18 09:02:28 EDT

+ +
+

Summary

+
+

+ A recent alert-context merge left services/api/src/index.ts importing + fetchAlertContextByTraceId twice from @islandflow/storage. + This change removes the duplicate import so the API entrypoint no longer carries that + merge regression. +

+
+
+ +
+

Changes Made

+
    +
  • Removed the second duplicate fetchAlertContextByTraceId import from services/api/src/index.ts.
  • +
  • Left the alert-context implementation and route behavior unchanged.
  • +
+
+ +
+

Context

+

+ This bug scan reviewed commits since the previous automation run on 2026-05-17. The + regression appears in the alert-context work that landed shortly after + c0b5b6d and remains present on the current tip. +

+
+ +
+

Important Implementation Details

+

+ The fix is intentionally minimal because the failure mode came from import duplication, + not from the runtime logic itself. +

+
import {
+  fetchAlertsAfter,
+  fetchAlertsBefore,
+  fetchAlertContextByTraceId,
+  fetchClassifierHitsAfter,
+  ...
+  fetchFlowPacketsAfter,
+  fetchFlowPacketById,
+  fetchFlowPacketsByMemberTraceIds,
+  ...
+} from "@islandflow/storage";
+
+ +
+

Expected Impact for End-Users

+

+ End-users should see no behavior change in the alert drawer itself. The benefit is + operational: the API source no longer contains this compile-time regression, which lowers + the chance of broken startup or validation around the new alert-context feature. +

+
+ +
+

Validation

+
    +
  • Ran bun test apps/web/app/terminal.test.ts packages/storage/tests/alerts.test.ts services/api/tests/alert-context.test.ts and all 75 tests passed.
  • +
  • Ran bunx tsc --noEmit -p services/api/tsconfig.json. The duplicate import no longer appears as an error, but the repo still has unrelated pre-existing TypeScript failures in other packages and modules.
  • +
+
+ +
+

Issues, Limitations, and Mitigations

+

+ The broader API TypeScript check is not clean yet. Remaining failures include unrelated + issues in packages/bus, packages/config, + packages/storage, services/api/src/live.ts, and other API type + call sites. They are outside the scope of this minimal regression fix, so they were not + changed here. +

+
+ +
+

Follow-up Work

+

+ No new follow-up issue was created for this patch beyond the Beads bug used to track this + fix. If the team wants a clean API typecheck gate, the remaining TypeScript failures + should be triaged separately. +

+
+
+ + diff --git a/services/api/src/index.ts b/services/api/src/index.ts index 433222a..be04122 100644 --- a/services/api/src/index.ts +++ b/services/api/src/index.ts @@ -54,7 +54,6 @@ import { fetchSmartMoneyEventsBefore, fetchFlowPacketsAfter, fetchFlowPacketById, - fetchAlertContextByTraceId, fetchFlowPacketsByMemberTraceIds, fetchFlowPacketsBefore, fetchRecentAlerts,