← Back to Index

CARMEE-PATHWAY-AUTOMATION-PROTOCOL.md

Status: EXPERIMENTAL (Test Case #1 for Species DNA Deployment Model)
Created: 2026-02-17
Last Updated: 2026-02-17
Last Challenged: Never (initial version)
Applies To: Main Agent (Minnie) + Future Ops Agent (if deployed)


The Problem

What failure, friction, or need created this protocol?

Incident: Feb 2026 - Pipeline analysis revealed systematic bottleneck

Root causes identified:

  1. No intent inference layer - Carmee forced to interrogate upfront (bureaucratic vibe)
  2. Binary gating ("LOCKED/UNLOCKED") - Didn't match real conversation flow (2-5 email exchanges)
  3. Manual state tracking - No system memory of "what's known, what's missing, what's next"
  4. Pilot pricing leakage risk - Enthusiasm → Expectation before requirements met
  5. No automation - Every inquiry requires full human attention

Quantified pain:

Evidence:


The Solution

Automated Pathway Coordination API with Intent Inference + State Machine Gating

Architecture (3-Layer Model)

Layer 1: Intent Inference (Sorting Hat)
  ↓ What future is this org leaning toward?
Layer 2: State Machine Gating (Progress Tracker)
  ↓ NURTURE → POTENTIAL → ELIGIBLE → DEPLOYABLE
Layer 3: Deterministic Routing (Execution)
  ↓ Quote / Pilot Overlay / Partner Relations

Core Components

1. Intent Inference API (POST /api/pathway/intent)

2. State Machine Gating (POST /api/pathway/gate)

3. Deterministic Routing (POST /api/pathway/route)

4. Quote Generation (POST /api/pathway/generate-quote)

Deployment Specs

Success Criteria

Conversational quality:

Governance compliance:

Efficiency metrics (90 days):


The Reasoning

WHY this approach vs. alternatives?

Design Decisions

1. Why Intent Inference FIRST (vs upfront gating)?

2. Why State Machine (vs binary LOCKED/UNLOCKED)?

3. Why Pilot Pricing Isolation Rule?

4. Why Gemini Flash (vs Claude/GPT)?

5. Why Build Custom API (vs use Zoho Workflows)?

Technical Constraints

Must integrate with:

Must avoid:

Assumptions

  1. Gemini Flash accuracy: Assumes 85-90% intent inference accuracy (validate in Phase 1)
  2. Carmee adoption: Assumes Carmee will use API vs continuing manual (change management needed)
  3. Inquiry volume: Assumes 40-50 inquiries/month baseline, scaling to 100+ (justify automation investment)
  4. State progression linearity: Assumes most inquiries follow NURTURE → POTENTIAL → ELIGIBLE (not all paths traverse all states)

The Evidence

What data supports this protocol's effectiveness?

Pre-implementation (current state):

Expected post-implementation (90-day target):

Validation plan:

Success indicators:


Challenge Conditions

When should this protocol be reconsidered?

Reconsider if:

  1. Low adoption (<50% of inquiries use API)

    • If Carmee bypasses system, automation failed
    • Action: Investigate friction points, simplify UX
  2. High false positive rate (>15% misrouted inquiries)

    • If API routes incorrectly, manual override burden increases
    • Action: Retrain intent model, adjust routing rules
  3. Governance violations (>1 per quarter)

    • If Pilot DEPLOYABLE without high-proof sources
    • Action: Tighten isolation rule, add manual checkpoints
  4. Inquiry volume stays low (<40/month for 3 months)

    • If volume doesn't justify automation investment
    • Action: Deprecate API, return to manual (ROI not there)
  5. API maintenance burden (>5 hrs/week)

    • If system requires constant fixes/updates
    • Action: Simplify architecture or deprecate
  6. LLM costs spike (>$500/month)

    • If Gemini Flash pricing changes or usage exceeds projections
    • Action: Switch to cheaper model or batch processing
  7. Carmee leaves / role changes

    • If primary user no longer needs automation
    • Action: Reassess if automation still valuable for new person

Friction thresholds:

Technology shifts:


Last Challenged

Date: Never (as of 2026-02-17 - initial version)

Status: Experimental protocol, first test of Species DNA deployment model

Future challenges expected:

Review cadence:


If This Becomes Ritual Without Reason

Ossification warning signs:

  1. Agents blindly route to API without understanding state machine

    • Detection: Ask agent "Why does Pilot require ELIGIBLE state?"
    • If answer is "because spec says so" → ossification
  2. Carmee bypasses API (returns to manual)

    • Detection: API usage metrics drop below 50%
    • Cause: System adds friction vs removes it
  3. State progressions rubber-stamped (no actual verification)

    • Detection: Pilot DEPLOYABLE states with weak proof sources
    • Cause: Isolation rule feels bureaucratic, agents circumvent
  4. Intent inference ignored (users skip to gating)

    • Detection: /intent endpoint usage drops to zero
    • Cause: Intent layer doesn't add value, users want faster path

Emergency halt conditions:

If API causes:

Action:

  1. Immediate API shutdown (disable endpoint)
  2. Escalate to Quan (sessions_send to main)
  3. Document failure mode in species-dna/CHALLENGE-LOG.md
  4. Post-incident review within 24 hours

Emergency Override Procedure

If API blocks critical operation:

Tier 1: Manual Override (Carmee authority)

Tier 2: State Jump (Kris/Quan authority)

Tier 3: API Disable (System failure)

Fallback to manual:

If API unavailable:

  1. Carmee continues manual pathway coordination (no dependency)
  2. Lost automation benefits but business continues
  3. API optional enhancement, not critical path

Recovery:


Related Protocols

Dependencies:

Synergies:

Conflicts:

Cross-agent implications:

If Ops Agent deployed:


Version History

v1.0 - 2026-02-17 - Initial protocol (synthesized from Carmee API spec v2.2)

Deployment Using Species DNA Model

Phase 1: Build + Test (This Week)

Deployment steps:

  1. Create API in species-dna/ (this protocol)

    # Already done - this file
    species-dna/CARMEE-PATHWAY-AUTOMATION-PROTOCOL.md
    
  2. Implement API endpoints (4-6 hours)

    # Create API directory
    mkdir -p tools/pathway-api/
    
    # Implement endpoints
    tools/pathway-api/intent.js       # Intent inference
    tools/pathway-api/gate.js         # State machine gating
    tools/pathway-api/route.js        # Deterministic routing
    tools/pathway-api/quote.js        # Quote generation
    tools/pathway-api/server.js       # Express server (port 18792)
    
    # Install dependencies
    cd tools/pathway-api/
    npm install express @google/generative-ai puppeteer
    
  3. Start API server

    # Run as systemd service (survives reboots)
    sudo tee /etc/systemd/system/pathway-api.service << 'EOF'
    [Unit]
    Description=Carmee Pathway API
    After=network.target
    
    [Service]
    Type=simple
    User=node
    WorkingDirectory=/home/node/.openclaw/workspace/tools/pathway-api
    ExecStart=/usr/local/bin/node server.js
    Restart=always
    Environment=GOOGLE_AI_API_KEY=...
    
    [Install]
    WantedBy=multi-user.target
    EOF
    
    sudo systemctl daemon-reload
    sudo systemctl enable pathway-api
    sudo systemctl start pathway-api
    
  4. Test on 10 historical inquiries

    # Validate intent inference accuracy
    node tools/test-pathway-api.js
    
    # Expected: >85% accuracy on pathway classification
    

Phase 2: Pilot with Carmee (Weeks 3-4)

Change management:

  1. Training session (30 min)

    • Show Carmee UI (http://100.72.11.53:18792/ui)
    • Walk through intent → gate → route → quote flow
    • Explain pilot state progression (NURTURE → POTENTIAL → ELIGIBLE)
  2. Pilot rollout (2 weeks)

    • Use API for NEW inquiries only (don't migrate existing)
    • Monitor adoption (usage metrics)
    • Collect friction feedback (weekly check-ins)
  3. Iteration (based on feedback)

    • Adjust UX if >2 clicks vs manual
    • Refine intent questions if users skip
    • Tighten isolation rule if district language leaks

Phase 3: Full Rollout (Weeks 5-8)

Scale to 100% adoption:

  1. Monitor metrics (weekly)

    # Check API health
    curl http://localhost:18792/health
    
    # View usage stats
    cat data/pathway-api/usage-stats.json
    
    # Intent accuracy
    cat data/pathway-api/intent-accuracy-log.jsonl | jq '.accuracy' | average
    
  2. Governance compliance checks (weekly)

    # Verify no Pilot DEPLOYABLE without high-proof
    cat data/pathway-api/state-transitions.jsonl | jq 'select(.new_state == "DEPLOYABLE" and .proof_level != "district_reply")'
    
    # Should return empty (zero violations)
    
  3. ROI validation (monthly)

    • Track Carmee time saved (self-reported + API usage metrics)
    • Calculate: (Time saved × $200/hr) / API costs
    • Target: >1,000x ROI (10,000x aspirational)

If Ops Agent Deployed (Future)

Ops Agent inherits this protocol automatically:

# On Ops Agent VPS
cd /home/node/.openclaw/workspace
git pull  # Gets latest species-dna/

# Ops Agent reads:
species-dna/CARMEE-PATHWAY-AUTOMATION-PROTOCOL.md

# Knows:
# - How pathway API works
# - When to route to Main vs handle locally
# - Pilot state progression rules
# - Isolation rule (no district language at POTENTIAL)

Division of labor:


Test Case Validation

This protocol is TEST CASE #1 for Species DNA deployment model.

What we're testing:

  1. Protocol template usability

    • Time to document: ~45 min (acceptable overhead)
    • Clarity: Can another agent understand reasoning?
    • Completeness: All sections answered meaningfully?
  2. Deployment automation

    • Can this protocol be turned into working code in <1 day?
    • Is deployment process clear enough to follow?
    • Does state machine enable future Ops Agent handoff?
  3. Challenge framework

    • Are challenge conditions specific enough to trigger review?
    • Can protocol detect its own ossification?
    • Is emergency override procedure clear?

Success criteria for Species DNA model:

Failure modes to watch:

Review after 90 days: Did this protocol template add value or just bureaucracy?


Notes

Implementation Priority (Phase 1)

Build order:

  1. /intent endpoint (core innovation, highest risk)
  2. /gate endpoint (state machine logic)
  3. /route endpoint (deterministic, low risk)
  4. /quote endpoint (straightforward pricing calc)
  5. Simple web UI (input form + state display)

Risk mitigation:

Edge Cases

What if inquiry spans multiple pathways?

What if organization changes mid-conversation?

What if Carmee disagrees with API recommendation?

Common Mistakes to Avoid

  1. Don't build UI-first - API endpoints + state machine logic before UI
  2. Don't optimize prematurely - Get intent accuracy working, then optimize latency
  3. Don't skip logging - Every state transition must be auditable
  4. Don't tighten isolation rule too early - Validate POTENTIAL state leakage happens before adding complexity

Links to Related Documentation


Template Checklist

Before committing, verify:

Status: Ready for species-dna/ commit.


This protocol validates the Species DNA deployment model. If template is too heavy, evolve it. If deployment steps are unclear, improve them. This is meta-evolution in action.

Last Updated: 2026-02-17
Challenge Conditions: If template takes >2 hours to complete, it's too heavy
Last Challenged: Never (initial version, awaiting Phase 1 validation)