32 Commits

Author SHA1 Message Date
Claude Code f243384d4e Semver rename + single-call gateway
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 21:37:37 -04:00
Claude Code f10e901fe0 Persistent RCON — single connection per server, auto-reconnect
Replaces socket-per-command pattern that crashed the dev server.
Connection pool keyed by host:port. Thread-safe with lock.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 18:25:05 -04:00
Claude Code 618c98cc4e Error correction, fire fix, Gemini pricing, command format examples
- Error correction on both sudo and pray paths
- Broadened RCON error detection: <--[HERE] catches all syntax errors
- Fixed fire fallback matching "firework" as fire intent
- Dynamic Gemini pricing by model name
- Command format RIGHT vs WRONG examples in prompts
- max_tokens 600 for command calls
- Removed template workflow from sudo prompt and context

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 23:09:42 -04:00
Claude Code 4706952c52 Async processing, single-call mode, validator tracking, think stripping
- ThreadPoolExecutor (3 workers) for concurrent prayer/sudo processing
- Single-call mode: one LLM call returns commands + message (config: single_call)
- Validator hit-rate tracking to /var/log/mc_validator_stats.json
- Strip <think> blocks from Qwen3 model output via regex
- Fresh LangGraph sessions (no history carryover)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 19:03:41 -04:00
Claude Code 6f585e0021 API cascade: Haiku → Gemini → local model, full POS status reports
- _llm_call routes through cascade: Haiku ($20) → Gemini Flash Lite ($20) → Ollama fallback
- Gemini API call function with persistent cost tracking
- Full status report on POS printer at each $1 milestone
  (cost, audit counts, services)
- Prayer title flash: "Your prayers have been answered!"

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 04:55:59 -04:00
Claude Code 616aab7cf4 Persistent Anthropic cost tracking to disk
Cost survives service restarts via /var/log/mc_anthropic_cost.json.
Saves after every API call. POS receipt prints at each $1 milestone.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 22:29:50 -04:00
Claude Code 9ce2013814 Short God messages, escpos cost printing, Anthropic provider fixes
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 20:33:31 -04:00
Claude Code e4c7dba580 Add Anthropic API provider, short God messages, budget tracking
- llm_provider config: "anthropic" or "ollama" (default)
- Anthropic call with cost tracking and budget cap
- Auto-fallback to Ollama when budget exhausted
- God message prompt: "1-2 sentences max, Old Testament telegram"

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 19:19:11 -04:00
Claude Code 545deb8674 Integrate God Soul into command and message prompts
- Loads god_soul.md from script directory or /etc/god_soul.md
- Command prompt includes full soul for decision-making guidance
- Message prompt includes soul for voice and personality
- Multilingual: message matches prayer language, commands always English
- Deployed to prod (paper-ai) and dev (paper-dev)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 18:31:36 -04:00
Claude Code a4405f79ea Support MC_AIGOD_CONFIG env var for multi-instance deployment
CONFIG_PATH now reads from MC_AIGOD_CONFIG env var, falling back
to /etc/mc_aigod_paper.json. Enables running multiple instances
with different configs (e.g. dev server with fine-tuned model).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 17:36:58 -04:00
Claude Code 72c4469fd9 5 validator fixes, [Not Secure] regex, interventions 48/day
Validator improvements (deployed to paper-ai):
- Fix 1: @s → player name (RCON has no executor entity)
- Fix 2: Old NBT {Enchantments:[...]} → 1.21 [enchantments={...}] converter
- Fix 3: Strip invalid item components (display, durability, enc)
- Fix 4: Hallucinated effect repair (invincibility→resistance, etc.)
- Fix 5: Hallucinated command repair (setworldborder→worldborder set, etc.)
- All fixes applied in execute-tail chains too

