Skip to content

armgit / AiSOC

Public Imported from GitHub
0

Open-source AI Security Operations Center: alert fusion, LLM-agent triage, MITRE ATT&CK investigation, and a replayable decision ledger for every agent step. Self-hostable, runs with no API keys, MIT licensed. Ships an MCP server for Claude, Cursor and Continue.

fix(ci): restore baseline CI to green (unblocks Dependabot sweep) (#191)

Prince Sinha6607e2162ed1
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 38eb6f376..2d5c17c95 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -120,7 +120,13 @@ jobs:
with:
python-version: '3.12'
- name: Install Ruff & Mypy
- run: pip install ruff mypy
+ # Pin to versions compatible with the constraints declared in each
+ # service's ``pyproject.toml`` (``ruff = "^0.4.4"``, ``mypy = "^1.10.0"``).
+ # The CI gate previously left these unpinned, so every new ruff release
+ # (e.g. 0.15.x adding ``UP037`` enforcement) silently broke main without
+ # any dependency-file change. Dependabot bumps to the pyproject
+ # constraints (PRs #186, #187) update these pins in the same diff.
+ run: pip install 'ruff>=0.4.4,<0.5' 'mypy>=1.10,<2'
# All services share the repo-root `ruff.toml`. Linting and formatting
# cover every Python service, not just the original four — the gate
# used to soft-fail with `|| true`; that's gone, so this is the real
diff --git a/apps/web/src/test/setup.ts b/apps/web/src/test/setup.ts
index 552b69282..7fa16678c 100644
--- a/apps/web/src/test/setup.ts
+++ b/apps/web/src/test/setup.ts
@@ -7,6 +7,7 @@
import '@testing-library/jest-dom/vitest';
import { afterEach, expect, vi } from 'vitest';
import { cleanup } from '@testing-library/react';
+import { mutate } from 'swr';
// NOTE: [email protected] ships a broken `vitest-axe/matchers.d.ts` that wraps
// its re-exports in `export type *`, so TS thinks `toHaveNoViolations` is a
// type even though the JS file exports a function. The deep path resolves to
@@ -21,6 +22,15 @@ expect.extend({ toHaveNoViolations });
afterEach(() => {
cleanup();
+ // SWR keeps a *module-scoped* cache that survives across tests in the
+ // same file. A test that mocks a fetcher to return an unresolved
+ // ``new Promise(() => {})`` (the loading-state smoke test) leaves that
+ // promise pinned to the cache key, so the next test's
+ // ``mockResolvedValue`` is silently ignored and the loading state
+ // bleeds through. Clear every key after each test so SWR refetches
+ // from the freshly-installed mock. See SOCInsightsView.test.tsx for
+ // the failure mode this avoids.
+ void mutate(() => true, undefined, { revalidate: false });
});
// matchMedia is touched by some recharts/framer-motion code paths.
diff --git a/scripts/run_evals.py b/scripts/run_evals.py
index a5a177eb8..2fcc803b4 100755
--- a/scripts/run_evals.py
+++ b/scripts/run_evals.py
@@ -226,6 +226,25 @@ _TELEMETRY_PATH = (
_AGENTS_ROOT / "tests" / "eval_data" / "synthetic_telemetry.jsonl"
)
+# Canonical suite name list. Kept in lock-step with the keys of
+# ``summary["suites"]`` built in ``main()`` and the per-suite ``_run_*``
+# helpers above. ``--suite all`` is the default; passing one of these names
+# runs that suite in isolation (used by the per-axis CI matrix and by
+# operators bisecting a regression to a single gate).
+_SUITE_NAMES: tuple[str, ...] = (
+ "mitre_accuracy",
+ "alert_reduction",
+ "investigation_completeness",
+ "response_quality",
+ "hunt_corpus",
+ "adversary_eval",
+ "confidence_calibration",
+ "memory_recall",
+ "override_accuracy",
+ "playbook_completion_rate",
+ "detection_fp_rate",
+)
+
def _run_mitre() -> dict:
t0 = time.perf_counter()
diff --git a/services/ingest/main.go b/services/ingest/main.go
index 9b8cdfe0a..761146c15 100644
--- a/services/ingest/main.go
+++ b/services/ingest/main.go
@@ -14,6 +14,7 @@ import (
"github.com/beenuar/aisoc/services/ingest/internal/config"
configsnap "github.com/beenuar/aisoc/services/ingest/internal/config_snapshot"
+ "github.com/beenuar/aisoc/services/ingest/internal/envmode"
"github.com/beenuar/aisoc/services/ingest/internal/graph"
"github.com/beenuar/aisoc/services/ingest/internal/graph_ws"
"github.com/beenuar/aisoc/services/ingest/internal/handler"