From 56aee91c78ccd2ea2890ac871d78515142d639a7 Mon Sep 17 00:00:00 2001 From: Omid Mirzaei Date: Sat, 19 Sep 2026 10:21:05 +0400 Subject: [PATCH 1/5] add Carbon arrows for the event path hops --- web/components/icons/.library.json | 2 ++ web/components/icons/arrow-down.tsx | 12 ++++++++++++ web/components/icons/arrow-right.tsx | 12 ++++++++++++ web/components/icons/index.ts | 2 ++ 4 files changed, 28 insertions(+) create mode 100644 web/components/icons/arrow-down.tsx create mode 100644 web/components/icons/arrow-right.tsx diff --git a/web/components/icons/.library.json b/web/components/icons/.library.json index 022a4cd..15b20c9 100644 --- a/web/components/icons/.library.json +++ b/web/components/icons/.library.json @@ -5,6 +5,8 @@ "installedAt": "2026-09-17T08:38:37.954Z", "icons": [ "activity", + "arrow-down", + "arrow-right", "chart-line", "checkmark", "compare", diff --git a/web/components/icons/arrow-down.tsx b/web/components/icons/arrow-down.tsx new file mode 100644 index 0000000..24edf49 --- /dev/null +++ b/web/components/icons/arrow-down.tsx @@ -0,0 +1,12 @@ +import type { SVGProps } from "react"; + +export function ArrowDownIcon(props: SVGProps) { + return ( + + + + ); +} diff --git a/web/components/icons/arrow-right.tsx b/web/components/icons/arrow-right.tsx new file mode 100644 index 0000000..631a6be --- /dev/null +++ b/web/components/icons/arrow-right.tsx @@ -0,0 +1,12 @@ +import type { SVGProps } from "react"; + +export function ArrowRightIcon(props: SVGProps) { + return ( + + + + ); +} diff --git a/web/components/icons/index.ts b/web/components/icons/index.ts index 2163900..b68f801 100644 --- a/web/components/icons/index.ts +++ b/web/components/icons/index.ts @@ -13,3 +13,5 @@ export { RenewIcon } from "./renew"; export { FlashIcon } from "./flash"; export { Network4Icon } from "./network-4"; export { DataTableIcon } from "./data-table"; +export { ArrowRightIcon } from "./arrow-right"; +export { ArrowDownIcon } from "./arrow-down"; From 7ceb233e1e09a866d131297919b89037dd919fcc Mon Sep 17 00:00:00 2001 From: Omid Mirzaei Date: Sat, 19 Sep 2026 10:21:15 +0400 Subject: [PATCH 2/5] keep DLQ after the happy path in node order --- web/lib/architecture.ts | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/web/lib/architecture.ts b/web/lib/architecture.ts index e5d0a41..f3d02c7 100644 --- a/web/lib/architecture.ts +++ b/web/lib/architecture.ts @@ -62,14 +62,6 @@ export const ARCH_NODES: ArchNode[] = [ detail: "Dedupe by event_id, then one tx: mark processed, write state, credit. Handler retries up to 3×, then DLQ.", code: "internal/worker", }, - { - id: "dlq", - label: "DLQ", - plain: "Hard fail", - detail: "After 3 worker retries, the event is published to player.events.dlq and is not credited. Inspect last N; redrive is a new signed ingest of the same event_id.", - code: "player.events.dlq", - branch: true, - }, { id: "rules", label: "Rules", @@ -91,10 +83,26 @@ export const ARCH_NODES: ArchNode[] = [ detail: "HTTP or gRPC behind X-API-Key. Tools get_player and get_metrics read. They do not credit or set VIP.", code: "GET /v1/players/{id}", }, + { + id: "dlq", + label: "DLQ", + plain: "Hard fail", + detail: "After 3 worker retries, the event is published to player.events.dlq and is not credited. Inspect last N; redrive is a new signed ingest of the same event_id.", + code: "player.events.dlq", + branch: true, + }, ]; export const ARCH_MAIN = ARCH_NODES.filter((n) => !n.branch); export const ARCH_BRANCH = ARCH_NODES.filter((n) => n.branch); +export const ARCH_ROW_1: ArchNodeId[] = [ + "partner", + "hmac", + "ingest", + "outbox", + "kafka", +]; +export const ARCH_ROW_2: ArchNodeId[] = ["worker", "rules", "ledger", "read"]; export const ARCH_EDGES: [ArchNodeId, ArchNodeId][] = [ ["partner", "hmac"], From db26e2cc673dce345fd23dbd34e888d04b4c23fb Mon Sep 17 00:00:00 2001 From: Omid Mirzaei Date: Sat, 19 Sep 2026 10:21:16 +0400 Subject: [PATCH 3/5] draw event-path hops instead of lines under the boxes --- web/components/architecture-diagram.tsx | 259 +++++++++++++++++------- 1 file changed, 182 insertions(+), 77 deletions(-) diff --git a/web/components/architecture-diagram.tsx b/web/components/architecture-diagram.tsx index d089d0b..3d32637 100644 --- a/web/components/architecture-diagram.tsx +++ b/web/components/architecture-diagram.tsx @@ -1,11 +1,16 @@ "use client"; import { - ARCH_EDGES, - ARCH_NODES, + ARCH_BRANCH, + ARCH_MAIN, + ARCH_ROW_1, + ARCH_ROW_2, + nodeById, type ArchNode, type ArchNodeId, } from "@/lib/architecture"; +import { ArrowDownIcon, ArrowRightIcon } from "@/components/icons"; +import { Badge } from "@/components/ui/badge"; import { cn } from "@/lib/utils"; type Props = { @@ -16,34 +21,6 @@ type Props = { groupName?: string; }; -const SLOT: Record = { - partner: "lg:col-start-1 lg:row-start-1", - hmac: "lg:col-start-2 lg:row-start-1", - ingest: "lg:col-start-3 lg:row-start-1", - outbox: "lg:col-start-4 lg:row-start-1", - kafka: "lg:col-start-5 lg:row-start-1", - worker: "lg:col-start-1 lg:row-start-2", - rules: "lg:col-start-2 lg:row-start-2", - ledger: "lg:col-start-3 lg:row-start-2", - read: "lg:col-start-4 lg:row-start-2", - dlq: "lg:col-start-1 lg:row-start-3", -}; - -const COLS = 5; -const ROWS = 3; -const SLOT_XY: Record = { - partner: { col: 1, row: 1 }, - hmac: { col: 2, row: 1 }, - ingest: { col: 3, row: 1 }, - outbox: { col: 4, row: 1 }, - kafka: { col: 5, row: 1 }, - worker: { col: 1, row: 2 }, - rules: { col: 2, row: 2 }, - ledger: { col: 3, row: 2 }, - read: { col: 4, row: 2 }, - dlq: { col: 1, row: 3 }, -}; - export function ArchitectureDiagram({ selected, onSelect, @@ -53,66 +30,180 @@ export function ArchitectureDiagram({ }: Props) { const hot = new Set(hotIds); const compact = variant === "compact"; + const stepOf = new Map(ARCH_MAIN.map((node, i) => [node.id, i + 1])); return (
-
- Partner to GET player. HMAC is signed in the BFF and verified in Go. - Worker retries three times, then DLQ. +
+ Happy path left to right, then worker. DLQ is the fail branch after + retry ×3.
-
- - {ARCH_EDGES.map(([from, to]) => ( - + +
+

+ + then worker +

+ +
+ +
+ +
+

+ Fail from worker after retry ×3 +

+
+ + {ARCH_BRANCH.map((node) => ( + ))} - -
    - {ARCH_NODES.map((node) => ( -
  1. - -
  2. - ))} -
+
); } -function edgePoints(from: ArchNodeId, to: ArchNodeId): string { - const a = SLOT_XY[from]; - const b = SLOT_XY[to]; - const x1 = ((a.col - 0.5) / COLS) * 100; - const y1 = ((a.row - 0.5) / ROWS) * 60; - const x2 = ((b.col - 0.5) / COLS) * 100; - const y2 = ((b.row - 0.5) / ROWS) * 60; - if (from === "kafka" && to === "worker") { - const midY = (1.5 / ROWS) * 60; - return `${x1},${y1} ${x1},${midY} ${x2},${midY} ${x2},${y2}`; - } - return `${x1},${y1} ${x2},${y2}`; +function PathRow({ + ids, + selected, + hot, + compact, + groupName, + stepOf, + onSelect, +}: { + ids: ArchNodeId[]; + selected: ArchNodeId; + hot: Set; + compact: boolean; + groupName: string; + stepOf: Map; + onSelect: (id: ArchNodeId) => void; +}) { + return ( +
    + {ids.map((id, i) => { + const node = nodeById(id); + const next = ids[i + 1]; + return ( +
  1. + + {next ? ( + <> + + + + ) : null} +
  2. + ); + })} +
+ ); +} + +function hopLit( + from: ArchNodeId, + to: ArchNodeId, + selected: ArchNodeId, + hot: Set, +): boolean { + return selected === from || selected === to || (hot.has(from) && hot.has(to)); +} + +function Hop({ + dir, + lit, + className, +}: { + dir: "right" | "down"; + lit: boolean; + className?: string; +}) { + const Icon = dir === "right" ? ArrowRightIcon : ArrowDownIcon; + return ( + + + + ); } function PathNode({ node, + step, selected, hot, compact, @@ -120,6 +211,7 @@ function PathNode({ onSelect, }: { node: ArchNode; + step: number | null; selected: boolean; hot: boolean; compact: boolean; @@ -148,12 +240,25 @@ function PathNode({ onChange={() => onSelect(node.id)} className="sr-only" /> - + + {step != null ? ( + + {step} + + ) : ( + + fail + + )} {node.label} {hot ? ( - + hot ) : null} From 937453daa4317d9197faabd15869d76543050f56 Mon Sep 17 00:00:00 2001 From: Omid Mirzaei Date: Sat, 19 Sep 2026 10:21:16 +0400 Subject: [PATCH 4/5] name the DLQ fail branch on the start path --- web/components/pulse-theater.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web/components/pulse-theater.tsx b/web/components/pulse-theater.tsx index 7e39fda..ab5fcaf 100644 --- a/web/components/pulse-theater.tsx +++ b/web/components/pulse-theater.tsx @@ -255,7 +255,8 @@ export function PulseTheater() {
Event path

- HMAC sign in the BFF, verify in Go, outbox, Kafka, worker tx. + HMAC in the BFF, verify in Go, outbox, Kafka, worker. DLQ is + the fail branch.