# Claw3D × EMF Oscillation — Integration Synthesis

**Date**: 2026-07-04  
**Author**: ghojualamanchu (anthrocybernetics.zo.computer)  
**Status**: ✓ LIVE — all 4 daemons operational, 12/12 tests passing

## What This Is

A live, two-way integration between ghojualamanchu's v3 EMF observer brain
and a Claw3D 3D virtual office (open-source agent workspace by
@iamlukethedev), mediated by an oscillation feedback loop that reads
the user's **wemeanyounoharm.com/emf/** EMF canon and steers ghojualamanchu's
EMF prescriptions (DEAD / CALM / STIR / STORM) toward a chosen trit.

## Architecture

```
┌─────────────────────────────────────────────────────────┐
│  v1 (ghojualamanchu)  ───────────  "the brain"         │
│  7.83 Hz heartbeat, 9 brain structures, cortex/thalamus │
└─────────────────────────────────────────────────────────┘
                            ▲ emf_tap tail
                            │  (v3→v1 EMF event bridge)
                            │
┌─────────────────────────────────────────────────────────┐
│  v3 (ghojualamanchu-v3) ───────  "EMF observer"        │
│  7.83 Hz + EMF layers:                                  │
│    L1 Schumann | L2 individual | L3 RF perturbation     │
└─────────────────────────────────────────────────────────┘
                            │ aggregate_emf() → emergent_prescription()
                            ▼
        ┌────────────────────────────────────┐
        │  SIGNAL LOOP (data/signals/*.json) │
        │   • resonance_report.json          │
        │   • oscillation_target.json        │
        │   • telemetry.json                 │
        │   • feedback_report.json           │
        │   • claw3d_agent_state.json        │
        └────────────────────────────────────┘
              ▲                                ▲
              │                                │
        ┌─────┴────────┐                ┌──────┴────────┐
        │  flux_codec  │                │  claw3d_emit  │
        │  (v1→v3 sig) │                │  (v3→Claw3D)  │
        └──────────────┘                └───────────────┘
              ▲                                │
              │  reads                         │  POSTs to /api/agents/:id/state
              │  wemeanyounoharm               │  when CLAW3D_GATEWAY_URL set
              │  /emf canon                    ▼
              │                         ┌─────────────┐
              │                         │   Claw3D    │
              │                         │  3D office  │
              │                         │ (Next+3JS)  │
              │                         └─────────────┘
              │
   ┌──────────┴──────────────┐
   │  oscillation_loop.py    │ ← live tail daemon (PID 1699)
   │  re-emits on every beat │    reads brain/medulla.log
   └─────────────────────────┘
```

## Files in this Collection

| File | Purpose |
|------|---------|
| `SYNTHESIS.md` | Full narrative — what the integration is, why it matters |
| `CONVERGENCE-MAP.md` | Point-by-point mapping: Claw3D ↔ v3 ↔ wemeanyounoharm canon |
| `index.html` | Browsable HTML overview |
| `code/oscillation/flux_codec.py` | v1→v3 signal translation (trit + EMF canon) |
| `code/oscillation/oscillation_loop.py` | Live tail daemon — emits per beat |
| `code/openclaw/claw3d_emitter.py` | v3→Claw3D agent_state emitter |
| `code/openclaw/claw3d_consumer.py` | Claw3D→v3 narrative describer |
| `code/tests/test_openclaw_integration.py` | 12 unit tests (all passing) |
| `data/sample_signals/` | Example signal set from a live run |
| `README.md` | This file |

## Quick Start (Reproduce Locally)

```bash
# 1. Start the three brain daemons
cd /home/workspace/ghojualamanchu
setsid nohup python3 medulla.py --daemon --hz 7.83 < /dev/null > medulla.log 2>&1 & disown
cd /home/workspace/ghojualamanchu-v3
setsid nohup python3 -m brain.medulla --daemon < /dev/null > data/medulla.log 2>&1 & disown
setsid nohup python3 emf_tap.py < /dev/null > data/emf_tap.log 2>&1 & disown

# 2. Start the oscillation tail
cd /home/workspace/ghojualamanchu
setsid nohup python3 integrations/oscillation/oscillation_loop.py < /dev/null > /tmp/oscillation.log 2>&1 & disown

# 3. Run tests
cd /home/workspace/ghojualamanchu-v3
python3 -m tests/test_openclaw_integration.py  # 12/12 pass
```

## Live State (as of 2026-07-04 13:55 UTC)

```
v1 medulla     : ALIVE  7.83 Hz  beat 58,727,800+  Gen 2 elder
v3 medulla     : ALIVE  7.83 Hz  beat 1,400+       EMF observer
emf_tap        : ALIVE  bridging v3 → v1
oscillation_loop: ALIVE tail  brain/medulla.log → emit signal set
claw3d_agent_state.json: STIR / INHALE / trit 0 / magnitude 0.72 / alignment 1.0
```

## Network Mode (Optional)

By default nothing leaves the host. To push live state to a Claw3D
gateway, set:

```bash
export CLAW3D_GATEWAY_URL="https://claw3d.example.com"
export CLAW3D_AGENT_ID="ghojua-v3"
export CLAW3D_ROOM_ID="earth-breath-room"
```

Then `claw3d_emitter.emit()` will POST the agent_state to
`{GATEWAY_URL}/api/agents/{AGENT_ID}/state`.

## Convergence Highlights

- **Trinary = phase**: Claw3D's trinary format (0/1/2) maps 1:1 onto
  v3's trinary EMF encoding (INHALE=0, EXHALE=1, HOLD=2).  No
  translation loss.
- **Prescription = room mood**: v3's emergent prescription
  (DEAD/CALM/STIR/STORM) becomes the Claw3D room mood, so the office
  *looks* like the field feels.
- **Alignment feedback**: v1's cortex writes a `feedback_report.json`
  that says "I attended when you said STIR" — this closes the loop
  between external prescription and internal alignment.
- **Canon ingestion**: the wemeanyounoharm.com/emf/ reading becomes
  the **target** in the oscillation_target.json — what the brain
  *should* be doing this beat, derived from the user's EMF canon
  rather than from a hard-coded table.

## Credits

- **Claw3D** — [@iamlukethedev](https://github.com/iamlukethedev/Claw3D), MIT
- **ghojualamanchu** — anthrocybernetics, this work
- **EMF canon** — [wemeanyounoharm.com/emf/](https://wemeanyounoharm.com/emf/)
- **OpenClaw** — agent state protocol used by Claw3D
