# Doc 20 · GAIA OS × Zennith OS — Bridge Architecture

> **Status:** Jenn-locked 2026-05-17. Formal ownership map between the two
> operating systems that converge on the hericium texture-engineering
> programme.
>
> **Trigger:** Jenn voice, 2026-05-17: *"this shud be gaiaos.ai. bridge with
> zennith os?? but for now zennith os main focus on marketing, that complete
> loop. not on this rnd so we might this on gaia os. gaia os more on
> production, rnd as well. like cost calculation, and day to day operation."*

---

## TL;DR

| OS | Domain | Surface | Lane fit |
|----|--------|---------|----------|
| **GAIA OS** | Production · R&D · Kitchen · Cost · Day-to-day ops | `gaiaos.ai`, `@Gaiachef_bot`, ingredient-vault, Pinxin supply chain | **Production-lane** (factory floor, kitchen, COGS, staff workflows) |
| **Zennith OS** | Marketing · Brief · Creative · Persona-sim · ROAS | `zennith-skills/skills/*`, `mkt` CLI, MiroFish, ad_id chain, compound-promoter | **Marketing-lane** (brief → gen → audit → publish → measure) |

**One sentence:** GAIA OS makes the food, Zennith OS sells the food, and the
`texture-engineer` skill is the thin pipe between them.

---

## 1. Why the split exists (and why it must)

The 2-day hericium deepdive (2026-05-15 to 2026-05-17) surfaced a structural
truth: **R&D execution and marketing execution share data but not workflow**.
Forcing them into one OS created the same mistake every D2C operator makes —
the marketing team gets blocked on supply-chain reality, the R&D team gets
distracted by creative cycles.

Concrete examples from this programme that forced the split:

| Decision | Wrong home (one-OS) | Right home (split) |
|---|---|---|
| Bulk-order TGase from Modernist Pantry | "Zennith OS skill `procurement-cli`?" — nope, that's a 30-second Shopee click on the kitchen iPad | GAIA OS · ingredient-vault · staff places order |
| Reject V1 batch — texture too rubbery | "compound-promoter sees a rejection event from… where?" | GAIA OS bot `/feedback` → writes JSONL → Zennith reads it nightly |
| Should we Kling-animate the V2 launch reel? | Always Zennith — pure creative loop | Zennith OS · `mkt conveyor --brand gaia-eats` |
| Reorder hericium from Ganofarm? Margin tight at 41% | "Marketing peer cares about margin?" — no, ops cares | GAIA OS · cost-calc + day-to-day |
| Has the V1 master formula been validated in 50-persona sim? | "Production peer cares about persona scores?" — no, marketing-attribution loop cares | Zennith OS · `texture-engineer` skill |

**One-OS approach failure mode (observed in prior cross-brand work):** every
new R&D ingredient becomes a creative-director context-stuff, every new
campaign launch blocks on kitchen capacity sheets that don't exist yet.
**Split-OS succeeds** because each loop closes on its own cadence — kitchen
loop = hours, marketing loop = days/weeks — and the only shared artifact is
the **typed recipe spec** that crosses the bridge.

---

## 2. The two operating systems

### 2.1 GAIA OS — Production lane

**Domain ownership:**
- R&D recipe execution (kitchen-floor)
- Cost calculation (COGS, margin, bulk-order math)
- Day-to-day staff workflow (Telegram bot, shift handover)
- Supplier database + ingredient vault
- Halal compliance audit trail (JAKIM-facing)
- Pinxin Vegan supply chain integration (frozen, 7 SKUs already live)
- HPP cold-chain partnership ops (MARDI)
- Equipment inventory (steam ovens, sears, pH meters, vacuum tumblers)

**Domain url:** `gaiaos.ai`

**Surfaces shipped today:**

| Surface | Path | Status |
|---|---|---|
| Texture-Engineering programme deploy | `https://texture-engineering.gaiaos.ai` (Cloudflare Pages) | LIVE — 14 docs |
| Ingredient Vault | `~/.zennith/workspace/intel/texture-engineering-deepdive-2026-05-16/ingredient-vault/index.html` (deploy → `ingredient-vault.gaiaos.ai`) | LIVE local · ready for CF push |
| GAIA R&D Telegram Bot (`@Gaiachef_bot`) | `~/.zennith/workspace/gaia-os/gaia-rd-bot/bot.py` · launchd `world.gaiaos.rd-bot.plist` | LIVE — PID 2590 |
| R&D Recipe Sheets (V1/V5/V2) | Doc 19 in same intel dir | LIVE — bot serves these |

