# Round 12 — Tower Floors J05-J09 · 5W Parallel Wing

**Date**: 2026-04-30
**Status**: ✅ COMPLETE · 5 parallel agents

---

## 🏛️ The 5W Wing — Architecture

5 קומות **רצות במקביל** (לא טור). כל אחת אחראית על field אחד של 5W. ה-fork הראשון של pipeline אחרי J04.

```
                    J04 Desk Router
                          │
        ┌────────┬────────┼────────┬────────┐
        ▼        ▼        ▼        ▼        ▼
       J05      J06      J07      J08      J09
       WHO     WHAT     WHEN    WHERE     WHY
        │        │        │        │        │
        └────────┴────────┼────────┴────────┘
                          ▼
                 5W Aggregator (J09.5)
                          │
                          ▼
                  J10 Vector Search
```

הexec במקביל = **תקרת זמן = max(5 floors), לא sum**. זה חוסך ~2 שניות בכל press flow.

---

## 👤 J05 · WHO — Entity Extraction

**תפקיד**: לזהות מי המעורבים — אנשים, ארגונים, תפקידים.

**Output**:
```json
{
  "primary": "משרד הביטחון",
  "secondary": ["ראש הממשלה", "צה\"ל"],
  "entities": [
    { "name": "משרד הביטחון", "type": "organization", "role": "actor" },
    { "name": "יואב גלנט", "type": "person", "role": "spokesperson" },
    { "name": "צה\"ל", "type": "organization", "role": "executor" }
  ],
  "confidence": 0.94
}
```

**Prompt**: extract who is doing what. Categorize as person/organization/role.

**Tools**: pgvector lookup ב-`jason_items` (31,590 articles) למצוא Wikipedia-style context לכל entity.

**Cost**: 0.0003$ · 600ms (Gemini Flash)

**A2UI**:
```json
{"updateDataModel":{"path":"/w5/who","value":"משרד הביטחון"}}
{"updateComponents":{"components":[
  {"id":"who-chip-1","component":"EntityChip","name":"משרד הביטחון","type":"organization","action":{"name":"open_dossier"}}
]}}
```

---

## 📋 J06 · WHAT — Action Extraction

**תפקיד**: מה קרה? action חד.

**Output**:
```json
{
  "primary": "עסקת רכש 12 סוללות כיפת ברזל בשווי 5 מיליארד שקל",
  "verb": "אושרה",
  "object": "עסקת רכש",
  "modifier": "12 סוללות / 5 מיליארד שקל",
  "confidence": 0.91
}
```

**Cost**: 0.0002$ · 500ms

---

## 🕒 J07 · WHEN — Temporal Extraction

**תפקיד**: זמן + תאריך + מצב זמני (passed/ongoing/future).

**Output**:
```json
{
  "iso": "2026-04-30T22:00:00+03:00",
  "human_he": "אמש בשעה 22:00",
  "tense": "past",
  "is_breaking": true,
  "time_until_event_seconds": -7200
}
```

**Tools**: Hebrew date parser (custom, handles "אמש", "מחרתיים", "בערב")

**Cost**: 0.0001$ · 300ms

---

## 🌍 J08 · WHERE — Location Extraction

**תפקיד**: מיקום + קואורדינטות.

**Output**:
```json
{
  "primary": "ירושלים",
  "secondary": ["משרד הביטחון, הקריה"],
  "coords": { "lat": 31.7683, "lng": 35.2137 },
  "country": "IL",
  "is_sensitive_location": false
}
```

**Tools**: pgvector lookup + Mapbox geocoding fallback.

**Cost**: 0.0002$ · 500ms

---

## ❓ J09 · WHY — Causal Extraction

**תפקיד**: למה זה קרה? motivation/cause.

**Output**:
```json
{
  "primary": "הצורך בחידוש מלאי כיפת ברזל לאחר ירידת מלאים בעקבות הסיבוב האחרון",
  "category": "operational_necessity",
  "confidence": 0.78
}
```

**הקשה ביותר**. confidence נמוך טבעי. צריך editor review אם < 0.8.

**Cost**: 0.0003$ · 700ms

---

## 🎯 5W Aggregator (J09.5)

ממזג את 5 ה-outputs לstructure אחיד. רצף:

```
1. Wait for all 5 to finish (Promise.all)
2. Validate (W5 must be coherent — same event)
3. Cross-validate (e.g., date matches headline?)
4. Emit 5w_done event
```

---

## ⏱️ Timing מצטבר

| Floor | Time | Cost |
|---|---|---|
| J05 WHO | 600ms | 0.0003$ |
| J06 WHAT | 500ms | 0.0002$ |
| J07 WHEN | 300ms | 0.0001$ |
| J08 WHERE | 500ms | 0.0002$ |
| J09 WHY | 700ms | 0.0003$ |
| **Parallel max** | **~700ms** | **0.0011$** |
| (sequential would be) | (2,600ms) | (same) |

**חיסכון**: 1.9 שניות.

---

## 🌊 ה-Streaming Pattern

ה-FiveWBar component ב-A2UI:
```json
{
  "id": "w5bar",
  "component": "FiveWBar",
  "fields": ["who", "what", "when", "where", "why"],
  "values": {
    "who":   { "path": "/w5/who" },
    "what":  { "path": "/w5/what" },
    "when":  { "path": "/w5/when" },
    "where": { "path": "/w5/where" },
    "why":   { "path": "/w5/why" }
  },
  "streaming": true
}
```

כשpath מתעדכן (כל אחד עצמאי, parallel), ה-cell המתאימה ב-bar מתעדכנת עם **typewriter animation** (50ms per char). User רואה 5 cells מתמלאים **בו-זמנית**, כל אחד בקצב משלו. זה אפקט ויזואלי מטורף.

---

## ✅ Closure

✅ Round 12 closed. **5W parallel = 700ms (vs 2.6s sequential)**.
