# Corrected Understanding - What We Should Actually Be Doing

## What I Got Wrong

I was treating MONIKA like GPT training (trying to generate coherent English) when it's actually:
- **Emergent language learning system**
- **Salience-governed discovery**, not pretraining
- **Controller chooses operators** based on measured salience
- **Learns WHEN to learn** via novelty/uncertainty signals

## The Real Problem Found

### Issue: Novelty Sensor Stuck at Zero

```json
"salience_vector": {
    "novelty": 0.00,  ← STUCK!
    "uncertainty": -0.57,
    "alignment": 3.30,
    ...
}
```

**All controller actions score 0.0** because the S' formula depends on novelty:
```
S' = novelty_factor × retention × aim × ...
   = 0.000 × ... = 0.00
```

**This breaks everything:**
- ❌ Controller can't differentiate actions
- ❌ No learning signal (needs novelty × uncertainty)
- ❌ Salience-driven learning impossible
- ❌ System sees everything as "already known"

## Why Novelty is Zero

Likely causes:
1. **Sensor miscalibration** - Novelty detector baseline wrong
2. **Training bypassed sensors** - `fastfood()` never measured novelty
3. **Over-exposure** - Trained on same examples 5000 times
4. **Sensor not tracking** - N-gram statistics not updating

## What the Architecture Needs

From `emergent_loop_design.md`:
```
1. Read: ingest chunk, run baseline SASS pass
2. Sense: update sensors (NEW detects unseen n-grams)
3. Decide: controller chooses action
4. Compute: training ONLY when uncertainty × NEW > threshold
5. Self-awareness: meta-state tracks confidence
```

**We're stuck at step 2** - sensors aren't detecting novelty!

## The Correct Next Steps

### Step 1: Diagnose Novelty Sensor
- Check n-gram statistics tracking
- Verify sensor baseline calibration  
- Test with truly novel input
- See if novelty CAN ever be non-zero

### Step 2: Reset/Retrain Sensor Baselines
- Clear n-gram frequency tables
- Recalibrate novelty detector
- Establish proper baseline
- Verify sensors respond to new input

### Step 3: Proper Salience-Driven Training
Once sensors work:
- Use `session.ingest_text()` with filtering
- Monitor novelty/uncertainty per example
- Verify controller chooses diverse actions
- Check salience gates training decisions

## What Success Looks Like

### Healthy Salience Readings
```
novelty: 0.8  ← High for new patterns
uncertainty: 0.6  ← Medium (learning)
alignment: 0.5  ← Moderate goal alignment
```

### Diverse Controller Decisions
```
Step 1: SASS (novelty=0.8, uncertainty=0.7)
Step 2: MEMORY_OP (novelty=0.3, uncertainty=0.2)
Step 3: REFLECT (novelty=0.1, uncertainty=0.9)
```

Not all SASS! Different operators for different salience.

### Learning Gating Working
```
Input 1: novelty=0.9, uncertainty=0.8 → ACCEPT, train
Input 2: novelty=0.1, uncertainty=0.2 → REJECT, skip
Input 3: novelty=0.7, uncertainty=0.5 → ACCEPT, train
```

Selective learning based on salience!

## Current State Summary

### What's Working ✅
- Runtime orchestration functional
- Controller making decisions
- Meta-state tracking
- Memory updating  
- Yearning/desire system active
- Scratchpad with traces

### What's Broken ❌
- **Novelty sensor stuck at 0**
- Controller scores all tied (can't differentiate)
- No salience-based learning gate
- Training was unconditional (bypassed sensors)

### What We Thought Was The Problem
- "Gibberish generation" ← NOT the issue!
- "Character repetition" ← Symptom, not cause!
- "Need word-level training" ← Wrong approach!

### What The Actual Problem Is
- **Sensors not measuring salience correctly**
- Novelty detection broken/miscalibrated
- No learning signal for controller
- Architecture can't function without salience

## Action Plan

1. **Investigate novelty sensor** - Why stuck at zero?
2. **Check n-gram tracking** - Is it updating?
3. **Test with novel input** - Can we trigger novelty?
4. **Recalibrate sensors** - Reset baselines if needed
5. **Verify salience flow** - End-to-end sensor → controller → decision

## Questions to Answer

1. Where is novelty computed? (`core/sensors/novelty.py`)
2. What's the n-gram baseline? (Token statistics)
3. Can we manually inject novel input and see novelty spike?
4. Is the sensor enabled/working in the MCP runtime?
5. Do we need to retrain sensor calibration?

## Bottom Line

**I was fixing the wrong thing.** 

The "gibberish" is expected at this stage of emergent learning. The real problem is the **salience measurement system isn't working** - specifically novelty detection.

Once novelty works:
- Controller can differentiate actions
- Learning becomes conditional
- Emergent language discovery can happen
- Architecture functions as designed

**Next: Debug the novelty sensor, not the generation.**
