mirror of
https://github.com/beenuar/AiSOC.git
synced 2026-11-24 08:35:46 +08:00
f4cea19023c331c052d1585e45ec76cc4f7fcab7
1
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
b854010e06 |
feat(v8.0): graph at ingest, four-agent rebrand, /hunt, 16 connectors, public benchmark (#125)
* chore(v8.0): kick off parallel team with progress tracker Initialise AISOC_V8_PROGRESS.md to mirror the v8.0 release plan and coordinate the wave-1 parallel team. Tracks T1.1, T1.3, T2.4, T2.5, T3.1, T3.4, T4 wave-1 connectors, T5.1/T5.2, T7.1. Co-authored-by: Cursor <cursoragent@cursor.com> * feat(api): T3.1 SOC Insights aggregator endpoint Add GET /v1/insights/soc?window=24h|7d|30d returning a 7-tile payload (MTTA, MTTR, FP rate, alerts/day, cases/day, agent-cost-per- investigation, analyst hours saved) with current value, previous-period delta, and a 24-bucket sparkline per tile. Tenant-scoped via the existing AuthUser dependency. The cost-per-investigation tile joins aisoc_run_costs to investigation_runs; if the cost telemetry table isn't deployed yet (TODO T2.4-followup) the helper swallows the SQLAlchemyError and returns 0 so the dashboard still renders. The "analyst hours saved" heuristic is documented inline: auto-closed cases x MANUAL_INVESTIGATION_MINUTES (45 min). Tests cover the delta-pct math (incl. the previous=0 -> None branch), the window allowlist, the seven-tile shape, the hours-saved formula, and the zero-state path. Co-authored-by: Cursor <cursoragent@cursor.com> * docs(architecture): T1.3 publish security knowledge graph v1.0 schema Publish the source-of-truth schema for the AiSOC security knowledge graph materialised by services/ingest. T1.3 ships in parallel with T1.1 (the ingest-side writer) because the schema is fully specified up front; the CI drift gate then guarantees the Go enums, the YAML, and the live DB stay in lockstep. * `schemas/graph-schema.yaml` — machine-readable v1.0 spec. 17 node labels (Identity, User, ServiceAccount, Role, Permission, Policy, Resource, Configuration, Endpoint, Repo, Container, Image, NetworkPath, SaaSApp, Alert, Case, Detection) and 14 relationships (:ASSUMED_BY, :HAS_PERMISSION, :GRANTS, :OWNS, :CONFIGURED_AS, :DEPLOYED_FROM, :ACCESSES, :PEER_OF, :TRIGGERED, :OCCURRED_ON, :MEMBER_OF, :DEPLOYS, :READS_FROM, :WRITES_TO). Six edges are flagged `event_edge: true` and carry the {ts, source_event_id, snapshot_id} triple the agent uses to replay state. * `apps/docs/docs/architecture/graph-schema.md` — narrative reference. Why-we-need-it preamble, Mermaid ER diagram of the twelve most- traversed relationships, per-label and per-relationship subsections, versioning rules, and the CI drift gate pointer. Co-authored-by: Cursor <cursoragent@cursor.com> * feat(scripts): T1.3 graph schema drift gate + export tool `scripts/export_graph_schema.py` is the single tool that keeps the YAML spec, the Go enums in `services/ingest/internal/graph/`, and the live Neo4j materialisation aligned. Three modes: * default — connect to Neo4j (env `AISOC_NEO4J_URI`/`NEO4J_URI`) and dump the live schema to `schemas/graph-schema-current.yaml`. Falls back to parsing the Go enums, and then to the YAML, so the script always produces an artefact even on a blank machine. The runtime dump is gitignored. * --check — parse YAML, Go enums (when present — T1.1 not landed yet is OK), and live DB (when reachable), and fail non-zero on drift. Includes internal-consistency checks: SchemaVersion sanity, duplicate detection, and the required {ts, source_event_id, snapshot_id} triple on every event_edge. * --from-go — regenerate the YAML skeleton from the Go enums for the rare case where Go is the authoritative change. `.github/workflows/graph-schema-check.yml` runs `--check` on PRs that touch `schemas/graph-schema.yaml`, `services/ingest/internal/graph/**`, or the script itself. Co-authored-by: Cursor <cursoragent@cursor.com> * feat(marketing): T6.2 reference-customer page template Adds an MDX-driven case-study template so GTM can publish a new customer story by dropping one file into apps/web/content/customers/, with no engineering involvement required. Surfaces: - /customers — public index, lists every non-draft case study with the industry badge, region, challenge, and a 3-stat preview band. - /customers/[slug] — detail page with hero (logo + industry + challenge), before/after stat band, pull-quote, MDX body, and deep links into the docs / app for the features cited. Wiring: - apps/web/src/lib/customers.ts: file-system loader (fs + gray-matter). Typed CustomerFrontmatter contract; sorts by `order` then title; supports draft: true to keep unpublished studies in-tree but off the index. - apps/web/src/components/marketing/MdxBody.tsx: shared MDX style map so prose authored in MDX inherits the landing-page typography palette. - next-mdx-remote@6.0.0 + gray-matter@4.0.3 added to apps/web deps; rendered via next-mdx-remote/rsc inside the [slug] page so the route is fully RSC-compatible. Content scaffold: - apps/web/content/customers/ created with a template MDX file (example.mdx) flagged draft: true and clearly marked "Example / Template — replace before publishing". - apps/web/public/customers/example/logo.svg: placeholder logo so the template renders end-to-end during local development. Both pages are statically generated via generateStaticParams() from the filesystem, so the production build doesn't depend on runtime FS access. Co-authored-by: Cursor <cursoragent@cursor.com> * feat(cursor-extension): T7.1 scaffold IDE extension for AiSOC MCP Ships the kickoff scaffold for the v8.0 IDE extension at `services/mcp/cursor-extension/`. Works on any VSCode-compatible IDE (`engines.vscode: ^1.80.0`) — Cursor, VSCode, Windsurf, et al. Registers four MCP-backed commands: - aisoc.runTriage — wraps aisoc_run_investigation - aisoc.replayDecision — wraps aisoc_replay_decision - aisoc.explainStep — wraps aisoc_explain_step - aisoc.queryDetections — wraps aisoc_query_detections Plus two key-management helpers (aisoc.setApiKey / aisoc.clearApiKey) that route through `context.secrets` so API keys never touch settings.json. The decoy `aisoc.apiKey` setting documents that pattern explicitly so analysts don't paste creds into a synced file. Architecture: - `src/mcpClient.ts` — typed JSON-RPC over HTTP wrapper. Posts `tools/call` payloads at the configured `aisoc.mcpEndpoint` (default `http://localhost:8765/mcp`) with `Authorization: Bearer` when a key is set. Maps transport, HTTP, JSON-RPC, and tool errors onto a single `McpClientError` class. - `src/views.ts` — singleton `OutputChannel` + side-panel webview that renders both the human text content and the structured JSON payload returned by the MCP server. Webview CSP is `default-src 'none'; style-src 'unsafe-inline'` — no JS, no external assets. - `src/extension.ts` — activation, command wiring, secret-storage integration, and per-command error notifications with a "Show details" jump to the output channel. Tests: 19 vitest smoke tests (`npm test`) stub `fetch` and assert URL normalisation, JSON-RPC payload shape per command, optional-argument omission, MITRE-id routing vs free-text query, Authorization header handling, and error-class discrimination (transport / http / jsonrpc / tool). Build verified: `npm install && npm run compile` produces `out/extension.js` cleanly. Marketplace publish deferred — README documents the full vsce/ovsx flow but no PAT is wired up in this PR. Mark T7.1 as `[~]` in AISOC_V8_PROGRESS.md per the M-effort gate (scaffold + working local install qualifies). Co-authored-by: Cursor <cursoragent@cursor.com> * docs(benchmark): T5.1 publish latency/tokens/USD scaffold + provenance Track 5 — Public benchmark + methodology page (P0, S). Adds the structural scaffold for the public benchmark page: - North-star callout (sub-minute p50, sub-2-minute p95 on the 200-incident eval), clearly labelled wet-eval-not-substrate. - "What's substrate vs wet?" section to keep the substrate self-checks visually separate from real wet-eval measurements (workspace rule). - Three placeholder tables — latency p50/p95/p99, tokens per investigation, USD per investigation — per template family + aggregate. Cells are <!-- T2.4 populates --> markers, not imputed numbers. - Provenance footer (commit SHA, run date, dataset SHA-256, eval mode, rate-card date) — populated by the per-PR substrate run and the weekly wet-eval CI job (T5.5). Adds scripts/render_eval_charts.py — public renderer that consumes eval_report.json and writes summary.md, wet_eval.md, and provenance.md into eval/results/charts/. Three input modes: - substrate-only report → emits placeholder note for wet eval - T2.4 per_investigation block → emits substrate-budget projection, clearly labelled as 'not wet eval' - T5.5 wet_eval block → emits real latency/tokens/USD tables Adds 'pnpm eval:public' as the single end-to-end entry point: python3 scripts/run_evals.py --out eval_report.json && python3 scripts/render_eval_charts.py eval_report.json Verified end-to-end against the live substrate suite — emits a passing report and rendered chart bundle in ~2.5 s. T2.4's per_investigation block surfaces correctly through the renderer with the 'deterministic-substrate budget, not wet eval' callout. * docs(benchmark): T5.2 add open methodology + sidebar + README footer Track 5 — Public benchmark methodology page (P0, S). Adds apps/docs/docs/benchmark-methodology.md — the open reference for anyone reproducing the numbers on benchmark.md or comparing AiSOC against their own SOC. Sections: 1. Why this exists (vs unreproducible vendor benchmarks) 2. Dataset — 200 incidents from 55 templates, deterministic seed, 100 % synthetic, 14-source backing telemetry, what's synthetic vs real 3. Substrate vs wet eval — the workspace-rule distinction restated in detail; cross-links to wet-eval-weekly.yml (T5.5) 4. Suites and what each one actually measures 5. Rate card (with effective-from dates and a 'rates evolve' note) 6. How to reproduce — exact commands incl. 'pnpm eval:public' 7. How to compare against your own SOC (invites reproductions; references the issue-template path that lands with T5.4) 8. Limitations + threats to validity (synthetic data, tautological substrate self-checks, wet-eval variance, rate-card-only cost, coverage gates, connector / SIEM coverage gaps) 9. Where to go from here (cross-links + open agent code reference) Wires benchmark-methodology into apps/docs/sidebars.ts under "Getting Started" so it sits next to benchmark.md. Appends a single-line reproducibility footer to README.md pointing at 'pnpm eval:public' and docs.aisoc.dev/benchmark-methodology — the line buyers/auditors should land on. * feat(marketing): T6.2 land MDX customer template content and pages Companion to f9dac9ef (whose tree was polluted by a concurrent commit on the parallel branch). Lands the actual files referenced in that commit message so the /customers and /customers/[slug] routes work end-to-end. Surfaces: - /customers — public index, lists every non-draft case study with the industry badge, region, challenge, and a 3-stat preview band. - /customers/[slug] — detail page with hero (logo + industry + challenge), before/after stat band, pull-quote, MDX body, and deep links into the docs / app for the features cited. Wiring: - apps/web/src/lib/customers.ts: file-system loader (fs + gray-matter). Typed CustomerFrontmatter contract; sorts by `order` then title; supports draft: true to keep unpublished studies in-tree but off the index. - apps/web/src/components/marketing/MdxBody.tsx: shared MDX style map so prose authored in MDX inherits the landing-page typography palette. - next-mdx-remote@6.0.0 + gray-matter@4.0.3 added to apps/web deps; rendered via next-mdx-remote/rsc inside the [slug] page so the route is fully RSC-compatible. Content scaffold: - apps/web/content/customers/example.mdx: template flagged draft: true and clearly marked "Example / Template — replace before publishing". - apps/web/public/customers/example/logo.svg: placeholder logo so the template renders end-to-end during local development. Both pages are statically generated via generateStaticParams() from the filesystem, so the production build doesn't depend on runtime FS access. Co-authored-by: Cursor <cursoragent@cursor.com> * chore(repo): T5.1 add eval-public entry point — flip T5.1 + T5.2 in progress tracker Marks T5.1 (Speed + token + USD published) and T5.2 (Methodology page) complete in AISOC_V8_PROGRESS.md, with a single combined changelog line documenting: - benchmark.md gains north-star callout, latency/tokens/USD scaffold (T2.4-populates placeholder cells), and a provenance footer - new benchmark-methodology.md — dataset, substrate-vs-wet eval, rate card, reproduce, how-to-compare, limitations - 'pnpm eval:public' entry point + scripts/render_eval_charts.py renderer - README footer points reproducers at the methodology page T2.4's per_investigation block (deterministic-substrate budget) is already wired through the renderer; T5.5 (wet-eval-weekly.yml) will fill the placeholder cells in benchmark.md once it lands. * feat(marketing): T6.3 sovereign + air-gap one-pager and nav wiring A landing page that surfaces AiSOC's deployment flexibility (air-gap, on-prem, hybrid, public cloud, managed SaaS) crossed with LLM mode (cloud APIs / local Ollama / BYO endpoint), data residency (EU / US / India / custom), and compliance posture (SOC2 / ISO27001 / GDPR / DPDP). GTM can hand this URL to a regulated buyer without an engineering touch. /sovereign sections: - Hero: "AiSOC runs where you do. Sovereign by default." - Three control points (deploy / LLM / data residency). - Deployment-mode matrix table with per-mode posture and runbook citation. - Repository artifacts: docker-compose.airgap.yml + Ollama overlay, infra/terraform/, infra/ Helm chart story, demo seed script — all linked back so the buyer can verify the claim before talking to us. - Country × cloud combo grid: AWS / Azure / GCP / OCI / DigitalOcean / Hetzner × US / EU / India / Singapore / Custom, with a tasteful "Validated / Bring your own" legend. - CTA strip: "Talk to us about sovereign deployment" → mailto + link to the early-access waitlist (T6.1). Nav wiring: - LandingNav: replaces the duplicated `/#architecture` and `/#mitre` hash links (already covered by Platform) with `/sovereign` and `/customers`. Both pages now visible from every marketing route. - Footer: adds "Sovereign + air-gap" and "Customers" under Platform. Static, server-rendered, no client JS dependency on top of the existing landing-page primitives. Co-authored-by: Cursor <cursoragent@cursor.com> * docs(agents): T2.5 mark four-agent rebrand shipped in progress tracker Flip [ ] T2.5 → [x] T2.5 in the v8.0 parallel-team tracker and add a changelog entry summarising the consolidation: the public surface now exposes exactly four named agents (Detect, Triage, Hunt, Respond), with sub-agents (phishing, identity, cloud, insider) reframed as capabilities of TriageAgent. Back-compat aliases keep existing imports working. Underlying T2.5 implementation files were swept up by a sibling subagent's git-add-all into commit 1dd339c1 ("docs(benchmark): T5.1 publish latency/tokens/USD scaffold + provenance"); content is correct at HEAD, but the commit attribution is mixed. Coordinator note: no rebase needed — the file content is what matters for the merge. * feat(papers): T7.2 publish L0–L4 automation maturity white paper Adds the full-length AiSOC white paper on the L0–L4 SOC automation maturity model, the WeasyPrint-based render tool, and the rendered PDF artifact under the marketing site's public papers directory. - apps/web/content/papers/l0-l4-automation-maturity.md — canonical ~4,400-word white paper with cover-page frontmatter, executive summary, five-tier deep dive, assessment checklist, migration paths, worked closed-loop example, and references to MITRE D3FEND, OASIS CACAO v2.0, SAE J3016, and NIST SP 800-61. - apps/web/public/papers/l0-l4-automation-maturity.pdf — rendered PDF (90 KB, A4, paginated, cover page + body) suitable for direct download from tryaisoc.com/papers/. - apps/web/public/papers/README.md — index of hosted PDFs plus the regenerate-from-source instructions (Docker, Homebrew, or pip). - scripts/render_white_paper.py — markdown→HTML→PDF render tool that reuses the WeasyPrint stack already pinned by services/api/Dockerfile; no new heavy dependency, no headless Chromium. No competitor product names appear in the white paper or in any artifact in this commit (project rule). Co-authored-by: Cursor <cursoragent@cursor.com> * docs(concepts): T7.2 add L0–L4 automation maturity concept page Lands the canonical written-down version of the L0–L4 model in the docs site as a Core Concepts page, wired into the sidebar after the existing Live Actions page. Cross-links to the longer white paper hosted at tryaisoc.com/papers/l0-l4-automation-maturity.pdf. - apps/docs/docs/concepts/automation-maturity.md — new ~2,250-word concept page that documents each tier (entry criteria, auto-executed scope, gated scope, MTTR target, FP tolerance), the gate evaluation order, the per-tenant maturity assessment checklist, migration paths between tiers, and what lives outside the dial. Honest about AiSOC sitting at L2 for the median tenant today. - apps/docs/sidebars.ts — adds concepts/automation-maturity to the Core Concepts section. - apps/docs/docs/concepts/capabilities.md — cross-links the L0–L4 remediation maturity row to both the concept page and the white paper. - AISOC_V8_PROGRESS.md — flips T7.2 from [ ] to [x] and records the shipped artefacts in the changelog. Co-authored-by: Cursor <cursoragent@cursor.com> * feat(demo): T6.4 deterministic 4-case quick seed + aisoc:demo --quick Adds a --demo-quick mode to the canonical demo seeder that populates exactly four deterministic DEMO-* incidents (phishing / cloud takeover / insider exfil / ransomware) anchored at a fixed wall-clock so every re-run is byte-stable — same hashes, same UUIDs, same timestamps. The mode is idempotent: existing DEMO-* cases, alerts, and timelines are purged before reseeding so re-running is a clean reset rather than a duplicate. Wires the same flag through to scripts/aisoc-demo.ts as `pnpm aisoc:demo --quick` (alias `--demo-quick`), plus `--clock <iso>` for power users and a proper `--help` banner. In quick mode the browser opens on DEMO-004 (LockBit ransomware) — the visually-loudest of the four cases and the one the T6.4 screencast lands on. Full-seed mode (no flag) is unchanged: 15 INC-RT-* incidents + 28 randomized alerts + the in-flight INC-RT-001 investigation. Backwards compatible with the hosted-demo wrapper (`app.scripts.demo_seed`) — it imports seed_demo.main without forwarding argparse, so we use parse_known_args to silently ignore wrapper-only flags. Co-authored-by: Cursor <cursoragent@cursor.com> * feat(connectors): T4 add Tines connector Audit + case ingestion via Tines REST API (PAT auth). Pulls GET /api/v1/audit_logs (admin events on tenants, stories, agents, credentials, team membership) and GET /api/v1/cases (story-produced work items) on each poll. Wave-1 severity collapse: high-risk audit ops (credential.*, story.deleted/disabled, tenant.api_key.*, team.member_role_changed, sso.disabled) → high; other deletions → medium; failures → low; everything else → info. Case record_severity maps critical/error → high, warn → low, info/success → info; closed + resolved cases collapse to info regardless. Pagination follows meta.next_page up to 20 pages per stream per poll. Optional team_id field scopes ingestion. Plugin manifest, docs walkthrough indexed in the Connectors sidebar, fixture-driven tests covering schema, registry membership, normalize roundtrip, pagination loop termination, and test_connection() success/failure. Co-authored-by: Cursor <cursoragent@cursor.com> * feat(connectors): T4 add Torq connector Workflow execution + audit ingestion via Torq Public API. OAuth-style client-credentials auth: exchanges key_id + key_secret for a short bearer token at /auth/v1/token on every poll. Two streams: GET /workflows/executions (per-run outcomes) and GET /audit-logs (workflow / credential / role / API-key / integration / SSO events). Wave-1 severity collapse: execution status success/completed/running → info, warning → low, failed/error/killed/critical → high. Audit ops: workflow.deleted/disabled, credential.*, user.role_changed/invited/ removed, api_key.created/revoked, integration.created/deleted, sso.disabled → high; other *.deleted → medium; *.failed → low; everything else → info. Pagination follows next_page_token up to 20 pages per stream. Optional base_url override for regional / self-hosted deployments. Co-authored-by: Cursor <cursoragent@cursor.com> * feat(connectors): T4 add Falco connector Push-based runtime-security event ingestion for Linux / Kubernetes. Accepts JSON rule hits over HTTP from falcosidekick or Falco's built-in http_output plugin; both payload shapes (batched array vs single event) are supported. Optional X-Falco-Secret header is validated with constant-time compare so missing / wrong secrets fail without timing leaks. minimum_priority floor (syslog ladder) drops events server-side before they pay the normalize() cost. Wave-1 severity collapse: EMERGENCY/ALERT/CRITICAL → high; ERROR → medium; WARNING/WARN → low; everything else → info. fetch_alerts() drains an in-memory webhook buffer atomically per poll; in production the buffer is replaced by a durable queue but the produce-once / consume-once contract is identical. Normalised events carry the hostname, k8s namespace, container id, and user.name pulled from Falco's output_fields when present. Co-authored-by: Cursor <cursoragent@cursor.com> * feat(connectors): T4 add PagerDuty connector Incident lifecycle + audit-record ingestion via PagerDuty REST API (Token token=<key> scheme). Two streams with distinct pagination: GET /incidents uses classic offset/limit/more, GET /audit/records uses opaque next_cursor. Wave-1 severity collapse: priority P1/critical → high, P2/error → medium, P3/warning → low, P4/P5/info → low/info; falls back to urgency (high/low) when no priority is set; resolved incidents collapse to info regardless. Audit ops: user.role_changed, user.create/delete, api_key.create/delete, extension.create/delete, webhook_subscription.create/delete, service.delete, escalation_policy.delete → high; other *.delete → medium; rest → info. test_connection() handles both user-level and general-access keys by probing /users/me first, falling back to /incidents?limit=1 on 401. Co-authored-by: Cursor <cursoragent@cursor.com> * feat(connectors): T4 add Opsgenie connector Alert + audit-log ingestion via Opsgenie REST API with GenieKey auth. Region-aware: us → api.opsgenie.com, eu → api.eu.opsgenie.com. Two streams: GET /v2/alerts uses a Lucene-style createdAt/updatedAt ms-epoch query; GET /v2/audit-logs?type=customer uses an ISO-8601 createdAtStart filter. Both paginate by following the absolute paging.next URL the API returns. Wave-1 severity collapse: P1 → high, P2 → medium, P3/P4 → low, P5 → info; status=closed alerts collapse to info regardless. Audit actions: ApiKeyCreated/Deleted, ApiIntegrationCreated/Deleted, UserRoleChanged, UserAdded/Deleted, EscalationPolicyDeleted, TeamDeleted, WebhookCreated/Deleted, IntegrationDisabled → high; other *Deleted/Disabled → medium; rest → info. test_connection() probes /v2/account and surfaces the account name + plan tier. Co-authored-by: Cursor <cursoragent@cursor.com> * feat(connectors): T4 add Confluence Audit connector Atlassian Confluence Cloud audit-trail ingestion via the REST API with HTTP Basic auth (email + API token). Pulls GET /wiki/rest/api/audit?startDate=<ms>&limit=100&start=<offset> on each poll; pagination terminates when size < limit. test_connection() distinguishes "bad creds" (401 on /user/current) from "auth ok but not site-admin" (200 on /user/current but 403 on /audit) so the operator gets actionable feedback. Wave-1 severity collapse: short allowlist of summary fragments (Removed user from site, Granted site admin, External share link created, Public link enabled, Site-wide deletion, Bulk delete, Anonymous access enabled, Site export started, Permissions granted to anyone) → high; Restrictions / Space / Page / Group / Global-permission changes → medium; permissions / security / users-and-groups category floor → medium; everything else → info. ms-since-epoch creationDate is converted to ISO-8601 in the normalised event. Co-authored-by: Cursor <cursoragent@cursor.com> * feat(connectors): T4 wire wave-1 connectors into registry + marketplace Register the six new wave-1 connector classes (TinesConnector, TorqConnector, FalcoConnector, PagerDutyConnector, OpsgenieConnector, ConfluenceAuditConnector) in `_CONNECTOR_CLASSES` so the platform's auto-discovery picks them up without per-instance wiring. Rebuild the marketplace index (`marketplace/index.json` + `apps/web/public/marketplace/index.json`) from `plugins/*/plugin.yaml` via `scripts/build_marketplace.py`, and re-run `curate_detections.py` to refresh `curated.json`. Index the six new connector setup pages (`tines`, `torq`, `falco`, `pagerduty`, `opsgenie`, `confluence-audit`) in the Docusaurus sidebar's Connectors category. Flip the matching T4.x rows in `AISOC_V8_PROGRESS.md` and add a wave-1 changelog entry. Co-authored-by: Cursor <cursoragent@cursor.com> * feat(web): T3.4 /hunt natural-language hunt surface Make /hunt the canonical natural-language hunt experience for AiSOC and collapse the legacy /investigate route into it. UI additions on /hunt: * New emerald hero block with the tagline "Hunt at the speed of thought" and three example-query pills covering geo ("Did we get any new attacks from Iran?"), IAM ("Show me everyone who touched our prod IAM role in the last 7 days") and identity ("Any GitHub auth from a new device this week?"). Clicking a pill immediately translates and runs the hunt; the inline NL input submits on Enter. * Saved-hunts sidebar (separate from the existing raw-query "Saved searches" panel) backed by /v1/saved-hunts. Each row shows the original NL question, schedule badge if cron-set, last-run timestamp, and a one-click Run / Delete pair. Re-running an NL hunt re-translates server-side, populates the editor with the refreshed ES|QL, and stamps last_run_at. * "Save hunt" button beside the editor that persists the most- recent NL question (preferred) or falls through to the legacy raw-query saver when the editor was hand-edited. * Translator explanation banner above the editor so analysts can see "what the platform thinks I asked" before running. Routing: * /investigate -> 308 permanent redirect to /hunt with all query parameters preserved (so notification emails, agent runs, and bookmarks keep working). The InvestigationChat / InvestigationTimeline components stay where they are; the page itself is now a tiny next/navigation `permanentRedirect` shell. API client + shared types: * `apps/web/src/lib/api.ts` exposes `nlQueryApi.translate` and a fully-typed `savedHuntsApi` (list / get / create / remove / run) matching `services/api/app/api/v1/endpoints/saved_hunts.py`. * `packages/types/src/hunt.ts` (new) re-exports `SavedHunt`, `TranslatedQueryEnvelope`, `CreateSavedHuntRequest`, `RunSavedHuntResponse`, `NlQueryTranslate{Request,Response}` so non-web SDK consumers can build against the same contract. Type-checks: `pnpm --filter @aisoc/types type-check` and `pnpm --filter @aisoc/web type-check` both pass. Co-authored-by: Cursor <cursoragent@cursor.com> * feat(eval): T2.4 token + USD telemetry, SVG charts, tests Per-investigation token / USD / latency telemetry for the public eval harness. Runs on every PR (substrate path, no LLM call) and feeds the benchmark page so token-budget regressions are caught before they hit the wet-eval weekly job. What lands: * scripts/eval_telemetry.py — new stdlib-only module. Computes prompt / completion / total tokens for each of the 200 synthetic incidents using OpenAI's published 4-chars-per-token rule, applies an illustrative 2025-era public rate card (gpt-4o, gpt-4o-mini, gpt-5, claude-3.5-sonnet, claude-3-haiku, gemini-1.5-pro, gemini-1.5-flash) to project USD per investigation, and measures wall-clock latency across the deterministic substrate path. Mirrors the per-1K rates in services/agents/app/core/cost_telemetry.py so the substrate gate and the runtime cost ledger agree on the same cost model. Aggregate + per-template stats (mean / median / p50 / p95 / p99). Carries mode="deterministic_substrate" so consumers cannot mistake it for wet-eval. * scripts/run_evals.py — folds the per_investigation block into eval_report.json (headline keys tokens_per_investigation / usd_per_investigation / latency_per_investigation_ms mirror the T5.1 doc-table contract). Adds --telemetry-only / --telemetry-model / --no-telemetry-records flags. Wraps the substrate-suite imports in a try/except so the telemetry block can run on a bare Python install without the full agent dependency stack (pydantic, langgraph, ...). * scripts/render_eval_charts.py — extended with a hand-rolled SVG emitter (zero new deps; matplotlib was an option but adds 30+ MB to the dev image for a 200-LOC chart need). Renders four charts into apps/docs/docs/benchmark-charts/: latency-p50-p95-p99.svg (bar chart), tokens-distribution.svg + usd-distribution.svg (histograms with median / p95 markers), latency-by-template.svg (slowest 20 templates). Falls back to a synthesised distribution if --no-telemetry-records was passed so histograms still render a recognisable shape from the aggregate stats. * services/agents/tests/test_eval_telemetry.py — 18 unit tests across 4 classes. Locks down the rate-card maths (1M+1M tokens at gpt-4o must equal $12.50 to six decimals), the 4-chars-per-token estimator, the aggregate/per-template stats including monotone percentiles (p50 ≤ p95 ≤ p99 ≤ max), severity-driven completion scaling, and the SVG round-trip (every chart starts with <?xml, contains <svg ... and <rect, closes with </svg>; histograms still draw with the no-records fallback). Sample numbers from a dry run against the 200-incident dataset (gpt-4o rate card, illustrative): tokens / investigation: mean=2186 median=2114 p95=2452 p99=2478 USD / investigation: mean=$0.01469 median=$0.01368 p95=$0.01693 p99=$0.01699 latency_ms (substrate path only): p50=0.0073 p95=0.0107 p99=0.0137 These are deterministic-substrate budget projections, not wet eval. Wet eval lands in T5.5; this telemetry is the CI-gated upper bound that runs every PR. The benchmark page documents the substrate-vs-wet split clearly per workspace rule. * feat(demo): T6.4 screencast placeholder + landing-page embed Adds the assets the 90-second `pnpm aisoc:demo --quick` screencast will ship with at v8.0 launch: - `apps/web/public/.demo-mp4-placeholder` — a text placeholder (no binary committed) documenting the recording brief: 90s against `pnpm aisoc:demo --quick`, H.264 1280x720, ≤8MB, lands on DEMO-004. - `apps/web/public/demo-thumbnail.svg` — brand-aligned 1280x720 SVG thumbnail with a play button and the four canonical case names visible, so it's recognisable as a product shot rather than a hero image. - `apps/web/src/components/onboarding/StartHero.tsx` — small non-intrusive `DemoScreencast` card under the three primary CTAs linking to `/demo.mp4`. Copy is honest about the launch timing ("Coming v8.0") so the link 404'ing pre-launch doesn't feel like a bug. The card is an `<a>` to /demo.mp4 (not an inline `<video>`) because the placeholder is a text file — embedding a player would render broken. The day the real .mp4 lands we swap to `<video>` with proper controls. Co-authored-by: Cursor <cursoragent@cursor.com> * docs(readme): T6.4 Fly.io demo badge + aisoc:demo --quick snippet Adds two new top-of-readme badges next to the existing License / Eval-harness / PRs / Version row: - "Live demo · Fly.io" → https://demo.aisoc.dev, the hostname the v8.0 Fly deploy will live at. Until the deploy lands the badge is a placeholder, so the existing tryaisoc.com paragraph immediately under the badge row picks up an explicit "goes live with the v8.0 launch" note. That way a buyer who clicks the badge pre-launch isn't confused. - "Render demo · one click" → the existing /deploy URL, lifted into the badge row for symmetry with Fly. The full Render section further down keeps its big "Deploy to Render" button — this badge is just so both hosted-demo paths are scannable from the header. Also adds the screencast-mode snippet inside the existing Docker Compose section: pnpm aisoc:demo --quick # 4 cases in 4 minutes with a short paragraph naming the four canonical DEMO-* cases the quick mode seeds (phishing / cloud takeover / insider exfil / ransomware) and noting it's the path the 90-second product screencast records against. The full-seed `pnpm aisoc:demo` (15 incidents) is preserved as the default — `--quick` is opt-in. Co-authored-by: Cursor <cursoragent@cursor.com> * docs(benchmark): T2.4 substrate-budget section + inline SVGs Wires T2.4's per-investigation telemetry into apps/docs/docs/benchmark.md and flips the AISOC_V8_PROGRESS.md checkbox. * New "Deterministic-substrate budget projection (T2.4)" subsection immediately above the existing wet-eval tables. Has its own warning banner, a substrate-budget table (mean / median / p95 / p99 for total / prompt / completion tokens, USD, and substrate-path latency), and four inline SVGs from apps/docs/docs/benchmark-charts/: latency p50/p95/p99 bar chart, tokens histogram, USD histogram, and the per-template top-20 latency chart. * The three pre-existing wet-eval tables (Table 1 / 2 / 3) keep their T2.4-populates placeholders. They are renamed to "Wet eval — Table N" and each gets a back-reference to the substrate budget above so readers can compare substrate p95 (CI-gated upper bound) against wet-eval p95 (real LLM, weekly). Per workspace rule: substrate numbers are never substituted into the wet-eval tables. * AISOC_V8_PROGRESS.md flips T2.4 to [x] and gets a changelog entry describing the deliverables, the rate card, and the substrate-vs-wet split. The plan file in plans/ is unchanged per the workspace rule. * feat(demo): T6.4 contract test for the quick-seed 4-case path Adds `services/api/tests/test_demo_seed.py` which locks in the contract of the `--demo-quick` mode introduced under T6.4: - exactly four canonical case keys (DEMO-001..DEMO-004) — adding a fifth would push the 90-second screencast over budget; removing one would weaken the four-pillar platform pitch (phishing / cloud / insider / ransomware) - the connector_sources list each case advertises (so the Source column in the demo doesn't silently drift to e.g. crowdstrike for a phishing case) - every alert under a case must come from one of the case's declared connectors (so the Source filter has no phantoms) - `_demo_quick_uuid` is byte-stable for identical inputs (locked against the SHA-shaped uuid5 namespace constant) - `_parse_clock(None)` returns the canonical T6.4 wall-clock anchor Fast tests (5) introspect the `_DEMO_QUICK_INCIDENTS` module-level constant and the deterministic helper — no DB, no event loop. The heavier "run the seeder, count DEMO-* rows" assertion sits behind `pytest.mark.integration` and is skipped unless `AISOC_RUN_INTEGRATION=1`, so a developer machine without a running Postgres still sees green. Registers the `integration` marker in services/api/pyproject.toml so the run produces no warnings. Co-authored-by: Cursor <cursoragent@cursor.com> * feat(ingest): T1.1 ingest-side graph writer scaffold Inserts a graph projection step into the Kafka ingest path so every normalised OCSF event materialises Neo4j nodes + edges before fusion sees it. New package services/ingest/internal/graph/ with: - schema.go — versioned vocabulary (v1.0): 17 node labels and 14 relationship types matching schemas/graph-schema.yaml. SchemaVersion exported as a const so downstream consumers (T2.1, T3.2, T3.3) can pin against a stable contract. - writer.go — Neo4j Bolt driver with batched UNWIND upserts. MERGE is keyed on (label, natural_key); a hash(properties) is stamped on every node so the realtime channel can skip no-op updates. The hot path is non-blocking — events go onto a bounded queue (default 2048) and a background flusher drains them every 100ms or 100 events, whichever comes first. When the queue is full we drop and increment a metric instead of blocking the caller. This is the explicit T1.1 guarantee: graph failures NEVER block fusion ingest, exercised by TestWriteEvent_NeverBlocksOnFailure with a deliberately wedged fake driver. - extractor.go — pulls entity references out of OCSF events. v1.0 ships real coverage for aws_security_hub, github_audit, okta_system_log, kubernetes_audit; everything else falls through to a generic actor + endpoint extractor so connectors we haven't fully wired still produce a non-empty projection. extractMITRE adds a Detection node and TRIGGERED edge per ATT&CK technique the normaliser already attached. Wiring: - handler.go fan-outs graph writes concurrently with the fusion publish. A nil writer disables the fan-out entirely so the rest of the pipeline behaves identically when AISOC_GRAPH_ENABLED=false. - publisher.go gains PublishGraphUpdate, satisfying the graph.UpdatePublisher interface. Every node and every edge upsert produces an envelope on the new security.graph_updates topic for the realtime websocket service (T1.4) to consume. - config.go: AISOC_GRAPH_ENABLED (default off), AISOC_NEO4J_URI, AISOC_NEO4J_USER, AISOC_NEO4J_PASSWORD (env-only — never committed), AISOC_NEO4J_DATABASE, AISOC_GRAPH_BATCH_SIZE, AISOC_GRAPH_FLUSH_INTERVAL_MS, AISOC_GRAPH_QUEUE_SIZE, AISOC_GRAPH_UPDATES_TOPIC. - main.go: opt-in graph writer construction + clean shutdown wired into the existing context cancellation. Tests: - internal/graph/writer_test.go (9 cases) — UNWIND batching against a fake Driver, idempotency on repeated natural keys, partial-failure surfacing, queue-full drop, the never-blocks-on-failure contract, graph-update publishing, schema-version stamping, idempotent close, concurrency-safe stats. - internal/graph/extractor_test.go (8 cases) — per-connector entity + edge shape, MITRE detection node, generic fallback, nil-/empty-input safety, time fallback. - services/agents/tests/test_graph_freshness.py — Python integration test (@pytest.mark.integration) probes p95 < 2s graph freshness end to end. Skips cleanly when Kafka or Neo4j aren't running locally so unit-only CI runs stay green. Also includes a smoke check that asserts ingest returns 2xx within 2s even when Neo4j is wedged (the failure-isolation contract). Source-type coverage on day one: - aws_security_hub: full mapping (User -> Resource via :OWNS, Alert -> Resource via :OCCURRED_ON) - github_audit: full mapping (User -> Repo via :READS_FROM / :WRITES_TO based on action verb) - okta_system_log: full mapping (Identity -> User via :ASSUMED_BY, User -> SaaSApp / NetworkPath via :ACCESSES) - kubernetes_audit: full mapping (User or ServiceAccount based on system:serviceaccount: prefix -> Resource via :ACCESSES with verb on the edge) - All connectors: ATT&CK :Detection node + :TRIGGERED edge per technique the normaliser already enriched - Generic fallback (actor + endpoint nodes) for the remaining 10 source types — TODOs in extractor.go call out which connectors are deferred to T1.2 / the T4 wave. Deferred (TODOs in code): - T1.2 — config snapshots tied to {ts, snapshot_id}. The schema and writer already plumb ev.SnapshotID through every node + edge property; T1.2 fills it in. - 360-event synthetic corpus expansion — the Python integration test ships with SAMPLE_SIZE=20 today and a TODO for the full corpus. - Full mapping for the other 10 connector types — currently use the generic fallback. Each has a TODO referencing the right v8.0 workstream. Acceptance: - go build ./... green - go test ./internal/graph/... green (16 tests, 1.3s) - go test ./... green (no regressions in handler/inbox) - schema enums + version constant exported (SchemaVersion = "v1.0") - security.graph_updates topic produces on every node/edge write - failure in graph write does NOT block fusion (asserted by TestWriteEvent_NeverBlocksOnFailure) - AISOC_V8_PROGRESS.md flipped to [~] T1.1 with status line Co-authored-by: Cursor <cursoragent@cursor.com> * chore(v8.0): wave-1 integration — author, signing, fork-PR workflow Records the final wave-1 status, locks in author attribution as Prince Sinha <prince.sinha@cyble.com> (Senior Director, Innovations at Cyble), and documents the SSH commit-signing setup applied locally to this repo (no global config touched per workspace rule). All 29 wave-1 commits were re-signed and re-authored via `git rebase --exec 'git commit --amend --no-edit --reset-author -S'` against upstream/main, with the SSH key at ~/.ssh/id_rsa.pub. Push target: origin (prince30121/AiSOC fork). PR target: upstream/main (beenuar/AiSOC). Signed-off-by: Prince Sinha <prince.sinha@cyble.com> * chore(repo): gitignore .eval-test-venv/ subagent artifact The T2.4 telemetry subagent created an .eval-test-venv/ Python virtualenv while running its CI checks. The directory is per-machine and shouldn't be tracked. Added to .gitignore under the Python block alongside .venv/ and venv/. Signed-off-by: Prince Sinha <prince.sinha@cyble.com> * chore(v8.0): record fork push + compare URL for wave-1 PR Push to origin (prince30121/AiSOC) over SSH succeeded — the branch now lives at: git@github.com:prince30121/AiSOC.git refs/heads/v8.0/parallel-team-kickoff Updated AISOC_V8_PROGRESS.md with the prepared compare URL so the PR can be opened from the browser against beenuar/AiSOC:main. Also gitignored .pr-body-*.md (local working copies of long PR bodies). gh CLI is not authenticated on this workstation, so the PR is created via the compare URL fallback rather than `gh pr create`. Signed-off-by: Prince Sinha <prince.sinha@cyble.com> * chore(schema): T3.2 add EFFECTIVE_PERMISSION edge Adds the cached effective-permissions edge to the v1.0 graph vocabulary. Materialised by services/api/app/services/effective_permissions/ rather than the ingest writer, so it carries `actions` (resolved allow-set), an optional `deny_actions` list, the `policy_chain_ids` provenance trail, and the `last_resolved` watermark the UI uses for "changes since last week". Schema is in lockstep across: * schemas/graph-schema.yaml * services/ingest/internal/graph/schema.go (RelEffectivePermission) Drift gate (`scripts/export_graph_schema.py --check`) passes: 15 rels (was 14). * chore(v8.0): refresh PR with wave-2 progress Wave-2 has begun: T3.2 EFFECTIVE_PERMISSION schema edge has landed ( |