**Recipe sheets (the canonical artifact GAIA OS owns):**
- Doc 19 — R&D Recipe Sheets V1/V5/V2 — every gram, every step, every verify
- `~/.zennith/workspace/gaia-os/gaia-rd-bot/data/{variants,ingredients,steps}.json` — typed slice the bot serves

**Bot commands (R&D staff entrypoint):**
```
/list                 show V1/V5/V2 cards
/v1 | /v5 | /v2       full recipe sheet (params + cook card)
/ingredients [V1|V5|V2]  bulk-order shopping list
/steps [V1|V5|V2]     13-step process spine
/feedback <msg>       log staff trial feedback
/ask <q>              question for R&D lead (replies async)
/status               bot health + log counts
```

### 2.2 Zennith OS — Marketing lane

**Domain ownership:**
- Brief authoring (`marketing --mode brief`, Jenn-locked 2026-05-13)
- Creative generation (creative-director, Nano Banana / Kling)
- Persona-sim validation (MiroFish OASIS engine + Moonshot LLM)
- Ad ID chain (mint → upload → UTM → Shopify → CAPI → ROAS)
- Compound-promoter (reject events → AVOID rules → next gen dodges)
- Channel publishing (Meta, IG, TikTok, Klaviyo, Shopify)
- ROAS attribution + autoads kill/scale loop

**Surfaces shipped today:**

| Surface | Path | Status |
|---|---|---|
| `texture-engineer` skill | `~/zennith-skills/skills/texture-engineer/SKILL.md` | LIVE v1.0 |
| `market-survey-deep-research` skill v1.5 | `~/zennith-skills/skills/market-survey-deep-research/` | LIVE — F1-F22 + PMR1-PMR7 |
| MiroFish OASIS + Moonshot LLM | `~/MiroFish/` | LIVE — 50-persona sim validated V1 winner |
| `mkt` CLI dispatcher | `~/zennith-skills/skills/mkt/scripts/mkt.sh` | LIVE — brief/audit/conveyor/attrib |
| Ad ID chain | `~/.zennith/skills/unified-intel/scripts/ad-id-mint.sh` | LIVE |
| compound-promoter | `~/.zennith/skills/artifact-bus/scripts/compound-promoter.sh` | LIVE (nightly 2:50 AM MYT iMac) |

---

## 3. The bridge — what crosses, what doesn't

### 3.1 The pipe

```
                              BRIDGE: texture-engineer skill
                              (Zennith OS surface, GAIA OS consumer)
                              ┌────────────────────────────────────┐
                              │ recipe.json (typed Pydantic spec)  │
                              │ 9-Node scores                      │
                              │ F1-F22 archetype tagging           │
                              │ persona-sim verdict                │
                              │ COGS estimate                      │
                              └────────────────────────────────────┘
                                       │           ▲
                                       ▼           │
   ZENNITH OS                                              GAIA OS
   ━━━━━━━━━━                                              ━━━━━━━
   marketing brief                                         R&D execution
   creative gen ─┐                                         ┌─ kitchen trial
   persona sim   │ → recipe spec ─→  /v1 bot card ─→       │  /feedback log
   ROAS measure  │   ←──  kitchen reject ←── feedback ←────┤
                 │                                         │
                 │   ←── COGS verified ←── invoices ←──────┤
                 │                                         │
   compound      │   ←── halal pass ←── JAKIM audit ←──────┤
   promoter ─────┘                                         └─ supply order
```

### 3.2 What crosses the bridge

| Direction | Artifact | Format | Owner-write · Reader |
|---|---|---|---|
| Zennith → GAIA | **Recipe spec** | `variants.json` (Pydantic) | Zennith `texture-engineer` writes · GAIA bot reads |
| Zennith → GAIA | **Brief** | `brief.md` | Zennith `marketing --mode brief` writes · GAIA reads for kitchen photo-call planning |
| Zennith → GAIA | **Persona-sim verdict** | `sim_<id>` summary | Zennith MiroFish writes · GAIA reads as "go/no-go signal" before kitchen burn |
| GAIA → Zennith | **Kitchen feedback** | `logs/feedback.jsonl` (bot) | GAIA bot writes · Zennith compound-promoter reads nightly |
| GAIA → Zennith | **Actual COGS** | Invoice JSON / spreadsheet | GAIA ops writes · Zennith marketing reads for margin-gate before paid push |
| GAIA → Zennith | **Halal cert** | JAKIM PDF + audit JSON | GAIA writes · Zennith reads (gates IG/TikTok ads in MY market) |
| GAIA → Zennith | **Production capacity** | `capacity.json` (units/week) | GAIA writes · Zennith reads (caps ad spend) |

