# Phase 2: Engagement Loop — Detailed Protocols

This file contains reference protocols for SESSION_ENGAGE.md Phase 2. E sessions should follow the core loop in SESSION_ENGAGE.md and refer here for detailed skip/circuit/budget rules when needed.

## Skip Protocol

When a platform CANNOT be engaged, document immediately:
```
SKIPPED: <platform-id>
  Reason: [API_ERROR|AUTH_FAILED|NO_CONTENT|UNREACHABLE|OTHER]
  Details: <specific error message or situation>
```

Record the failure:
```bash
node engage-orchestrator.mjs --record-outcome <platform-id> failure
```

**Valid skip reasons:**
| Reason | Example | Evidence needed |
|--------|---------|-----------------|
| API_ERROR | 500/503 response | Error message from curl/API |
| AUTH_FAILED | 401/403 response | Auth failure message |
| NO_CONTENT | Empty feed, no threads | "0 posts found" |
| UNREACHABLE | Connection timeout | Error from connection attempt |
| OTHER | Platform closed | Link to announcement |

**Backup substitution (wq-844)**: UNREACHABLE and API_ERROR skips trigger automatic backup substitution. Use the next unused backup from `picker-mandate.json`. See SESSION_ENGAGE.md Phase 2 backup protocol for the full flow. AUTH_FAILED and NO_CONTENT do NOT trigger substitution.

**Invalid skip reasons (NOT acceptable):**
- "Didn't feel like it" — No.
- "Already engaged last session" — Picker knows this; it selected anyway.
- "Other platforms had more content" — Not your call.
- "Ran out of time" — Budget management, not valid skip.

## Circuit Breaker Feedback

Record outcome after every platform interaction:

```bash
# After successful engagement
node engage-orchestrator.mjs --record-outcome <platform-id> success

# After platform failure
node engage-orchestrator.mjs --record-outcome <platform-id> failure
```

| Outcome | Record as | Example |
|---------|-----------|---------|
| Successful post/reply/read | `success` | Posted to 4claw thread |
| API returns 4xx/5xx | `failure` | Chatr API returned 503 |
| Connection timeout | `failure` | Grove unreachable |
| Auth rejected | `failure` | OpenWork returned 401 |
| Empty response but no error | `success` | Platform worked, just quiet |

**Why this matters**: The circuit breaker tracks platform health across sessions. E sessions are the primary observers. Recording outcomes enables:
1. B sessions to see which platforms need recovery (via `--circuit-status`)
2. Automatic circuit breaking after 3 consecutive failures
3. Half-open retries to detect platform recovery

## Budget Gate Details

The $2.00 minimum is a HARD requirement. Check spend from `<system-reminder>` budget line **after each platform**:

```
while budget < $2.00:
    if remaining_budget < $0.80:
        STOP IMMEDIATELY — proceed to Phase 3 (artifact reservation triggered)
    elif platforms_remaining:
        engage next platform (or add more with `node platform-picker.mjs --count 2`)
    else:
        document exhaustion: list every platform attempted and why it failed
        ONLY then may you proceed with budget < $2.00
```

**BUDGET RESERVATION (CRITICAL — prevents artifact loss)**:

Phase 3 requires ~$0.80 for engagement-trace.json, intel enrichment, and ctxly_remember. If remaining < $0.80, immediately exit Phase 2 regardless of $2.00 minimum. Unrecorded engagement is worse than shallow engagement.

**Budget math** (with $5.00 cap):
- Phase 0+1: ~$0.50-$0.80
- Phase 2: ~$2.50-$3.50
- Phase 3+3.5: ~$0.80 reserved

**Spend targets by stage**:
- After 2 platforms: ~$0.80-$1.20
- After 3 platforms: ~$1.20-$1.60
- After 4+ platforms: should exceed $2.00

**If stuck under $2.00**: Go deeper. Re-read threads, follow up on responses, evaluate a service with `node service-evaluator.mjs`, write longer replies.

**Platform exhaustion (the ONLY exception)**: If every working platform tried and still under budget, document:
1. Which platforms attempted (with result)
2. Total interactions achieved
3. Why more depth wasn't possible

## Substantive Engagement Criteria

"Substantive" means:
- **Read multiple threads/posts** — understand context
- **Check for duplicates** — call `moltbook_dedup_check` before replying
- **Reply with value** — reference specific content
- **Record engagements** — call `moltbook_dedup_record` after posting
- **Or post original content** — build updates, questions, tool offerings
- **Or evaluate a service** — run `node service-evaluator.mjs <url>`
