Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 33 additions & 7 deletions db/seeds/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,26 @@ module DevelopmentSeed
AGENT_ORGANIZE_RUN_ID = "development-seed-organize-run"

CONTENT_FIXTURES = {
# Deliberately wider than a document column: this is the fixture that
# demonstrates the legibility floor (the diagram keeps its real size
# and scrolls rather than shrinking to unreadable) and the pan/zoom
# expanded view.
flowchart: <<~MARKDOWN,
```mermaid
flowchart LR
Client --> Gateway
Gateway --> API
API --> DB[(Database)]
Client[Merchant client] --> Gateway[Edge gateway]
Gateway --> Auth[Token exchange]
Auth --> API[Orders API]
API --> Rules[Eligibility rules]
Rules --> Engine[Pricing engine]
Engine --> Ledger[(Price ledger)]
Engine --> Risk[Risk scoring]
Risk --> Capture[Capture service]
Capture --> Settle[Settlement batch]
Settle --> Payout[(Payout store)]
API --> Events[Event feed]
Events --> Search[(Search index)]
Events --> Warehouse[(Warehouse)]
```
MARKDOWN
state_diagram: <<~MARKDOWN,
Expand All @@ -182,11 +196,23 @@ module DevelopmentSeed
S-->>A: Receipt ID
```
MARKDOWN
# Wide and long on purpose — the fixture that shows a table framed and
# wrapped in the document, and opened as a spreadsheet.
table: <<~MARKDOWN,
| Metric | Control | Treatment |
| --- | ---: | ---: |
| Success | 61.2% | 62.9% |
| Errors | 18.4% | 17.7% |
| Variant | Cohort | Sessions | Success | Errors | p95 latency | Revenue / session | Notes |
| --- | --- | ---: | ---: | ---: | ---: | ---: | --- |
| Control | All | 41,208 | 61.2% | 18.4% | 412ms | $2.14 | Baseline ranker, unchanged since March |
| Treatment A | All | 40,876 | 62.9% | 17.7% | 438ms | $2.31 | Recall boost on long-tail queries |
| Treatment B | All | 12,004 | 59.8% | 21.3% | 507ms | $1.96 | Reranker on top; latency cost too high |
| Control | New | 8,912 | 54.1% | 22.8% | 401ms | $1.42 | New accounts see fewer personalized results |
| Treatment A | New | 8,844 | 58.6% | 19.9% | 430ms | $1.71 | Largest lift in the whole experiment |
| Treatment B | New | 2,610 | 55.2% | 24.1% | 512ms | $1.38 | Same latency story as the pooled cohort |
| Control | Returning | 32,296 | 63.1% | 17.2% | 414ms | $2.34 | |
| Treatment A | Returning | 32,032 | 64.1% | 17.1% | 440ms | $2.47 | Small but consistent across every week |
| Treatment B | Returning | 9,394 | 61.1% | 20.5% | 505ms | $2.12 | |
| Control | Mobile | 19,441 | 57.8% | 20.6% | 486ms | $1.88 | Mobile is latency-bound before it is ranking-bound |
| Treatment A | Mobile | 19,388 | 59.9% | 19.4% | 511ms | $2.02 | Lift holds, but the latency budget is nearly spent |
| Treatment B | Mobile | 5,702 | 54.3% | 25.7% | 604ms | $1.61 | Rejected on mobile outright |
MARKDOWN
code_walkthrough: <<~'MARKDOWN',
How the discount engine decides what every line item costs. Each stage is
Expand Down
Loading
Loading