File size: 2,395 Bytes
446ae08
17caec4
 
 
 
 
446ae08
17caec4
446ae08
 
17caec4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
---
title: Message Router  An Inbox That Reasons
emoji: 🧭
colorFrom: green
colorTo: pink
sdk: static
pinned: false
short_description: Interactive WhatsApp UI for a real AI notification router
---

# Message Router — an inbox that reasons

A WhatsApp-accurate, fully interactive front end for the notification-routing
pipeline documented in the parent repo's `README.md`. Every decision shown
here is a real, precomputed output of the actual run — nothing is invented
for the demo, and no API key is needed to view it.

- Pick any of the 32 real inboxes from the dropdown and browse their chats.
- Tap a message with a dashed outline to open the animated 5-phase routing
  trace: bundle → media → rules → router → normalize, including hard-override
  behavior, evidence, and the semantic-consistency check.
- **Router HQ** (pinned chat, pulses on load) narrates the architecture
  inside a chat thread, with tappable quick replies and deep links into real
  examples.
- **Try It Yourself** (pinned chat) runs a small client-side heuristic so you
  can type your own message and get an instant (clearly-labelled toy) verdict.
- Search, Unread/Groups filters, a ⋮ menu, and the static architecture
  diagram below the phone (animated on scroll) are all live, not decorative.
- Light/dark theme toggle, default light.

This folder is exactly what gets deployed — nothing here needs a build step.

## Local preview

```bash
cd hf
python -m http.server 8000
# open http://localhost:8000
```

## Regenerating data.json

`data.json` is generated once from the parent repo's real outputs and
committed here. The generator and its source data (`runs/`, `dataset/`) live
one level up — see `../webapp/build_data.py`:

```bash
python ../webapp/build_data.py     # reads ../dataset, ../runs
                                    # writes ./data.json
```

## Deploying this folder to a Hugging Face Space

This folder *is* the Space — `sdk: static` in the frontmatter above means
Spaces serves `index.html`, `styles.css`, `app.js` and `data.json` directly,
no runtime, no secrets, no `GEMINI_API_KEY`.

```bash
huggingface-cli repo create message-router --type space --space_sdk static
git clone https://huggingface.co/spaces/<you>/message-router
cp hf/*.md hf/*.html hf/*.css hf/*.js hf/*.json message-router/
cd message-router && git add -A && git commit -m "deploy" && git push
```