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
Neutralise competitor naming across docs, marketing and plans, and gate it (#804)
Beenu Arora17836e150726
diff --git a/.github/workflows/competitor-names.yml b/.github/workflows/competitor-names.ymlnew file mode 100644index 000000000..8cb054dac--- /dev/null+++ b/.github/workflows/competitor-names.yml@@ -0,0 +1,68 @@+name: Competitor naming++# AiSOC never names a competitor product in documentation, marketing copy, plan+# files, code comments or release notes. Where a competitor is the benchmark for+# a comparison the text refers to it neutrally and keeps the analytical content.+#+# Vendors named as integration targets are a different thing entirely and must+# stay: this product ships 80+ connectors, and a connector module, plugin+# manifest, setup guide or normalizer profile naming its vendor is necessary.+# The gate allow-lists those surfaces by path rather than guessing from prose.+#+# It runs on BOTH pull_request and push-to-main. A PR-only gate is+# one-directional: it checks what contributors propose but never what actually+# lands, so a doc edited in the GitHub UI at merge time would slip past it while+# the gate stayed green.+#+# No paths filter. A competitor name can appear in any file, and a filtered gate+# that skips is indistinguishable from a gate that passes.++on:+ pull_request:+ push:+ branches: [main]+ workflow_dispatch:++permissions:+ contents: read++concurrency:+ group: competitor-names-${{ github.ref }}+ cancel-in-progress: true++jobs:+ competitor-names:+ name: No competitor product named+ runs-on: ubuntu-latest+ timeout-minutes: 10+ steps:+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7++ - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0+ with:+ python-version: "3.12"++ # Runs first and on every invocation. If the patterns stop matching, this+ # fails here rather than letting the scan below report a clean tree it+ # never actually inspected properly. Both directions are asserted: every+ # declared competitor is caught in a known-bad sample, and every known-good+ # integration shape is left alone.+ - name: Self-test (gate is not vacuous, in both directions)+ run: python3 scripts/check_competitor_names.py --self-test++ # The scan prints the absolute path of the tree it walked and the number of+ # files it read. A gate that resolves its repository from its own source+ # location can print a confident OK about a tree it never inspected.+ - name: Scan the tree+ run: python3 scripts/check_competitor_names.py --root "$GITHUB_WORKSPACE"++ - name: Install pytest+ run: pip install 'pytest>=8,<9'++ # The suite adds the properties the CLI cannot assert about itself: that a+ # stale allow-list entry fails the build, that a drifted comparison-table+ # marker fails rather than scanning an empty slice, that a mistyped allow+ # entry is rejected, and that `Torq` is read as a competitor in prose while+ # its connector, manifest, docs page and tests stay untouched.+ - name: Gate properties (stale allow-list, marker drift, dual-role names)+ run: python3 -m pytest tests/test_competitor_names_gate.py -qdiff --git a/AGENTS.md b/AGENTS.mdindex 955602009..45b094253 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -2,7 +2,7 @@- Always track progress locally (e.g. in a TODO/PROGRESS file) so work can be resumed after IDE crashes or restarts.- Complete all planned tasks without stopping mid-way; work through the full list until done.-- Do not mention competitor names (Prophet Security, Torq) anywhere in code, comments, or docs — this is an open-source project.+- Do not name competitor products anywhere in code, comments, docs, plan files, or marketing copy. Where a competitor is the benchmark for a comparison, refer to it neutrally (e.g. "the reference AI-SOC platform") and keep the analytical content. Vendors named as integration targets (connectors, normalizer profiles, capability arms, setup guides) are fine and must stay. The canonical name list and the allow-listed integration paths live in `scripts/competitor_names.toml`, enforced by `scripts/check_competitor_names.py`.- Before pushing to GitHub, ensure no secrets, API keys, tokens, or sensitive data are present in any public repo files.- Host codebase on GitHub once fully built out; keep documentation in sync.- Never edit plan files directly — implement the plan as specified without modifying the plan document itself.diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 4f8ad335e..db161211e 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -77,6 +77,49 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0### Added+- **Competitor product names removed from the docs portal, the benchmark page+ and the archived plan subtree, and a CI gate added to keep them out.** AiSOC+ names no competitor product, but two published comparison tables and the+ competitive-landscape section of the archived plan named eleven vendors+ outright. The analytical content is preserved everywhere: every matrix cell+ survives unchanged and every gap keeps its capability, direction and+ magnitude — only the vendor's identity is gone. The comparison columns on+ `apps/docs/src/pages/index.tsx` and `apps/docs/docs/benchmark.md` now read+ "Open-source SIEM/HIDS" and "Commercial SIEM platform"; the plan's competitor+ profiles and its five-column capability matrix now carry category labels+ ("Autonomous triage", "Hyperautomation SOAR", "Hyperscaler bundle",+ "Vendor-stack XDR", "First-line responder", "No-code automation").++ - `scripts/check_competitor_names.py` + `scripts/competitor_names.toml` drive+ the gate from an **explicit list of competitor product names**, never a+ heuristic, and allow-list the integration surfaces **by path** — connector+ modules, plugin manifests, connector docs, the connector registry, fixtures+ and tests. This matters because a vendor name is usually correct here:+ `Torq` is simultaneously a first-party SOAR connector and a name that+ appeared in a comparison matrix, so a global replace would have broken+ working connector code. Its connector, manifest, docs page and tests are+ untouched; only the competitive framing changed.+ - Both lists are checked **in both directions**. A pattern that matches+ nothing is dead and fails; an allow entry whose files no longer contain any+ of the names it excuses is stale and fails, so an exemption cannot outlive+ the code it excused; a mistyped name in an allow entry is rejected at load+ rather than silently excusing nothing.+ - A published comparison table is the one place where *any* vendor name is a+ violation, including one AiSOC integrates with, because the table's job is+ to position AiSOC against it. Those two regions are pinned by literal+ start/end markers and checked against a wider vendor list; a marker that+ drifts fails rather than scanning an empty slice and reporting clean.+ - The scan root comes from the working directory or `--root`, never from the+ script's own location, and the run prints the absolute path it walked plus+ the file count — a gate that resolves its own repository can print a+ confident OK about a tree it never inspected.+ - `scripts/check_competitor_names.py --self-test` proves the gate detects a+ known-bad sample and passes a known-good one in both directions, and fails+ if a declared competitor has no fixture. `tests/test_competitor_names_gate.py`+ adds 42 cases covering the stale-allow-list, marker-drift and dual-role-name+ properties. Wired into `.github/workflows/competitor-names.yml`, which runs+ on pull requests *and* pushes to `main` with no paths filter.+- **Tool attribution is now prevented at commit time and blocked in CI.** AiSOCdoes not attribute work to a development tool or AI assistant. An audit foundthe rule was being broken automatically: a `Co-authored-by:` trailer naming andiff --git a/CONTRIBUTING.md b/CONTRIBUTING.mdindex e0aa966ac..881d6d2da 100644--- a/CONTRIBUTING.md+++ b/CONTRIBUTING.md@@ -170,6 +170,35 @@ vendor string, or prose naming a vendor neutrally rather than as an attribution[`.githooks/attribution-allowlist.txt`](.githooks/attribution-allowlist.txt) soa reviewer sees the exemption in the diff.+### Naming competitors, and naming vendors we integrate with++AiSOC does not name a competitor product — not in documentation, marketing copy,+plan files, code comments or release notes. Where a competitor is the benchmark+for a comparison, refer to it neutrally and keep the analytical content. "We lag+the reference AI-SOC platform on recursive investigation depth" is useful; "we+lag a competitor on some things" is not. In a comparison table that usually means+the row or column labels become neutral capability descriptors while every cell+survives intact.++A vendor named as an **integration target is not a competitor reference**. This+product ships 80+ connectors, and a connector module, plugin manifest, setup+guide, normalizer profile or test naming its vendor is correct and necessary.+Some names play both roles — `Torq` ships as a first-party SOAR connector and has+also appeared in competitive framing — so judge each occurrence by its context+rather than doing a global replace, which would break working connector code.++```bash+python3 scripts/check_competitor_names.py --self-test+python3 scripts/check_competitor_names.py+```++The gate reads an explicit name list and a path allow-list from+[`scripts/competitor_names.toml`](scripts/competitor_names.toml); it never infers+intent from prose. If it flags an integration reference, add the path to+`[[allow]]` with the names it excuses and a reason. Both lists are checked in+both directions, so a stale exemption whose files no longer contain the name+fails the build rather than outliving the code it excused.+### Testing- Write tests for all new featuresdiff --git a/apps/docs/docs/benchmark.md b/apps/docs/docs/benchmark.mdindex 766f0c453..75c5dccaf 100644--- a/apps/docs/docs/benchmark.md+++ b/apps/docs/docs/benchmark.md@@ -769,16 +769,16 @@ Submission rules:## Comparison to other AI SOC offerings-| Capability | AiSOC | Wazuh | Splunk | Closed-source AI SOC |-|-----------------------------------------------|:-----:|:-----:|:------:|:---------------------:|-| Open-source (MIT) | yes | yes | no | no |-| Self-hostable | yes | yes | yes | no |-| Agent decisions step-by-step auditable | yes | n/a | n/a | no |-| Public, reproducible regression harness | yes | no | no | no |-| Eval dataset shipped in the repo | yes | no | no | no |-| Substrate-level regression gate in CI | yes | no | no | no |-| Plugin SDK (Python + Go) | yes | yes | yes | partial |-| Free | yes | yes | no | no |+| Capability | AiSOC | Open-source SIEM/HIDS | Commercial SIEM | Closed-source AI SOC |+|-----------------------------------------------|:-----:|:---------------------:|:---------------:|:---------------------:|+| Open-source (MIT) | yes | yes | no | no |+| Self-hostable | yes | yes | yes | no |+| Agent decisions step-by-step auditable | yes | n/a | n/a | no |+| Public, reproducible regression harness | yes | no | no | no |+| Eval dataset shipped in the repo | yes | no | no | no |+| Substrate-level regression gate in CI | yes | no | no | no |+| Plugin SDK (Python + Go) | yes | yes | yes | partial |+| Free | yes | yes | no | no |A self-hostable, MIT-licensed agent with a published regression harness issomething an auditor or regulated buyer can review directly. Vendor clouddiff --git a/apps/docs/docs/compliance/evidence-pack.md b/apps/docs/docs/compliance/evidence-pack.mdindex fb653605d..a68802357 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 | 32-payload adversarial corpus with a recall floor and a false-positive ceiling | `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: 107 rows+The last row is the one worth reading first. It is the honest index: 108 rows`GATED`, 9 `PARTIAL` with the specific gap named, and a ratchet that refusesto let a row sit at `NO GATE`.diff --git a/apps/docs/src/pages/index.tsx b/apps/docs/src/pages/index.tsxindex 72d2a4272..2b468210e 100644--- a/apps/docs/src/pages/index.tsx+++ b/apps/docs/src/pages/index.tsx@@ -117,8 +117,8 @@ type CompareCell = { kind: 'yes' | 'no' | 'caveat'; label: string };const COMPARE_HEADERS = ['Capability','AiSOC',- 'Wazuh',- 'Splunk Enterprise Security',+ 'Open-source SIEM/HIDS',+ 'Commercial SIEM platform','Closed-source AI SOC',] as const;@@ -155,7 +155,7 @@ const COMPARE_ROWS: ReadonlyArray<{ feature: string; cells: CompareCell[] }> = [cells: [{ kind: 'yes', label: 'LangGraph multi-agent' },{ kind: 'no', label: 'No' },- { kind: 'caveat', label: 'Splunk AI Assistant add-on' },+ { kind: 'caveat', label: 'Paid AI assistant add-on' },{ kind: 'yes', label: 'Closed-source' },],},@@ -172,8 +172,8 @@ const COMPARE_ROWS: ReadonlyArray<{ feature: string; cells: CompareCell[] }> = [feature: 'Plugin SDK (Python + Go) + community marketplace',cells: [{ kind: 'yes', label: 'Both SDKs, MIT' },- { kind: 'caveat', label: 'Wodles only' },- { kind: 'yes', label: 'Splunkbase' },+ { kind: 'caveat', label: 'Collector modules only' },+ { kind: 'yes', label: 'Vendor app marketplace' },{ kind: 'no', label: 'Vendor-only' },],},diff --git a/docs/audit/CLAIM_TO_GATE_MATRIX.md b/docs/audit/CLAIM_TO_GATE_MATRIX.mdindex 931bf8396..715492002 100644--- a/docs/audit/CLAIM_TO_GATE_MATRIX.md+++ b/docs/audit/CLAIM_TO_GATE_MATRIX.md@@ -124,10 +124,11 @@ Statuses: `GATED` (a CI job fails when the claim stops being true) · `PARTIAL`| Config snapshots reach the graph when the feature reports enabled | architecture/graph-schema.md (`:CONFIGURED_AS`) | `ci.yml` ingest job (`http_provider_test.go`) — the provider's request shape is pinned against the served route, vendor-supplied ids are escaped so an ARN cannot inject a query parameter, a 501 is distinguished from an error, and the bi-temporal edge properties the schema declares are asserted present | GATED | `is_current` is set on write and never cleared, because closing the previous interval needs a read-modify-write the ingest hot path does not do || SIEM integrations are two-way: an AiSOC verdict reaches the finding that raised it | docs/integrations/siem-writeback.md | `ci.yml` actions job (`test_disposition_writeback.py` — a confirmed true positive escalates and is never closed, an unrecognised verdict is refused rather than normalised, and the taxonomy is compared against the agents service so a verdict present on one side only cannot silently mean nothing) + `test_siem_client_signatures.py` (every close and escalate arm autospec'd against its real client) + api job (`test_siem_writeback.py` — refusals, simulations and transport failures all record `executed=False`) + fusion job (`test_source_finding_link.py` — `finding.uid` reaches `alerts.external_id`, and only a vendor with a writeback arm gets a link row) | GATED | - || A dry run never reaches a customer's vendor | live-action dry-run contract | `ci.yml` actions job (`test_dry_run_credential_strip.py` — each client factory's read set is re-derived from its own source and compared with the adapter's strip list, stripping that set is asserted to make the factory return `None`, and an end-to-end dry run with full credentials trips a wire if any factory returns a client) | GATED | the wire covers the four SIEM factories the writeback path uses; other vendors' adapters are covered by the strip-list equality check only |+| Documentation and marketing name no competitor product, while vendors AiSOC integrates with stay named | AGENTS.md (naming rule); docs portal + benchmark comparison tables | `competitor-names.yml` (`scripts/check_competitor_names.py` — an explicit name list plus a path allow-list for integration surfaces, both checked in both directions: a dead pattern, a stale allow entry that no longer excuses anything, and a drifted comparison-table marker each fail rather than reporting a clean tree; the scan prints the absolute root and file count so it cannot report on a tree it never read) + `tests/test_competitor_names_gate.py` (42 cases, including `Torq` asserted as a competitor in prose *and* left untouched across its connector module, manifest, docs page and tests) | GATED | the name list is AI-SOC/SOAR rivals; vendors that are purely integration targets are deliberately absent from it and are instead held out of the pinned comparison-table regions, which are checked against a wider vendor list |## Summary-- GATED: 107+- GATED: 108- PARTIAL: 9- 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/plans/cyble-aisoc/cyble-aisoc-plan.md b/plans/cyble-aisoc/cyble-aisoc-plan.mdindex e49e567ab..e5bb9ee92 100644--- a/plans/cyble-aisoc/cyble-aisoc-plan.md+++ b/plans/cyble-aisoc/cyble-aisoc-plan.md@@ -55,7 +55,7 @@ Every strategy rests on premises. These must survive challenge.**Evidence:** CyberSeek 2024 shows 660,000+ unfilled cybersecurity jobs in the US alone. Enterprise SOC teams report 45% analyst burnout leading to 2-year average tenure. Average CISO spends 35% of security budget on analyst labor vs. 15% a decade ago.-**Devil's advocate:** Hyperscaler-native SIEM/SOAR bundles (Sentinel + Copilot, Chronicle + Duet) are improving analyst productivity within existing tools. Offshore SOC models (India, Philippines, Eastern Europe) are absorbing demand at 40–60% cost reduction. If enterprises route to MDR/MSSP at scale, the TAM for in-house SOC automation shrinks.+**Devil's advocate:** Hyperscaler-native SIEM/SOAR bundles (each major cloud's own SIEM plus its bundled AI assistant) are improving analyst productivity within existing tools. Offshore SOC models (India, Philippines, Eastern Europe) are absorbing demand at 40–60% cost reduction. If enterprises route to MDR/MSSP at scale, the TAM for in-house SOC automation shrinks.**Verdict:** Premise holds. Offshore and MDR trends create *channel partners*, not competitors — MSSPs need the platform more urgently than enterprise SOCs do, and they represent a faster go-to-market. Hyperscaler bundles are real competition (see Section 2c), not a premise-killer.@@ -65,7 +65,7 @@ Every strategy rests on premises. These must survive challenge.**The claim:** Agent reliability for structured tool-calling tasks (lookup, enrich, classify, score) is high enough for production use if: (a) the agent only calls declared tools, (b) tool outputs are sanitized before re-ingestion, (c) human gates are placed at irreversible actions, and (d) the agent produces a signed evidence trail.-**Evidence:** Benchmark studies on GPT-4o and Claude 3.5/3.7 family show >95% tool-call accuracy on structured security enrichment tasks when given well-formed schemas. Commercial deployments at Dropzone AI, Intezer Analyze, and Prophet Security report production alert-triage accuracy competitive with Tier-1 analysts in controlled evaluations.+**Evidence:** Benchmark studies on GPT-4o and Claude 3.5/3.7 family show >95% tool-call accuracy on structured security enrichment tasks when given well-formed schemas. Commercial deployments at the leading autonomous-triage vendors and at an automated malware-analysis vendor report production alert-triage accuracy competitive with Tier-1 analysts in controlled evaluations.**Devil's advocate:** LLMs hallucinate. In a security context, a hallucinated threat verdict that closes a real incident is worse than no automation. Prompt injection via adversarial log content is a real attack vector. Fine-grained multi-step reasoning is still unstable — an agent that correctly enriches 9 of 10 tool calls and then misclassifies the 10th still produces a false close.@@ -77,7 +77,7 @@ Every strategy rests on premises. These must survive challenge.**The claim:** The underlying LLM is a commodity by 2026. Anthropic, OpenAI, Google, and open weights will all hit roughly equivalent capability for structured tool-calling. The moat is: (a) the depth and freshness of threat intelligence the agent can query, (b) the breadth of tools the agent can call, (c) the feedback loop from analyst corrections that continuously improves verdict quality.-**Devil's advocate:** If the moat is integrations, Torq and Tines already have 200+ connectors. If the moat is CTI, IBM X-Force and Recorded Future are better-resourced than Cyble in certain enterprise segments. Model-level differentiation may last longer than assumed — agentic orchestration quality (chain-of-thought stability, multi-step planning) varies significantly by model family, and a model-native SOC product from Anthropic/OpenAI is not impossible.+**Devil's advocate:** If the moat is integrations, the incumbent hyperautomation SOAR platforms already have 200+ connectors. If the moat is CTI, the largest commercial threat-intelligence providers are better-resourced than Cyble in certain enterprise segments. Model-level differentiation may last longer than assumed — agentic orchestration quality (chain-of-thought stability, multi-step planning) varies significantly by model family, and a model-native SOC product from Anthropic/OpenAI is not impossible.**Verdict:** Premise holds *with qualification.* Cyble's moat is **the specific combination**: dark-web telemetry + ASM surface mapping + brand intel + CTI, all fused at query time by agents that have already learned what matters to each customer's environment. No competitor has all four owned feeds. The integration breadth is table stakes; the intel fusion is the weapon.@@ -97,41 +97,41 @@ Every strategy rests on premises. These must survive challenge.#### Tier 1: Direct Competitors (most dangerous)-**Prophet Security**+**The reference autonomous-triage platform** *(category leader, triage-only positioning)*- What they do: Autonomous Tier-1 triage via multi-agent AI. Alert enrichment, verdict with confidence score, auto-close with full reasoning.- Where they are strong: Clean UX, solid accuracy on standard EDR/identity alerts, fast time-to-value.- Where they break: Intel depth is third-party only (VirusTotal, Shodan, IP reputation). No SOAR. No investigation depth. No exposure awareness. Single-use case positioning limits upsell.-- Where Cyble beats them: Cyble CTI + dark-web + ASM enrichment makes every verdict richer. Cyble AiSOC adds investigation + SOAR + exposure-to-response in the same substrate — Prophet is a point product.+- Where Cyble beats them: Cyble CTI + dark-web + ASM enrichment makes every verdict richer. Cyble AiSOC adds investigation + SOAR + exposure-to-response in the same substrate — the triage-only platform is a point product.-**Torq**+**The reference hyperautomation SOAR platform**- What they do: AI-assisted SOAR with no-code/low-code hyperautomation. 1,000+ integrations. "Autonomous SOC" positioning.-- Where they are strong: Integration breadth, automation velocity, existing enterprise customer base (Commvault, Armis, others), strong funding ($70M Series B).+- Where they are strong: Integration breadth, automation velocity, an established enterprise customer base, strong funding (~$70M Series B).- Where they break: Still fundamentally playbook-based — "AI-assisted" means suggesting the next step, not reasoning end-to-end. No native CTI. No investigation agent. Alert triage is still analyst-driven. The "autonomous" label overpromises.-- Where Cyble beats them: True agentic reasoning (no playbooks) + native Cyble intel fusion. Torq requires playbook authors; Cyble AiSOC requires none for standard use cases.+- Where Cyble beats them: True agentic reasoning (no playbooks) + native Cyble intel fusion. The SOAR platform requires playbook authors; Cyble AiSOC requires none for standard use cases.#### Tier 2: Strong Adjacents (real risk at displacement)-**Microsoft Sentinel + Security Copilot**-- Bundle threat: Every Azure customer gets Sentinel. Security Copilot adds natural-language SIEM querying, incident summaries, guided investigation. Free or near-free for M365 E5 customers.-- Weakness: Copilot is an assistant, not an autonomous agent. No dark-web. No external CTI depth. Microsoft alert sources only in early tiers. Bureaucratic product velocity.-- Cyble counter: The Cyble CTI + multi-SIEM angle (Splunk + Elastic + Sentinel in the same substrate) + MSSP channel serve customers who aren't Microsoft-only stacks.+**The primary hyperscaler SIEM + AI-assistant bundle**+- Bundle threat: Every customer of that cloud already gets the SIEM. The bundled assistant adds natural-language SIEM querying, incident summaries, guided investigation. Free or near-free at the top productivity-suite tier.+- Weakness: The assistant is an assistant, not an autonomous agent. No dark-web. No external CTI depth. First-party alert sources only in early tiers. Bureaucratic product velocity.+- Cyble counter: The Cyble CTI + multi-SIEM angle (Splunk + Elastic + Sentinel in the same substrate) + MSSP channel serve customers who aren't single-vendor stacks.-**Google Chronicle + Duet AI**-- Similar to Sentinel: strong for Google-native stacks, weak on dark-web/CTI depth, assistant not agent.+**The second hyperscaler SIEM + AI-assistant bundle**+- Similar to the first: strong for that cloud's native stacks, weak on dark-web/CTI depth, assistant not agent.-**Palo Alto XSIAM**+**The reference vendor-stack unified SIEM/SOAR/XDR platform**- What they do: Unified SIEM + SOAR + XDR + CDL on a single data platform. Strong automated playbooks, stitched investigation.-- Weakness: Heavily biased toward Palo Alto product stack. Expensive. No agentic reasoning substrate — still rule-based.-- Cyble counter: Multi-vendor, multi-SIEM, vendor-neutral + Cyble intel fusion. For mixed-stack enterprises, XSIAM creates lock-in that Cyble AiSOC avoids.+- Weakness: Heavily biased toward that vendor's own product stack. Expensive. No agentic reasoning substrate — still rule-based.+- Cyble counter: Multi-vendor, multi-SIEM, vendor-neutral + Cyble intel fusion. For mixed-stack enterprises, the single-vendor platform creates lock-in that Cyble AiSOC avoids.-**Dropzone AI**-- What they do: Autonomous alert triage and investigation for SecOps. Similar positioning to Prophet but focused on fully automated first-line response.+**The autonomous first-line-response challenger**+- What they do: Autonomous alert triage and investigation for SecOps. Similar positioning to the triage category leader but focused on fully automated first-line response.- Weakness: Limited integration depth, early stage, US-market focused.-**Swimlane / Tines**+**The no-code automation platforms**- Automation platforms with SOC use cases. Strong no-code. Weak on AI reasoning depth.-**Radiant Security**+**The early-stage AI-SOC entrant**- AI-powered SOC with alert correlation and triage. Series A stage.#### Competitive summary matrix@@ -141,12 +141,12 @@ Every strategy rests on premises. These must survive challenge.│ Tier-1 Triage │ Investigation│ Fusion │ Automation │ Response Loop─────────────────────┼───────────────┼──────────────┼──────────────┼──────────────┼──────────────Cyble AiSOC (target) │ ●●●●● │ ●●●●● │ ●●●●● │ ●●●●● │ ●●●●●-Prophet Security │ ●●●● │ ●● │ ●● │ ○ │ ○-Torq │ ●● │ ●● │ ● │ ●●●● │ ●-Microsoft Copilot │ ●● │ ●●● │ ●● │ ●●● │ ●-Palo Alto XSIAM │ ●●● │ ●●● │ ●● │ ●●●● │ ●●-Dropzone AI │ ●●●● │ ●●● │ ●● │ ● │ ○-Swimlane/Tines │ ● │ ● │ ● │ ●●●● │ ●+Autonomous triage │ ●●●● │ ●● │ ●● │ ○ │ ○+Hyperautomation SOAR │ ●● │ ●● │ ● │ ●●●● │ ●+Hyperscaler bundle │ ●● │ ●●● │ ●● │ ●●● │ ●+Vendor-stack XDR │ ●●● │ ●●● │ ●● │ ●●●● │ ●●+First-line responder │ ●●●● │ ●●● │ ●● │ ● │ ○+No-code automation │ ● │ ● │ ● │ ●●●● │ ●● = minimal ●●●●● = best-in-class```@@ -207,8 +207,8 @@ The four wedges are not four products. They are four roles on the same agentic s- For verdicts below threshold or novel TTPs: escalates to Investigator Agent with pre-built context.- Analyst receives exception queue only: novel, complex, or high-stakes alerts needing human judgment.-**Differentiation vs Prophet/Dropzone:**-Prophet triages alerts using third-party feeds. Cyble AiSOC triages using Cyble's proprietary dark-web + ASM + credential exposure data — detecting threats that no third-party feed catches because Cyble collected them directly from the source. A phishing campaign targeting a specific enterprise brand that appears in Cyble dark-web monitoring but not yet in any public feed is caught. No Prophet alert would fire for it.+**Differentiation vs the autonomous-triage platforms:**+Those platforms triage alerts using third-party feeds. Cyble AiSOC triages using Cyble's proprietary dark-web + ASM + credential exposure data — detecting threats that no third-party feed catches because Cyble collected them directly from the source. A phishing campaign targeting a specific enterprise brand that appears in Cyble dark-web monitoring but not yet in any public feed is caught. No third-party-feed-only alert would fire for it.**Quantified target:**- 85% of Tier-1 alerts auto-closed with verdict + full evidence trail@@ -239,7 +239,7 @@ Prophet triages alerts using third-party feeds. Cyble AiSOC triages using Cyble'- Produces: case narrative (human-readable, analyst-editable), blast radius map, MITRE ATT&CK tactic chain, confidence score per finding, recommended next actions ranked by urgency.- Analyst reviews, edits, approves, and escalates response or closes.-**Differentiation vs Microsoft Copilot / Chronicle Duet:**+**Differentiation vs the hyperscaler SIEM assistants:**Those are query assistants — they help the analyst write better Kusto/YARA-L queries. The Investigator Agent *runs* the investigation plan autonomously, calls tools in sequence, and hands back a completed case file. The analyst's job shifts from "run every query" to "review and approve findings."**Quantified target:**@@ -252,7 +252,7 @@ Those are query assistants — they help the analyst write better Kusto/YARA-L q### 3c. Pillar 3 — AI-Native SOAR (No Playbooks)-**Job to be done:** An investigated incident needs a response action: isolate a host, reset a password, block an IP, quarantine an email, revoke a token. Today this requires a pre-authored playbook in Splunk SOAR/Torq/Tines. Cyble AiSOC executes response actions through agentic reasoning — no playbook authoring required for standard use cases.+**Job to be done:** An investigated incident needs a response action: isolate a host, reset a password, block an IP, quarantine an email, revoke a token. Today this requires a pre-authored playbook in a traditional SOAR platform. Cyble AiSOC executes response actions through agentic reasoning — no playbook authoring required for standard use cases.**Today's manual workflow (with legacy SOAR):**1. Playbook author writes isolation playbook (days of work, QA cycle).@@ -269,8 +269,8 @@ Those are query assistants — they help the analyst write better Kusto/YARA-L q- Handles edge cases by reasoning: "The standard isolation playbook doesn't apply here because this host is tagged as a critical production DB. Recommending network segmentation instead of full isolation. Please confirm."- Logs every action to ticketing, SIEM, and audit store.-**Differentiation vs Torq/Tines/Swimlane:**-Torq/Tines require a human to build and maintain playbooks for every response scenario. Cyble AiSOC's Responder Agent reasons from the current case context to select and sequence actions — no playbook required for the top 80% of response scenarios. Custom playbooks remain available for the 20% of scenarios where organizational policy requires specific steps.+**Differentiation vs the no-code SOAR/automation platforms:**+Those platforms require a human to build and maintain playbooks for every response scenario. Cyble AiSOC's Responder Agent reasons from the current case context to select and sequence actions — no playbook required for the top 80% of response scenarios. Custom playbooks remain available for the 20% of scenarios where organizational policy requires specific steps.**Quantified target:**- Top 20 response action types handled without playbook authoring@@ -298,7 +298,7 @@ Torq/Tines require a human to build and maintain playbooks for every response sc- **Threat Graph continuously updated**: every Investigator + Hunter finding is persisted as entity relationships (user → host → IP → campaign → threat actor). Future triage queries the graph instead of rebuilding context from scratch.**Differentiation vs all competitors:**-No competitor has this loop closed. Prophet/Dropzone/Torq are reactive (they respond to SIEM alerts). Cyble AiSOC generates proactive cases from Cyble's proprietary exposure data. The Threat Graph accumulates institutional memory — every investigation makes future investigations faster. This is the compounding flywheel that makes the platform better the longer a customer uses it.+No competitor has this loop closed. The autonomous-triage platforms and the hyperautomation SOAR platforms are reactive (they respond to SIEM alerts). Cyble AiSOC generates proactive cases from Cyble's proprietary exposure data. The Threat Graph accumulates institutional memory — every investigation makes future investigations faster. This is the compounding flywheel that makes the platform better the longer a customer uses it.**Quantified target:**- Mean time from dark-web credential exposure to proactive case creation: <4 hours@@ -908,8 +908,8 @@ The base fee lowers buyer risk and creates a predictable floor. The outcome tier- Target: $15M ARR new-logo in Year 2**Competitive displacement play:**-- Prophet Security customers: upsell from triage-only to full platform-- Torq customers: replacement play on "playbook authoring fatigue" — no more SOAR maintenance+- Autonomous-triage platform customers: upsell from triage-only to full platform+- Hyperautomation SOAR customers: replacement play on "playbook authoring fatigue" — no more SOAR maintenance- Manual SIEM-only shops: greenfield, highest value, most education needed---@@ -973,7 +973,7 @@ See [roadmap/12-month.md](roadmap/12-month.md) for full detail.- Connector SDK GA + community marketplace beta**GTM:**-- "Replace your SOAR" campaign targeting Torq/Tines/Swimlane prospects+- "Replace your SOAR" campaign targeting no-code SOAR/automation platform prospects- Case studies from Q1/Q2 early adopters published- New-logo pipeline development (North America + Europe)- SOC 2 Type II report issued@@ -1096,17 +1096,17 @@ These are USER CHALLENGES per /autoplan methodology: places where my analysis le----**UC1 — "All four wedges" as simultaneous GTM messaging is Torq's mistake**+**UC1 — "All four wedges" as simultaneous GTM messaging is the hyperautomation SOAR platform's mistake****What you said:** Build all four pillars and go to market with all of them.**What I'm recommending:** Build all four pillars (architecturally, yes — one substrate), but go to market with **one beachhead message** for Year 1.-**Why:** Torq launched with "autonomous SOC" and "1,000 integrations" and "hyperautomation" simultaneously. Every analyst report I've read says the result is a fuzzy ICP (Ideal Customer Profile) — Torq appeals to everyone and closes fewer deals because "autonomous SOC" without a specific job-to-be-done doesn't create urgency. Prophet Security's single-message approach ("autonomous Tier-1 triage") creates a specific pain, a specific buyer (VP SOC Operations), and a specific success metric (Tier-1 analyst hours saved). They convert faster.+**Why:** The hyperautomation SOAR platform launched with "autonomous SOC" and "1,000 integrations" and "hyperautomation" simultaneously. Every analyst report I've read says the result is a fuzzy ICP (Ideal Customer Profile) — it appeals to everyone and closes fewer deals because "autonomous SOC" without a specific job-to-be-done doesn't create urgency. The autonomous-triage platform's single-message approach ("autonomous Tier-1 triage") creates a specific pain, a specific buyer (VP SOC Operations), and a specific success metric (Tier-1 analyst hours saved). They convert faster.**Recommendation:** Lead with **Autonomous Tier-1 Triage with Cyble Intel Fusion** as the market message. Everything else (investigation, SOAR, exposure loop) is revealed in the product, mentioned in demos, and expanded in subsequent sales motion. One problem, one buyer, one metric. The architecture supports all four from Day 1 — but the *story* is one.-**What you might know that I don't:** Cyble may have existing relationships where the SOAR replacement story (replacing Torq) is the urgent opener. Or the Hunter/exposure-loop story may be uniquely compelling for Cyble CTI customers who already have the intel and just need the response arm. If either of those is true, the beachhead message changes — but it should still be one message, not four.+**What you might know that I don't:** Cyble may have existing relationships where the SOAR replacement story (replacing an incumbent hyperautomation SOAR) is the urgent opener. Or the Hunter/exposure-loop story may be uniquely compelling for Cyble CTI customers who already have the intel and just need the response arm. If either of those is true, the beachhead message changes — but it should still be one message, not four.**If I'm wrong, the cost is:** Slower initial triage POVs (one-message focus might narrow early pipeline). You have a broader story but no crisp ICP, and first 12 months are spent educating buyers rather than converting a clear pain point.@@ -1114,14 +1114,14 @@ These are USER CHALLENGES per /autoplan methodology: places where my analysis le**UC2 — The "100x better" framing needs a falsifiable claim or it becomes noise**-**What you said:** "100x better in quality, collections and integrations than Torq and Prophet Security."+**What you said:** "100x better in quality, collections and integrations than [the leading hyperautomation SOAR and autonomous-triage platforms]."**What I'm recommending:** Replace "100x better" with specific, auditable claims that can be proven in a 30-day POV. "100x" is marketing noise in security. Buyers have heard it from every vendor. It creates skepticism, not urgency.**Proposed falsifiable claims:**-- "Auto-close 85% of Tier-1 alerts with full evidence trail. Prophet closes ~70% without Cyble intel."-- "Connect to your first SIEM and see a completed case in <10 minutes. Torq takes days to first working automation."-- "Zero playbook authoring for the top 20 response scenarios. Torq requires a playbook for every one."+- "Auto-close 85% of Tier-1 alerts with full evidence trail. The autonomous-triage category leader closes ~70% without Cyble intel."+- "Connect to your first SIEM and see a completed case in <10 minutes. The incumbent hyperautomation SOAR takes days to first working automation."+- "Zero playbook authoring for the top 20 response scenarios. The incumbent hyperautomation SOAR requires a playbook for every one."- "Surface credential exposures from Cyble dark-web monitoring before your SIEM fires. No competitor does this."These are differentiating, measurable, and provable in a POV. "100x better" is not.diff --git a/plans/cyble-aisoc/roadmap/12-month.md b/plans/cyble-aisoc/roadmap/12-month.mdindex 20be9698e..bf3104c85 100644--- a/plans/cyble-aisoc/roadmap/12-month.md+++ b/plans/cyble-aisoc/roadmap/12-month.md@@ -301,9 +301,9 @@ Ship the Responder Agent. Position the platform as a SOAR replacement. SDK becom### GTM deliverables**Month 7:**-- [ ] "Replace your SOAR" campaign launch: positioning vs Torq, Tines, Swimlane-- [ ] Sales play: "playbook fatigue" — Torq/Tines customer displacement motion-- [ ] Target list: 200 Torq/Tines accounts (via contact data + partner intelligence)+- [ ] "Replace your SOAR" campaign launch: positioning vs the incumbent no-code SOAR/automation platforms+- [ ] Sales play: "playbook fatigue" — no-code SOAR customer displacement motion+- [ ] Target list: 200 no-code SOAR accounts (via contact data + partner intelligence)**Month 8:**- [ ] New-logo pipeline development: North America enterprise (1,000–5,000 employees, no SOAR)diff --git a/scripts/build_marketplace.py b/scripts/build_marketplace.pyindex 003264116..d378be1c1 100644--- a/scripts/build_marketplace.py+++ b/scripts/build_marketplace.py@@ -495,7 +495,7 @@ def _tier_breakdown(items: list[dict[str, Any]]) -> dict[str, int]:def _detection_tier_breakdown(items: list[dict[str, Any]]) -> dict[str, int]:- """Count detection items per tier — the main 'are we Wazuh-scale' headline."""+ """Count detection items per tier — the main 'are we at open-source-SIEM scale' headline."""counts: dict[str, int] = {}for item in items:if item.get("type") != "detection":diff --git a/scripts/check_competitor_names.py b/scripts/check_competitor_names.pynew file mode 100644index 000000000..dbc96c8f0--- /dev/null+++ b/scripts/check_competitor_names.py@@ -0,0 +1,506 @@+#!/usr/bin/env python3+"""Competitor-naming gate.++AiSOC never names a competitor product — not in documentation, marketing copy,+plan files, code comments or release notes. Where a competitor is the benchmark+for a comparison the text refers to it neutrally and keeps the analytical+content: the capability compared, the direction of the gap, the magnitude.++The difficulty is that a vendor name is usually *correct* here. This product+ships 80+ connectors, so a connector module, a plugin manifest, a setup guide or+a normalizer profile naming its vendor is necessary. `Torq` is the clearest+case: it is simultaneously a first-party SOAR connector and a name that used to+appear in a competitive comparison matrix. A blind search-and-replace would+break working connector code.++So the gate never infers intent from prose. It works from two explicit lists in+`scripts/competitor_names.toml`:++ * `[[competitors]]` — the product names that may not appear, as regexes.+ * `[[allow]]` — the integration surfaces where those names are expected,+ by path, each naming which names it excuses and why.++Plus a third, narrower list: `[[comparison_surfaces]]` pins the published+comparison tables by literal start/end marker and checks them against a wider+vendor list. A comparison table is the one place where any vendor name is a+violation, including a vendor this product integrates with, because the table's+whole job is to position AiSOC against it. The integration allow-list does not+apply inside those regions.++Both lists are checked in both directions, because the dominant failure shape in+this repository is a check that compares A against B and never B against A, then+prints OK while drift accumulates:++ * a competitor pattern that matches nothing anywhere — including its own+ fixtures — is dead and fails, rather than silently excusing the tree;+ * an allow entry matching no file, or matching files that no longer contain+ any of the names it excuses, is a stale exemption and fails, so an exemption+ cannot outlive the code it excused;+ * a comparison-surface marker that no longer matches fails, rather than+ scanning an empty slice and reporting clean.++The scan root is resolved from the working directory (or `--root`), never from+this file's own location, and is printed along with the file count. A gate that+resolves its own repository can print a confident OK about a tree it never+inspected.++Usage:+ python3 scripts/check_competitor_names.py --self-test+ python3 scripts/check_competitor_names.py+ python3 scripts/check_competitor_names.py --root /path/to/worktree+"""++from __future__ import annotations++import argparse+import fnmatch+import json+import re+import subprocess+import sys+import tomllib+from dataclasses import dataclass, field+from pathlib import Path++# Paths that hold competitor names because they are the machinery for detecting+# them, or the record of the cleanup. Scanning these would make the gate flag+# itself and its own documentation.+SELF_REFERENTIAL = frozenset(+ {+ "scripts/competitor_names.toml",+ "scripts/check_competitor_names.py",+ "scripts/competitor_fixtures.json",+ "tests/test_competitor_names_gate.py",+ ".github/workflows/competitor-names.yml",+ }+)++# Binary and lockfile suffixes: never prose, and only a source of noise.+SKIP_SUFFIXES = (+ ".png",+ ".jpg",+ ".jpeg",+ ".gif",+ ".webp",+ ".svg",+ ".ico",+ ".pdf",+ ".woff",+ ".woff2",+ ".ttf",+ ".zip",+ ".gz",+ ".tar",+ ".mp4",+ ".lock",+)+++class ConfigError(RuntimeError):+ """The gate's own configuration is unusable, so it cannot report a verdict."""+++@dataclass(frozen=True)+class Competitor:+ name: str+ regex: re.Pattern[str]+ neutral: str+++@dataclass(frozen=True)+class AllowEntry:+ paths: tuple[str, ...]+ names: frozenset[str]+ reason: str+++@dataclass(frozen=True)+class ComparisonSurface:+ file: str+ start: str+ end: str+ reason: str+++@dataclass(frozen=True)+class Config:+ competitors: tuple[Competitor, ...]+ allows: tuple[AllowEntry, ...]+ comparison_vendors: tuple[str, ...]+ comparison_surfaces: tuple[ComparisonSurface, ...]+++@dataclass+class Finding:+ path: str+ line_no: int+ competitor: str+ excerpt: str+ neutral: str+ kind: str = "naming"+++@dataclass+class ScanReport:+ root: Path+ config_path: Path+ files_scanned: int = 0+ files_skipped: int = 0+ findings: list[Finding] = field(default_factory=list)+ stale_allows: list[str] = field(default_factory=list)+ dead_patterns: list[str] = field(default_factory=list)+ broken_surfaces: list[str] = field(default_factory=list)+ surfaces_checked: int = 0++ @property+ def ok(self) -> bool:+ return not (self.findings or self.stale_allows or self.dead_patterns or self.broken_surfaces)+++def load_config(path: Path) -> Config:+ """Parse the TOML config, failing loudly on anything malformed."""+ try:+ raw = tomllib.loads(path.read_text(encoding="utf-8"))+ except FileNotFoundError as exc:+ raise ConfigError(f"config not found: {path}") from exc+ except tomllib.TOMLDecodeError as exc:+ raise ConfigError(f"config is not valid TOML: {path}: {exc}") from exc++ competitors: list[Competitor] = []+ for entry in raw.get("competitors", []):+ name = entry.get("name")+ pattern = entry.get("pattern")+ if not name or not pattern:+ raise ConfigError(f"[[competitors]] entry needs both 'name' and 'pattern': {entry!r}")+ flags = 0 if entry.get("case_sensitive", False) else re.IGNORECASE+ try:+ regex = re.compile(pattern, flags)+ except re.error as exc:+ raise ConfigError(f"[[competitors]] {name}: bad regex {pattern!r}: {exc}") from exc+ competitors.append(Competitor(name=name, regex=regex, neutral=entry.get("neutral", "a neutral descriptor")))+ if not competitors:+ raise ConfigError("config declares no competitors, so the gate would pass everything")++ known = {c.name for c in competitors}+ allows: list[AllowEntry] = []+ for entry in raw.get("allow", []):+ paths = tuple(entry.get("paths", ()))+ names = frozenset(entry.get("names", ()))+ reason = entry.get("reason", "")+ if not paths or not names or not reason:+ raise ConfigError(f"[[allow]] entry needs 'paths', 'names' and 'reason': {entry!r}")+ unknown = names - known+ if unknown:+ raise ConfigError(f"[[allow]] {paths[0]} excuses names that are not declared competitors: {sorted(unknown)}")+ allows.append(AllowEntry(paths=paths, names=names, reason=reason))++ vendors = tuple(raw.get("comparison", {}).get("vendors", ()))+ surfaces: list[ComparisonSurface] = []+ for entry in raw.get("comparison_surfaces", []):+ for key in ("file", "start", "end", "reason"):+ if not entry.get(key):+ raise ConfigError(f"[[comparison_surfaces]] entry needs '{key}': {entry!r}")+ surfaces.append(ComparisonSurface(file=entry["file"], start=entry["start"], end=entry["end"], reason=entry["reason"]))+ if surfaces and not vendors:+ raise ConfigError("comparison surfaces are declared but [comparison].vendors is empty")++ return Config(+ competitors=tuple(competitors),+ allows=tuple(allows),+ comparison_vendors=vendors,+ comparison_surfaces=tuple(surfaces),+ )+++def resolve_root(explicit: str | None) -> Path:+ """Resolve the tree to scan from the working directory, never from __file__.++ A gate that locates its repository relative to its own source file reports on+ whichever checkout it was imported from, which is not necessarily the one the+ caller meant. Deriving it from the caller's directory keeps the two aligned.+ """+ if explicit:+ root = Path(explicit).resolve()+ if not root.is_dir():+ raise ConfigError(f"--root is not a directory: {root}")+ return root+ try:+ out = subprocess.run(+ ["git", "rev-parse", "--show-toplevel"],+ capture_output=True,+ text=True,+ check=True,+ )+ except (OSError, subprocess.CalledProcessError) as exc:+ raise ConfigError("not inside a git worktree; pass --root explicitly") from exc+ return Path(out.stdout.strip()).resolve()+++def tracked_files(root: Path) -> list[str]:+ out = subprocess.run(+ ["git", "-C", str(root), "ls-files", "-z"],+ capture_output=True,+ text=True,+ check=True,+ )+ return [p for p in out.stdout.split("\0") if p]+++def _matches(path: str, globs: tuple[str, ...]) -> bool:+ for glob in globs:+ if fnmatch.fnmatch(path, glob):+ return True+ # A directory glob should cover the directory itself as well as its+ # contents, so "docs/connectors/**" matches "docs/connectors/x.md".+ if glob.endswith("/**") and (path == glob[:-3] or path.startswith(glob[:-2])):+ return True+ return False+++def excused_names(path: str, allows: tuple[AllowEntry, ...]) -> set[str]:+ excused: set[str] = set()+ for allow in allows:+ if _matches(path, allow.paths):+ excused |= allow.names+ return excused+++def scan_text(+ path: str,+ text: str,+ competitors: tuple[Competitor, ...],+ excused: set[str],+) -> list[Finding]:+ findings: list[Finding] = []+ for line_no, line in enumerate(text.splitlines(), start=1):+ for competitor in competitors:+ if competitor.name in excused:+ continue+ match = competitor.regex.search(line)+ if match:+ findings.append(+ Finding(+ path=path,+ line_no=line_no,+ competitor=competitor.name,+ excerpt=line.strip()[:160],+ neutral=competitor.neutral,+ )+ )+ return findings+++def scan_comparison_surfaces(root: Path, config: Config, report: ScanReport) -> None:+ """Check the pinned comparison-table regions against the wider vendor list."""+ vendor_patterns = [(v, re.compile(rf"\b{re.escape(v)}\b", re.IGNORECASE)) for v in config.comparison_vendors]+ for surface in config.comparison_surfaces:+ target = root / surface.file+ if not target.is_file():+ report.broken_surfaces.append(f"{surface.file}: file is missing, so its comparison table was never checked")+ continue+ text = target.read_text(encoding="utf-8", errors="replace")+ start = text.find(surface.start)+ if start == -1:+ report.broken_surfaces.append(f"{surface.file}: start marker {surface.start!r} not found, so the region was never checked")+ continue+ end = text.find(surface.end, start + len(surface.start))+ if end == -1:+ report.broken_surfaces.append(f"{surface.file}: end marker {surface.end!r} not found after the start marker")+ continue+ report.surfaces_checked += 1+ offset = text.count("\n", 0, start) + 1+ for rel_line, line in enumerate(text[start:end].splitlines()):+ for vendor, pattern in vendor_patterns:+ if pattern.search(line):+ report.findings.append(+ Finding(+ path=surface.file,+ line_no=offset + rel_line,+ competitor=vendor,+ excerpt=line.strip()[:160],+ neutral="a neutral capability descriptor (row/column labels), keeping every cell intact",+ kind="comparison",+ )+ )+++def scan_tree(root: Path, config: Config, config_path: Path) -> ScanReport:+ report = ScanReport(root=root, config_path=config_path)+ # Which competitor names were seen anywhere at all, and which allow entries+ # actually excused something. Both feed the reverse checks below.+ seen_names: set[str] = set()+ allow_hits: dict[int, int] = {i: 0 for i in range(len(config.allows))}++ for rel in tracked_files(root):+ if rel in SELF_REFERENTIAL or rel.endswith(SKIP_SUFFIXES):+ report.files_skipped += 1+ continue+ target = root / rel+ try:+ text = target.read_text(encoding="utf-8")+ except (OSError, UnicodeDecodeError):+ report.files_skipped += 1+ continue+ report.files_scanned += 1++ excused = excused_names(rel, config.allows)+ for competitor in config.competitors:+ if competitor.regex.search(text):+ seen_names.add(competitor.name)+ for index, allow in enumerate(config.allows):+ if competitor.name in allow.names and _matches(rel, allow.paths):+ allow_hits[index] += 1+ report.findings.extend(scan_text(rel, text, config.competitors, excused))++ scan_comparison_surfaces(root, config, report)++ # Reverse check 1: an allow entry that excuses nothing is stale. Either the+ # integration was removed and the exemption outlived it, or the path moved+ # and the exemption now covers nothing while looking like it still works.+ for index, allow in enumerate(config.allows):+ if allow_hits[index] == 0:+ report.stale_allows.append(f"{', '.join(allow.paths)} excuses {sorted(allow.names)} but no file there contains any of them")++ # Reverse check 2: a competitor pattern that matches nothing in the tree is+ # not proof of cleanliness on its own — the self-test proves each pattern+ # still matches its fixture. What is checked here is that the fixtures exist+ # and cover every declared competitor, which `--self-test` enforces.+ return report+++def print_report(report: ScanReport, config: Config) -> None:+ print(f"competitor-naming gate: scanned {report.root}")+ print(f" config: {report.config_path}")+ print(f" competitors: {len(config.competitors)}")+ print(f" allow entries: {len(config.allows)}")+ print(f" files scanned: {report.files_scanned}")+ print(f" files skipped: {report.files_skipped} (binary, generated, or the gate's own machinery)")+ print(f" comparison tables: {report.surfaces_checked}/{len(config.comparison_surfaces)} regions located and checked")++ if report.broken_surfaces:+ print("\nComparison-table regions that could not be located:")+ for item in report.broken_surfaces:+ print(f" ✗ {item}")++ if report.stale_allows:+ print("\nStale allow-list entries (an exemption must not outlive the code it excused):")+ for item in report.stale_allows:+ print(f" ✗ {item}")++ if report.findings:+ print(f"\n{len(report.findings)} competitor reference(s) found:")+ for finding in report.findings:+ label = "comparison table" if finding.kind == "comparison" else "competitor name"+ print(f" ✗ {finding.path}:{finding.line_no} [{label}] {finding.competitor}")+ print(f" {finding.excerpt}")+ if finding.kind == "comparison":+ print(f" → use {finding.neutral}")+ else:+ print(f" → use {finding.neutral}, keeping the analytical content")+ print(+ "\nIf this is an integration reference (a connector, plugin manifest, setup\n"+ "guide, normalizer profile or test), add the path to [[allow]] in\n"+ "scripts/competitor_names.toml with the names it excuses and a reason."+ )++ if report.ok:+ print("\nOK: no competitor product named outside its integration surfaces.")+++def self_test(config_path: Path, fixtures_path: Path) -> int:+ """Prove the gate is not vacuous, in both directions.++ A gate checked only against clean input cannot tell you it still works: a+ regex that stops matching turns it into a no-op that reports OK forever. A+ gate checked only against bad input can pass by flagging everything, which+ would break every connector page in the tree. Both directions are asserted.+ """+ config = load_config(config_path)+ corpus = json.loads(fixtures_path.read_text(encoding="utf-8"))+ failures: list[str] = []++ declared = {c.name for c in config.competitors}+ covered = {case["competitor"] for case in corpus["bad"]}+ missing = declared - covered+ if missing:+ failures.append(f"no known-bad fixture for declared competitor(s): {sorted(missing)}")++ # Direction 1: every known-bad sample must be caught, by the expected name.+ for case in corpus["bad"]:+ found = scan_text(case["path"], case["text"], config.competitors, excused=set())+ names = {f.competitor for f in found}+ if case["competitor"] not in names:+ failures.append(f"known-bad not caught ({case['competitor']}): {case['text'][:80]!r}")++ # Direction 2: every known-good sample must pass. These are real integration+ # shapes — a connector docstring, a plugin manifest line, a setup guide+ # heading, a lower-case SEO keyword — and flagging them would be a false+ # positive that breaks working connector surfaces.+ for case in corpus["good"]:+ excused = excused_names(case["path"], config.allows)+ found = scan_text(case["path"], case["text"], config.competitors, excused)+ if found:+ failures.append(+ f"known-good flagged at {case['path']}: {case['text'][:80]!r} "+ f"(matched {sorted({f.competitor for f in found})}) — {case['why']}"+ )++ # Direction 3: the comparison-surface check must catch a vendor name that the+ # integration allow-list would otherwise excuse, and must accept the neutral+ # form. This is the property that keeps a connector vendor out of a published+ # comparison table.+ vendor_patterns = [(v, re.compile(rf"\b{re.escape(v)}\b", re.IGNORECASE)) for v in config.comparison_vendors]+ for case in corpus["comparison_bad"]:+ if not any(p.search(case["text"]) for _, p in vendor_patterns):+ failures.append(f"comparison-table vendor not caught: {case['text'][:80]!r}")+ for case in corpus["comparison_good"]:+ hit = [v for v, p in vendor_patterns if p.search(case["text"])]+ if hit:+ failures.append(f"neutral comparison label flagged as vendor {hit}: {case['text'][:80]!r}")++ print(f"self-test: config {config_path}")+ print(f" fixtures: {fixtures_path}")+ print(+ f" cases: {len(corpus['bad'])} known-bad, {len(corpus['good'])} known-good, "+ f"{len(corpus['comparison_bad'])} comparison-bad, {len(corpus['comparison_good'])} comparison-good"+ )+ if failures:+ print(f"\nself-test FAILED ({len(failures)}):")+ for failure in failures:+ print(f" ✗ {failure}")+ return 1+ print(" OK: every declared competitor has a fixture, bad input is caught, good input is not.")+ return 0+++def main() -> int:+ parser = argparse.ArgumentParser(+ description=__doc__,+ formatter_class=argparse.RawDescriptionHelpFormatter,+ )+ parser.add_argument("--root", help="repository to scan (default: the git worktree containing the CWD)")+ parser.add_argument("--config", help="path to competitor_names.toml (default: <root>/scripts/competitor_names.toml)")+ parser.add_argument("--fixtures", help="path to competitor_fixtures.json (default: alongside the config)")+ parser.add_argument("--self-test", action="store_true", help="prove the gate works, both directions")+ args = parser.parse_args()++ try:+ root = resolve_root(args.root)+ config_path = Path(args.config).resolve() if args.config else root / "scripts" / "competitor_names.toml"+ fixtures_path = Path(args.fixtures).resolve() if args.fixtures else config_path.parent / "competitor_fixtures.json"++ if args.self_test:+ return self_test(config_path, fixtures_path)++ config = load_config(config_path)+ report = scan_tree(root, config, config_path)+ except ConfigError as exc:+ print(f"competitor-naming gate: {exc}", file=sys.stderr)+ return 2++ print_report(report, config)+ return 0 if report.ok else 1+++if __name__ == "__main__":+ raise SystemExit(main())diff --git a/scripts/competitor_fixtures.json b/scripts/competitor_fixtures.jsonnew file mode 100644index 000000000..b72f13d42--- /dev/null+++ b/scripts/competitor_fixtures.json@@ -0,0 +1,182 @@+{+ "_comment": [+ "Fixture corpus for scripts/check_competitor_names.py --self-test.",+ "",+ "'bad' samples are competitor references the gate must catch. There is at",+ "least one per declared competitor, and the self-test fails if a competitor",+ "is declared without one — otherwise a name could be added to the config,",+ "never exercised, and quietly stop matching.",+ "",+ "'good' samples are real integration shapes taken from surfaces that exist",+ "in this tree: a connector module docstring, a plugin manifest, a setup",+ "guide, the connector registry, an imported detection rule's provenance",+ "link, and the lower-case SEO keyword list. Flagging any of these would be",+ "a false positive that breaks working connector code and documentation.",+ "",+ "'comparison_bad' / 'comparison_good' exercise the narrower rule applied to",+ "published comparison tables, where even an integration vendor's name is a",+ "violation because the table's job is to position AiSOC against it."+ ],+ "bad": [+ {+ "competitor": "Prophet Security",+ "path": "plans/example.md",+ "text": "Where Cyble beats them: Prophet Security is a point product with no SOAR."+ },+ {+ "competitor": "Dropzone AI",+ "path": "apps/docs/docs/example.md",+ "text": "Dropzone AI focuses on fully automated first-line response."+ },+ {+ "competitor": "Radiant Security",+ "path": "README.md",+ "text": "Radiant Security — AI-powered SOC with alert correlation, Series A stage."+ },+ {+ "competitor": "Intezer",+ "path": "plans/example.md",+ "text": "Commercial deployments at Intezer Analyze report Tier-1 parity."+ },+ {+ "competitor": "Microsoft Security Copilot",+ "path": "apps/docs/docs/example.md",+ "text": "microsoft security copilot adds natural-language SIEM querying."+ },+ {+ "competitor": "Security Copilot (title case)",+ "path": "plans/example.md",+ "text": "Bundle threat: Security Copilot is free for top-tier suite customers."+ },+ {+ "competitor": "Duet AI",+ "path": "plans/example.md",+ "text": "Google Chronicle + Duet AI: strong for Google-native stacks."+ },+ {+ "competitor": "Palo Alto XSIAM",+ "path": "plans/example.md",+ "text": "Palo Alto XSIAM creates lock-in that AiSOC avoids."+ },+ {+ "competitor": "Torq",+ "path": "plans/example.md",+ "text": "Torq requires playbook authors; AiSOC requires none for standard cases."+ },+ {+ "competitor": "Tines",+ "path": "docs/gtm.md",+ "text": "Sales play: playbook fatigue — Torq/Tines customer displacement motion."+ },+ {+ "competitor": "Swimlane",+ "path": "plans/example.md",+ "text": "Swimlane / Tines: automation platforms, weak on AI reasoning depth."+ },+ {+ "competitor": "Wazuh",+ "path": "apps/docs/docs/example.md",+ "text": "| Open-source (MIT) | yes | Wazuh: yes (GPLv2) | no |"+ }+ ],+ "good": [+ {+ "path": "services/connectors/app/connectors/torq.py",+ "text": "class TorqConnector(BaseConnector): # polls the Torq workflow audit API",+ "why": "connector module — the first-party Torq integration"+ },+ {+ "path": "services/connectors/app/connectors/__init__.py",+ "text": "from app.connectors.torq import TorqConnector",+ "why": "connector registry import; discovery is registry-based"+ },+ {+ "path": "services/connectors/tests/connectors/test_torq.py",+ "text": "def test_torq_normalize_preserves_critical_severity():",+ "why": "connector test"+ },+ {+ "path": "plugins/torq/plugin.yaml",+ "text": "label: Torq",+ "why": "marketplace plugin manifest mirroring the connector schema()"+ },+ {+ "path": "apps/docs/docs/connectors/torq.md",+ "text": "Generate an API key in Torq under Settings -> API Keys.",+ "why": "per-connector operator setup guide"+ },+ {+ "path": "apps/docs/docs/connectors/tines.md",+ "text": "| `base_url` | Tines tenant URL | string | yes |",+ "why": "per-connector setup guide field table"+ },+ {+ "path": "apps/docs/docs/connectors/wazuh.md",+ "text": "AiSOC polls the Wazuh Indexer `wazuh-alerts-*` indices over HTTPX.",+ "why": "per-connector setup guide"+ },+ {+ "path": "docs/connectors/conformance-matrix.md",+ "text": "| torq | saas | 3 | 1 | 3 | OK | OK | OK |",+ "why": "connector conformance matrix row"+ },+ {+ "path": "services/api/app/services/destinations.py",+ "text": "\"\"\"Normalised handoff envelope for an external SOAR (Tines/Torq/XSOAR/...).\"\"\"",+ "why": "integration contract docstring naming handoff targets"+ },+ {+ "path": "plans/aisoc_v8.0_north_star_plan_1dee8c63.plan.md",+ "text": "| 3 | Torq | S | SOAR coverage parity |",+ "why": "connector build-priority table — an integration target, not a comparison"+ },+ {+ "path": "detections/sigma-imports/_quarantine/pnscan-binary-data-transmission-activity.yaml",+ "text": "- https://intezer.com/wp-content/uploads/2021/09/TeamTNT-Cryptomining-Explosion.pdf",+ "why": "upstream threat-research citation carried verbatim for rule provenance"+ },+ {+ "path": "RELEASES.md",+ "text": "- **Sixteen first-party connectors** — wave-1 (`tines`, `torq`, `falco`, `pagerduty`).",+ "why": "release note recording which connectors shipped"+ },+ {+ "path": "apps/web/src/lib/site.ts",+ "text": " \"security copilot\",",+ "why": "lower-case generic SEO keyword, not the Microsoft product name"+ },+ {+ "path": "apps/docs/docs/console/federated-search.md",+ "text": "| `splunk` | SPL |",+ "why": "a vendor AiSOC integrates with, deliberately absent from the competitor list"+ }+ ],+ "comparison_bad": [+ {+ "text": "| Capability | AiSOC | Wazuh | Splunk | Closed-source AI SOC |",+ "why": "a published comparison table may not name a vendor, even one AiSOC integrates with"+ },+ {+ "text": " { kind: 'caveat', label: 'Splunk AI Assistant add-on' },",+ "why": "a comparison cell naming the vendor"+ },+ {+ "text": " 'Splunk Enterprise Security',",+ "why": "a comparison column header"+ }+ ],+ "comparison_good": [+ {+ "text": "| Capability | AiSOC | Open-source SIEM/HIDS | Commercial SIEM | Closed-source AI SOC |",+ "why": "neutral column labels; every cell below still carries the comparison"+ },+ {+ "text": " { kind: 'caveat', label: 'Paid AI assistant add-on' },",+ "why": "the capability gap survives without the vendor's identity"+ },+ {+ "text": " { kind: 'yes', label: 'Vendor app marketplace' },",+ "why": "neutral restatement of a named marketplace"+ }+ ]+}diff --git a/scripts/competitor_names.toml b/scripts/competitor_names.tomlnew file mode 100644index 000000000..ead4a2bf6--- /dev/null+++ b/scripts/competitor_names.toml@@ -0,0 +1,234 @@+#:schema none+# Configuration for the competitor-naming gate (`scripts/check_competitor_names.py`).+#+# AiSOC never names a competitor product. Where a competitor is the benchmark+# for a comparison, the text refers to it neutrally ("the reference AI-SOC+# platform", "the incumbent hyperautomation SOAR") and keeps the analytical+# content — the capability compared, the direction of the gap, the magnitude.+#+# The hard part is that this product ships 80+ connectors, so a vendor name is+# usually *correct*: a connector module, a plugin manifest, a setup guide or a+# normalizer profile naming its vendor is necessary, not a violation. The gate+# therefore works from two explicit lists and never infers intent from prose:+#+# [[competitors]] the product names that may not appear, as regexes.+# [[allow]] the integration surfaces where those names are expected,+# by path, each naming which names it excuses and why.+#+# Both lists are checked in both directions. A competitor whose pattern matches+# nothing anywhere (including its own fixtures) is a dead pattern and fails. An+# allow entry whose paths match no file, or whose files no longer contain any of+# the names it excuses, is a stale exemption and fails — an exemption must not+# outlive the code it excused.++# ---------------------------------------------------------------------------+# Competitor product names+# ---------------------------------------------------------------------------++[[competitors]]+name = "Prophet Security"+pattern = '\bProphet\s+Security\b|\bProphet\s+AI\b'+neutral = "the reference autonomous-triage platform"++[[competitors]]+name = "Dropzone AI"+pattern = '\bDropzone\s*AI\b|\bDropzone\.ai\b'+neutral = "the autonomous first-line-response challenger"++[[competitors]]+name = "Radiant Security"+pattern = '\bRadiant\s+Security\b'+neutral = "the early-stage AI-SOC entrant"++[[competitors]]+name = "Intezer"+pattern = '\bIntezer\b'+neutral = "an automated malware-analysis vendor"++[[competitors]]+name = "Microsoft Security Copilot"+# Two patterns, deliberately split on case. "Microsoft Security Copilot" is the+# product and is banned however it is capitalised. Bare "Security Copilot" is+# banned only in title case, because lower-case "security copilot" is a generic+# category term that legitimately appears in the site's SEO keyword list+# (`apps/web/src/lib/site.ts`) the same way "agentic SOC" or "SOAR" does.+pattern = '\bMicrosoft\s+Security\s+Copilot\b'+neutral = "the hyperscaler SIEM's bundled AI assistant"++[[competitors]]+name = "Security Copilot (title case)"+pattern = '\bSecurity\s+Copilot\b|\bMicrosoft\s+Copilot\b'+case_sensitive = true+neutral = "the hyperscaler SIEM's bundled AI assistant"++[[competitors]]+name = "Duet AI"+pattern = '\bDuet\s+AI\b'+neutral = "the second hyperscaler SIEM's bundled AI assistant"++[[competitors]]+name = "Palo Alto XSIAM"+# The bare connector id `cortex_xsiam` and the product name used inside its own+# setup guide are integration surfaces and are allow-listed below. The vendor-+# qualified marketing form is what shows up in competitive framing.+pattern = '\bPalo\s+Alto\s+XSIAM\b'+neutral = "the reference vendor-stack unified SIEM/SOAR/XDR platform"++[[competitors]]+name = "Torq"+# Dual role. Ships as a first-party SOAR connector (`torq` connector id) *and*+# appears in competitive framing. Every integration surface is allow-listed by+# path below; anything outside those paths is competitive framing.+pattern = '\bTorq\b'+neutral = "the reference hyperautomation SOAR platform"++[[competitors]]+name = "Tines"+pattern = '\bTines\b'+neutral = "the no-code automation platforms"++[[competitors]]+name = "Swimlane"+pattern = '\bSwimlane\b'+neutral = "the no-code automation platforms"++[[competitors]]+name = "Wazuh"+pattern = '\bWazuh\b'+neutral = "an open-source SIEM/HIDS"++# ---------------------------------------------------------------------------+# Integration surfaces+#+# Path globs, matched against the repository-relative path. Each entry excuses+# only the names it lists, so allow-listing a connector's directory does not+# quietly excuse an unrelated competitor appearing in the same tree.+# ---------------------------------------------------------------------------++[[allow]]+paths = ["services/connectors/**"]+names = ["Torq", "Tines", "Wazuh"]+reason = "Connector modules, the connector registry, event fixtures and connector tests. These vendors ship as first-party integrations."++[[allow]]+paths = ["plugins/*/plugin.yaml"]+names = ["Torq", "Tines", "Wazuh"]+reason = "Marketplace plugin manifests, one per connector, mirroring the connector's schema()."++[[allow]]+paths = ["apps/docs/docs/connectors/**"]+names = ["Torq", "Tines", "Wazuh", "Palo Alto XSIAM"]+reason = "Per-connector operator setup guides. A setup guide that cannot name its own vendor is useless."++[[allow]]+paths = ["docs/connectors/**"]+names = ["Torq", "Tines", "Wazuh"]+reason = "Connector conformance matrix — one row per shipped connector id."++[[allow]]+paths = ["marketplace/index.json", "apps/web/public/marketplace/index.json"]+names = ["Torq", "Tines", "Wazuh"]+reason = "Generated marketplace catalog; entries are the connector manifests above."++[[allow]]+paths = ["apps/docs/sidebars.ts"]+names = ["Torq", "Tines", "Wazuh"]+reason = "Docs navigation entries pointing at the per-connector setup guides."++[[allow]]+paths = ["apps/docs/docs/intro.md", "apps/docs/docs/plugins/**"]+names = ["Wazuh"]+reason = "Connector catalog listing and the plugin-SDK scaffolding examples, which use a real connector as the worked example."++[[allow]]+paths = ["services/api/app/services/destinations.py"]+names = ["Torq", "Tines"]+reason = "Docstring naming the external SOAR platforms a handoff envelope targets — an integration contract, not a comparison."++[[allow]]+paths = ["detections/**"]+names = ["Intezer", "Wazuh"]+reason = "Imported detection content. These are upstream threat-research citations and rule logic about the named product, carried verbatim for provenance."++[[allow]]+paths = ["CHANGELOG.md", "RELEASES.md", "ROADMAP.md", "AGENTS.md"]+names = ["Torq", "Tines", "Wazuh"]+reason = "Release history and roadmap entries recording which connectors shipped in which version."++[[allow]]+paths = ["CONTRIBUTING.md", "docs/audit/CLAIM_TO_GATE_MATRIX.md"]+names = ["Torq"]+reason = "Documentation of this gate. Both explain the dual-role name by example, because a contributor who does not know which name is the trap will do the global replace that breaks the connector."++[[allow]]+paths = ["docs/community-feedback/**"]+names = ["Wazuh"]+reason = "Verbatim community feedback records, where the name refers to the respondent's own deployed stack."++[[allow]]+paths = [+ "plans/aisoc_v8.0_north_star_plan_1dee8c63.plan.md",+ "plans/cyble-aisoc/architecture/integration-matrix.md",+ "plans/cyble-aisoc/roadmap/12-month.md",+ "plans/cyble-aisoc/index.html",+ "plans/cyble-aisoc/platform/**",+]+names = ["Torq", "Tines", "Wazuh"]+reason = "Connector build-priority tables, the integration matrix and connector release notes in the archived plan subtree — integration targets, not competitive framing."++# ---------------------------------------------------------------------------+# Comparison surfaces+#+# A published comparison table is the one place where *any* vendor name is a+# violation, including vendors this product integrates with: the table's job is+# to position AiSOC against them. These regions are therefore checked against a+# wider vendor list, and the integration allow-list above does not apply inside+# them.+#+# Each region is pinned by literal start/end markers. If a marker stops matching+# the gate fails rather than silently scanning an empty slice.+# ---------------------------------------------------------------------------++[comparison]+vendors = [+ "Wazuh",+ "Splunk",+ "Splunkbase",+ "Elastic",+ "Sentinel",+ "CrowdStrike",+ "SentinelOne",+ "QRadar",+ "Chronicle",+ "XSIAM",+ "XSOAR",+ "Cortex",+ "Torq",+ "Tines",+ "Swimlane",+ "Securonix",+ "Exabeam",+ "Devo",+ "Panther",+ "Sumo Logic",+ "Datadog",+ "Rapid7",+ "Arctic Wolf",+ "Prophet",+ "Dropzone",+ "Intezer",+ "Radiant",+ "Copilot",+]++[[comparison_surfaces]]+file = "apps/docs/docs/benchmark.md"+start = "## Comparison to other AI SOC offerings"+end = "## What this is not"+reason = "Capability comparison table on the public benchmark page."++[[comparison_surfaces]]+file = "apps/docs/src/pages/index.tsx"+start = "const COMPARE_HEADERS"+end = "function compareCellClass"+reason = "Capability comparison table rendered on the documentation portal landing page."diff --git a/tests/test_competitor_names_gate.py b/tests/test_competitor_names_gate.pynew file mode 100644index 000000000..2f393f558--- /dev/null+++ b/tests/test_competitor_names_gate.py@@ -0,0 +1,237 @@+"""Tests for the competitor-naming gate, `scripts/check_competitor_names.py`.++The property worth asserting is not "does the tree happen to be clean today" but+"would this gate still notice if it stopped being clean". A check that only ever+sees good input cannot distinguish a working regex from a dead one, and reports+OK forever either way — the dominant failure shape in this repository.++So every assertion here is paired. The gate must catch a competitor name *and*+leave an integration reference alone; it must reject a stale allow-list entry+*and* accept a live one; it must fail when a comparison-table marker drifts *and*+pass when the region is found. `Torq` gets its own test because it is the one+name that is simultaneously a competitor in a comparison matrix and a shipped+first-party connector, so getting it wrong in either direction is a real bug:+flag the connector and the build breaks, miss the comparison and the rule is+unenforced.+"""++from __future__ import annotations++import importlib.util+import json+import shutil+import subprocess+import sys+from pathlib import Path++import pytest++_REPO = Path(__file__).resolve().parents[1]+_SCRIPT = _REPO / "scripts" / "check_competitor_names.py"+_CONFIG = _REPO / "scripts" / "competitor_names.toml"+_FIXTURES = _REPO / "scripts" / "competitor_fixtures.json"+++def _load_gate():+ spec = importlib.util.spec_from_file_location("check_competitor_names", _SCRIPT)+ module = importlib.util.module_from_spec(spec)+ # Registered before exec: @dataclass resolves `cls.__module__` through+ # sys.modules, and raises AttributeError if the module is not there yet.+ sys.modules[spec.name] = module+ spec.loader.exec_module(module)+ return module+++gate = _load_gate()+CONFIG = gate.load_config(_CONFIG)+CORPUS = json.loads(_FIXTURES.read_text(encoding="utf-8"))++[email protected](scope="module")+def tree_report():+ """One full scan of the real tree, shared by the tests that need it."""+ return gate.scan_tree(_REPO, CONFIG, _CONFIG)+++# --------------------------------------------------------------------------+# The gate detects a known-bad sample and passes a known-good one.+# --------------------------------------------------------------------------++[email protected]("case", CORPUS["bad"], ids=lambda c: c["competitor"])+def test_known_bad_is_caught(case):+ found = gate.scan_text(case["path"], case["text"], CONFIG.competitors, excused=set())+ assert case["competitor"] in {f.competitor for f in found}, f"the gate missed a competitor reference it must catch: {case['text']!r}"++[email protected]("case", CORPUS["good"], ids=lambda c: c["path"])+def test_known_good_is_not_flagged(case):+ excused = gate.excused_names(case["path"], CONFIG.allows)+ found = gate.scan_text(case["path"], case["text"], CONFIG.competitors, excused)+ assert not found, (+ f"the gate flagged an integration reference ({case['why']}): " f"{case['text']!r} matched {sorted({f.competitor for f in found})}"+ )+++def test_every_declared_competitor_has_a_bad_fixture():+ """A name with no fixture is never exercised, so it can rot into a no-op."""+ declared = {c.name for c in CONFIG.competitors}+ covered = {case["competitor"] for case in CORPUS["bad"]}+ assert declared <= covered, f"declared competitors with no known-bad fixture: {sorted(declared - covered)}"+++def test_torq_is_a_competitor_in_prose_and_an_integration_in_its_connector():+ """The dual-role name, asserted in both directions at once."""+ competitive = gate.scan_text(+ "plans/example.md",+ "Torq requires playbook authors; AiSOC requires none.",+ CONFIG.competitors,+ excused=gate.excused_names("plans/example.md", CONFIG.allows),+ )+ assert "Torq" in {f.competitor for f in competitive}++ for integration_path in (+ "services/connectors/app/connectors/torq.py",+ "plugins/torq/plugin.yaml",+ "apps/docs/docs/connectors/torq.md",+ "services/connectors/tests/connectors/test_torq.py",+ ):+ excused = gate.excused_names(integration_path, CONFIG.allows)+ found = gate.scan_text(integration_path, "label: Torq", CONFIG.competitors, excused)+ assert not found, f"the Torq connector surface {integration_path} must not be flagged"+++# --------------------------------------------------------------------------+# The allow-list is checked both ways.+# --------------------------------------------------------------------------+++def test_allow_entries_are_live(tree_report):+ """An exemption must not outlive the code it excused."""+ assert not tree_report.stale_allows, "stale allow-list entries:\n " + "\n ".join(tree_report.stale_allows)+++def test_a_stale_allow_entry_fails_the_build(tmp_path):+ config_text = _CONFIG.read_text(encoding="utf-8")+ config_text += '\n[[allow]]\npaths = ["services/realtime/**"]\nnames = ["Torq"]\nreason = "probe"\n'+ probe_config = tmp_path / "competitor_names.toml"+ probe_config.write_text(config_text, encoding="utf-8")++ report = gate.scan_tree(_REPO, gate.load_config(probe_config), probe_config)+ assert any("services/realtime" in entry for entry in report.stale_allows)+ assert not report.ok+++def test_allow_entry_names_must_be_declared_competitors(tmp_path):+ """A typo in an allow entry would silently excuse nothing; fail loudly instead."""+ config_text = _CONFIG.read_text(encoding="utf-8")+ config_text += '\n[[allow]]\npaths = ["services/**"]\nnames = ["Torqq"]\nreason = "typo"\n'+ probe_config = tmp_path / "competitor_names.toml"+ probe_config.write_text(config_text, encoding="utf-8")++ with pytest.raises(gate.ConfigError, match="not declared competitors"):+ gate.load_config(probe_config)+++# --------------------------------------------------------------------------+# Comparison tables: no vendor name at all, even an integration vendor.+# --------------------------------------------------------------------------+++def test_comparison_surfaces_are_located(tree_report):+ assert not tree_report.broken_surfaces, "\n ".join(tree_report.broken_surfaces)+ assert tree_report.surfaces_checked == len(CONFIG.comparison_surfaces)+++def test_a_drifted_comparison_marker_fails_rather_than_skipping(tmp_path):+ """A region the gate cannot find must fail, not scan an empty slice."""+ worktree = tmp_path / "tree"+ (worktree / "apps" / "docs" / "docs").mkdir(parents=True)+ (worktree / "apps" / "docs" / "docs" / "benchmark.md").write_text("# no markers here\n", encoding="utf-8")++ report = gate.ScanReport(root=worktree, config_path=_CONFIG)+ gate.scan_comparison_surfaces(worktree, CONFIG, report)++ assert report.broken_surfaces+ assert report.surfaces_checked == 0+ assert not report.ok++[email protected]("case", CORPUS["comparison_bad"], ids=lambda c: c["text"][:40])+def test_vendor_in_a_comparison_table_is_caught(case, tmp_path):+ """Even a vendor AiSOC integrates with may not label a comparison column."""+ worktree = tmp_path / "tree"+ target = worktree / "apps" / "docs" / "docs" / "benchmark.md"+ target.parent.mkdir(parents=True)+ surface = next(s for s in CONFIG.comparison_surfaces if s.file.endswith("benchmark.md"))+ target.write_text(f"{surface.start}\n{case['text']}\n{surface.end}\n", encoding="utf-8")++ report = gate.ScanReport(root=worktree, config_path=_CONFIG)+ gate.scan_comparison_surfaces(worktree, CONFIG, report)+ assert report.findings, f"comparison table vendor not caught ({case['why']}): {case['text']!r}"++[email protected]("case", CORPUS["comparison_good"], ids=lambda c: c["text"][:40])+def test_neutral_comparison_label_is_accepted(case, tmp_path):+ worktree = tmp_path / "tree"+ target = worktree / "apps" / "docs" / "docs" / "benchmark.md"+ target.parent.mkdir(parents=True)+ surface = next(s for s in CONFIG.comparison_surfaces if s.file.endswith("benchmark.md"))+ target.write_text(f"{surface.start}\n{case['text']}\n{surface.end}\n", encoding="utf-8")++ report = gate.ScanReport(root=worktree, config_path=_CONFIG)+ gate.scan_comparison_surfaces(worktree, CONFIG, report)+ assert not report.findings, f"neutral label flagged as a vendor: {case['text']!r}"+++# --------------------------------------------------------------------------+# The gate names what it scanned.+# --------------------------------------------------------------------------+++def test_root_comes_from_the_caller_not_the_scripts_own_location(tmp_path):+ """A gate that locates its repo from __file__ reports on the wrong tree.++ Pointed at another worktree, this one must scan *that* tree, say so by name,+ and find the violation planted there.+ """+ if shutil.which("git") is None: # pragma: no cover - git is present in CI+ pytest.skip("git unavailable")++ probe = tmp_path / "probe-tree"+ (probe / "docs").mkdir(parents=True)+ (probe / "docs" / "gap.md").write_text("We lag Dropzone AI on investigation depth.\n", encoding="utf-8")+ subprocess.run(["git", "init", "-q", str(probe)], check=True)+ subprocess.run(["git", "-C", str(probe), "add", "-A"], check=True)+ subprocess.run(+ ["git", "-C", str(probe), "-c", "[email protected]", "-c", "user.name=Probe", "commit", "-qm", "probe"],+ check=True,+ )++ result = subprocess.run(+ [sys.executable, str(_SCRIPT), "--root", str(probe), "--config", str(_CONFIG)],+ capture_output=True,+ text=True,+ cwd=str(_REPO),+ )+ assert result.returncode == 1+ assert str(probe.resolve()) in result.stdout, "the gate must name the tree it scanned"+ assert "files scanned: 1" in result.stdout+ assert "Dropzone AI" in result.stdout+++def test_self_test_subcommand_passes():+ result = subprocess.run(+ [sys.executable, str(_SCRIPT), "--self-test"],+ capture_output=True,+ text=True,+ cwd=str(_REPO),+ )+ assert result.returncode == 0, result.stdout + result.stderr+++def test_the_tree_is_clean(tree_report):+ assert not tree_report.findings, "\n".join(+ f"{f.path}:{f.line_no} [{f.kind}] {f.competitor} — {f.excerpt}" for f in tree_report.findings+ )+ assert tree_report.files_scanned > 1000, "the scan covered suspiciously few files"