Files
2026-03-17 20:26:21 -04:00

9.8 KiB

SESSION.md — Minecraft AI God (Vanilla)

Persistent AI session memory for this project. See /root/bin/SESSION.md for the global template and guide.

Context Files

  • /root/bin/core_homelab.md — cluster topology, SSH aliases
  • /root/bin/services_directory.md — active service IPs and domains
  • /root/bin/SESSION.md — global session memory and patterns
  • ./CONTEXT.md — Minecraft infrastructure, server config, RCON helper
  • ./README.md — project overview (see sister repo for Paper fork)
  • Sister repo session memory: /root/bin/Sethpc-Minecraft-PaperFork/SESSION.md

This document links the two Minecraft AI God projects together, describes their Gitea repos, and serves as the AI session memory for both.


Memory Discipline

  • Update SESSION.md immediately when a durable fact, decision, or fix is discovered.
  • Before every final reply, run a memory check and append any missing durable notes.
  • End every reply with one line: Session memory: updated or Session memory: no new durable facts.

The Two Projects

This repo — minecraft-ai-god (Vanilla)

  • Local path: /root/bin/Sethpc-Minecraft
  • Gitea: https://git.sethpc.xyz/Seth/minecraft-ai-god
  • Purpose: Vanilla Minecraft 1.21.x, no plugins or mods. All automation via log watching + RCON. Targets the mc1 server (port 25565) and shrink-world server (port 25566) on CT 644.
  • Key services: mc-godmode.service, mc-shrink-kit.service, mc-aigod.service
  • AI features: pray chat trigger → Ollama LLM → structured JSON → RCON execution; divine intervention timer; shrink-world kit/stats watcher

Sister repo — minecraft-ai-god-paper-fork (Paper Advanced Fork)

  • Local path: /root/bin/Sethpc-Minecraft-PaperFork
  • Gitea: https://git.sethpc.xyz/Seth/minecraft-ai-god-paper-fork
  • Purpose: Dedicated Paper server on port 25567 with plugins (FastAsyncWorldEdit, LuckPerms). Extends the vanilla branch with build templates, expanded command set, sudo translator mode, and LangGraph-style session gateway.
  • Key services: mc-paper-ai.service, mc-aigod-paper.service, mc-langgraph-gateway.service
  • AI features: All vanilla features + sudo build/make/create deterministic templates, sudo lookup/wiki/search, LangGraph gateway sidecar (FastAPI on 127.0.0.1:8091), SQLite session persistence

Relationship Between the Two

The Paper fork is a direct evolution of this vanilla repo. They share:

  • Same pray/bible/sudo trigger style and chat patterns
  • Same two-call LLM split (message + commands JSON schema)
  • Same RCON helper (raw socket, no library)
  • Same command validation + syntax repair pipeline
  • Same intervention timer design (Poisson process, presence guard)

The Paper fork adds on top of this base:

  • Plugin-enabled command families (fill, setblock, clone)
  • Deterministic build templates before LLM translation
  • LangGraph gateway with session memory and tool loop
  • server_type gating so paper commands don't leak to vanilla

Both can run simultaneously — they use separate ports, services, and config files.


Gitea Backup Workflow

Both repos push every committed change to Gitea. This is the standard workflow:

# From either local repo dir:
git add -A
git commit -m "<description of change>"
git push origin main

Both remotes are pre-configured with token auth:

  • Vanilla: https://Seth:<token>@git.sethpc.xyz/Seth/minecraft-ai-god.git
  • Paper fork: https://Seth:<token>@git.sethpc.xyz/Seth/minecraft-ai-god-paper-fork.git

The Gitea instance lives at git.sethpc.xyz (CT 146, node-173, 192.168.0.125).
API key: see GITEA_API.md in this repo.

Convention: commit every meaningful change immediately. Commits are the changelog — no squashing, no batching unrelated changes.


Keeping This File Current

Run /update-context in OpenCode at the end of any session to automatically:

  1. Review the conversation for new decisions, fixes, and discoveries
  2. Append them to SESSION.md in both repos
  3. Commit and push both repos to Gitea

The command is defined globally at ~/.config/opencode/commands/update-context.md.


AI Conversation Notes

This section captures decisions and context accumulated across conversations with the AI assistant (OpenCode/Claude). Update it as significant choices are made.