Chat patterns updated for online-mode=false ([Not Secure] prefix)
Divine interventions set to 48/day

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 16:05:09 -04:00
Claude Code 1e9bda4a15 Add training audit logger, open sudo for playtesting
- Structured JSONL audit log for every pray/sudo interaction
- Bug_log feedback linked to last interaction with trust-level tagging
- sudo_allow_all_players config flag for playtest mode (enabled)
- training_audit_path config key (/var/log/mc_training_audit.jsonl)
- Deployed to CT 644 paper-ai server

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 13:38:25 -04:00
Claude Code ba4a2f4262 Switch all Ollama models to gemma3n:e4b on node-197 GPU
Bake-off results: gemma3n:e4b (80.6% cmd match, 100% safety, 5.9s)
outperforms qwen3-coder:30b on all metrics. Updated paper, shrink,
and langgraph gateway configs. Frees steel141 for LoRA training.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 10:29:54 -04:00
Claude Code 30aa8388e3 Fix sudo follow-up status checks and intent repair gaps 2026-03-17 20:26:29 -04:00
Claude Code 40b4da345a Add retrieval-grounded sudo flow and execution feedback loop 2026-03-17 19:53:32 -04:00
Claude Code f4ce19db6d Add paper bug_log flow and more ironic God persona 2026-03-17 14:53:54 -04:00
Claude Code d6e84e9fbf Rename CONVERSATION.md to SESSION.md, add context file pointers 2026-03-17 00:41:05 -04:00
Claude Code 0a26d85088 Add /update-context workflow to CONVERSATION.md 2026-03-17 00:38:22 -04:00
Claude Code 70642c9e9b Add CONVERSATION.md linking paper fork and vanilla repos with AI context 2026-03-17 00:33:27 -04:00
Claude Code 0e67883bec Add online player positions to sudo context 2026-03-16 19:41:53 -04:00
Claude Code cf2aeb1a5e Add server_type variable, gate fill/setblock/clone and template build on server_type=paper 2026-03-16 19:36:12 -04:00
Claude Code b7451e3290 Add LangGraph gateway, template manager, teleport border guard, enchantment context, server_type prep, session persistence 2026-03-16 19:28:52 -04:00
Seth 08e8f067ad Paper fork: harden latest.log tailing across rotation/restart
- Detect inode changes and truncation in tail_log
- Reopen latest.log automatically when Paper recreates log file
- Prevent lost trigger parsing after server restarts
2026-03-15 23:40:41 -04:00
Seth d2c302b48e Paper fork polish: isolate logs and deploy docs
- Use /var/log/mc_aigod_paper.log and _paper_responses.log
- Keep paper service logs separate from vanilla service
- Include paper config/service/runtime docs in fork
2026-03-15 23:29:08 -04:00
Seth 34697b5341 Paper fork: fallback build package when player position unavailable 2026-03-15 23:27:46 -04:00
Seth 0c2902de8a Add Paper advanced fork implementation
- Introduce dedicated paper AI script (mc_aigod_paper.py)
- Add expanded whitelist for structure ops: fill/setblock/clone
- Add deterministic sudo build templates (house/tower/wall/church)
- Keep prayer/sudo/memory/intervention architecture from base branch
- Add paper-specific config and systemd unit files
- Document deployment/runtime in rewritten README
2026-03-15 23:27:17 -04:00
Seth 83b9037a94 Docs: full README refresh for current runtime behavior
- Rewrite README to reflect live architecture and feature set
- Document pray/bible/sudo triggers (chat without slash)
- Document two-call model split and context payloads
- Add first-login benevolence behavior and persistence
- Add sudo history context and whitelist details
- Update config table and shrink-world example values
- Refresh deployment and debugging sections
2026-03-15 21:24:52 -04:00
Seth ead48cd399 Docs: expand bundled sudo agent behavior
- Document sudo history context (last 10 actions)
- Document whitelist scope and syntax auto-repair
- Clarify sudo must be typed in chat without slash
- Add additional sudo usage example
2026-03-15 21:16:14 -04:00
Seth d7d69d37af Add first-login benevolence + sudo history context
- First-login benevolence hook on player join (once per player, persisted)
- New first-login memory file and config keys
- Benevolence command prompt enforces multi-command blessing behavior
- Limit first-login player-kill commands to at most one
- Add sudo history buffer (last 10 actions) and inject into sudo translator context
- Add effect syntax auto-fix for malformed 'effect <player> ...' outputs
2026-03-15 20:20:33 -04:00
Seth 52d288406a Add sudo translator agent with whitelist and user lock
- New sudo chat trigger: 'sudo <request>'
- Authorized user only (configurable, default slingshooter08)
- Uses command_model to translate natural language to JSON commands
- Executes commands through existing whitelist/validator pipeline
- No God persona or speech call in sudo mode
- Added sudo_enabled/sudo_user/sudo_max_commands config keys
- Added common give-item alias normalization (wood->oak_log, bed->white_bed)
- Updated README with sudo usage and config docs
2026-03-15 19:56:50 -04:00
Seth c94fa1872a Expand world context + two-call LLM split
- Replace time-based log window with line-based (200 lines, 3hr cap)
- Add per-player position and death count to server context
- Add server scoreboards (total deaths, shrink enabled, border parity)
- Add god_lore config key injected into message system prompt
- Two-call split: qwen3-coder:30b (commands) + gemma3:12b (messages)
- interventions_per_day bumped to 48 (avg every 30min)
- cooldown_seconds reduced to 20
2026-03-15 19:42:31 -04:00
Seth 8ee8be9cc0 Initial commit — Minecraft AI God plugin
- mc_aigod.py: main watcher script (log tail, RCON, two-call LLM)
- Two-call LLM split: qwen3-coder:30b for commands, gemma3:12b for messages
- Divine intervention timer (Poisson process, configurable avg/day)
- Prayer memory (persistent, last 10 exchanges)
- Rolling server log context (last 20 min events)
- Live player context (inventory with rarity, health, food, pos, XP)
- /pray and bible chat detection (no slash — vanilla 1.21 compatible)
- Login notice, bible help system
- debug_commands toggle (in-game command display via tellraw)
- Auto-fix for transposed give command syntax
- JSON repair fallback for truncated LLM responses
- Sentence-aware message chunking for long responses
- mc-aigod.service systemd unit
- mc_aigod_shrink.json example config
- README.md full implementation guide
- Minecraft_Ai_God.md full design document
2026-03-15 19:02:16 -04:00