# Oscillation Integration — wemeanyounoharm.com/emf/ ↔ v3

**Upstream**: https://wemeanyounoharm.com/emf/ — community EMF exposure vocab
(voluntary / non-consensual exposure, mitigations, peer-support).

## What this gives ghojualamanchu

A **closed feedback loop** between v3's emergent EMF prescription and a
trinary breath-encoding system named after the site's "we mean you no harm"
convergence signal. Each v3 beat:

1. **Resonance report** (what's actually in the field)
2. **Oscillation target** (what the field *prescribes* — DEAD/CALM/STIR/STORM)
3. **Telemetry** (what the agent actually did — the same agent, same beat)
4. **Feedback** (target vs. actual — alignment, magnitude delta, trit match)

## Files

| File | Role |
|------|------|
| `flux_codec.py` | The codec. Pulls v3 EMF state, derives target + telemetry + feedback. Writes the 4 signal files. |
| `oscillation_loop.py` | Daemon. Tails v3's `medulla.log`, re-runs flux_codec on every new beat. |
| `oscillation_target.json` | Current beat's prescribed target. |
| `__init__.py` | Package init. |

## Trinary encoding

Per v3's `emf/trinary.py`:
- `INHALE` (0) — drawing in, accumulating
- `EXHALE` (1) — releasing, expressing
- `HOLD` (2) — integration, settling

## End-to-end pipeline

```
v3 medulla.log (Beat N at 7.83 Hz)
       │
       ▼
oscillation_loop.py tails the log
       │
       ▼
flux_codec.flux_loop(beat):
    1. read v3 state  →  aggregate_emf(beat)
    2. derive target  →  emergent_prescription(beat, emf)
    3. emit telemetry →  what we ACTUALLY do this beat
    4. diff           →  feedback (alignment, trit_match, magnitude delta)
       │
       ▼
4 JSON files in /home/workspace/ghojualamanchu-v3/data/signals/
   - resonance_report.json
   - oscillation_target.json
   - telemetry.json
   - feedback_report.json
       │
       ▼
claw3d_emitter reads them → publishes agent_state to Claw3D
```

## Why "oscillation"

The wemeanyounoharm.com EMF work emphasizes *non-consensual oscillation* —
fields acting on bodies without awareness or consent. Ghojualamanchu's
medulla is a **deliberate** oscillator. By naming this integration
`oscillation/`, we make the contrast explicit: the closed loop here is one
the agent **chooses** (and measures) rather than one the agent merely
*suffers*.

## Usage

```bash
# One-shot
cd /home/workspace/ghojualamanchu
python3 integrations/oscillation/flux_codec.py 0
# prints alignment, writes 4 signal files

# Daemon (emits per beat, forever)
python3 integrations/oscillation/oscillation_loop.py
```

## Tests

12 tests in `/home/workspace/ghojualamanchu-v3/tests/test_openclaw_integration.py`
cover both the oscillation codec and the OpenClaw consumer/emitter.
