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(trust): publish the CORE service count the compose file actually starts (#927)

Beenu Arorac95d05fab2af
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1eebf7a4d..dfa9e3e23 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,29 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
+### Fixed
+
+- **Five surfaces kept publishing 14 CORE services after ADR-0007 moved it to
+ 16, and the gate that exists for this could not see them.** Two were the
+ landing page and the FAQ, so the wrong figure was the one a reader met first.
+ `check_profile_service_counts.py` validated a hardcoded list of ten sites
+ against `docker-compose.yml` and never asked the tree whether anything else
+ published the number, so a count added to a file the list does not name was a
+ count the gate never read. It reported "10 published figures agree" while
+ five disagreed.
+
+ The exact list stays, because the reasoning behind it is right: a gate that
+ guessed which integers were claims would flag prose forever. What was missing
+ is the other direction. `unregistered_mentions()` now finds anything that
+ publishes a service count and fails unless it is registered or exempted on
+ purpose, so a new surface must join the list rather than escape it. The five
+ are registered and the gate now checks fifteen sites; the exemptions are
+ release history, ADRs that state the count they decided, and two files
+ counting something other than a compose profile.
+
+ Verified by running the repaired gate against the pre-fix tree, where it
+ names all five.
+
### Added
- **A tenant can now teach the investigation agent what is normal in its own
diff --git a/ROADMAP.md b/ROADMAP.md
index 707ddb859..5bca08d1e 100644
--- a/ROADMAP.md
+++ b/ROADMAP.md
@@ -786,7 +786,7 @@ could reach the port could write alerts into any tenant. And CORE now needs
**8 GB of memory and 20 GB of free disk**, up from `~6.5 GB`, because the
threat-intelligence feed, its vector store and a local model moved into it.
-Re-measured rather than restated: CORE is 14 long-running services plus a
+Re-measured rather than restated: CORE is 16 long-running services plus a
one-shot model pull and `full` is 22; resident memory for the whole stack went
1.72 GiB → 4.84 GiB. A fresh `make up` now holds 1,723 real CISA KEV entries
within a minute of boot with no credentials, and runs triage against a bundled
diff --git a/apps/web/public/screenshots/README.md b/apps/web/public/screenshots/README.md
index b011b4d42..6db57922e 100644
--- a/apps/web/public/screenshots/README.md
+++ b/apps/web/public/screenshots/README.md
@@ -13,7 +13,7 @@ so in the table below and in every caption that uses it.
```bash
cp .env.example .env
-make up # CORE: 14 long-running services, no credentials of any kind
+make up # CORE: 16 long-running services, no credentials of any kind
make smoke # one real event through the real spine
```
diff --git a/apps/web/src/app/page.tsx b/apps/web/src/app/page.tsx
index ffe5918a9..0579d6c4c 100644
--- a/apps/web/src/app/page.tsx
+++ b/apps/web/src/app/page.tsx
@@ -170,7 +170,7 @@ const faqJsonLd = {
acceptedAnswer: {
'@type': 'Answer',
text:
- 'No. The core profile brings up 14 services with no credentials of any kind: it generates its own secrets, creates an administrator, runs a local model behind the gateway so triage is real rather than stubbed, and polls the public CISA Known Exploited Vulnerabilities catalogue so the first thing you see is real threat intelligence.',
+ 'No. The core profile brings up 16 services with no credentials of any kind: it generates its own secrets, creates an administrator, runs a local model behind the gateway so triage is real rather than stubbed, and polls the public CISA Known Exploited Vulnerabilities catalogue so the first thing you see is real threat intelligence.',
},
},
{
diff --git a/apps/web/src/components/landing/sections/Faq.tsx b/apps/web/src/components/landing/sections/Faq.tsx
index e91bbbee9..4ea60a0ec 100644
--- a/apps/web/src/components/landing/sections/Faq.tsx
+++ b/apps/web/src/components/landing/sections/Faq.tsx
@@ -51,7 +51,7 @@ const FAQS: ReadonlyArray<QA> = [
{
q: 'Do I need an API key to try it?',
a:
- 'No. The core profile brings up 14 services with no credentials of any kind: it generates its own secrets, creates an administrator, runs a local model behind the gateway so triage is real rather than stubbed, and polls the public CISA Known Exploited Vulnerabilities catalogue so the first thing you see is real threat intelligence.',
+ 'No. The core profile brings up 16 services with no credentials of any kind: it generates its own secrets, creates an administrator, runs a local model behind the gateway so triage is real rather than stubbed, and polls the public CISA Known Exploited Vulnerabilities catalogue so the first thing you see is real threat intelligence.',
},
{
q: 'How good is the model that ships with it?',
diff --git a/docs/testing/CLEAN_INSTALL.md b/docs/testing/CLEAN_INSTALL.md
index 6eaad9c5b..bc5598eef 100644
--- a/docs/testing/CLEAN_INSTALL.md
+++ b/docs/testing/CLEAN_INSTALL.md
@@ -28,7 +28,7 @@ make smoke
| Stage | Result |
|---|---|
| Clone | pass |
-| `make up` — CORE profile, 14 long-running services | pass |
+| `make up` — CORE profile, 16 long-running services | pass |
| Postgres accepting connections, 92 tables | pass |
| Kafka broker answering admin requests | pass |
| `api`, `ingest-worker`, `fusion` healthy | pass |
diff --git a/scripts/check_profile_service_counts.py b/scripts/check_profile_service_counts.py
index 5e42d3100..f6fc446d5 100644
--- a/scripts/check_profile_service_counts.py
+++ b/scripts/check_profile_service_counts.py
@@ -98,13 +98,99 @@ CLAIM_SITES: tuple[tuple[str, str, str], ...] = (
"core",
r"CORE profile: (\d+) long-running services",
),
+ # The five below went unchecked until ADR-0007 moved CORE to 16 and they
+ # kept saying 14. Two of them are the landing page and the FAQ, so the
+ # wrong number was the one a reader met first.
+ ("ROADMAP.md", "core", r"CORE is (\d+) long-running services"),
+ (
+ "apps/web/public/screenshots/README.md",
+ "core",
+ r"CORE: (\d+) long-running services",
+ ),
+ ("apps/web/src/app/page.tsx", "core", r"core profile brings up (\d+) services"),
+ (
+ "apps/web/src/components/landing/sections/Faq.tsx",
+ "core",
+ r"core profile brings up (\d+) services",
+ ),
+ (
+ "docs/testing/CLEAN_INSTALL.md",
+ "core",
+ r"CORE profile, (\d+) long-running services",
+ ),
+)
+
+
+#: Where a service count may be *mentioned* without being a claim about a
+#: profile. Each entry is a path, and every one is a deliberate decision that
+#: the number there is not the CORE or `full` figure.
+COUNT_MENTION_EXEMPT: frozenset[str] = frozenset(
+ {
+ # Records what each release changed, including counts that were correct
+ # then and are not now. Rewriting them would be revisionism.
+ "CHANGELOG.md",
+ "RELEASES.md",
+ # An ADR states the count at the moment it was decided, as its own
+ # evidence. ADR-0006 says 11 and ADR-0007 says 14 to 16; both are true
+ # of the day they were written.
+ "docs/decisions",
+ # Historical prototype subtree, not this product.
+ "plans",
+ # Counts source directories, not running containers.
+ "docs/architecture/SYSTEM_DESIGN.md",
+ # Counts what that deployment target runs, which is not a profile of
+ # this compose file.
+ "infra/railway/README.md",
+ }
)
+#: Finds a sentence that looks like it publishes a profile's service count.
+#: Deliberately narrow: it wants the number adjacent to the word services, not
+#: any integer in the vicinity.
+COUNT_MENTION = re.compile(r"\b(\d+)\s+(?:long-running\s+)?(?:services|containers)\b")
+
class ScanError(RuntimeError):
"""The compose file could not be read or parsed."""
+def unregistered_mentions() -> list[str]:
+ """Files publishing a service count that no CLAIM_SITES entry validates.
+
+ The list above is deliberately exact, and the reasoning is sound: a gate
+ that guessed which integers were claims would flag prose forever. But it
+ left the gate blind in the direction things actually move. Nothing noticed
+ when five surfaces kept saying 14 after ADR-0007 took CORE to 16, including
+ the landing page and the FAQ, because a figure added to a file this list
+ does not name is a figure this gate never reads.
+
+ So the exactness stays for *validating* a number, and this asks the
+ complementary question: does anything publish a count we are not checking?
+ A new surface must either join CLAIM_SITES or be exempted on purpose.
+ """
+ registered = {rel for rel, _profile, _pattern in CLAIM_SITES}
+ findings: list[str] = []
+ for path in sorted(REPO_ROOT.rglob("*")):
+ if path.is_dir() or path.suffix not in {".md", ".mdx", ".tsx", ".ts"}:
+ continue
+ rel = path.relative_to(REPO_ROOT).as_posix()
+ if rel in registered or any(rel == e or rel.startswith(f"{e}/") for e in COUNT_MENTION_EXEMPT):
+ continue
+ if any(part in {"node_modules", ".git", ".next", "dist"} for part in path.parts):
+ continue
+ try:
+ text = path.read_text(encoding="utf-8", errors="replace")
+ except OSError:
+ continue
+ for line_no, line in enumerate(text.splitlines(), start=1):
+ if "profile" not in line.lower() and "make up" not in line and "CORE" not in line:
+ continue
+ match = COUNT_MENTION.search(line)
+ if match:
+ findings.append(f"{rel}:{line_no} publishes '{match.group(0)}' and no CLAIM_SITES entry validates it")
+ return findings
+
+
def _parse_services(text: str) -> dict[str, list[str] | None]:
"""Service name to its declared profile list, or ``None`` for no list.
@@ -233,6 +319,10 @@ def scan() -> tuple[dict[str, int], dict[str, set[str]], list[str]]:
"`docker compose --profile chatops` will refuse to render"
)
+ # Asks the tree about the list, having just asked the list about the tree.
+ # Without this the gate can only be wrong about files it already knows.
+ errors.extend(unregistered_mentions())
+
return counts, members, errors