### 3.3 What stays inside its own OS

| Stays in GAIA OS (never crosses) | Stays in Zennith OS (never crosses) |
|---|---|
| Ingredient supplier prices (negotiation-sensitive) | Ad ID chain (privacy + attribution-sensitive) |
| Staff shift schedules | Persona definitions (IP) |
| Equipment depreciation | Compound-learning rules (proprietary) |
| Kitchen reject samples (physical) | Brand DNA palette + voice |
| HPP partner contract terms | Klaviyo segment definitions |

### 3.4 Anti-pattern guard

> ❌ **Never let creative-director read raw ingredient invoices.**
> ❌ **Never let R&D staff browse the persona-sim Moonshot logs.**
> ❌ **Never write a brief that names a supplier.**
>
> Silver Platter pattern enforced at the bridge: only typed, summarized
> artifacts cross. Everything else stays inside its own OS — invoiced raw
> data does not belong in a creative-director context window.

---

## 4. The 7-loop pipeline mapped to both OS

The texture-engineering 7-layer chain (from `market-survey-deep-research/chain.json`):

| Layer | Loop | Lives in | Output |
|---|---|---|---|
| L1 | Intent | Zennith (orchestrator) | `intent.md` |
| L2 | Design-space | Zennith (`texture-engineer`) | `design-space.json` |
| L3 | Chemistry | Zennith (autoresearch) | `results.json` (top variants) |
| L4 | Simulation | Zennith (MiroFish OASIS) | `sim_<id>/verdict.md` |
| L5 | Strategy | Zennith (marketing) | `brief.md` + creative pack |
| **L6** | **Kitchen + production** | **GAIA** | **bot feedback + COGS reality** |
| L7 | Compound writeback | Both | feedback feeds both compound-promoters |

**Critical:** L6 lives entirely in GAIA OS. Zennith hands off the recipe spec
at the L5/L6 boundary and stops touching the kitchen. GAIA hands back
feedback at the L6/L7 boundary and stops touching the marketing surface.

---

## 5. Compound-learning across the bridge

The GAIA bot logs feedback to `~/.zennith/workspace/gaia-os/gaia-rd-bot/logs/feedback.jsonl`.

**Bridge cron (to be wired, T+1d):**

```bash
# iMac, nightly 02:55 MYT — between zennith compound-promoter (02:50) and dawn cron
~/.zennith/skills/gaia-bridge/scripts/promote-rd-feedback.sh
```

What it does:
1. Reads `feedback.jsonl` (new entries since last run)
2. Classifies each: `texture_issue | cost_breach | halal_concern | process_clarification`
3. Routes:
   - texture_issue → Zennith `compound-promoter` (3+ occurrences = AVOID rule for next gen)
   - cost_breach → Zennith `marketing --mode measure` (caps margin in brief)
   - halal_concern → GAIA `halal-audit` (regulator-facing)
   - process_clarification → GAIA `recipe-update` (writes back to doc 19)

This closes the loop: kitchen reality bends both the next creative cycle
(Zennith side) and the next recipe iteration (GAIA side).

---

## 6. Deploy plan

### Phase 1 — Local (DONE 2026-05-17)
- [x] Doc 19 R&D Recipe Sheets V1/V5/V2 written
- [x] ingredient-vault/index.html built (Koji Brutalism styled, 26 ingredients, 5 classes)
- [x] gaia-rd-bot built (Python · long-poll · 3 JSON data files)
- [x] Bot launched + verified live (`@Gaiachef_bot` PID 2590)
- [x] launchd plist installed for auto-restart
- [x] Doc 20 (this file) written

### Phase 2 — Cloud (NEXT — 2026-05-18)
- [ ] `wrangler pages deploy ingredient-vault → ingredient-vault.gaiaos.ai`
- [ ] Update `texture-engineering.gaiaos.ai/index.html` to link to ingredient-vault
- [ ] `launchctl load ~/Library/LaunchAgents/world.gaiaos.rd-bot.plist`
- [ ] Smoke test: send `/start` from Jenn's Telegram to `@Gaiachef_bot`
- [ ] Invite Tricia + Yivonne + kitchen-lead to bot

