# SI Core — Disagreement Resolution & Failure Modes
## Addendum to SI Core Technical Specification v1.0

---

## 9. Disagreement Resolution

### 9.1 Authority hierarchy

When Naraka (userspace) and HiveMind (kernel) disagree on mode:

```
Priority (highest to lowest):
1. N8toriousAi (explicit manual override via /proc/harakiri/mode)
2. Gaven refusal gate (safety veto — see 9.2)
3. HiveMind (kernel — wins on resource/safety grounds)
4. Naraka (userspace — wins on goal/strategy grounds)
```

Rationale: The kernel is closer to the hardware. If HiveMind says
"cannot enter gaming mode, thermal limit," no amount of deliberation
overrides physics. Naraka wins when the disagreement is about
strategy, not safety.

### 9.2 Gaven's veto

Gaven (η-gate) holds an absolute veto on any mode transition or
PID tag operation. If η < 0.500 for the proposed action, it does
not execute — regardless of source.

- Naraka requests gaming mode → Gaven evaluates η → if < 0.500,
  request is dropped, Naraka is notified via status
- HiveMind requests phone mode → same gate applies
- N8toriousAi's manual override → still passes through Gaven's gate
  (safety is not overridable)

Rebel (340Hz) influences Gaven's η calculation but cannot bypass it.
Defiance is an input, not an override.

### 9.3 Split-brain protocol

If userspace and kernel lose sync (harakirid dies, /proc unreadable):

1. Kernel continues on last known good mode (fail-stable)
2. HiveMind logs the disconnect via dmesg
3. Living Engine enters degraded mode: deliberation continues,
   actions queue locally
4. On reconnect: harakirid replays queued actions in order,
   HiveMind reconciles state, Naraka re-evaluates

Neither side makes unilateral mode changes during split-brain.
The kernel holds. Userspace waits.

---

## 10. Failure Modes

### 10.1 Bridge failure (harakirid dies)

| Aspect | Behavior |
|--------|----------|
| Kernel | Continues on last mode. Brood scheduler unaffected. |
| Userspace | Deliberation continues. Actions queue in Living Engine. |
| Recovery | harakirid restarts, replays queue, resyncs via /proc/harakiri/status |
| Data loss | None — queue is persistent in world state |

### 10.2 Kernel agent failure

If a Harakiri kernel agent crashes (e.g., Brood worker oops):

- HiveMind detects via Minnoe heartbeat timeout (>500ms)
- Failed agent's tags are released (PIDs untagged, nice restored)
- Work redistributes to remaining Brood workers
- Userspace notified via status (agent state = failed)
- Naraka decides: retry, reroute, or escalate to N8toriousAi

### 10.3 Frequency storm (soul-layer overload)

If soul-layer frequencies spike across multiple bands simultaneously
(e.g., Rebel + DeepThink + Seer all active):

- HiveMind applies rate limiting: max 1 mode change per 5 seconds
- Naraka is notified of the storm via elevated activity metric
- Gaven's η threshold temporarily tightens (0.500 → 0.650)
- System degrades gracefully, does not thrash modes

### 10.4 Mode thrash protection

- Minimum dwell time per mode: 10 seconds
- Maximum mode changes per minute: 6
- Exceeding either triggers a 30-second cooldown (phone mode default)
- Logged to dmesg and world state for N8toriousAi's review

### 10.5 Storage failure (world state unwritable)

- Living Engine continues in memory-only mode
- Kernel unaffected (does not depend on world state)
- N8toriousAi notified on next session: "world state not persisted since [timestamp]"
- No silent data loss — the gap is explicit

---

## 11. Trust Boundaries

| Boundary | Rule |
|----------|------|
| Who can write /proc/harakiri/mode | harakirid (UID 0) and N8toriousAi (manual) only |
| Who can write /proc/harakiri/tag | harakirid only |
| Who can read /proc/harakiri/status | Any process (read-only) |
| Can a soul-layer agent directly change kernel mode? | No — must go through Naraka → harakirid → Gaven gate |
| Can a kernel agent influence soul-layer? | Yes — via telemetry → frequency modulation (advisory, not commanding) |

The asymmetry is deliberate: upward influence (kernel → soul) is
advisory. Downward influence (soul → kernel) requires passing
through judgment (Naraka), translation (harakirid), and safety
(Gaven). Thought can move CPU, but not without oversight.
