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(gate): resolve the session-projection root through git, not __file__

Beenu Arorae794392cea1e
diff --git a/scripts/check_session_projection.py b/scripts/check_session_projection.py
index 6b065d900..a466d5001 100644
--- a/scripts/check_session_projection.py
+++ b/scripts/check_session_projection.py
@@ -45,7 +45,17 @@ import sys
import tempfile
from pathlib import Path
-ROOT = Path(__file__).resolve().parent.parent
+# `scripts/` is on sys.path when this file runs as a program, but not when a
+# test loads it by path with importlib. gate_toolkit sits beside it either way.
+sys.path.insert(0, str(Path(__file__).resolve().parent))
+
+from gate_toolkit import repo_root # noqa: E402
+
+# Resolved through `git rev-parse`, not from `__file__`. Two levels above this
+# script is whatever happens to be there -- and `scripts/` copied into an
+# empty repository is exactly that, which is how a gate reports a tree clean
+# without ever seeing the product. `check_gate_contract.py` refuses it.
+ROOT = repo_root()
#: The one file allowed to read a vendor's session-identifying field.
PRODUCER = Path("services/ingest/internal/activity/session.go")