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.
Python agentic-aiai-securityalert-triageblue-teamcybersecuritydetection-engineeringincident-responselanggraphllm-agentsmcpmitre-attackmodel-context-protocolpurple-teamsecurity-operationsself-hostedsiemsoarsocthreat-detectionthreat-intelligence
docs: publish v12.0.0 as current and gate the version against going stale (#963)
Beenu Arora7d5138fb0012
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 77239ca63..929fa5703 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -33,6 +33,99 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0### Fixed+- **`RELEASES.md` announced v11.2.0 as the current release for the whole of+ v12.0.0, and every figure gate in the repository was green while it did.**+ The TL;DR read "AiSOC is on `v11.2.0`, released 2026-09-26", the "What's+ new" section opened "`VERSION` is `11.2.0`", and there was no `## v12.0.0`+ section at all — so the file whose job is to say what shipped was wrong+ about the most basic fact it carries, including on the BREAKING items a+ reader most needs before upgrading.++ **Why it survived.** `scripts/readme_gates.py` already re-derives two+ figures for `RELEASES.md` — the executable-rule count from the generated+ truth table, and the claim-gate tally from the matrix rows — and the file+ passed both. It had **no version check of any kind**, so the one number+ that changes on every release was the one number nothing compared against+ `VERSION`. `gate_current_version()` now reads the three sentence shapes+ that present a version as the current one: `AiSOC is on vX.Y.Z`,+ ``VERSION` is `X.Y.Z``, and the README's shields.io badge.++ **What it deliberately does not read.** A figure gate over every version+ string in these documents would be unusable, because `RELEASES.md` names+ ten superseded releases on purpose and each opens in the past tense+ (``VERSION` was `11.0.0``). The check reads only the present-tense forms,+ which is the same idea as the existing `_HISTORICAL_QUOTE` exemption+ arrived at from the other direction.++ It also does **not** reuse that exemption, and that is the load-bearing+ decision rather than an omission. `_is_historical` exempts a whole line,+ and the stale TL;DR is a single long line that legitimately dates a+ *different* figure in the same sentence ("at the v11.2.0 cut: 147 rows").+ Applying it would have skipped the stale version claim eighty words to its+ left — the exact text the gate was written for — so the new patterns carry+ their own scoping instead of borrowing a neighbour's. A test injects that+ shape and requires it to fail.++ Proven against the pre-fix tree rather than assumed: run at `dd072a75`, the+ new check exits 1 naming both statements, while that commit's own+ `readme_gates.py` reports `readme-gates: OK` on the identical text.++ v12.0.0 is now published in `RELEASES.md` and `ROADMAP.md`, and v11.2.0 is+ demoted to a past-tense section carrying its own dated tally unchanged.++- **Five documents published figures that had drifted from the artefacts they+ cite, three of them while saying they could not.**+ `docs/contributing/detection-translation-drive.md` introduces its table as+ copied from a CI-gated source "so it cannot drift" and read `native+ 869/869` and `sigma (imported) 3132/77` against a generated truth table+ holding `877/833` and `3132/1770`. The gate holds the *generated* file to+ what the engine loads; nothing held that page to the generated file. Its+ headline said 947 of 6,983 rules fire against a real 2,603 of 6,991.++ The advice was staler than the numbers, which matters more for a page whose+ purpose is directing a first contribution: it offered "3,055 quarantined+ Sigma rules against 77 already translated" as easy bulk work, when 1,770+ now compile and the remaining **1,362 were each refused with a recorded+ reason**. Picking an arbitrary quarantined rule now likely lands on one+ refused on purpose — 464 of them are negations that must stay refused,+ because Sigma reads `not filter` as true when the field is absent. The page+ now points at the refusal table and names the leverage: 556 need a+ connector that emits their log source, and several groups are one matcher+ feature standing in front of a whole family.++ The four `docs/design/landing-page-*` documents carried 69 connectors,+ 6,998 detections, 7,117 marketplace items and 57 plugins. These are not+ inert design notes: five shipped landing-page components name them as the+ verbatim copy source. They now read 84 connectors across 9 categories,+ 2,603 executable of 6,991 on disk, 7,155 marketplace items, 77 plugins and+ 62 packs. Where a recipe gave a literal (`value={6998}`) it now names the+ generated constant the components already import, so the next corpus change+ moves the page without an edit.++- **`ROADMAP.md` pointed its v11.2 section at the wrong changelog anchor and+ had no v12.0 section**, so the newest release was absent from the roadmap+ while the previous one linked to its notes. Three labels were corrected+ without inventing scope. The mobile responder line asserted "no React+ Native code exists in the tree" — `apps/mobile` declares `react-native` and+ Expo, and the same file already recorded the PWA and `apps/mobile` as+ shipped in v9.0 two hundred lines earlier, so the document contradicted+ itself; it now states what shipped and that what remains is a device build,+ a store submission and APNs/FCM credentials, which are account actions. The+ marketplace-v3 item read "deferred past v8.0" through five majors: it is an+ open, unscheduled scope decision that was never scheduled against a+ release, and dating the label made it look like a slipped commitment.+ Phase 7 still pointed at `docs/audit/PROGRESS.md`, which is in+ `.gitignore`, was never committed, and is called out as exactly that by+ line 22 of the same file — repointed at `DEFERRED_SUBPHASES.md`, where 7b++ is genuinely scoped. Phase 10's "all 69 connectors" is date-scoped rather+ than rewritten, since the generated conformance matrix now reads 84 / 84.+ Phase 4 stays unchecked: what it needs is a funded provider key, not code.++- **A duplicate empty `## Summary` heading sat above the real one** in+ `docs/audit/CLAIM_TO_GATE_MATRIX.md`. Removed without touching a table row,+ a status, or the blank-line discipline the parser depends on; the tally is+ unchanged at 236 rows — 228 GATED, 8 PARTIAL, 0 NO GATE.+- **The marketplace answered 503 in every container, on every release sincethe endpoint was written.** Reported against an on-premise Docker Composedeployment in [#374](https://github.com/beenuar/AiSOC/discussions/374). Twodiff --git a/RELEASES.md b/RELEASES.mdindex 8f38bfa4b..136eb44a3 100644--- a/RELEASES.md+++ b/RELEASES.md@@ -2,13 +2,34 @@This file mirrors what used to live in the "What's new" section of [`README.md`](README.md). The complete, machine-readable inventory (with file paths, env-var diffs, and per-release test counts) lives in [`CHANGELOG.md`](CHANGELOG.md).-> **TL;DR for first-time visitors:** AiSOC is on `v11.2.0`, released 2026-09-26 — the release where the detection engine went from 833 rules to **2,603**, and every one of the 1,770 added rules was watched to fire before it shipped. The library had held roughly 7,000 ATT&CK-mapped rules for months while 833 ran, and the reason turned out to be one thing: Windows events nest their payload under `System`/`EventData`, one level below anything the engine flattened, so `CommandLine` and `Image` read `None` and no Windows rule could fire however correctly it was written. Fixed in the connector; the engine and matcher are byte-identical. 1,362 imported rules were **refused** with recorded reasons, which matters as much as the 1,770 accepted. **It is a minor: nothing here forces an operator to act** — but the detection surface is 3.1x wider, so a deployment with Windows telemetry should expect more alerts from the same stream. Every product claim is backed by a failing CI test (claim-to-gate matrix at the v11.2.0 cut: 147 rows — 139 GATED / 8 PARTIAL / 0 NO GATE, counted from the table by `scripts/check_claim_gate_matrix.py`, which is the figure to recount rather than to quote). The latest GitHub release with notes and downloads: <https://github.com/beenuar/AiSOC/releases/latest>.+> **TL;DR for first-time visitors:** AiSOC is on `v12.0.0`, released 2026-09-28 — the release where two services stopped serving unauthenticated and started refusing to serve instead. **Read the BREAKING section of the changelog before upgrading.** The actions service had skipped authentication entirely whenever its token was empty and `AISOC_DEV_MODE` was set, and compose defaults that flag on while nothing generated the token, so every stock install dispatched `isolate_host`, `disable_user`, `block_ip` and `run_script` to anything that could reach the port; the realtime edge verified connection tickets against a constant committed to this repository and treated an unset internal token as authorized; and a `viewer` role could write to cases on all nine write routes where the permission was enforced nowhere. Each was a reported vulnerability — four advisories across the three items — and each now returns 503 or 401 until the credential it needs is set, which is the intended failure and the reason this is a major. The upgrade action for all three is `make up`, because `scripts/ensure_env.py` backfills generated secrets into an **existing** `.env` and not only a new one. Alongside that, hunting stopped being a library of hunts somebody had already written: an agent turns a hypothesis into a plan whose fields and operators are closed enums, so there is no string it can produce that becomes SQL text, and the hunt corpus went from 5 to 68. Every product claim is backed by a failing CI test (claim-to-gate matrix at the v12.0.0 cut: 236 rows — 228 GATED / 8 PARTIAL / 0 NO GATE, counted by `scripts/check_claim_gate_matrix.py`, which is the figure to recount rather than to quote). The latest GitHub release with notes and downloads: <https://github.com/beenuar/AiSOC/releases/latest>.---## What's new-`VERSION` is `11.2.0`. The **v11.2.0** release (2026-09-26) answers a question that had been asked of this repository for months — *why 833 rules and not 5,000?* — and the answer was not a missing feature.+`VERSION` is `12.0.0`. The **v12.0.0** release (2026-09-28) treats the stack a stranger actually starts as the thing that has to be secure. Three of its items are reported vulnerabilities in the deployment this repository ships by default, and none of them needed a credential to reach.++**Read the BREAKING section of the changelog before upgrading.** Two services now refuse to serve rather than serve unauthenticated, and one role loses a permission it was never meant to have. The actions service returns 503 on every mutating route until `AISOC_ACTIONS_SERVICE_TOKEN` is set; the realtime edge rejects every connection until `AISOC_REALTIME_JWT_SECRET` is set and answers 503 on `/internal/*` until `REALTIME_INTERNAL_TOKEN` is set. A deployment that upgrades without those values keeps running and stops responding on those routes, which is the intended failure and the reason this is a major. **The action for all three is `make up`** (or `make env`): `scripts/ensure_env.py` backfills every generated secret into an **existing** `.env` and not only a new one, so the documented path repairs itself. If you deploy by Helm, Terraform or your own compose, generate the three values first and set them on the `api`, `actions` and `realtime` services — `.env.example` documents each one and which services must share it.++**What is measured, and what is not.** The prompt-injection guard was hardened and graded twice so the second number could contradict the first, and it does. On the corpus it was written against, detection went from 66.7% to **98.1%**. On 28 adversarial payloads authored after the guard was committed and never consulted while its patterns were written, it scores **7.1%, and that is the figure to plan against** — the hardening moved the corpus it was tuned on by 31 points and moved unseen payloads by a single payload. Both rates are published with the distinction stated and the held-out one leads, because a reader who stops after the first number leaves with the rate that describes the guard least. The held-out corpus deliberately carries no floor and no ratchet: a target on a held-out set is an instruction to tune against it. **No hosted provider has ever been exercised** — that still needs a funded key which does not exist, and it remains a separate, unmade claim. The npm and PyPI packages are built and packed on every tag and **none of the eight is uploaded**, because the first npm upload of a package needs a token no repository variable can replace; treat any install command for them as unavailable rather than broken.++**v12.0.0 highlights (September 28, 2026)**+- **A stock install dispatched response actions to anyone who could reach the port.** The actions service skipped authentication entirely whenever its service token was empty and `AISOC_DEV_MODE` was set — and compose defaults that flag to `1` while nothing generated the token, so `isolate_host`, `disable_user`, `block_ip` and `run_script` were available unauthenticated on the profile `make up` starts. The realtime edge was the same shape twice over: connection tickets were verified against a constant committed to this repository, and the `/internal/*` guard read an unset token as authorized rather than as unconfigured.+- **A `viewer` token could write to cases.** `cases:write` was withheld from the role deliberately and then enforced on none of the nine write routes in `cases.py`, so the read-only role could mutate a case and launch an investigation. A permission that exists, is documented, and is checked nowhere is indistinguishable from one that was never granted until somebody tries it.+- **Hunting no longer starts from a hunt somebody already wrote.** An analyst gives a hypothesis and the agent fills a plan whose fields and operators are closed enums in the schema it is handed — 17 fields, 8 operators — which a compiler renders into SQL with every model-supplied value bound as a parameter. There is no string the model can produce that becomes SQL text, so injection is not filtered, it is unrepresentable. A lake that could not answer returns a reason and no `rows` key at all, so findings, no findings and could not check stay three outcomes rather than two.+- **The hunt corpus went from 5 hunts to 68, and the grading covering it stopped being satisfiable by accident.** A hunt passed when it fired on its positive scenario and not on its negative, and the second half was free: a negative drawn from a different log source never fires on any hunt, so a corpus of those reports a perfect false-positive rate while grading only the hunt's aim. A negative must now differ from its positive in exactly one indicator field. That found **8 violations on its first run against a corpus the existing grading was passing**, three of them in hunts predating this work. `scripts/run_hunt_evals.py` also now exists: `hunts/README.md` had told contributors to run it before opening a PR for months, and it had never been written.+- **Autonomy is earned from a measured track record rather than typed into a setting.** The tier, the per-action thresholds and the force-auto override were all numbers somebody entered, and nothing connected what the agent had actually got right to what it was allowed to do unattended. A grant now needs a minimum sample with enough of it closed as malicious, agreement whose denominator excludes abstentions so declining cannot inflate it, a capped abstention rate, malicious recall that counts an abstention as a miss, and a trailing slice scored separately so drift arriving gradually is not absorbed by a 30-day average. Promotion refuses an unmeasured rate; demotion ignores one, because a week with no malicious alert is not evidence the agent got worse.+- **Deactivating a user ended their sessions and left their API keys working.** The key resolver looked up the owning user with `is_active == True` and, finding nothing, fell through to a generic `api_service` role instead of refusing — so every credential a deprovisioned principal had minted for themselves went on authenticating indefinitely with nothing in the request or the logs looking wrong. Anyone testing deprovisioning would have checked the session, which did stop.+- **The gate written for this exact bug class had never seen a route.** It read `app.routes` and filtered for `APIRoute`, but on the FastAPI version these services pin, `include_router` appends a single `_IncludedRouter` instead — so the check compared zero pairs, found zero problems and reported success over an app serving 456 operations. The defect it should have caught: `DELETE /api/v1/autonomy-policy/grants` had been unreachable since it shipped, taken by a `DELETE /{action}` handler declared earlier in the same router, answering 204 to the caller while deleting from the wrong table and leaving the tenant holding the capability.++The full inventory — 44 entries — lives under `[12.0.0]` in [`CHANGELOG.md`](CHANGELOG.md).++---++## v11.2.0 (2026-09-26)++`VERSION` was `11.2.0`. The **v11.2.0** release (2026-09-26) answers a question that had been asked of this repository for months — *why 833 rules and not 5,000?* — and the answer was not a missing feature. (Claim-to-gate matrix at the v11.2.0 cut: 147 rows — 139 GATED / 8 PARTIAL / 0 NO GATE, counted from the table by `scripts/check_claim_gate_matrix.py`, which is the figure to recount rather than to quote.)**Nothing in this release requires you to act, which is why it is a minor.** There is no configuration change, no migration and no API change. The connector fix only *adds* fields: it lifts the `System` and `EventData` containers into the namespace the matcher already read, and a connector-normalized key still wins on collision. What does change is that 2,603 rules evaluate where 833 did, and 1,687 of the additions are Windows rules that could never fire before — so expect more alerts from the same stream. Every imported rule carries its `upstream_status` onto the alert, so the 125 `experimental` ones can be filtered without disabling the rest.diff --git a/ROADMAP.md b/ROADMAP.mdindex a5ac35233..6ef5213f9 100644--- a/ROADMAP.md+++ b/ROADMAP.md@@ -29,10 +29,10 @@ A proof-first, security-first program to make every README claim gate-backed, cl- [ ] Phase 4 — Real evals + detection content truth table (third-party-labeled corpus, hallucination/calibration/abstention, model matrix) — **4a/4b/4c landed**: de-circularised DAC candidate-rule gate; honest executable-vs-imported truth table; hallucination, abstention, calibration and containment metrics in `packages/aisoc-benchmark` with a documented adapter so a third-party agent can be graded on the same corpus; confidence calibration gated in `test_confidence_calibration.py`; and a **model matrix** (`scripts/run_model_matrix.py`) wired into the weekly wet eval, which grades the same corpus across several models by re-invoking the existing evaluator rather than defining a second notion of accuracy. **Remains open on one thing only, and it is not code:** the live-agent numbers need a funded provider key. Without one the matrix reports *not measured* per model rather than emitting zeros, because a zero is a measurement and "we did not run this" is not.- [x] Phase 5 — Data spine correctness (versioned event-schema registry + dead-letter queue + source-event lineage in the fusion consumer; idempotency via AlertSink dedup + event-time watermarking; backfill/replay-from-offset tracked as 5b)- [x] Phase 6 — Performance + cost (fusion hot-path throughput harness with a generous regression-floor gate; deterministic storage $/TB cost model + drift gate; storage-consolidation ADR-0005)-- [x] Phase 7 — Ingest-time graph + multi-model router — **graph-at-ingest already shipped** (v8 T1.1, `services/ingest/internal/graph/`); **7a landed**: unified deterministic→ML→LLM router with tier attribution + the `AISOC_DETERMINISTIC` determinism contract (`services/agents/app/routing/model_router.py`, gated). 7b+ (posture collection, effective-permissions snapshot loader, bi-temporal valid_from/valid_to, fusion-time ContextBundle) tracked in `docs/audit/PROGRESS.md`+- [x] Phase 7 — Ingest-time graph + multi-model router — **graph-at-ingest already shipped** (v8 T1.1, `services/ingest/internal/graph/`); **7a landed**: unified deterministic→ML→LLM router with tier attribution + the `AISOC_DETERMINISTIC` determinism contract (`services/agents/app/routing/model_router.py`, gated). 7b+ (posture collection, effective-permissions snapshot loader, bi-temporal valid_from/valid_to, fusion-time ContextBundle) scoped in [`docs/audit/DEFERRED_SUBPHASES.md`](docs/audit/DEFERRED_SUBPHASES.md), which records that all five effective-permissions resolvers already ship and that what remains is one thing: no connector answers `__posture_snapshot__`- [x] Phase 8 — LLMOps (version+hash-pinned prompt registry with a CI drift gate; model pins + deterministic-terminated provider-fallback chains; content-addressed response cache; fail-closed structured-output validation)- [x] Phase 9 — Autonomy safety (dry-run-by-default policy, honest bounded rollback-capability contract replacing silent `return True`, mandatory post-action verification for unattended containment, break-glass HIGH-blast flag, autonomy scorecard — all gated at the policy layer; live-router wiring + durable approval-SLA timer table tracked as 9b)-- [x] Phase 10 — Connector + content quality (runtime-contract conformance suite across all 69 connectors — gates the "live Test connection" capability that had NO gate + secret-field-marking; published `conformance-matrix.md` with a drift gate; detection lifecycle already gated by Phase 4a DAC + Phase 4b truth table. Live-vendor sandbox smoke + rate-limit/checkpoint durability tracked as 10b)+- [x] Phase 10 — Connector + content quality (runtime-contract conformance suite across all 69 connectors registered when the phase landed; the generated [`conformance-matrix.md`](docs/connectors/conformance-matrix.md) now reads 84 / 84 — gates the "live Test connection" capability that had NO gate + secret-field-marking; the matrix is published with a drift gate on it; detection lifecycle already gated by Phase 4a DAC + Phase 4b truth table. Live-vendor sandbox smoke + rate-limit/checkpoint durability tracked as 10b)- [x] Phase 11 — API / SDK / release engineering (pure-Python OpenAPI breaking-change detector `scripts/openapi_diff.py` + `openapi-breaking.yml` gate: PR spec vs base fails on removed endpoint/schema/field, type change, tightened request, or dropped enum value — closes the OpenAPI NO GATE row; per-language SDK generated-client contract-drift tracked as 11b)- [x] Phase 12 — Observability + governance (per-service SLOs in `docs/operations/slos.yaml` with a coverage gate; `docs/operations/observability.md` documenting the four golden signals + single OTel trace across the spine; `GOVERNANCE.md` + `MAINTAINERS.md` + DCO sign-off in `CONTRIBUTING.md`; governance-completeness gate — `governance.yml`)@@ -262,9 +262,12 @@ Implemented and reviewed by Beenu Arora <[email protected]>.account action rather than an engineering one — see`apps/mobile/README.md`.)_- [ ] Plugin publishing marketplace v3 (commercial plugins, revenue sharing)- _(deferred past v8.0; **not started**. Revenue sharing is a commercial- decision rather than an engineering one, and the free packaging path is- itself still blocked on registry credentials — see v8.1.)_+ _(**open and unscheduled**, and never in fact scheduled against a+ particular release. The "deferred past v8.0" this line used to carry+ dated the label rather than the decision, and survived five majors.+ Revenue sharing is a commercial decision rather than an engineering one,+ and the free packaging path is itself still blocked on registry+ credentials — see v8.1.)_---@@ -606,12 +609,22 @@ Disposition of every item that had been listed against v8.0:- ~~NL→query: "show me failed logins from new ASNs last 24h" → ES|QL / KQL~~ → **shipped in v7.2.0** (deterministic translator + 50-pair eval set)- ~~SOC-in-a-box one-click cloud deploy (Terraform module for AWS / GCP)~~ → **GCP module shipped in v7.2.0** (AWS already shipped)- ~~Automated retro/blameless post-mortem drafting from case timeline~~ → **shipped in v7.2.0** (ideas backlog item promoted)-- Mobile responder console (React Native) — **not started**, deferred; see the- note under v7.0 above. No React Native code exists in the tree.+- Mobile responder console (React Native) — **shipped in v9.0**; see the note+ under v7.0 above. The "no React Native code exists in the tree" this line+ used to carry is false: `apps/mobile` declares `react-native` and Expo, and+ the capability itself had shipped earlier still as a PWA under+ `apps/web/src/app/(responder)/`. What genuinely remains is not engineering:+ **no device build, simulator run or store submission has been performed**,+ and the APNs and FCM credentials needed to deliver a push to a real handset+ are an account action, the same class of blocker as the npm and PyPI+ publish. `apps/mobile/README.md` states both halves.- Plugin publishing marketplace v3 (commercial plugins, revenue sharing) —- **not started**, deferred. Revenue sharing is a commercial decision rather- than an engineering one, and the free packaging path is itself still blocked- on registry credentials.+ **open and unscheduled**, and never in fact scheduled against a particular+ release. This line read "deferred past v8.0" through five majors, which+ dated the label rather than the decision; it is a scope decision, not a+ slipped commitment. Revenue sharing is a commercial decision rather than an+ engineering one, and the free packaging path is itself still blocked on+ registry credentials.- MSSP RBAC enforcement on `/api/v1/actors/*` (threat attribution) — **shippedin v7.5.0** as part of the threat-actor attribution RBAC + port fix.- AI-generated threat intelligence briefings from public feeds — **open**, not@@ -677,6 +690,45 @@ Full inventory under `[8.1.1]` in [`CHANGELOG.md`](CHANGELOG.md).---+## v12.0 — Shipped (2026-09-28)++The deployment a stranger actually starts, treated as the threat model. Three+reported vulnerabilities sat in the profile `make up` brings up, and none of+them needed a credential to reach: the actions service skipped authentication+entirely whenever its service token was empty and `AISOC_DEV_MODE` was set —+which compose defaults on while nothing generated the token — so+`isolate_host`, `disable_user`, `block_ip` and `run_script` were available to+anything that could reach the port; the realtime edge verified connection+tickets against a constant committed to this repository and read an unset+`/internal/*` token as authorized rather than as unconfigured; and `viewer`+could write to cases on all nine write routes, where a permission deliberately+withheld from the role was enforced nowhere. All three now refuse to serve+until the credential they need is set, which is what makes this a major, and+`scripts/ensure_env.py` backfills the generated secrets into an existing+`.env` so the documented path repairs itself.++Capability work in the same release: hunting stopped being a library of hunts+somebody had already written, with an agent that turns a hypothesis into a+plan whose fields and operators are closed enums and a compiler that binds+every model-supplied value as a parameter, so injection is unrepresentable+rather than filtered; the hunt corpus went from 5 to 68, and the grading over+it stopped being satisfiable by accident once a negative scenario had to+differ from its positive in exactly one indicator field — which found eight+violations on its first run against a corpus the old grading was passing. And+autonomy is now earned from a measured track record rather than typed into a+setting, with promotion refusing an unmeasured rate and demotion ignoring one.++Two gates that reported success over nothing were rebuilt on what the app+actually serves: the route-shadowing check read `app.routes` and filtered for+`APIRoute`, which `include_router` no longer populates, so it compared zero+pairs across 456 published operations — and the defect it should have caught+had left `DELETE /api/v1/autonomy-policy/grants` unreachable since it shipped,+answering 204 while deleting from the wrong table.++Full inventory — 44 entries — under `[12.0.0]` in [`CHANGELOG.md`](CHANGELOG.md).++---+## v11.1 — Shipped (2026-09-25)One user's bug report, and the audit it turned into. A self-hoster bringing@@ -762,7 +814,7 @@ were moved onto the compiled ruleset, which is what closed the long-standingdisagreement between the validator, the coverage page, the marketplace indexand the truth table.-Full inventory under `[12.0.0]` in [`CHANGELOG.md`](CHANGELOG.md).+Full inventory under `[11.2.0]` in [`CHANGELOG.md`](CHANGELOG.md).---diff --git a/docs/audit/CLAIM_TO_GATE_MATRIX.md b/docs/audit/CLAIM_TO_GATE_MATRIX.mdindex cd0f905db..06ad21ec2 100644--- a/docs/audit/CLAIM_TO_GATE_MATRIX.md+++ b/docs/audit/CLAIM_TO_GATE_MATRIX.md@@ -245,10 +245,6 @@ Statuses: `GATED` (a CI job fails when the claim stops being true) · `PARTIAL`| The hunting agent never writes a query: it fills a closed schema and the values it supplies are bound parameters | `plans/aisoc_gap_closure_plan.plan.md` (8.3); `apps/docs/docs/concepts/hunting-agent.md` | `ci.yml :: hunt agent boundary` (`check_hunt_agent_boundary.py` — reads the plan enum, the SQL compiler and the ClickHouse DDL together and fails when any drifts from the others; proven against an open enum, a query-shaped property and a field the DDL does not declare) | GATED | The gate reads structure, not intent: it cannot say the plan the model chose is a sensible hunt, only that the model could not have expressed anything outside the vocabulary || A hunt the event lake could not answer is reported as unavailable with a reason, never as zero findings | `plans/aisoc_gap_closure_plan.plan.md` (8.3) | `ci.yml :: api tests` (`test_hunt_plan_sql.py` — the unavailable branch omits the `rows` key entirely, so a caller reading `rows` raises rather than rendering an empty list as a clean estate; asserted across all three failure classes) | GATED | Three outcomes are kept apart in the response shape rather than in prose: findings, no findings, and could not check |-## Summary---## Summary- GATED: 228diff --git a/docs/contributing/detection-translation-drive.md b/docs/contributing/detection-translation-drive.mdindex 3cafe5669..1d411357d 100644--- a/docs/contributing/detection-translation-drive.md+++ b/docs/contributing/detection-translation-drive.md@@ -5,34 +5,63 @@ one where a first-time contributor can land something measurable in an hour.## The gap, in the project's own numbers-From [`docs/detections/truth-table.md`](../detections/truth-table.md), which is-generated by `scripts/detection_truth_table.py` and CI-gated so it cannot-drift:+Copied from [`docs/detections/truth-table.md`](../detections/truth-table.md),+which is generated by `scripts/detection_truth_table.py` and gated by+`--check` against what the engine loads:| tier | on disk | executable ||------|--------:|-----------:|-| native | 869 | 869 |-| sigma (imported) | 3132 | 77 |+| native | 877 | 833 |+| sigma (imported) | 3132 | 1770 || splunk (imported) | 2005 | 0 || chronicle (imported) | 877 | 0 || car (imported) | 99 | 0 |+| community | 1 | 0 |-**947 of 6,983 rules fire today.** The other 6,036 are on disk for provenance-and ATT&CK coverage mapping, quarantined because their body is an upstream-query language the engine does not execute.+**2,603 of 6,991 rules fire today.** The other 4,388 are on disk for+provenance and ATT&CK coverage mapping — 4,213 of them under `_quarantine/`+because their body is an upstream query language the engine does not execute,+and 175 carrying `enabled: false` with a reason.++This table is copied from the generated file rather than counted by hand, and+it has still gone stale once: it read `native 869/869` and `sigma 3132/77`+against a source holding `877/833` and `3132/1770`, and said in the paragraph+above that being copied from a CI-gated source meant it could not drift. The+gate holds the *generated* file to the engine. Nothing held this page to the+generated file, so re-read it from the link above rather than trusting the+numbers here.The project is deliberately honest about this — the README quotes theexecutable figure, not the on-disk one. The way to improve the number is totranslate rules, not to relabel them.-## Start with Sigma+## Start with Sigma, but read the refusals first-Of the five tiers, the imported Sigma pool is by far the best target:+Of the four imported tiers, Sigma remains the best target, and what makes a+useful contribution has changed: **1,770 Sigma rules now ship and 1,362 are+refused, each with a recorded reason** in+[`docs/detections/sigma-compilation.md`](../detections/sigma-compilation.md).+The bulk one-at-a-time translation that used to be the ask is largely done, so+picking an arbitrary quarantined rule is likely to land on one that was+refused on purpose.-- **3,055 quarantined Sigma rules**, against 77 already translated — so there- are worked examples in-tree to copy from.- Sigma's `selection` / `condition` model maps closely onto the native- `match_when` DSL. It is mechanical, not a rewrite.+ `match_when` DSL, and there are now 1,770 worked examples in-tree rather+ than 77. It is mechanical, not a rewrite.+- **The highest-leverage work is a named capability gap, not a rule.** The+ refusal table groups the 1,362 by cause, and several are one matcher+ feature standing in front of a whole family: 71 rules need a+ case-sensitive `|re`, 59 need a dotted field path, 17 need a `|cidr`+ operator, 14 need `|all` on a non-`contains` modifier, 10 use bare keywords+ against a field-scoped matcher. Closing one unlocks its family at once.+- **556 were refused because no connector emits their log source**, which is+ connector work rather than translation work, and is the largest single+ group.+- **464 negations are refused deliberately and should stay refused.** Sigma+ treats `not filter` as *true* when the field is absent, and only `not_in`+ and `not_contains_any` behave that way here, so compiling the rest would+ turn "not this value" into "fires whenever the field is missing". A+ translation that is merely close changes what a rule means.- SPL, YARA-L and CAR pseudocode need semantic reinterpretation and are a muchpoorer first task. Leave those.@@ -40,8 +69,8 @@ Of the five tiers, the imported Sigma pool is by far the best target:1. Pick a rule under `detections/_quarantine/` in the sigma tier. Check no openPR already claims it.-2. Translate the body into the native condition DSL. The 869 rules under- `detections/<category>/` are your reference, and the 77 already-translated+2. Translate the body into the native condition DSL. The 877 rules under+ `detections/<category>/` are your reference, and the 1,770 already-compiledSigma imports are the closest analogues.3. Write **both** fixtures under `detections/fixtures/` — one event the rulemust fire on, one it must stay quiet on. This is not optional paperwork: thediff --git a/docs/design/landing-page-brief.md b/docs/design/landing-page-brief.mdindex 38cdcf8e2..009d10858 100644--- a/docs/design/landing-page-brief.md+++ b/docs/design/landing-page-brief.md@@ -34,8 +34,8 @@AiSOC is an MIT-licensed agentic Security Operations Center that fuses rawevents into incidents, runs four named agents — Detect, Triage, Hunt, andRespond — against them, and records every prompt, tool call, and rationale-to a replayable Investigation Ledger. It ships with 69 click-and-connect-data sources, 6,998 detection rules, 62 playbook packs, and a public+to a replayable Investigation Ledger. It ships with 84 click-and-connect+data sources, 2,603 executable detection rules, 62 playbook packs, and a publicbenchmark harness that gates every PR. You can self-host the whole stackin five minutes, take it air-gapped on a flag, or join the managedwaitlist at `tryaisoc.com` — same code in every direction.@@ -195,14 +195,17 @@ Ranked. Five total. Each one cites the shipped feature behind it.connector classes spanning EDR / SIEM / cloud / IAM / SaaS / VCS /network. Each one renders a schema-driven form, encrypts secrets via`CredentialVault`, and starts polling on a per-instance schedule. The- marketplace ships 7,117 items (6,998 detections, 62 playbook packs, 57- plugins) per `marketplace/index.json`.+ marketplace ships 7,155 items (6,991 detections on disk, 87 playbooks+ across 62 packs, 77 plugins) per `marketplace/index.json`.- **Repo evidence.** `services/connectors/app/connectors/`,`apps/docs/docs/operations/credentials.md`,`packages/plugin-sdk-py/`, `packages/plugin-sdk-go/`,`packages/plugin-sdk-ts/`, `marketplace/index.json`.-- **Metric to display.** 69 connectors live, 7 categories, 7,117- marketplace items.+- **Metric to display.** 84 connectors live, 9 categories, 7,155+ marketplace items. Render these from the generated constants rather than+ retyping them: `CONNECTOR_COUNT` in `apps/web/src/data/connectorCount.ts`,+ and `MARKETPLACE_ITEM_COUNT` / `EXECUTABLE_DETECTION_COUNT` in+ `apps/web/src/data/corpusStats.ts`.- **Persona.** Analyst (the click-and-connect promise), detection engineer(the SDK promise).@@ -233,8 +236,8 @@ number is MIT-licensed and reproducible from a fresh clone.**Defence.** The agent orchestrator is ~600 lines of LangGraph in`services/agents/app/orchestrator/`. The detection corpus is YAML under-`detections/` (6,998 rules across cloud, endpoint, identity, network,-application, and data-exfil). The benchmark dataset and harness are in+`detections/` (6,991 rules on disk across cloud, endpoint, identity,+network, application, and data-exfil, of which 2,603 are executable). The benchmark dataset and harness are in`services/agents/tests/eval_data/` and `scripts/run_evals.py`. Anyone canrun `python3 scripts/run_evals.py` and reproduce every number on thebenchmark page in roughly 35 ms. There is no private fork, no@@ -320,7 +323,7 @@ section tracking.H1 ("Detect. Triage. Hunt. Respond.") · sub-head ·Primary CTA ("Start free on managed") ·Secondary CTA ("Self-host on GitHub") ·- Social-proof bar (GitHub stars · 69 connectors · 6 deploy targets) ·+ Social-proof bar (GitHub stars · 84 connectors · 6 deploy targets) ·Visual: animated agent-graph or screencast of `INC-RT-001` ledger.- **Visual treatment:** Two-column on laptop+. Copy left, graphvisualisation right. The graph motion is the recurring brand motif —@@ -408,7 +411,7 @@ section tracking.- **Hunt & Respond.** 6 tiles: NL hunt at `/hunt` · Hunt-as-Code YAML· response planner · ChatOps approvals · L0–L4 maturity dial ·SOAR exec.- - **Operate at scale.** 6 tiles: 69 connectors · marketplace · plugin+ - **Operate at scale.** 6 tiles: 84 connectors · marketplace · pluginSDKs (Py/TS/Go) · MCP server · Cursor extension · cost telemetry.- **Visual treatment:** Each tile: icon · 1-line headline · 1-sentencebody · doc link. Background `surface-card`.@@ -420,8 +423,9 @@ section tracking.- **Persona:** Manager primary.- **Conversion behaviour:** Click through to the marketplace; encourageSDK contribution.-- **Content blocks:** H2 ("69 connectors, 6,998 detections, 62 playbook- packs") · category chips (EDR, SIEM, Cloud, IAM, SaaS, VCS, Network) ·+- **Content blocks:** H2 ("84 connectors, 2,603 executable detections, 62+ playbook packs") · category chips (EDR, SIEM, Cloud, IAM, SaaS, VCS,+ Network, NDR, AI) ·marquee or grid of connector logos · "Build your own in 50 lines" codecallout linking to `packages/plugin-sdk-py/`.- **Visual treatment:** Logo grid with subtle reveal on scroll. Each@@ -693,7 +697,7 @@ Primary CTA names: `cta-start-managed-{section}`, secondary CTA names:- **Title (≤ 60 chars):** `AiSOC — The open agentic SOC`- **Description (≤ 155 chars):** `Open-source MIT-licensed agentic SOC.- Four named agents. 69 connectors. Public benchmark. Self-host in 5+ Four named agents. 84 connectors. Public benchmark. Self-host in 5minutes or join the managed waitlist.`- **OG image direction.** 1200×630. Dark surface. Wordmark top-left.Centred phrase "Detect. Triage. Hunt. Respond." in white. Brand-500@@ -885,8 +889,8 @@ Condensed teardown lives at `docs/design/landing-page-references.md`.| Weekly wet-eval CI | `.github/workflows/wet-eval.yml` | Manager | V3 | benchmark | Shipped (T5.5 wip) || LLM input contract (fail-closed) | `services/agents/.../llm_input_contract.py` (T2.3) | CISO | V1, P3 | pillars (P3) | Shipped (T2.3 wip) || Pre-fetched ContextBundle | `services/agents/.../context_bundle.py` (T2.1) | Manager | V1 | features-hunt | Shipped (T2.1 wip) |-| 69 click-and-connect connectors | `services/connectors/app/connectors/__init__.py` | Analyst, manager | V4 | connectors, features-operate | Shipped |-| Marketplace (7,117 items) | `marketplace/index.json` · `scripts/build_marketplace.py` | Detection engineer | V4 | connectors | Shipped |+| 84 click-and-connect connectors | `services/connectors/app/connectors/__init__.py` | Analyst, manager | V4 | connectors, features-operate | Shipped |+| Marketplace (7,155 items) | `marketplace/index.json` · `scripts/build_marketplace.py` | Detection engineer | V4 | connectors | Shipped || Credential vault (Fernet + HMAC) | `services/api/app/services/vault.py` · `apps/docs/docs/operations/credentials.md` | CISO | V4, P3 | deploy, pillars (P3) | Shipped || Plugin SDKs (Python, TypeScript, Go) | `packages/plugin-sdk-py/` · `packages/plugin-sdk-ts/` · `packages/plugin-sdk-go/` | Detection engineer | V4 | features-operate | Shipped || MCP server (18 tools) | `services/mcp/` | Detection engineer | V4 | features-operate | Shipped |diff --git a/docs/design/landing-page-component-recipes.md b/docs/design/landing-page-component-recipes.mdindex 95c91b98c..6e7e3d1c1 100644--- a/docs/design/landing-page-component-recipes.md+++ b/docs/design/landing-page-component-recipes.md@@ -97,7 +97,7 @@- **Primitives:**- Aceternity **Glowing Effect** (`/components/glowing-effect`) — wraps each card border. `glow={true}`, `proximity={64}`, `inactiveZone={0.4}`.- Aceternity **Bento Grid** — used loosely (flat 2 × 2, equal heights, no skew).- - MagicUI **Number Ticker** — stat lines. P1 `value={6998}`, P2 `value={17}`, P3 `value={4}`, P4 `value={6}`.+ - MagicUI **Number Ticker** — stat lines. P1 `value={EXECUTABLE_DETECTION_COUNT}` (from `apps/web/src/data/corpusStats.ts`, currently 2603 — do not hard-code it; the literal `6998` sat here while the corpus moved), P2 `value={17}`, P3 `value={4}`, P4 `value={6}`.- **Custom:** 24 × 24 brand glyphs (`open-source`, `graph`, `agentic`, `deploy-anywhere`). Active borders: P2 → `landing.gradient.pillars`, P3 → `landing.accent.ember`, P1 / P4 → `brand-500/30`.- **Anatomy:** `Pillars` → `PillarsHeading`, `PillarsGrid` (4 × `PillarCard`), each → `PillarIcon`, `PillarTitle`, `PillarBody`, `PillarStat`, `PillarLink`.- **States:** Default `landing.shadow.1`, `surface-border`. Hover → Glowing Effect on; lift `-2 px`. Focus → existing `:focus-visible` 2 px `brand-500` ring. <768 stacks. Reduced-motion → Glowing `disabled={true}`; lift instant.diff --git a/docs/design/landing-page-content.md b/docs/design/landing-page-content.mdindex 857eb3814..7bf7bdeed 100644--- a/docs/design/landing-page-content.md+++ b/docs/design/landing-page-content.md@@ -29,8 +29,8 @@- **Secondary CTA:** `Self-host on GitHub`- **Tertiary link (under CTAs):** `Watch a 90-second investigation →`- **Social-proof bar (three chips):**- - `69 connectors · EDR · SIEM · cloud · IAM · SaaS · VCS · network`- - `6,998 detections · 62 playbook packs · 57 plugins`+ - `84 connectors · EDR · SIEM · cloud · IAM · SaaS · VCS · network · NDR · AI`+ - `2,603 executable detections · 62 playbook packs · 77 plugins`- `Self-host · Render · Fly.io · Helm · Terraform · air-gap`---@@ -124,7 +124,7 @@- **Card P1 — Open source and transparent**- **Body:** `MIT-licensed agent, public detection corpus, reproduciblebenchmark — every claim on this page maps to a file in the repo.`- - **Stat:** `6,998 public detection rules`+ - **Stat:** `2,603 executable detection rules`- **Link:** `Read the LICENSE →`- **Card P2 — Graph-native at ingest**- **Body:** `The entity graph is written while events are normalised,@@ -151,8 +151,8 @@1. **Fusion engine.** `Real-time dedup, ML scoring, per-alert confidence.`2. **Entity-risk rollup (RBA).** `Time-decayed risk per user, host, IP,domain — 50:1 alert-to-incident.`-3. **Native detections.** `6,998 YAML rules across cloud, endpoint,- identity, network, application, and data-exfil.`+3. **Native detections.** `2,603 executable rules across cloud, endpoint,+ identity, network, application, and data-exfil, of 6,991 on disk.`4. **Investigation Ledger.** `Replayable, step-by-step record of everyagent decision per case.`5. **Attack-chain timeline.** `Cytoscape over the Neo4j subgraph — see@@ -176,9 +176,9 @@### Operate at scale (6 tiles)-1. **69 click-and-connect connectors.** `EDR · SIEM · cloud · IAM ·- SaaS · VCS · network.`-2. **Marketplace.** `7,117 community items — detections, playbooks,+1. **84 click-and-connect connectors.** `EDR · SIEM · cloud · IAM ·+ SaaS · VCS · network · NDR · AI.`+2. **Marketplace.** `7,155 community items — detections, playbooks,plugins.`3. **Plugin SDKs.** `Python, TypeScript, Go — build a connector in 50lines.`@@ -194,7 +194,7 @@## `connectors` — Connectors + Marketplace- **Eyebrow:** `Plug in everything`-- **H2:** `69 connectors. 6,998 detections. 62 playbook packs.`+- **H2:** `84 connectors. 2,603 executable detections. 62 playbook packs.`- **Sub-head:**`Every connector renders a schema-driven form, encrypts its secrets atthe application layer, and starts polling on a per-instance schedule.@@ -337,7 +337,7 @@- **Card — Community**- **Price:** `Free`- **Tagline:** `Self-host the full stack.`- - **Includes:** `MIT-licensed code · all 69 connectors · marketplace+ - **Includes:** `MIT-licensed code · all 84 connectors · marketplace· public benchmark harness · community Discord.`- **Card — Team (managed)**- **Price:** `Contact us — waitlist`diff --git a/docs/design/landing-page-motion-spec.md b/docs/design/landing-page-motion-spec.mdindex 611ddc866..8a45b9ee7 100644--- a/docs/design/landing-page-motion-spec.md+++ b/docs/design/landing-page-motion-spec.md@@ -20,7 +20,7 @@ reduced-motion does instead.** Each row is one PR-sized unit.| `hero-cta-shimmer` | `hero`, `final-cta` | hover | `medium` 400 | `in-out-quad` | `fast` 150 | `in-out-quad` | — | **none** — solid `brand-500`, no sheen | Reward intent on conversion target without animating pre-hover. || `pillar-card-stagger` | `pillars` | scroll-into-view | `medium` 400 | `out-quart` | — | — | 80 / card | **instant** — cards opacity 1, no translate | Eye absorbs four claims one at a time. || `pillar-card-glow` | `pillars` (P2) | hover | `base` 250 | `in-out-quad` | `fast` 150 | `in-out-quad` | — | **none** — static `border-brand-500/30` | Marks P2 differentiation without a "look at me" loop. |-| `connector-marquee` | `connectors`, `proof-strip` | mount loop | `marquee` 20000–60000 | `linear-loop` | — | — | — | **static row** — 18 logos in 5-col grid | Gives "69 connectors" sensory weight; static art still works. |+| `connector-marquee` | `connectors`, `proof-strip` | mount loop | `marquee` 20000–60000 | `linear-loop` | — | — | — | **static row** — 18 logos in 5-col grid | Gives the `CONNECTOR_COUNT` chip (84 connectors) sensory weight; static art still works. || `agent-beam` | `solution`, `hero` visual | scroll + loop | `beam` 1500 | custom `cubic-bezier(0.65,0,0.35,1)` | `slow` 800 | `in-out-quad` | — | **static path** full-length, single colour | Four-agent topology as a sequence, not an org chart. || `number-ticker-benchmark` | `benchmark`, `nav`, `pillars`, `open-source` | scroll-into-view | `slow` 800–`beam` 1500 | `out-expo` | — | — | 200 / tile | **final value** rendered directly | Earns the metric; reduced-motion shows destination directly. || `accordion-toggle` | `faq` | click | `base` 250 open / `fast` 150 close | `in-out-quad` | `fast` 150 | `in-out-quad` | — | **instant** — open / close, no slide | Familiar affordance; small motion confirms click. |diff --git a/scripts/readme_gates.py b/scripts/readme_gates.pyindex e43fac048..51d9336d8 100644--- a/scripts/readme_gates.py+++ b/scripts/readme_gates.py@@ -11,8 +11,11 @@ PRs that touch the README front door:3. Every reference to `apps/web/public/demo/<asset>` in README is pairedwith an actually-existing file (or is paired with an explicit"rendered .mp4 lands with v8.0" guard).+4. Figures repeated in prose match the artifact they summarise: the+ executable-rule count, the claim-gate tally, and the version a document+ presents as the current one.-The four-th gate (`aisoc-sandbox` cross-platform smoke test) lives in a+The fifth gate (`aisoc-sandbox` cross-platform smoke test) lives in aseparate matrix job in `.github/workflows/readme-gates.yml` because itneeds Linux + macOS runners.@@ -393,6 +396,7 @@ def gate_sandbox_offline_smoke() -> list[GateFailure]:TRUTH_TABLE = REPO_ROOT / "docs" / "detections" / "truth-table.md"CLAIM_MATRIX = REPO_ROOT / "docs" / "audit" / "CLAIM_TO_GATE_MATRIX.md"+VERSION_FILE = REPO_ROOT / "VERSION"#: Other documents that quote the claim-gate tally. Each is checked the#: same way the README is: a figure repeated in prose drifts from its@@ -428,6 +432,96 @@ def _is_historical(text: str, index: int) -> bool:return bool(_HISTORICAL_QUOTE.search(text[start : len(text) if end < 0 else end]))+#: Sentence shapes that present a version as *the* current one. A figure gate+#: over every version string in these documents would be unusable — the whole+#: point of `RELEASES.md` is that it names ten past versions — so this reads+#: only the forms whose grammar makes the present-tense claim, and the release+#: history's own opener (``VERSION`` *was* ``11.0.0``) is not one of them.+#:+#: The line-level `_is_historical` exemption is deliberately **not** applied+#: here, and that is the load-bearing decision. `RELEASES.md`'s TL;DR is a+#: single long line that legitimately dates a *different* figure in the same+#: sentence ("at the v11.2.0 cut: 147 rows"), so exempting the line would have+#: skipped the stale "AiSOC is on `v11.2.0`" sitting eighty words to its left —+#: which is the exact text this gate was written for. These patterns carry+#: their own scoping instead of borrowing a neighbour's.+_CURRENT_VERSION_CLAIMS = (+ # RELEASES.md's TL;DR: "AiSOC is on `v11.2.0`, released 2026-09-26".+ re.compile(r"AiSOC is (?:on|at)\s+`?v?(\d+\.\d+\.\d+)`?"),+ # The opener of whichever section describes the current release.+ re.compile(r"`VERSION`\s+is\s+`?v?(\d+\.\d+\.\d+)`?"),+ # README's shields.io badge, which a reader takes as the version on sight.+ re.compile(r"shields\.io/badge/version-(\d+\.\d+\.\d+)"),+)+++def _declared_version() -> str | None:+ """The version this tree ships, from ``VERSION`` — the file the release+ flow bumps, so no document can be more current than it."""+ if not VERSION_FILE.exists():+ return None+ return _read(VERSION_FILE).strip() or None+++def _doc_label(path: Path) -> str:+ """A repo-relative label for a document, falling back to its file name.++ The tests repoint ``REPO_ROOT`` at a scratch tree; the label is cosmetic+ and must not take the gate down with it.+ """+ try:+ return str(path.relative_to(REPO_ROOT))+ except ValueError:+ return path.name+++def _figure_sources() -> list[tuple[str, str]]:+ """Every document that publishes a figure, as ``(label, text)`` pairs.++ Shared by both figure gates so a document added to `FIGURE_DOCS` is read+ by each of them. Listing a surface for one check and not the other is how+ `ROADMAP.md` went stale while the gate that should have caught it passed.+ """+ sources: list[tuple[str, str]] = []+ if README.exists():+ sources.append(("README", _read(README)))+ sources.extend((_doc_label(path), _read(path)) for path in FIGURE_DOCS if path.exists())+ return sources+++def gate_current_version() -> list[GateFailure]:+ """A document may not present a version other than ``VERSION`` as current.++ `RELEASES.md` announced `v11.2.0` as the current release for the whole of+ `v12.0.0` — no TL;DR rewrite, no `## v12.0.0` section, and the file's+ figure claims were being checked the entire time, because the figure gate+ reads detection counts and the claim-gate tally and had never read a+ version string. A reader landing on the release notes was told the wrong+ thing about the most basic fact the file exists to carry.+ """+ version = _declared_version()+ if version is None:+ return []++ failures: list[GateFailure] = []+ for label, text in _figure_sources():+ for pattern in _CURRENT_VERSION_CLAIMS:+ for m in pattern.finditer(text):+ if m.group(1) == version:+ continue+ failures.append(+ GateFailure(+ "current-version",+ f"{label} presents {m.group(1)} as the current version "+ f"({m.group(0).strip()!r}); VERSION says {version}. "+ f"Either update it, or rewrite it in the past tense the "+ f"way RELEASES.md dates a superseded release "+ f'("`VERSION` was `{m.group(1)}`").',+ )+ )+ return failures++def _truth_table_executable() -> int | None:"""The executable-rule count from the generated truth table."""if not TRUTH_TABLE.exists():@@ -512,22 +606,13 @@ def gate_readme_figures() -> list[GateFailure]:# counting note about this exact failure; it recurred because the gate# written afterwards pointed outward only.sources: list[tuple[str, str]] = [- (- str(CLAIM_MATRIX.relative_to(REPO_ROOT)) if CLAIM_MATRIX.is_relative_to(REPO_ROOT) else CLAIM_MATRIX.name,- _read(CLAIM_MATRIX),- ),+ (_doc_label(CLAIM_MATRIX), _read(CLAIM_MATRIX)),("README", readme),]for path in FIGURE_DOCS:if not path.exists():continue- try:- label = str(path.relative_to(REPO_ROOT))- except ValueError:- # The tests repoint REPO_ROOT at a scratch tree; the label is- # cosmetic and must not take the gate down with it.- label = path.name- sources.append((label, _read(path)))+ sources.append((_doc_label(path), _read(path)))for label, text in sources:for m in re.finditer(r"(\d+)\s+(?:rows\s+)?`?GATED`?[,/\s]+(?:and\s+)?(\d+)\s+`?PARTIAL", text):@@ -579,6 +664,7 @@ def _run_all(check_network: bool, skip_sandbox: bool) -> list[GateFailure]:failures.extend(gate_package_references(check_network))failures.extend(gate_demo_asset_references())failures.extend(gate_readme_figures())+ failures.extend(gate_current_version())if not skip_sandbox:failures.extend(gate_sandbox_offline_smoke())return failuresdiff --git a/tests/test_readme_figures_gate.py b/tests/test_readme_figures_gate.pyindex 7fefc5424..12a41c251 100644--- a/tests/test_readme_figures_gate.py+++ b/tests/test_readme_figures_gate.py@@ -37,6 +37,7 @@ def _load_gates(tmp_root: Path):module.README = tmp_root / "README.md"module.TRUTH_TABLE = tmp_root / "docs" / "detections" / "truth-table.md"module.CLAIM_MATRIX = tmp_root / "docs" / "audit" / "CLAIM_TO_GATE_MATRIX.md"+ module.VERSION_FILE = tmp_root / "VERSION"# Every module-level path, not just REPO_ROOT: leaving FIGURE_DOCS# pointing at the real tree made the gate read the live compliance page# against a scratch matrix, and every test failed for a reason that had@@ -69,6 +70,7 @@ def tree(tmp_path: Path) -> Path:(tmp_path / "docs" / "audit").mkdir(parents=True)(tmp_path / "docs" / "detections" / "truth-table.md").write_text(TRUTH_TABLE)(tmp_path / "docs" / "audit" / "CLAIM_TO_GATE_MATRIX.md").write_text(MATRIX)+ (tmp_path / "VERSION").write_text("12.0.0\n")return tmp_path@@ -199,3 +201,103 @@ def test_a_stale_partial_count_in_the_summary_also_fails(tree: Path) -> None:failures = _load_gates(tree).gate_readme_figures()assert len(failures) == 1, failuresassert "PARTIAL: 4" in failures[0].detail+++# ── The version a document presents as current ───────────────────────────────+#+# RELEASES.md announced v11.2.0 as the current release for the whole of+# v12.0.0 — stale TL;DR, stale `VERSION` is line, and no v12.0.0 section at+# all — while every check in the repository passed, because the figure gate+# read detection counts and the claim-gate tally and had never read a version+# string. The most basic fact the file carries was the one nothing checked.+++def _releases(tree: Path, body: str) -> None:+ """A scratch tree whose README is clean, so only RELEASES.md is on trial."""+ (tree / "README.md").write_text("833 executable. 2 GATED / 1 PARTIAL.\n")+ (tree / "RELEASES.md").write_text(body)+++def _version_failures(tree: Path):+ module = _load_gates(tree)+ module.FIGURE_DOCS = (tree / "RELEASES.md",)+ return module.gate_current_version()+++def test_a_doc_naming_the_current_version_passes(tree: Path) -> None:+ _releases(tree, "AiSOC is on `v12.0.0`, released 2026-09-28.\n\n`VERSION` is `12.0.0`.\n")+ assert _version_failures(tree) == []+++def test_a_stale_current_version_fails(tree: Path) -> None:+ """The exact text that shipped: the TL;DR and the section opener both stale."""+ _releases(tree, "AiSOC is on `v11.2.0`, released 2026-09-26.\n\n`VERSION` is `11.2.0`.\n")+ failures = _version_failures(tree)+ assert len(failures) == 2, failures+ assert all("11.2.0" in f.detail and "12.0.0" in f.detail for f in failures)+++def test_a_past_tense_mention_does_not_fail(tree: Path) -> None:+ """RELEASES.md names ten superseded versions and must keep being able to.++ Every one of them opens in the past tense, which is the shape the gate+ declines to read. A gate that flagged these would force the release+ history to be rewritten on every bump, so it would be turned off.+ """+ _releases(+ tree,+ "AiSOC is on `v12.0.0`, released 2026-09-28.\n\n"+ "## v11.2.0 (2026-09-26)\n\n"+ "`VERSION` was `11.2.0`. The **v11.2.0** release (2026-09-26) widened the corpus.\n\n"+ "## v11.1.0 (2026-09-25)\n\n"+ "`VERSION` was `11.1.0`. As of v11.1.0 the console re-resolves its upstreams.\n",+ )+ assert _version_failures(tree) == []+++def test_a_stale_claim_sharing_a_line_with_a_dated_figure_still_fails(tree: Path) -> None:+ """The reason `_is_historical` is not applied to these patterns.++ RELEASES.md's TL;DR is one long line that legitimately dates a *different*+ figure in the same sentence. Exempting the line — which is what the figure+ gate does — would have skipped the stale version claim eighty words to its+ left, so the gate would have passed on the tree it was written for.+ """+ _releases(+ tree,+ "> **TL;DR:** AiSOC is on `v11.2.0`, released 2026-09-26 — the corpus "+ "release. Every claim is gated (claim-to-gate matrix at the v11.2.0 "+ "cut: 147 rows — 139 GATED / 8 PARTIAL / 0 NO GATE).\n",+ )+ failures = _version_failures(tree)+ assert len(failures) == 1, failures+ assert "11.2.0" in failures[0].detail+++def test_a_stale_readme_version_badge_fails(tree: Path) -> None:+ """A reader takes the badge as the version on sight, without reading prose."""+ (tree / "README.md").write_text(+ "[](CHANGELOG.md)\n833 executable. 2 GATED / 1 PARTIAL.\n"+ )+ module = _load_gates(tree)+ module.FIGURE_DOCS = ()+ failures = module.gate_current_version()+ assert len(failures) == 1, failures+ assert "README" in failures[0].detail and "11.2.0" in failures[0].detail+++def test_a_missing_version_file_skips_the_check(tmp_path: Path) -> None:+ """A partial checkout or a release tarball must skip, not fail."""+ (tmp_path / "README.md").write_text("AiSOC is on `v3.0.0`.\n")+ module = _load_gates(tmp_path)+ module.FIGURE_DOCS = ()+ assert module.gate_current_version() == []+++def test_the_live_tree_presents_its_own_version(tmp_path: Path) -> None:+ """Production, with nothing reconfigured — the half that actually gates."""+ module = _import_gates()++ assert module.REPO_ROOT == REPO_ROOT+ assert module._declared_version() == (REPO_ROOT / "VERSION").read_text().strip()+ assert module.gate_current_version() == []