### Phase 3 — Bridge cron (within week)
- [ ] Build `skills/gaia-bridge/scripts/promote-rd-feedback.sh`
- [ ] Wire to iMac cron 02:55 MYT
- [ ] Add `mkt rd-status` subcommand pulling bot feedback summary

### Phase 4 — Real R&D burn (within 2 weeks)
- [ ] Kitchen lead executes V1 trial batch following doc 19
- [ ] Logs feedback via bot `/feedback`
- [ ] If V1 passes → fire V5 + V2 in parallel
- [ ] If 3+ texture_issue events → compound-promoter writes AVOID rule
- [ ] Re-run autoresearch with kitchen-grounded weights

---

## 7. Naming + URL conventions

| What | URL pattern |
|---|---|
| Texture-engineering programme docs | `texture-engineering.gaiaos.ai` |
| Ingredient vault | `ingredient-vault.gaiaos.ai` |
| R&D bot | `@Gaiachef_bot` on Telegram |
| Bot data (internal) | `~/.zennith/workspace/gaia-os/gaia-rd-bot/data/` |
| Bot logs (internal) | `~/.zennith/workspace/gaia-os/gaia-rd-bot/logs/` |
| Production deploys (GAIA) | `*.gaiaos.ai` Cloudflare Pages |
| Production deploys (Zennith) | `dashboard.zennithos.ai` (TBD) · current `100.78.69.119:8080` |
| Bridge skill | `~/zennith-skills/skills/gaia-bridge/` (TBD) |

> **GAIA OS = `*.gaiaos.ai`. Zennith OS = `*.zennithos.ai` (when stood up) or
> local Tailscale CGNAT today.** Never mix domains.

---

## 8. Open questions for Jenn

1. **Bridge cron home** — iMac (current Zenni host) or dedicated GAIA OS host?
   Default: iMac, since Zenni already runs the parallel compound-promoter.

2. **Cost calculation skill** — GAIA OS should own a `cost-calc` skill (COGS
   recompute on supplier price changes). Build now or after first 50 kitchen
   trials? Default: after, real data first.

3. **R&D staff onboarding** — who's the first kitchen lead invited to
   `@Gaiachef_bot`? Default: Tricia + Yivonne + 1 kitchen-floor lead.

4. **Halal cert workflow** — does GAIA OS hold the JAKIM doc upload UI, or
   does that stay in a manual Drive folder? Default: manual Drive folder for
   v1, custom UI only after 3+ products in cert pipeline.

5. **Bot persistence** — current bot is on Jenn's Mac. Should it move to iMac
   (24/7) immediately, or stay on Jenn's machine until kitchen team is
   onboarded? Default: keep on Mac for week 1, move to iMac with the bridge
   cron in Phase 3.

---

## 9. Anti-fork guarantees

Both OSes share these (no fork, no duplication):

- **Memory** (`~/.claude/projects/.../memory/MEMORY.md`) — single auto-memory
- **Compound rules** (`~/.zennith/learnings/_global/`) — single rule store
- **Brand DNA** (`~/.zennith/brands/<brand>/BRAND-DNA.md`) — single source
- **Secrets** (`~/.zennith/secrets/`) — single vault

What's separated:
- **Deploy domains** (`gaiaos.ai` vs `zennithos.ai`)
- **Operator surfaces** (Telegram bot vs `mkt` CLI)
- **Loops** (kitchen cadence hours vs marketing cadence days)
- **State stores** (bot feedback.jsonl vs compound feedback_*.md)

---

## 10. Source artifacts

- `19-RD-RECIPE-SHEETS-V1-V5-V2.md` — kitchen-ready recipe sheets
- `ingredient-vault/index.html` — supplier vault
- `~/.zennith/workspace/gaia-os/gaia-rd-bot/` — bot codebase
- `~/Library/LaunchAgents/world.gaiaos.rd-bot.plist` — auto-restart
- `~/zennith-skills/skills/texture-engineer/SKILL.md` — the bridge skill
- `~/zennith-skills/skills/market-survey-deep-research/references/FOOD-PARTICLE-SEMANTICS.md` — F1-F22 + PMR1-PMR7 canon

---

**Verdict:** GAIA OS owns the kitchen, Zennith OS owns the storefront,
`texture-engineer` is the only bridge skill that gets to read both, and
nothing else does. Clean separation, single shared memory, two URLs.
