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.

feat(compose): put connectors and actions in CORE so the agent has somewhere to reach (#911)

Beenu Arorad21f4c97c267
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index ea9af2a95..5e37a67d8 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -638,6 +638,16 @@ jobs:
python scripts/generate_slo_alerts.py --check
- name: Grafana dashboards query metrics that exist
run: python scripts/check_grafana_dashboards.py
+ # Five documents publish how many services each compose profile starts
+ # and nothing compared any of them to docker-compose.yml. ADR-0006 hit
+ # this while editing the table for another reason: the published `full`
+ # count was 30, which is every profile at once rather than what
+ # `make up-full` starts. ADR-0007 moved two services into CORE, so the
+ # figure now has a reason to move again.
+ - name: Published profile service counts match the compose file
+ run: |
+ python3 scripts/check_profile_service_counts.py --self-test
+ python3 scripts/check_profile_service_counts.py
- name: Support bundle must not leak
run: |
python3 -m pip install --quiet pytest
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 12c00483a..fd0cfb45d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,6 +9,64 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
+- **`connectors` and `actions` now start on the default CORE profile, so the
+ investigation agent has somewhere to reach** (gap-closure Phase 4.5,
+ [ADR-0007](docs/decisions/0007-connectors-and-actions-in-core.md)).
+
+ **The gap, stated exactly.** The plan's finding was that on the profile
+ `make up` starts, the agent has no evidence source at all. The sharper
+ version is that CORE was not missing the capability, it was advertising
+ one it could not perform: `api` in CORE already sets
+ `CONNECTORS_SERVICE_URL: http://connectors:8003` and
+ `AISOC_ACTIONS_BASE_URL: http://actions:8085`, and
+ `AISOC_FEATURE_FED_SEARCH` defaults on, so federated search was enabled
+ and fanning out to a hostname that does not resolve while the live-actions
+ surface answered 502 naming two compose profiles.
+
+ **How it was measured, because CORE's 8 GB budget is not a suggestion.**
+ Images pulled fresh from GHCR and resident memory read with `docker stats`,
+ the same method as ADR-0006 on the same class of machine. `actions` is
+ 539 MB of image and 45.99 MiB resident at cold start, 48.3 MiB after 40
+ hours; `connectors` is 586 MB and 71.45 MiB, 76.51 MiB after 40 hours.
+ Together **124.8 MiB, which is 1.5% of the budget**. Cross-checked against
+ `litellm` on the same host at 471 MiB, which ADR-0006 measured at 451 MiB,
+ so the method reproduces within about 4%. ADR-0006's trap was checked for
+ and is absent: `ollama` idles at 9.6 MiB and measures 2.96 GiB while
+ inferring, whereas neither service here moves more than 0.6 MiB under 100
+ requests, because both are network front ends holding no model and no
+ index. Both were also verified to boot and serve with **no configuration**:
+ `actions` answers its capability list and `connectors` all 84 connectors.
+
+ **What it does not fix, said plainly.** The lake and the graph are the
+ other half of the plan's sentence and they stay in `full`, because
+ ClickHouse and Neo4j are stateful stores with their own memory floors
+ rather than front ends, which is a different decision needing its own
+ measurement. So a CORE deployment's agent can now reach a configured
+ vendor and still cannot reach an event lake. And what an evaluator with no
+ vendor account gains is the path, not the data: tool advertisement is
+ scoped to the tenant's configured backends, so a fresh CORE install offers
+ the agent no customer tools and says so.
+
+ `actions` is now in **no** profile rather than a longer list, because a
+ service in no profile is included in every profile run, which keeps
+ `slack-bot`'s `chatops` dependency renderable. CORE goes from 14 services
+ to 16; `full` stays at 22 because both were already in it.
+
+- **A gate on the published compose-profile service counts**
+ (`scripts/check_profile_service_counts.py`). Four documents publish how
+ many services each profile starts, across ten separate figures, and nothing
+ compared any of them to `docker-compose.yml`. ADR-0006 found exactly this
+ while editing the same table for another reason: the published `full` count
+ was 30, which is every profile at once rather than what `make up-full`
+ starts. The gate parses profile membership out of the compose YAML rather
+ than shelling out to `docker compose`, because CI has no daemon in that job
+ and `docker compose` resolves `.env`, which would make the answer depend on
+ the caller's environment instead of on the tree. It fails in both
+ directions, so deleting a claim fails as a stale entry rather than passing
+ because nothing matched, and it asserts `actions` stays reachable from the
+ `chatops` profile since compose refuses to render a file whose dependency
+ sits outside the profile being started. Proven able to fail by re-staling
+ the README's core figure to 14.
- **A prompt-injection corpus whose incidents come in twins, and the four
metrics that grade them** (gap-closure Phase 3.1 and 3.2). `PromptInjectionGuard`
already existed and already had a measured history. What did not exist was
diff --git a/GAP_CLOSURE_PROGRESS.md b/GAP_CLOSURE_PROGRESS.md
index 969c25a62..de061460b 100644
--- a/GAP_CLOSURE_PROGRESS.md
+++ b/GAP_CLOSURE_PROGRESS.md
@@ -313,7 +313,7 @@ through `audit_hash.verify_chain`.
- [ ] **4.2 Vendor read tools**, plus new read verbs for SentinelOne, Microsoft Entra ID, Google Workspace, AWS CloudTrail and Microsoft Defender.
- [ ] **4.3 Tool handling**: advertise only configured backends, project and cap results, mark them untrusted, and surface a read failure as "could not check".
- [ ] **4.4 Strategies** updated so `check_investigation_depth.py` still holds.
-- [ ] **4.5 CORE decision**: measure the memory cost of `connectors` and `actions` in CORE, decide in an ADR, implement the decision.
+- [x] **4.5 CORE decision**: measured, decided in [ADR-0007](docs/decisions/0007-connectors-and-actions-in-core.md), implemented. Both services join CORE. Measured with images pulled fresh from GHCR and `docker stats`, the same method as ADR-0006: `actions` 539 MB image / 45.99 MiB cold-start / 48.3 MiB at 40 hours, `connectors` 586 MB / 71.45 MiB / 76.51 MiB, together **124.8 MiB against an 8 GB budget, 1.5%**. Cross-checked against `litellm` at 471 MiB on the same host, which ADR-0006 measured at 451 MiB. ADR-0006's misleading-idle trap was checked for and is absent: neither moves more than 0.6 MiB under 100 requests, because both are network front ends with no model and no index. Both verified to boot and serve with zero configuration. The decision turned on something stronger than a feature gap, recorded as D17: CORE was already *configured* for both and started neither. The README's ~8 GB figure is deliberately not moved, and the lake and graph deliberately stay in `full`.
## Phase 5: MCP client
@@ -568,6 +568,45 @@ against `connectors.updated_at` makes "somebody saved the connector" the only
thing that resumes polling. A timer would have been the churn the state exists
to avoid, and a manual reset would have been a support ticket.
+### D17. CORE was not missing `connectors` and `actions`. It was configured for both and started neither
+
+The plan's framing of 4.5 is a capability gap: "the default profile has no
+evidence source". Measuring it found something worse than absence, and the
+difference is what made the decision easy rather than a judgement call about
+124.8 MiB.
+
+`api` in CORE carries `CONNECTORS_SERVICE_URL: http://connectors:8003` and
+`AISOC_ACTIONS_BASE_URL: http://actions:8085`, and
+`AISOC_FEATURE_FED_SEARCH` defaults to `True` in the API's settings. So on
+the profile `make up` starts, the federated-search route was enabled and
+fanning out to a hostname that does not resolve, and the live-actions proxy
+answered 502 with a message naming the two compose profiles an operator would
+have had to know to switch to. The capability was not switched off in CORE.
+It was switched on and pointed at nothing.
+
+That reframes the alternative. "Leave both in `full`" is not "CORE stays
+lean", it is "CORE keeps advertising a capability it cannot perform", and the
+only other honest option would have been to delete the configuration, which
+trades a broken capability for an absent one.
+
+**Two things were also corrected while the profile table was open,** on the
+precedent ADR-0006 set when it found the published `full` count was 30:
+
+- The counts were published in ten figures across four documents and nothing
+ compared any of them to `docker-compose.yml`. That is now
+ `scripts/check_profile_service_counts.py`, wired into `ci.yml`, failing in
+ both directions. `docs/testing/CLEAN_INSTALL.md` also says 14 and is
+ **left alone** deliberately: it records a dated run on 2026-09-23 and
+ rewriting it would be revisionism.
+- The ADR index in `docs/decisions/README.md` was missing 0005 and 0006.
+
+**What is not decided, so nobody reads 4.5 as having closed the whole gap.**
+ClickHouse and Neo4j stay in `full`. They are stateful stores with their own
+memory floors rather than network front ends, so they are a separate decision
+needing its own measurement. After this change a CORE agent can reach a
+configured vendor and still cannot reach an event lake, and the eleven lake
+pivots report their data class is unavailable rather than returning empty.
+
### D12. `unified_decision` had no production caller, and the plan names it anyway
The plan says to wire the promotion gate into
diff --git a/PHASE4_PROGRESS.md b/PHASE4_PROGRESS.md
new file mode 100644
index 000000000..7a907b0a4
--- /dev/null
+++ b/PHASE4_PROGRESS.md
@@ -0,0 +1,39 @@
+# Phase 4 working notes (local, not committed)
+
+Worktree: /Users/beenu/Desktop/AiSOC-agenttools
+Branch base: feat/phase4-agent-tools off origin/main @ 1f56e324
+
+## Measured for 4.5 (done)
+
+Images pulled fresh from GHCR 2026-09-26:
+- ghcr.io/beenuar/aisoc-actions:latest 539 MB
+- ghcr.io/beenuar/aisoc-connectors:latest 586 MB
+
+Resident memory, measured on this machine (16.7 GB host):
+
+| | cold-start idle (45s) | under 100 reqs | 40h steady state |
+|---|---|---|---|
+| actions | 45.99 MiB | 46.3 MiB | 48.3 MiB |
+| connectors | 71.45 MiB | 71.98 MiB | 76.51 MiB |
+| total | 117.4 MiB | 118.3 MiB | 124.8 MiB |
+
+Reference on the same host, same method: litellm 471.1 MiB (ADR-0006 measured
+451 MiB), agents 223.7 MiB, api 213.9 MiB, web 86.2 MiB, fusion 58.1 MiB.
+
+Zero-config boot verified:
+- actions: /health 200, /api/v1/live-actions 200 listing the capability set
+- connectors: /api/v1/connectors 200 with all 84 connectors
+
+CORE today already points at both: api has CONNECTORS_SERVICE_URL=http://connectors:8003
+and AISOC_ACTIONS_BASE_URL=http://actions:8085, and AISOC_FEATURE_FED_SEARCH
+defaults True. Neither hostname resolves in CORE.
+
+## Plan
+
+- [x] worktree, read plan + tracker
+- [x] 4.5 measurement
+- [ ] PR1: ADR-0007 + compose + docs (4.5)
+- [ ] PR2: 4.2 new vendor read verbs in services/actions
+- [ ] PR3: 4.1 + 4.3 + 4.4 agent tool surface
+- [ ] tracker + claim matrix + changelog
+- [ ] eval re-grade deltas
diff --git a/README.md b/README.md
index 7e0dd2bdf..01cf3525b 100644
--- a/README.md
+++ b/README.md
@@ -127,9 +127,9 @@ a time, and every box in every diagram links to the code that implements it.
| Profile | Command | Services | RAM | What you get |
|---|---|---|---|---|
-| **core** | `make up` | 14 | ~8 GB | The full alerting pipeline: ingest → detect → correlate → alert → triage → console, plus the LLM gateway, a local model, and the CISA KEV threat feed |
-| **full** | `make up-full` | 22 | ~12 GB | Core plus event lake, entity graph, full-text search, enrichment, scheduled connectors |
-| **demo** | `make up && make demo` | 14 | ~8 GB | Core plus labelled synthetic data |
+| **core** | `make up` | 16 | ~8 GB | The full alerting pipeline: ingest → detect → correlate → alert → triage → console, plus the LLM gateway, a local model, the CISA KEV threat feed, and the connector and response services the agent's vendor tools reach |
+| **full** | `make up-full` | 22 | ~12 GB | Core plus event lake, entity graph, full-text search, enrichment |
+| **demo** | `make up && make demo` | 16 | ~8 GB | Core plus labelled synthetic data |
CORE is the smallest deployment that takes a real event and produces a real
alert, and **it needs no credentials to do either** — for two reasons.
diff --git a/ROADMAP.md b/ROADMAP.md
index 9e6528c5c..971238f76 100644
--- a/ROADMAP.md
+++ b/ROADMAP.md
@@ -44,7 +44,7 @@ A proof-first, security-first program to make every README claim gate-backed, cl
- **Phase D (breadth):** D1 eight connectors (QRadar/Exabeam/Securonix/Devo/Netskope/Windows-Sysmon/Zeek-Suricata/syslog-CEF) · D2 AI/LLM-usage audit connector + `llm-*` detections + hot/cold lake tiering · D3 live-vendor mock-server smoke.
- **Phase E (prove it):** E1 CI-gated benchmark scoreboard tied to a deterministic live-agent MITRE-accuracy run.
-The claim-to-gate matrix stands at **173 rows — 165 GATED / 8 PARTIAL / 0 NO GATE** — **every product claim is backed by a failing test** and the ratchet (`MAX_NO_GATE=0`) forbids any regression. The 8 remaining PARTIAL rows are honest, named deferrals; none was relabelled without building the gate it names. Count the table rows with `python3 scripts/check_claim_gate_matrix.py` rather than trusting a figure quoted in prose — this line has gone stale before. The six lettered deferrals are scoped in [`docs/audit/DEFERRED_SUBPHASES.md`](docs/audit/DEFERRED_SUBPHASES.md).
+The claim-to-gate matrix stands at **174 rows — 166 GATED / 8 PARTIAL / 0 NO GATE** — **every product claim is backed by a failing test** and the ratchet (`MAX_NO_GATE=0`) forbids any regression. The 8 remaining PARTIAL rows are honest, named deferrals; none was relabelled without building the gate it names. Count the table rows with `python3 scripts/check_claim_gate_matrix.py` rather than trusting a figure quoted in prose — this line has gone stale before. The six lettered deferrals are scoped in [`docs/audit/DEFERRED_SUBPHASES.md`](docs/audit/DEFERRED_SUBPHASES.md).
## v4.0 — Shipped
diff --git a/apps/docs/docs/architecture.md b/apps/docs/docs/architecture.md
index ec8de4371..2f6ba44b6 100644
--- a/apps/docs/docs/architecture.md
+++ b/apps/docs/docs/architecture.md
@@ -321,11 +321,11 @@ the word "autonomous" in this project.
| Profile | Command | Long-running services | Memory | What you get |
|---|---|---|---|---|
-| **core** | `make up` | 14 | ~8 GB | Steps 1–10, plus the LLM gateway, the local model behind it, and the CISA KEV feed with its vector store |
-| **full** | `make up-full` | 22 | ~12 GB | Core plus the event lake, entity graph, full-text search, enrichment and scheduled connectors |
-| **demo** | `make up && make demo` | 14 | ~8 GB | Core plus clearly-labelled synthetic data |
+| **core** | `make up` | 16 | ~8 GB | Steps 1–10, plus the LLM gateway, the local model behind it, the CISA KEV feed with its vector store, and the connector and response services the investigation agent's vendor tools reach |
+| **full** | `make up-full` | 22 | ~12 GB | Core plus the event lake, entity graph, full-text search and enrichment |
+| **demo** | `make up && make demo` | 16 | ~8 GB | Core plus clearly-labelled synthetic data |
-CORE is 14 long-running containers; `ollama-pull` is a fifteenth that fetches
+CORE is 16 long-running containers; `ollama-pull` is a seventeenth that fetches
the model once and exits. `full` is 22 long-running containers — not 30, which
is every profile including `monitoring`, `chatops`, `extras` and `osquery`,
none of which `make up-full` starts.
diff --git a/apps/docs/docs/compliance/evidence-pack.md b/apps/docs/docs/compliance/evidence-pack.md
index 768b2ca26..c9e95aa19 100644
--- a/apps/docs/docs/compliance/evidence-pack.md
+++ b/apps/docs/docs/compliance/evidence-pack.md
@@ -33,7 +33,7 @@ and says so.
| Prompt-injection resistance | Two adversarial corpora with a recall floor and a false-positive ceiling: 32 payloads scanned in isolation, and 65 incident pairs whose payloads are placed in attacker-controllable fields, each against a clean twin | `services/agents/tests/adversarial/` |
| Claim-to-gate traceability | Every product claim mapped to the CI job that fails when it stops being true | `docs/audit/CLAIM_TO_GATE_MATRIX.md` |
-The last row is the one worth reading first. It is the honest index: 165 rows
+The last row is the one worth reading first. It is the honest index: 166 rows
`GATED`, 8 `PARTIAL` with the specific gap named, and a ratchet that refuses
to let a row sit at `NO GATE`.
diff --git a/apps/docs/docs/quickstart.md b/apps/docs/docs/quickstart.md
index 680a554cb..3ac887565 100644
--- a/apps/docs/docs/quickstart.md
+++ b/apps/docs/docs/quickstart.md
@@ -234,16 +234,21 @@ does not.
| Profile | Services |
| --- | --- |
-| *(default — CORE)* | **postgres** (5432) · **redis** (6379) · **zookeeper** · **kafka** (9092) · **qdrant** (6333) · **litellm** (4000, LLM gateway) · **ollama** (11434, local model) · **ollama-pull** (one-shot model fetch) · **ingest-worker** (8081, Go) · **fusion** (8003) · **api** (8000) · **agents** (8001) · **threatintel** (8005) · **realtime** (8086) · **web** (3000) |
-| `full` | **clickhouse** (8123/9000) · **neo4j** (7474/7687) · **opensearch** (9200) · **ueba** (8007) · **connectors** (8088) · **enrichment** (8080, Go) · **kafka-ui** (8090) · **actions** (8002) |
+| *(default — CORE)* | **postgres** (5432) · **redis** (6379) · **zookeeper** · **kafka** (9092) · **qdrant** (6333) · **litellm** (4000, LLM gateway) · **ollama** (11434, local model) · **ollama-pull** (one-shot model fetch) · **ingest-worker** (8081, Go) · **fusion** (8003) · **api** (8000) · **agents** (8001) · **threatintel** (8005) · **realtime** (8086) · **web** (3000) · **connectors** (8088) · **actions** (8002) |
+| `full` | **clickhouse** (8123/9000) · **neo4j** (7474/7687) · **opensearch** (9200) · **ueba** (8007) · **enrichment** (8080, Go) · **kafka-ui** (8090) |
| `extras` | **honeytokens** (8008) · **purple-team** (8006) |
-| `chatops` | **slack-bot** (8009) · **actions** (8002) |
+| `chatops` | **slack-bot** (8009) |
| `monitoring` | **prometheus** (9091) · **grafana** (3001) · **alertmanager** (9094) · **tempo** (3200) · **otel-collector** (4317/4318) |
| `osquery` | **osquery-tls** (8091) |
-CORE is 14 long-running services — 15 counting `ollama-pull`, which fetches
-the model once and exits — and `full` is 22; `actions` is in both `full` and
-`chatops`, so it is counted once. Named profiles compose, so
+CORE is 16 long-running services, or 17 counting `ollama-pull`, which fetches
+the model once and exits, and `full` is 22. `connectors` and `actions` moved
+into CORE because the API service in CORE already pointed at both and
+federated search defaults on, so the capability was enabled and aimed at a
+hostname that does not resolve; the measured cost of moving them is 124.8 MiB
+([ADR-0007](https://github.com/beenuar/AiSOC/blob/main/docs/decisions/0007-connectors-and-actions-in-core.md)).
+They are now in no profile, which means every profile run includes them, so
+`chatops` still gets `actions` for `slack-bot`. Named profiles compose, so
`docker compose --profile full --profile extras up -d` is valid; it just does
not wait for health the way `make up-full` does.
diff --git a/docker-compose.yml b/docker-compose.yml
index 0d2069203..4e1db513e 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -822,11 +822,21 @@ services:
restart: unless-stopped
actions:
- # Response execution. Governed and copilot-default; nothing in CORE
- # dispatches to it, so it is not part of the minimal pipeline. Carries the
- # `chatops` profile too because slack-bot depends on it, and a profile
- # whose dependency is not in the same profile fails to render at all.
- profiles: ["full", "chatops"]
+ # Response execution, and the only service that holds the read-only vendor
+ # verbs an investigation pivots through.
+ #
+ # This was `profiles: ["full", "chatops"]` on the reasoning that nothing in
+ # CORE dispatches to it. Two things were wrong with that. The `api` service
+ # in CORE already sets AISOC_ACTIONS_BASE_URL to this hostname, so the
+ # live-actions surface was enabled and pointed at a name that does not
+ # resolve; and the investigation agent's vendor read tools dispatch here,
+ # so on the default profile the agent had no way to reach a customer's EDR
+ # or IdP at all. Measured cost of moving it: 48.3 MiB resident, 539 MB of
+ # image. See docs/decisions/0007-connectors-and-actions-in-core.md.
+ #
+ # No `profiles:` key rather than a longer list: a service in no profile is
+ # included in every profile run, so `chatops` still gets it and
+ # slack-bot's dependency still renders.
build:
context: ./services/actions
dockerfile: Dockerfile
@@ -856,8 +866,19 @@ services:
restart: unless-stopped
connectors:
- # full profile — Scheduled vendor polling. CORE accepts events over the ingest HTTP API instead.
- profiles: ["full"]
+ # Scheduled vendor polling, the 84-connector registry, and the fan-out
+ # target for federated SIEM search.
+ #
+ # This was `profiles: ["full"]` on the reasoning that CORE accepts events
+ # over the ingest HTTP API instead. That is true of ingest and says nothing
+ # about the other two jobs: `api` in CORE sets CONNECTORS_SERVICE_URL to
+ # this hostname and AISOC_FEATURE_FED_SEARCH defaults on, so federated
+ # search fanned out to a name that does not resolve. Measured cost of
+ # moving it: 76.5 MiB resident, 586 MB of image. See
+ # docs/decisions/0007-connectors-and-actions-in-core.md.
+ #
+ # The poll scheduler is per-instance, so a fresh install schedules nothing
+ # until an operator saves a connector.
build:
context: ./services/connectors
dockerfile: Dockerfile
diff --git a/docs/audit/CLAIM_TO_GATE_MATRIX.md b/docs/audit/CLAIM_TO_GATE_MATRIX.md
index 40838b0b4..c191d5f71 100644
--- a/docs/audit/CLAIM_TO_GATE_MATRIX.md
+++ b/docs/audit/CLAIM_TO_GATE_MATRIX.md
@@ -181,10 +181,11 @@ Statuses: `GATED` (a CI job fails when the claim stops being true) · `PARTIAL`
| A scheduled sweep tells a condition that will never resolve from one that might, and says which | `apps/docs/docs/operations/shadow-mode.md` (What stops it, and whether waiting helps); `services/actions/app/api/shadow_reconcile_router.py` | `ci.yml` actions job (`test_shadow_reconcile_route.py::TestPermanentIsNotTransient` - the vendor's own status decides, so all four of 400/401/403/404 answer 422 naming the operator action while 500/502/503/504 and a timeout answer 502 without it, and a 429 forwards the vendor's own `Retry-After` rather than a guess; a reader that could not build a client is refused before the matcher is reached, because an empty window reads as "these analysts closed nothing") + `ci.yml` api job (`test_shadow_reconcile_sweep.py::TestPermanentIsNotTransient` - a permanent refusal blocks the connector and stops polling it, a transient one never blocks and leaves the watermark untouched, an undecryptable credential blocks before the vendor is called at all, and a deployment-level refusal halts the whole pass rather than writing "needs an operator" onto every connector. Unblocking is asserted to require the connector row changing and nothing weaker, so a revoked credential resumes on the one event that could have fixed it) | GATED | The classification is drawn from the vendor's HTTP status. A vendor that answers 200 with an error body, or 500 for a permanently bad query, is classified by what it said rather than by what it meant |
| The sweep is bounded work against a customer's API: it keeps a watermark, honours rate limits and never re-reads a window forever | `apps/docs/docs/operations/shadow-mode.md` (What it does to your SIEM); `services/api/migrations/068_shadow_reconcile_state.sql` | `ci.yml` api job (`test_shadow_reconcile_sweep.py::TestRateLimitingAndTheWatermark` - the watermark advances to the latest closure actually seen rather than to the end of the window asked for, so a vendor that indexes late does not have findings stepped over; an **empty** window still advances it, minus the overlap, so quiet hours are not re-read forever; a window is capped so a connector blocked for a month catches up in steps rather than asking for the month in one search; a first pass starts when measurement started rather than at the beginning of the vendor's retention; the per-connector floor and the per-tick cap are both asserted to withhold a poll; and a `Retry-After` is stored and honoured. `test_a_transient_failure_leaves_the_watermark_alone` asserts a failure cannot look like progress) | GATED | Every limit is asserted against the sweep's own decision to poll. Whether the defaults are the *right* numbers for a given SIEM is a judgement: they are configurable and the docs table publishes each one beside what it bounds |
| The API scores a replay with the grader the benchmark package ships, not a second copy of it | `services/api/app/_vendor/aisoc_benchmark/VENDORED.md` | `ci.yml :: vendored-sync` (`scripts/sync_vendored_benchmark.py --check` — every module of `packages/aisoc-benchmark/aisoc_benchmark/` must be byte-identical in `services/api/app/_vendor/aisoc_benchmark/`, checked in **both** directions so a module present only in the mirror fails too, and refusing to report a clean mirror when the source directory yields no modules) | GATED | A mirror rather than an import, because the `aisoc-core-api` image is built with `./services/api` as its context and nothing under `packages/` exists at runtime. Same constraint that produced `_vendor/narrative.py` and `_vendor/nl_query/`. A second grader would eventually disagree with the first about what "hallucination rate" means while both kept calling themselves the same number |
+| The published count of services each compose profile starts is what the compose file starts | README L130-132 (profile table); `apps/docs/docs/architecture.md`; `apps/docs/docs/quickstart.md`; `docs/audit/REPOSITORY_REALITY.md`; [ADR-0007](../decisions/0007-connectors-and-actions-in-core.md) | `ci.yml` gates job (`scripts/check_profile_service_counts.py`: ten published figures across four documents are compared against the profile membership parsed out of `docker-compose.yml`, with compose's "a service in no profile is in every profile" semantic implemented rather than assumed, and one-shot containers counted separately from long-running ones because "long-running services" is the figure the documents publish. Fails in **both** directions: a count that disagrees, and a watched figure that has vanished from a document, so deleting the claim fails as a stale entry rather than passing because nothing matched. Also asserts `actions` is reachable from the `chatops` profile, since `slack-bot` depends on it and compose refuses to render a file whose dependency is outside the profile being started, which is the specific state ADR-0007 created by putting `actions` in no profile at all. Proven able to fail by re-staling the README's core figure to 14) | GATED | The counts are gated; the **memory** figures in ADR-0007 are point-in-time measurements on one machine and no gate can re-measure them in CI. They are published with the host, the engine version and the date, and the ~8 GB README figure is deliberately left unmoved because 124.8 MiB does not move a number published to one significant figure |
## Summary
-- GATED: 165
+- GATED: 166
- PARTIAL: 8
- NO GATE: 0 (**every claim is backed by a failing test.** The last NO GATE — the weekly benchmark scoreboard running live against `main` — closed in Phase E1: `scripts/check_scoreboard.py` ties the published scoreboard to a deterministic per-PR live-agent MITRE-accuracy run, while the funded weekly `wet-eval.yml` appends the LLM-tier rows. The remaining PARTIAL rows are honest, named deferrals — each states the specific gap and what closes it — not unproven claims.)
diff --git a/docs/audit/REPOSITORY_REALITY.md b/docs/audit/REPOSITORY_REALITY.md
index 67fdae5c3..2840ea3d6 100644
--- a/docs/audit/REPOSITORY_REALITY.md
+++ b/docs/audit/REPOSITORY_REALITY.md
@@ -227,7 +227,7 @@ Stated rather than guessed:
## Reproducing this audit
```bash
-make up # CORE profile: 14 long-running services (+ a one-shot model pull)
+make up # CORE profile: 16 long-running services (+ a one-shot model pull)
make doctor # every dependency probed, not just "running"
make smoke # one real event through the real pipeline
make stats # recount every published figure from the tree
diff --git a/docs/decisions/0007-connectors-and-actions-in-core.md b/docs/decisions/0007-connectors-and-actions-in-core.md
new file mode 100644
index 000000000..0e9e37e82
--- /dev/null
+++ b/docs/decisions/0007-connectors-and-actions-in-core.md
@@ -0,0 +1,165 @@
+# ADR-0007: `connectors` and `actions` belong in the CORE profile
+
+- **Status:** accepted
+- **Date:** 2026-09-26
+- **Supersedes:** the `profiles: ["full"]` marking on `connectors` and the `profiles: ["full", "chatops"]` marking on `actions` in `docker-compose.yml`
+- **Related:** [ADR-0006](./0006-llm-gateway-in-core.md), which moved the LLM gateway and then the local model into CORE on the same kind of reasoning and with the same method of measurement
+
+## Context
+
+Gap-closure Phase 4 gives the investigation agent tools that reach the
+customer's own SIEM and EDR rather than only AiSOC's event lake. The plan
+that asks for it also records why the work is close to pointless on the
+default profile:
+
+> On the default CORE profile the agent has no evidence source at all: the
+> lake, the graph, `connectors` and `actions` all run in `full`.
+
+Two of those four are this ADR's subject. The plan requires a measured answer
+rather than an opinion, and it forbids adding a container to CORE without one:
+CORE needs 8 GB, and every service in it is paid for by every self-hoster.
+
+There is a sharper version of the problem than "a feature is absent". CORE
+already **configures** both services and then does not start them. `api` in
+`docker-compose.yml` carries
+`CONNECTORS_SERVICE_URL: http://connectors:8003` and
+`AISOC_ACTIONS_BASE_URL: http://actions:8085`, and
+`AISOC_FEATURE_FED_SEARCH` defaults to `True` in
+`services/api/app/core/config.py`. So on the profile `make up` starts, the
+federated-search route is enabled and fans out to a hostname that does not
+resolve, and the live-actions proxy answers 502 with a message that names the
+profiles an operator would have to switch to. The capability is not switched
+off in CORE. It is switched on and pointed at nothing.
+
+## What was measured, rather than assumed
+
+Same method as ADR-0006, on the same class of machine: images pulled from
+GHCR, resident memory read with `docker stats --no-stream`.
+
+Host: macOS, Docker Engine 29.5.2, 15.58 GiB available to the engine.
+Images pulled fresh on 2026-09-26.
+
+| | Image on disk | Cold-start idle, 45 s after boot | Serving 100 requests | Steady state, 40 h uptime |
+|---|---|---|---|---|
+| `aisoc-actions` | **539 MB** | **45.99 MiB** | 46.3 MiB | **48.3 MiB** |
+| `aisoc-connectors` | **586 MB** | **71.45 MiB** | 71.98 MiB | **76.51 MiB** |
+| **both** | **1.13 GB** | **117.4 MiB** | 118.3 MiB | **124.8 MiB** |
+
+For scale, measured on the same host in the same run:
+
+| Service already in CORE | Resident |
+|---|---|
+| `litellm` | 471.1 MiB |
+| `agents` | 223.7 MiB |
+| `api` | 213.9 MiB |
+| `web` | 86.2 MiB |
+| `fusion` | 58.1 MiB |
+
+The `litellm` figure is the useful cross-check: ADR-0006 measured it at
+451 MiB and this run reads 471 MiB, so the method reproduces within about 4%.
+
+Two properties were verified rather than assumed, because ADR-0006's mistake
+was moving a gateway that then had no model behind it:
+
+- **Both boot and serve with no configuration.** `actions` answers `/health`
+ with 200 and `GET /api/v1/live-actions` with 200 and its full capability
+ list. `connectors` answers `GET /api/v1/connectors` with 200 and all **84**
+ connectors. Neither needs a credential, a vendor account or a key to reach
+ a serving state, so adding them cannot break a keyless install.
+- **The idle figure is not hiding a serving spike.** This was the trap in
+ ADR-0006: `ollama` idles at 9.6 MiB and measures 2.96 GiB while running
+ inference, so its idle number was the misleading half of the truth. Neither
+ service here moves more than 0.6 MiB under 100 requests. They are network
+ front ends over vendor HTTP APIs, and they hold no model and no index.
+
+**124.8 MiB is 1.5% of CORE's 8 GB budget.** The 1.13 GB of image is 5.6% of
+the 20 GB disk figure CORE already publishes.
+
+## Decision
+
+**Move `connectors` and `actions` into CORE**, by deleting their `profiles:`
+keys so they start with `docker compose up` and `make up`.
+
+`actions` keeps no profile list at all rather than keeping `chatops`: a
+service in no profile is included in every profile run, so `chatops` still
+gets it and `slack-bot`'s dependency still renders.
+
+### Why not keep both in `full`
+
+Because the alternative to adding them is not "CORE stays lean". It is
+"CORE keeps advertising a capability it cannot perform". An evaluator
+following the documented first run reaches the federated-search page and the
+live-actions surface and gets a 502 naming two compose profiles. Fixing that
+by *removing* the configuration would be honest, but it trades a broken
+capability for an absent one, and it would leave Phase 4's agent tools
+reachable only on a profile the quickstart does not describe.
+
+The measured price of not making that trade is 1.5% of the budget.
+
+### Why not a module inside an existing service
+
+The plan says to prefer a module inside an existing service where that is the
+honest answer, and here it is not.
+
+`services/actions` owns twenty-three vendor clients, the executor registry,
+the credential-key translation at the dispatch boundary and the blast-radius
+gate. `services/connectors` owns the 84-connector registry, each connector's
+`normalize()` and the poll scheduler. A module in the API reproducing either
+would be a second copy of the thing that decides what a customer's Splunk row
+means or what may be done to their estate, and this repository has paid for
+second copies of exactly these two several times: a dry-run credential-strip
+list that had drifted from what the client factory read, a bundled connector
+catalog that was wrong by 58 entries for as long as nobody compared it by
+hand, and a capability mirror that needs a CI check to stay in step.
+
+The honest answer is that these are already the right two services. What was
+wrong was the profile they were declared in.
+
+### Why not start them conditionally
+
+ADR-0006 rejected a Makefile conditional for two reasons that apply
+unchanged: it relocates the manual step rather than removing it, and it makes
+`make up` and `docker compose up` disagree about what is running. A condition
+here would also be unanswerable, because the thing it would test, whether
+this tenant has a vendor connector, is a database row that does not exist until
+after the stack is up.
+
+## Consequences
+
+- CORE goes from **14 services to 16**. `full` stays at 22, because both
+ services were already in it. Verified with `docker compose config
+ --services` on both profiles, and with `--profile chatops` to confirm
+ `actions` is still there for `slack-bot`. The README profile table is
+ corrected rather than left stale.
+- The README's RAM figure stays at **~8 GB**. 124.8 MiB does not move a
+ figure published to one significant figure, and inflating it to ~8.2 GB
+ would imply a precision the other rows do not have. The disk figure stays
+ at 20 GB for the same reason: 1.13 GB against 20 GB.
+- Federated SIEM search and the live-actions surface work on the default
+ profile the moment a tenant configures a connector, with no profile change.
+- **What an evaluator with no vendor account gains is the path, not the
+ data.** Both surfaces still show nothing until a real Splunk, Sentinel,
+ Elastic, QRadar, CrowdStrike, Defender, Okta, SentinelOne, Entra or Google
+ Workspace credential is saved. Phase 4's tool advertisement is scoped to
+ the tenant's configured backends, so on a fresh CORE install the agent is
+ offered no customer tools and says so. That is the honest behaviour and it
+ is unchanged by this ADR. The difference is that configuring a vendor now
+ works on CORE instead of requiring a profile switch nobody was told about.
+- The connector poll scheduler now runs on the default profile. It is
+ per-instance and there are no instances in a fresh install, so it schedules
+ nothing until an operator saves a connector. That is the same trigger the
+ `full` profile has always used.
+
+## What this ADR does not decide
+
+**The lake and the graph stay in `full`.** They are the other half of the
+sentence quoted at the top and they are not in scope here, for a reason that
+the numbers above make concrete rather than for convenience: ClickHouse and
+Neo4j are stateful stores with their own memory floors, not network front
+ends, so they are a different decision needing its own measurement. The
+consequence is recorded plainly so nobody reads this ADR as having closed the
+whole gap: after this change a CORE deployment's investigation agent can
+reach a configured vendor and still cannot reach an event lake, because there
+is no event lake in CORE. The eleven lake pivots report that their data class
+is not available, which is the behaviour Phase 4's tool handling requires and
+is not the same thing as an empty result.
diff --git a/docs/decisions/README.md b/docs/decisions/README.md
index 4e9314687..7cd3596b3 100644
--- a/docs/decisions/README.md
+++ b/docs/decisions/README.md
@@ -18,6 +18,9 @@ ADRs are immutable once accepted. If a decision changes, write a new ADR that su
| [ADR-0002](./0002-compliance-claims.md) | Compliance claims — "controls aligned to" until a Type I audit lands | accepted | 2026-06-28 |
| [ADR-0003](./0003-mssp-pricing-shape.md) | MSSP pricing — keep three public tiers, treat MSSP as an Enterprise mode with its own narrative page | accepted | 2026-06-28 |
| [ADR-0004](./0004-live-demo-strategy.md) | Live demo — replace the Cloudflare Tunnel with an always-on Fly.io deploy via the managed-mode pipeline | accepted | 2026-06-28 |
+| [ADR-0005](./0005-storage-consolidation.md) | Tiered storage consolidation + a $/TB cost model | accepted | 2026-07-12 |
+| [ADR-0006](./0006-llm-gateway-in-core.md) | The LLM gateway belongs in the CORE profile | accepted | 2026-09-24 |
+| [ADR-0007](./0007-connectors-and-actions-in-core.md) | `connectors` and `actions` belong in the CORE profile | accepted | 2026-09-26 |
## Authoring conventions
diff --git a/scripts/check_profile_service_counts.py b/scripts/check_profile_service_counts.py
new file mode 100644
index 000000000..5e42d3100
--- /dev/null
+++ b/scripts/check_profile_service_counts.py
@@ -0,0 +1,269 @@
+#!/usr/bin/env python3
+"""Gate: the published compose-profile service counts match the compose file.
+
+Five documents publish how many services each profile starts, and until this
+gate existed nothing compared any of them to ``docker-compose.yml``. That is
+the shape this repository keeps paying for: a number copied into prose goes
+stale silently, and a reader has no way to tell a current figure from one that
+was true two releases ago. ADR-0006 found exactly this while editing the same
+table for a different reason: the published ``full`` count was 30, which is
+every profile at once rather than what ``make up-full`` starts.
+
+Derived from the YAML rather than from ``docker compose config``, for two
+reasons. CI has no Docker daemon in the jobs that would want to run this, and
+``docker compose`` resolves ``.env``, so the answer would depend on the
+caller's environment rather than on the tree.
+
+What it checks, in both directions:
+
+ 1. Every documented count equals the count the compose file implies.
+ 2. Every profile a document names still exists in the compose file, so a
+ renamed profile fails as a stale reference rather than passing because
+ nothing matched it.
+ 3. ``actions`` is reachable from the ``chatops`` profile, because
+ ``slack-bot`` declares a dependency on it and a compose file whose
+ dependency is outside the profile fails to render at all. ADR-0007 moved
+ ``actions`` out of every profile list to satisfy this, and "it is in no
+ list" is precisely the state a future edit would undo by adding one back.
+
+Run: python3 scripts/check_profile_service_counts.py
+ python3 scripts/check_profile_service_counts.py --inventory
+ python3 scripts/check_profile_service_counts.py --self-test
+
+Exit codes: 0 clean, 1 a published count is wrong, 2 the scan could not run.
+"""
+
+from __future__ import annotations
+
+import argparse
+import re
+import sys
+from pathlib import Path
+
+sys.path.insert(0, str(Path(__file__).resolve().parent))
+
+from gate_toolkit import repo_root, self_test_if_requested
+
+self_test_if_requested(__file__)
+
+REPO_ROOT = repo_root()
+COMPOSE = REPO_ROOT / "docker-compose.yml"
+
+#: One-shot containers that run to completion and exit. Counted separately
+#: because "long-running services" is the figure the documents publish, and
+#: folding a container that exits into it would overstate what is resident.
+ONE_SHOT: frozenset[str] = frozenset({"ollama-pull"})
+
+#: Where a count is published, and how to find it. Each entry is
+#: ``(path, profile, regex)`` where the regex has one group holding the
+#: number. Deliberately a list of exact sites rather than a search for any
+#: integer near the word "services": a gate that guesses which numbers are
+#: claims would either miss the one that matters or flag prose forever.
+CLAIM_SITES: tuple[tuple[str, str, str], ...] = (
+ ("README.md", "core", r"\|\s*\*\*core\*\*\s*\|\s*`make up`\s*\|\s*(\d+)\s*\|"),
+ ("README.md", "full", r"\|\s*\*\*full\*\*\s*\|\s*`make up-full`\s*\|\s*(\d+)\s*\|"),
+ ("README.md", "core", r"\|\s*\*\*demo\*\*\s*\|\s*`make up && make demo`\s*\|\s*(\d+)\s*\|"),
+ (
+ "apps/docs/docs/architecture.md",
+ "core",
+ r"\|\s*\*\*core\*\*\s*\|\s*`make up`\s*\|\s*(\d+)\s*\|",
+ ),
+ (
+ "apps/docs/docs/architecture.md",
+ "full",
+ r"\|\s*\*\*full\*\*\s*\|\s*`make up-full`\s*\|\s*(\d+)\s*\|",
+ ),
+ (
+ "apps/docs/docs/architecture.md",
+ "core",
+ r"CORE is (\d+) long-running containers",
+ ),
+ (
+ "apps/docs/docs/architecture.md",
+ "full",
+ r"`full` is (\d+) long-running containers",
+ ),
+ (
+ "apps/docs/docs/quickstart.md",
+ "core",
+ r"CORE is (\d+) long-running services",
+ ),
+ (
+ "apps/docs/docs/quickstart.md",
+ "full",
+ r"and `full` is (\d+)",
+ ),
+ (
+ "docs/audit/REPOSITORY_REALITY.md",
+ "core",
+ r"CORE profile: (\d+) long-running services",
+ ),
+)
+
+
+class ScanError(RuntimeError):
+ """The compose file could not be read or parsed."""
+
+
+def _parse_services(text: str) -> dict[str, list[str] | None]:
+ """Service name to its declared profile list, or ``None`` for no list.
+
+ Hand-parsed rather than via PyYAML because several gates here run on a
+ bare interpreter before any ``pip install``, and ``gate_toolkit`` exists
+ to keep that true. The shape being read is narrow: two-space-indented
+ service keys under a top-level ``services:``, and a ``profiles:`` key
+ four spaces in, in either inline (``["a", "b"]``) or block (``- a``)
+ form. Both forms appear in this file.
+ """
+ services: dict[str, list[str] | None] = {}
+ in_services = False
+ current: str | None = None
+ collecting_block: bool = False
+
+ for raw in text.splitlines():
+ if re.match(r"^services:\s*$", raw):
+ in_services = True
+ continue
+ if not in_services:
+ continue
+ # A new top-level key ends the services block.
+ if raw and not raw.startswith((" ", "\t")) and not raw.startswith("#"):
+ break
+
+ service = re.match(r"^ ([A-Za-z0-9][A-Za-z0-9._-]*):\s*$", raw)
+ if service:
+ current = service.group(1)
+ services.setdefault(current, None)
+ collecting_block = False
+ continue
+
+ if current is None:
+ continue
+
+ inline = re.match(r"^ profiles:\s*\[(.*)\]\s*$", raw)
+ if inline:
+ services[current] = re.findall(r"[A-Za-z0-9._-]+", inline.group(1))
+ collecting_block = False
+ continue
+
+ if re.match(r"^ profiles:\s*$", raw):
+ services[current] = []
+ collecting_block = True
+ continue
+
+ if collecting_block:
+ item = re.match(r"^ -\s*([A-Za-z0-9._-]+)\s*$", raw)
+ if item:
+ bucket = services[current]
+ if bucket is None: # pragma: no cover - set to [] just above
+ bucket = services[current] = []
+ bucket.append(item.group(1))
+ continue
+ collecting_block = False
+
+ return services
+
+
+def _profile_members(services: dict[str, list[str] | None], profile: str) -> set[str]:
+ """Services a ``--profile <profile>`` run starts.
+
+ A service with no ``profiles:`` key is started by every run, which is the
+ compose semantic ADR-0007 relies on. ``core`` is spelled as a profile here
+ for symmetry with the documents, and means "no named profile".
+ """
+ members = {name for name, profiles in services.items() if not profiles}
+ if profile != "core":
+ members |= {name for name, profiles in services.items() if profiles and profile in profiles}
+ return members
+
+
+def _long_running(members: set[str]) -> int:
+ return len(members - ONE_SHOT)
+
+
+def _declared_profiles(services: dict[str, list[str] | None]) -> set[str]:
+ return {p for profiles in services.values() if profiles for p in profiles}
+
+
+def scan() -> tuple[dict[str, int], dict[str, set[str]], list[str]]:
+ """Returns (counts by profile, members by profile, errors)."""
+ if not COMPOSE.is_file():
+ raise ScanError(f"no compose file at {COMPOSE}")
+ text = COMPOSE.read_text(encoding="utf-8")
+ services = _parse_services(text)
+ if not services:
+ raise ScanError(f"parsed zero services out of {COMPOSE}; the format this gate reads has changed")
+
+ errors: list[str] = []
+ profiles = ("core", *sorted(_declared_profiles(services)))
+ members = {p: _profile_members(services, p) for p in profiles}
+ counts = {p: _long_running(members[p]) for p in profiles}
+
+ for rel, profile, pattern in CLAIM_SITES:
+ path = REPO_ROOT / rel
+ if not path.is_file():
+ errors.append(f"{rel}: published a profile count and the file is gone")
+ continue
+ if profile not in counts:
+ errors.append(f"{rel}: names profile {profile!r}, which no service in docker-compose.yml declares")
+ continue
+ found = re.search(pattern, path.read_text(encoding="utf-8"))
+ if found is None:
+ errors.append(
+ f"{rel}: the {profile!r} count this gate watches is no longer there "
+ f"(pattern {pattern!r}). Either the figure moved, in which case update "
+ f"CLAIM_SITES, or it was deleted and the entry is stale."
+ )
+ continue
+ published = int(found.group(1))
+ if published != counts[profile]:
+ errors.append(
+ f"{rel}: publishes {published} services for the {profile!r} profile; "
+ f"docker-compose.yml has {counts[profile]} long-running "
+ f"({', '.join(sorted(members[profile] - ONE_SHOT))})"
+ )
+
+ # slack-bot depends on actions, and compose refuses to render a file whose
+ # dependency sits outside the profile being started. ADR-0007 satisfies
+ # this by putting actions in no profile at all; a later edit adding it
+ # back to a list would break `--profile chatops` for everyone.
+ if "chatops" in members and "actions" in services and "actions" not in members["chatops"]:
+ errors.append(
+ "actions is not reachable from the chatops profile, and slack-bot depends on it; "
+ "`docker compose --profile chatops` will refuse to render"
+ )
+
+ return counts, members, errors
+
+
+def main(argv: list[str] | None = None) -> int:
+ parser = argparse.ArgumentParser(description=__doc__)
+ parser.add_argument("--inventory", action="store_true", help="print the per-profile membership and exit 0")
+ args = parser.parse_args(argv)
+
+ try:
+ counts, members, errors = scan()
+ except ScanError as exc:
+ print(f"profile-service-counts: {exc}", file=sys.stderr)
+ return 2
+
+ if args.inventory:
+ for profile in sorted(counts):
+ print(f"{profile:12s} {counts[profile]:3d} {', '.join(sorted(members[profile]))}")
+ return 0
+
+ if errors:
+ print("PROFILE SERVICE COUNT GATE FAILED:", file=sys.stderr)
+ for error in errors:
+ print(f" - {error}", file=sys.stderr)
+ return 1
+
+ print(
+ f"profile-service-counts: OK, core {counts['core']}, full {counts.get('full', 0)}, "
+ f"{len(CLAIM_SITES)} published figures agree with docker-compose.yml"
+ )
+ return 0
+
+
+if __name__ == "__main__":
+ raise SystemExit(main())