Architecture decisions

  • No plugins on vanilla servers. All mc1 and shrink-world automation is pure log-tail + RCON. This keeps the vanilla experience intact and requires no server restarts for updates.
  • Paper fork is separate, not a branch. Running both as separate services on separate ports was chosen over a single multi-mode script to keep failure domains isolated.
  • LLM backend: Ollama at 192.168.0.179:11434 for the vanilla service. The Paper fork uses 192.168.0.141:11434 (steel141, local GPU) for better throughput on heavier models (gemma3:12b, qwen3-coder:30b).
  • Session gateway (Paper fork only): The LangGraph-style FastAPI sidecar adds multi-turn memory without requiring a full LangGraph install. Safety enforcement stays in mc_aigod_paper.py, not the gateway.
  • Bug intake trigger (2026-03-17): Added bug_log <optional description> chat command in vanilla AI God. It appends structured bug entries to /var/log/mc_aigod_bug.log with player, description, recent in-memory events, and recent raw latest.log lines, then confirms to the player in chat.
  • God voice update (2026-03-17): Increased default God persona emphasis on irony, dark humor, and sarcastic one-liners in both command and message system prompts (vanilla + Paper variants) while keeping command strictness unchanged.
  • Paper bug report triage (2026-03-17): bug_log captured a case where a prayer reward path issued vertical teleport (execute as slingshooter08 run tp slingshooter08 ~ ~10 ~) and felt unsafe/unintended for a build-oriented prayer; indicates need for pray-path movement guardrails and safer teleport policy.
  • Teleport safety guard (2026-03-17): Added execution-time TP safety wrapper in vanilla execute_response: risky upward teleports (relative delta >= configured threshold or high absolute Y) are prefixed with slow_falling + resistance effects to prevent accidental lethal falls while keeping punishment/spectacle behavior.
  • Bug-log signal upgrade (2026-03-17): bug_log entries now include filtered raw log lines (RCON connect/disconnect noise removed) plus a new "RECENT AI ACTIONS" section from service logs (Prayer from, Executing RCON, SUDO execute, results) for faster triage.
  • Weather normalization fix (2026-03-17): added explicit prompt/context rule and command normalizer in vanilla script mapping weather storm|rainstorm|thunderstorm -> weather thunder before validation/execution.

Infrastructure decisions

  • mc1 autoStart: Set to true in MCSManager instance config (/opt/mcsmanager/daemon/data/InstanceConfig/d39f55861cb34204a92a18a9e1c78ca6.json) so the server starts on CT 644 boot. mc-godmode.service uses tail -F and handles the log appearing late gracefully.
  • mc-godmode.service startup: Already enabled (systemctl is-enabled = enabled), WantedBy=multi-user.target, After=mcsm-daemon.service. The service was not failing — the MC server itself wasn't auto-starting (fixed by enabling autoStart).
  • shrink-world aigod tail fix (2026-03-17): mc-aigod.service stayed active but stopped reacting to chat after log file recreation because tail_log() used a single open()+readline() handle. Updated /usr/local/bin/mc_aigod.py to detect inode changes/truncation and reopen latest.log automatically; restarted mc-aigod.service on CT 644.
  • sudo hallucination observed (2026-03-17): after tail fix, sudo destroy my surroundings was parsed and executed as execute as slingshooter08 run tp @e[type=player,tag=destroyed] ~ ~ ~ and execute as slingshooter08 run kill @e[type=player,tag=destroyed]. Both returned empty RCON results; current validator allowed them because prefix-only checks pass and only give/effect have syntax repair.
  • Context/prompt refinement (2026-03-17): updated vanilla sudo/god prompts to emphasize strict 1.21 syntax (including effect give ..., no old enchant NBT, weather clear/rain/thunder only), concise JSON outputs, and avoidance of accidental high vertical teleports in benevolent responses; increased vanilla sudo translator token budget from 180 to 260 to reduce truncated JSON on longer kit requests.
  • bug_log deployment status (2026-03-17): local repo had bug_log feature before CT deployment. /usr/local/bin/mc_aigod.py on CT 644 did not contain BUG_LOG_PATTERNS or bible help text until redeployed; pushed updated script + config and restarted mc-aigod.service successfully.
  • Project governance for bug intake (2026-03-17): multiple players may submit bug_log reports, but these are advisory signal only. The owner (slingshooter08) sets product direction and prioritization; non-owner feedback should be considered with appropriate weighting.

Open threads / next ideas

  • Prayer history log (JSON) for review and tuning
  • God mood / divine disposition score persisted across restarts
  • Dual-server support in vanilla aigod (watch both mc1 and shrink-world logs)
  • Redis backend for Paper fork gateway sessions (currently SQLite only)
  • MCP-based tool adapters in the gateway tool loop
  • Web dashboard for recent prayers + God responses (n8n or simple Flask)
  • Paper sudo fallback behavior: when request intent is outside command library, run lookup/wiki/search step and synthesize closest safe workaround (example intent: destruction -> TNT-oriented actions) instead of emitting hallucinated raw commands.
  • Paper AI behavior preference: prioritize richer reasoning over deterministic templates; provide broader Minecraft/WorldEdit context via a local indexed knowledge corpus, then let the agent retrieve only needed docs/files per request before generating commands.