Skip to main content
ARCHOS 525 BLUEPRINT · /d/dgm_code-aho-corasick-multi-pattern-matching

Aho-Corasick Multi-Pattern Matching (DLP, WAF & Guardrails)

6 COMPONENTS · 6 FLOWS · UPDATED 2026-11-24
GITHUB README / PR PREVIEW CARD
[![Aho-Corasick Multi-Pattern Matching (DLP, WAF & Guardrails) — ArchOS Architecture](https://archos.sageideas.dev/d/dgm_code-aho-corasick-multi-pattern-matching/opengraph-image)](https://archos.sageideas.dev/d/dgm_code-aho-corasick-multi-pattern-matching)

*Interactive architecture diagram powered by [ArchOS Studio](https://archos.sageideas.dev/d/dgm_code-aho-corasick-multi-pattern-matching)*
NOTION / DOCS / CONFLUENCE EMBED
<iframe src="https://archos.sageideas.dev/embed/dgm_code-aho-corasick-multi-pattern-matching" width="100%" height="580" style="border:1px solid rgba(240,236,225,0.14);border-radius:6px;" loading="lazy" title="Aho-Corasick Multi-Pattern Matching (DLP, WAF & Guardrails) — Interactive in ArchOS"></iframe>
PORTABLE MERMAID SPEC (GITHUB / NOTION / RFC)
flowchart LR
  client_0["Text / Packet Stream"]
  n1_1[("Compiled Automaton")]
  n2a_2["Byte-Stream Scanner"]
  n2b_3[("Failure Link Table")]
  n3_4["Match Collector"]
  downstream_5["Downstream & OTel"]
  client_0 -->|"1. Load DFA · DFA"| n1_1
  n1_1 -->|"2a. Step state · Scan"| n2a_2
  n1_1 -->|"2b. Fail jump · Link"| n2b_3
  n2a_2 -->|"3a. Emit hits · Matches"| n3_4
  n2b_3 -->|"3b. Merge · RAM"| n3_4
  n3_4 -.->|"4. Emit / · OTLP/API"| downstream_5

COMPONENT STACK (6)

  • Text / Packet StreamSTATELESS
    Prompt / HTTP / Log Payload
  • Compiled AutomatonSTATEFUL
    Trie + failure links + output
  • Byte-Stream ScannerSTATELESS
    Single pass O zero-backtrack
  • Failure Link TableSTATEFUL
    Fallback on mismatch without rewind
  • Match CollectorSTATELESS
    Emits all overlapping hits
  • Downstream & OTelSTATELESS
    Consumers, metrics & SLOs

REQUEST & DATA FLOW (6)

  1. Text / Packet Stream → Compiled Automaton (Load DFA)[DFA]
  2. Compiled Automaton → Byte-Stream Scanner (Step state)[Scan]
  3. Compiled Automaton → Failure Link Table (Fail jump)[Link]
  4. Byte-Stream Scanner → Match Collector (Emit hits)[Matches]
  5. Failure Link Table → Match Collector (Merge)[RAM]
  6. Match Collector → Downstream & OTel (Emit /)[OTLP/API]
Configure NGINX / Postgres / K8s →60-Sec L4–L7 Diagnostic →