Interactive Architecture & Dashboard Tour
Experience how Diverge orchestrates delta deployments, header/cookie routing, database schema isolation, serverless scale-to-zero hibernation, autonomous AgentTask Macaroon sandboxes, and diverge doctor diagnostics right in your browser—before installing a single CRD.
Interactive 6-Step Sandbox Walkthrough
Section titled “Interactive 6-Step Sandbox Walkthrough”Use the step buttons below (or press ← / → when focused inside the tour) to step through the lifecycle of PR #42 (feat/instant-payouts) on a 3-service e-commerce stack (storefront-web, checkout-api, fulfillment-worker).
Your Staging Cluster Before Any Pull Requests Open
Three microservices run in demo-staging alongside shared PostgreSQL, Kafka, and Flipt feature flags. All traffic flows through diverge-proxy to baseline v1.4.0 pods.
<div class="dv-topo-grid"> <div class="dv-node dv-node-proxy" id="dv-s1-proxy"> <div class="dv-node-head"> <span class="dv-badge dv-badge-orange">Ingress / L7 Router</span> <code>diverge-proxy</code> </div> <div class="dv-node-meta">Header & <code>?_diverge_env</code> cookie aware</div> </div>
<div class="dv-node" id="dv-s1-web"> <div class="dv-node-head"> <span class="dv-badge dv-badge-green">Baseline 1/1</span> <code>storefront-web</code> </div> <div class="dv-node-meta">Image: <code>v1.4.0</code> · Next.js / Go BFF</div> </div>
<div class="dv-node" id="dv-s1-api"> <div class="dv-node-head"> <span class="dv-badge dv-badge-green">Baseline 1/1</span> <code>checkout-api</code> </div> <div class="dv-node-meta">Image: <code>v1.4.0</code> · Propagates <code>x-diverge-env</code></div> </div>
<div class="dv-node" id="dv-s1-worker"> <div class="dv-node-head"> <span class="dv-badge dv-badge-green">Baseline 1/1</span> <code>fulfillment-worker</code> </div> <div class="dv-node-meta">Image: <code>v1.4.0</code> · Topic: <code>orders.events</code></div> </div>
<div class="dv-node" id="dv-s1-pg"> <div class="dv-node-head"> <span class="dv-badge dv-badge-blue">PostgreSQL 16</span> <code>schema: public</code> </div> <div class="dv-node-meta">Table: <code>orders</code> (4 baseline rows)</div> </div>
<div class="dv-node" id="dv-s1-flipt"> <div class="dv-node-head"> <span class="dv-badge dv-badge-purple">OpenFeature / Flipt</span> <code>namespace: default</code> </div> <div class="dv-node-meta">Flag: <code>instant_payouts = false</code></div> </div></div>
<div class="dv-console" id="dv-s1-console"> <div class="dv-console-bar"> <span>HTTP Trace & JSON Response</span> <code id="dv-s1-status">200 OK · 14ms · Baseline Route</code> </div> <pre class="dv-console-pre" id="dv-s1-output">$ curl -s https://shop.preview.example.com/api/checkout | jq .{ “service”: “checkout-api”, “version”: “v1.4.0”, “environment”: “baseline (demo-staging)”, “db_schema”: “public”, “feature_flags”: { “instant_payouts”: false }, “settlement_eta”: “T+2 business days” }
feat/instant-payouts)
Delta Analysis, Isolated Postgres Schema & Flipt Flag
PR #42 modifies services/checkout-api/main.go and adds migrations/20260902_add_instant_payouts.sql. Diverge deploys only 1 delta pod instead of cloning all 3 services.
<div class="dv-split-2"> <div class="dv-console"> <div class="dv-console-bar"> <span>CLI Diff & Controller Reconciliation</span> <code>67% Compute Saved</code> </div> <pre class="dv-console-pre" id="dv-s2-cli">$ diverge diff --base origin/mainChanged files (2): M services/checkout-api/main.go A services/checkout-api/migrations/20260902_add_instant_payouts.sql
Impact Matrix: [SKIP] storefront-web (0 files changed -> reuse baseline v1.4.0) [DEPLOY] checkout-api (2 files changed -> build tag pr-42-9f3a1c) [SKIP] fulfillment-worker (0 files changed -> reuse baseline v1.4.0)
Reconciling PreviewGroup/pr-42: ✓ Secret/diverge-db-env-pr-42 created (schema: preview_pr_42) ✓ Job/atlas-migrate-pr-42 succeeded (applied 20260902_add_instant_payouts.sql) ✓ Flipt namespace “preview-pr-42” synced (instant_payouts = true) ✓ Deployment/checkout-api-pr-42 Ready (1/1 pods · $0.012/hr) ✓ HTTPRoute/checkout-api-pr-42 programmed (x-diverge-env: pr-42)
<div class="dv-delta-cards"> <div class="dv-delta-card dv-delta-reused"> <div class="dv-delta-row"> <strong><code>storefront-web</code></strong> <span class="dv-badge dv-badge-gray">Reused from Baseline (0 extra pods)</span> </div> <p>Forwards incoming <code>x-diverge-env: pr-42</code> header to downstream <code>checkout-api</code>.</p> </div>
<div class="dv-delta-card dv-delta-deployed" id="dv-s2-delta-card"> <div class="dv-delta-row"> <strong><code>checkout-api-pr-42</code></strong> <span class="dv-badge dv-badge-orange">Delta Deployed (1 pod · $0.012/hr)</span> </div> <p>Injected with <code>DIVERGE_PREVIEW_SCHEMA=preview_pr_42</code> and Flipt namespace <code>preview-pr-42</code>.</p> </div>
<div class="dv-delta-card dv-delta-reused"> <div class="dv-delta-row"> <strong><code>fulfillment-worker</code></strong> <span class="dv-badge dv-badge-gray">Reused + Ephemeral Topic <code>pr-42.orders.events</code></span> </div> <p>Zero duplicate worker pods needed unless worker code changes in the PR.</p> </div>
<div class="dv-delta-card dv-delta-db"> <div class="dv-delta-row"> <strong>Postgres Schema <code>preview_pr_42</code> + Atlas</strong> <span class="dv-badge dv-badge-blue">Isolated DDL</span> </div> <p><code>ALTER TABLE preview_pr_42.orders ADD COLUMN payout_rail TEXT DEFAULT 'RTP_INSTANT';</code></p> </div> </div></div>One-Click ?_diverge_env=pr-42 Cookie Switcher & L7 Header Propagation
Click any URL pill below to simulate how a PM, designer, or QA engineer switches between baseline and PR #42 in their browser without installing extensions or changing DNS.
<div class="dv-url-pills" role="group" aria-label="Simulated Browser URL Switcher"> <button type="button" class="dv-url-pill" data-url-mode="baseline"> <span class="dv-pill-tag">Baseline</span> <code>https://shop.preview.example.com/</code> </button> <button type="button" class="dv-url-pill active" data-url-mode="pr42"> <span class="dv-pill-tag dv-pill-tag-accent">Activate PR #42</span> <code>https://shop.preview.example.com/?_diverge_env=pr-42</code> </button> <button type="button" class="dv-url-pill" data-url-mode="clear"> <span class="dv-pill-tag">Clear Cookie</span> <code>https://shop.preview.example.com/?_diverge_env=clear</code> </button></div>
<div class="dv-browser-window"> <div class="dv-browser-chrome"> <div class="dv-browser-dots"><span></span><span></span><span></span></div> <div class="dv-browser-addr" id="dv-s3-address">https://shop.preview.example.com/?_diverge_env=pr-42</div> <div class="dv-browser-cookie" id="dv-s3-cookie-badge">Cookie: <code>_diverge_env=pr-42</code></div> </div>
<div class="dv-browser-body"> <div class="dv-shop-card"> <div class="dv-shop-header"> <div> <span class="dv-shop-eyebrow">Acme Merchant Storefront (<code>storefront-web:v1.4.0</code>)</span> <h4 class="dv-shop-title" id="dv-s3-shop-title">Instant Payouts Checkout Preview</h4> </div> <span class="dv-badge dv-badge-orange" id="dv-s3-flag-pill">Flipt: instant_payouts = true</span> </div>
<div class="dv-shop-grid"> <div class="dv-shop-stat"> <span class="dv-shop-stat-label">Backend Responder</span> <strong id="dv-s3-responder"><code>checkout-api-pr-42</code> (PR #42 Delta Pod)</strong> </div> <div class="dv-shop-stat"> <span class="dv-shop-stat-label">PostgreSQL Schema</span> <strong id="dv-s3-schema"><code>preview_pr_42</code> (<code>payout_rail: RTP_INSTANT</code>)</strong> </div> <div class="dv-shop-stat"> <span class="dv-shop-stat-label">Settlement Speed</span> <strong id="dv-s3-eta">Instant (< 4 seconds via FedNow / RTP)</strong> </div> </div>
<div class="dv-trace-strip" id="dv-s3-trace"> <code>Browser</code> → <code>diverge-proxy (Set-Cookie: _diverge_env=pr-42)</code> → <code>storefront-web [baseline]</code> → <code>[x-diverge-env: pr-42]</code> → <strong class="dv-trace-highlight">checkout-api-pr-42 [delta]</strong> → <code>PG [preview_pr_42]</code> </div> </div>
<div class="dv-preview-banner" id="dv-s3-banner"> <div> <strong>⚡ Diverge Preview Environment:</strong> <code>pr-42</code> (Branch: <code>feat/instant-payouts</code> · Cost: <code>$0.012/hr</code>) </div> <button type="button" class="dv-banner-exit" id="dv-s3-banner-reset">Exit Preview (<code>?_diverge_env=clear</code>)</button> </div> </div></div>Scale-to-Zero (0/0 Pods) & 202 Accepted Wake-Up Splash
After 30 minutes without traffic (divergedev.com/hibernate-after: "30m"), Diverge scales checkout-api-pr-42 to 0 replicas (`$0.00/hr`). Click below to send a browser request and watch activator-proxy --wake-splash wake the pod.
<div class="dv-split-2"> <div class="dv-s2z-viewport" id="dv-s4-viewport"> <div class="dv-s2z-badge-row"> <span class="dv-badge dv-badge-orange" id="dv-s4-http-badge">HTTP 202 Accepted · Wake Splash Active</span> <code id="dv-s4-replicas">Deployment/checkout-api-pr-42: 0/1 Ready ($0.000/hr)</code> </div>
<div class="dv-splash-box" id="dv-s4-splash-box"> <div class="dv-splash-spinner" id="dv-s4-spinner" aria-hidden="true"></div> <h4 class="dv-splash-title" id="dv-s4-title">Waking Preview Environment <code>pr-42</code>…</h4> <p class="dv-splash-sub" id="dv-s4-sub"><code>activator-proxy</code> triggered scale-up from <code>0 → 1</code> replica and is polling <code>GET /-/wakeup-status?env=pr-42</code> every 1.5s.</p> <div class="dv-splash-steps"> <div class="dv-splash-step done" id="dv-s4-st1">1. Intercepted browser <code>GET /</code> with <code>Accept: text/html</code></div> <div class="dv-splash-step active" id="dv-s4-st2">2. Patched <code>Deployment/checkout-api-pr-42</code> replicas <code>0 → 1</code></div> <div class="dv-splash-step" id="dv-s4-st3">3. Pod readiness probe passed — auto-reloading storefront (`200 OK`)</div> </div> </div> </div>
<div class="dv-console"> <div class="dv-console-bar"> <span>Activator Proxy & Wakeup Status Log</span> <code id="dv-s4-timer">Cold start: ~2.4s</code> </div> <pre class="dv-console-pre" id="dv-s4-log">[21:00:00Z] hibernate-controller: env "pr-42" idle for 30m0s -> scaled checkout-api-pr-42 to 0 replicas[21:00:00Z] metrics: diverge_environment_estimated_hourly_cost_usd{environment=“pr-42”} 0.000
Click “Wake Hibernated Preview (GET /)” above to trigger cold-start wake-up…
Section titled “Click “Wake Hibernated Preview (GET /)” above to trigger cold-start wake-up…” </div></div>AgentTask in gVisor + Live Macaroon LLM Budget Enforcement
A reviewer comments /diverge fix "Fix currency rounding in instant payouts" on PR #42. Diverge spawns an isolated gvisor sandbox with a cryptographic HMAC-SHA256 Macaroon token capped at $5.00 and restricted to claude-3-7-sonnet.
<div class="dv-split-2"> <div class="dv-agent-panel"> <div class="dv-agent-header"> <div> <span class="dv-badge dv-badge-green" id="dv-s5-phase-badge">Phase: Running (gVisor)</span> <h4 class="dv-agent-title"><code>AgentTask/fix-pr-42-rounding</code></h4> </div> <code class="dv-token-status" id="dv-s5-token-badge">Macaroon: ACTIVE</code> </div>
<div class="dv-caveat-list"> <div class="dv-caveat"><code>task_id = fix-pr-42-rounding</code></div> <div class="dv-caveat"><code>max_cost_usd = 5.00</code></div> <div class="dv-caveat"><code>max_tokens = 200000</code></div> <div class="dv-caveat"><code>allowed_models = claude-3-7-sonnet</code></div> <div class="dv-caveat"><code>linked_preview = agent-preview-fix-pr-42</code></div> </div>
<div class="dv-meter-box"> <div class="dv-meter-labels"> <span>Live LLM Spend (<code>status.costUSD</code> / <code>$5.00</code> Cap)</span> <strong id="dv-s5-spend-label">$1.25 / $5.00 (42,000 tokens)</strong> </div> <div class="dv-meter-bar"> <div class="dv-meter-fill" id="dv-s5-meter-fill" style="transform: scaleX(0.25);"></div> </div> </div>
<div class="dv-agent-controls"> <label class="dv-model-select-wrap" for="dv-s5-model"> <span>Model in Request:</span> <select id="dv-s5-model" class="dv-select"> <option value="claude-3-7-sonnet">claude-3-7-sonnet (Allowed)</option> <option value="gpt-4o">gpt-4o (Disallowed by Caveat)</option> </select> </label> <button type="button" class="dv-btn dv-btn-accent" id="dv-btn-meter-call">Simulate Agent LLM Call (<code>+$1.35</code>)</button> <button type="button" class="dv-btn dv-btn-ghost" id="dv-btn-agent-resume">Resume Task (<code>+$5.00 Budget</code>)</button> </div> </div>
<div class="dv-console"> <div class="dv-console-bar"> <span><code>POST /api/v1/agenttask/meter</code> Response</span> <code id="dv-s5-http-code">HTTP 200 OK</code> </div> <pre class="dv-console-pre" id="dv-s5-console">$ curl -X POST https://diverge-server.diverge-system.svc:8080/api/v1/agenttask/meter \-H “Authorization: Bearer MDAxZWxvY2F0aW9uIGRpdmVyZ2Utc2VydmVy…”
-d ‘{“model”:“claude-3-7-sonnet”,“tokensUsed”:42000,“costUSD”:1.25,“iteration”:1}’
HTTP/1.1 200 OK { “allowed”: true, “suspended”: false, “task”: “fix-pr-42-rounding”, “costUSD”: 1.25, “budgetUSD”: 5.00, “tokensUsed”: 42000, “remainingUSD”: 3.75 }
diverge doctor Fault Simulator (DIV-101–DIV-110) & PR Merge Teardown
Inject a realistic failure below to inspect the exact diverge doctor diagnostic code and remediation output, or merge PR #42 to watch finalizer cleanup tear down every ephemeral resource.
<div class="dv-url-pills" role="group" aria-label="diverge doctor fault injector"> <button type="button" class="dv-url-pill active" data-doc-mode="healthy"> <span class="dv-pill-tag">Healthy</span> <code>All Checks Passing</code> </button> <button type="button" class="dv-url-pill" data-doc-mode="div102"> <span class="dv-pill-tag dv-pill-tag-warn">Inject DIV-102</span> <code>Atlas Migration Failed</code> </button> <button type="button" class="dv-url-pill" data-doc-mode="div105"> <span class="dv-pill-tag dv-pill-tag-warn">Inject DIV-105</span> <code>Pod CrashLoopBackOff</code> </button> <button type="button" class="dv-url-pill" data-doc-mode="div110"> <span class="dv-pill-tag dv-pill-tag-warn">Inject DIV-110</span> <code>AgentTask BudgetExceeded</code> </button></div>
<div class="dv-console"> <div class="dv-console-bar"> <span><code>diverge doctor --namespace demo-staging</code></span> <a href="/guides/troubleshooting/#diagnostic-error-codes-div-101--div-110" class="dv-doc-link" id="dv-s6-doc-link">View DIV-101–DIV-110 Playbook →</a> </div> <pre class="dv-console-pre" id="dv-s6-output">$ diverge doctor --namespace demo-staging✓ Kubernetes API & Diverge CRDs (Environment, PreviewGroup, AgentTask) healthy ✓ PreviewGroup/pr-42 [Phase: Ready] (1 delta service: checkout-api-pr-42) ✓ Database Schema “preview_pr_42” & Secret/diverge-db-env-pr-42 synced ✓ HTTPRoute/checkout-api-pr-42 Programmed=True (header: x-diverge-env=pr-42) ✓ AgentTask/fix-pr-42-rounding [Phase: Succeeded] ($3.80 / $5.00 budget)
No issues found (0 critical, 0 warnings).
What You Just Experienced
Section titled “What You Just Experienced”- Delta Deployments (
PreviewGroup&diverge diff): Instead of cloningstorefront-web,checkout-api, andfulfillment-workerfor every PR, Diverge deployed onlycheckout-api-pr-42—cutting preview compute by 67% on a 3-service stack (and >90% on a 25-service stack). - Zero-Extension Browser Testing (
?_diverge_env=pr-42): Clicking a shareable URL sets anHttpOnly_diverge_env=pr-42cookie indiverge-proxyand injects the floating Preview Switcher Banner so reviewers can toggle back to baseline with one click. - Full-Stack State Isolation: Each preview automatically receives an isolated PostgreSQL schema (
preview_pr_42) migrated via Ariga Atlas, an isolated Flipt feature flag namespace (preview-pr-42), and isolated Kafka topics (pr-42.orders.events). - Serverless Scale-to-Zero (
activator-proxy --wake-splash): Idle previews scale down to0pods and wake seamlessly with a202 AcceptedHTML splash screen that pollsGET /-/wakeup-statusuntil ready. - Cryptographic
AgentTaskGovernance: Autonomous coding agents run ingvisor/katasandboxes with HMAC-SHA256 Macaroon capability caveats (max_cost_usd,max_tokens,allowed_models) enforced live on everyPOST /api/v1/agenttask/metercall. - Actionable Diagnostics (
DIV-101–DIV-110):diverge doctorsurfaces deterministic error codes linked directly to the Troubleshooting Playbook.
