Files
Clawd BotandClaude Opus 4.6 ca9b510922 chore: align with upstream openclaw/openclaw and overlay local additions
- Reset master to upstream/main (16,697 commits)
- Overlay 2,271 local-only files (skills, tools, workspace, configs, apps)
- Restore IDENTITY.md and USER.md templates
- Build verified, gateway running, Discord working

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-03-03 07:40:46 +01:00

5.0 KiB

AI_ACTION_PLAN.md — Implementation Phases


Phase 1 — Backbone

  • Install Redis as system service (native redis-server.service, enabled, running since Jan 25)
  • Enable Redis persistence (AOF + RDB) and local-only bind
  • Enforce Redis auth (requirepass) and update clients (password in james/.env)
  • Enable systemd auto-restart + health checks
  • Define channels (james.events.*, james.decisions, james.actions, james.audit)
  • Implement audit logging (audit logger in james/tools/audit_logger.py)
  • Test pub/sub flow (verified 2026-02-04)

Deliverable: Redis running, events can be published/subscribed

Redis persistence + auto-restart steps (draft):

  1. Update james/redis/redis.conf:
    • appendonly yes
    • appendfsync everysec
    • save 900 1, save 300 10, save 60 10000
    • requirepass <strong-pass>
    • bind 127.0.0.1
  2. Ensure volume mounts in docker-compose for /data (AOF/RDB files).
  3. In james/systemd/redis.service:
    • Restart=always
    • RestartSec=3
    • StartLimitIntervalSec=0
    • ExecStartPre=/usr/bin/docker compose -f /home/alex/clawd/james/docker-compose.yml up -d redis
    • ExecStop=/usr/bin/docker compose -f /home/alex/clawd/james/docker-compose.yml down
  4. Reload systemd and enable:
    • systemctl daemon-reload
    • systemctl enable --now redis.service
  5. Validate:
    • redis-cli -a <pass> ping
    • kill container, confirm auto-restart

Phase 1.5 — Event Schema Validation

  • Define JSON schema for universal events
  • Add schema checks to publishers (watcher + publish tool + analyst done; mail agent pending)

Deliverable: Invalid events rejected before publish


Phase 2 — Node Watchers

  • Deploy watcher-agent on all nodes
  • Publish system events (CPU, RAM, disk, Docker) (basic watcher in james/agents/watcher/)
  • Add event rate limiting + batching (default 30s)
  • Add TTL for low-priority events
  • Verify multi-node awareness
  • Add GPU metrics (if available)

Deliverable: System events flowing into Redis from all nodes


Phase 3 — Analyst Agent

  • Connect Qwen via Ollama
  • Implement JSON-only reasoning
  • Publish decisions to james.decisions
  • Test classification accuracy
  • Enforce Ollama format: json + schema validation retry on parse errors

Deliverable: Events → Analyst → Structured decisions


Phase 3.5 — Analyst Hardening

  • Build prompt test suite (edge cases + false positives)
  • Capture accuracy/confidence baselines
  • Add retry policy for malformed JSON (max 2 retries)

Deliverable: Stable, measurable analyst output


Phase 4 — Policy Engine

  • Encode POLICY.md rules
  • Enforce approval logic (internal vs external)
  • Integrate audit trail
  • Test forbidden action blocking
  • Implement approval timeouts via Redis TTL (james.pending default deny)

Deliverable: Actions gated by policy, logged to audit


Phase 4.5 — Policy Dry-Run

  • Add dry-run mode (log allow/deny without enforcement)
  • Review dry-run logs and tune rules

Deliverable: Tuned policy rules with low false positives


Phase 5 — Discord Control Plane

  • Build approval bot
  • Reaction-based action gating (👍/👎)
  • Role-based permissions
  • Status dashboard

Deliverable: Human can approve/deny actions via Discord


Phase 6 — Home Assistant Integration

  • Status sensors (sensor.james_node_*)
  • Push notifications
  • Critical alert automations
  • Optional TTS for urgent events

Deliverable: Home Assistant aware of James state, sends notifications


Phase 7 — Mail Agent

  • IMAP/Gmail fetch
  • Classification (action required, invoice, security, FYI)
  • Draft replies
  • Approval loop
  • Add mail.draft.review step with mandatory human approval
  • Pre-filter sensitive patterns (secrets/PII)

Deliverable: Daily inbox scan, human-approved replies


Phase 8 — Voice Layer

  • Cloud model integration (GPT-4 or Claude for voice)
  • Briefing and escalation mode
  • Daily system summary
  • Optional ElevenLabs TTS
  • Hybrid TTS: local for routine, cloud for complex

Deliverable: Natural language interface for status/briefings


Phase 9 — Security + Metrics

  • Redis network isolation (localhost/VPN only)
  • Audit log immutability (append-only)
  • Metrics: events/hour, confidence dist, approval latency, false positives, cloud tokens

Deliverable: Hardened ops + visibility


Success Criteria

  • Zero unaudited external actions
  • Sub-1000 cloud tokens per day
  • Multi-node awareness
  • Human-approved communications
  • Reliable event classification

Current State (as of 2026-02-04)

  • Home Assistant running (192.168.1.24:8123)
  • Ollama + Qwen2.5-coder available
  • Docker game servers operational
  • Discord integration exists (clawdbot)
  • Google OAuth configured (Gmail/Calendar)

Next immediate step: Phase 1 (Redis backbone)