Behaviour-focused iteration on top of v0.3.0. The bot was "walking
back and forth for three days burning tokens" — this PR makes it
actually progress through the survival arc. 9 commits, all on v0.3.1.
Why (observed failure modes)
Sated bot chasing food forever — food bar 17/20 but storyline +
manifesto required 2+ food items in inventory, so it looped
scout/acquire-food for hours instead of working toward tools.
No narrative — manifesto said "you need food" but never "go chop
that tree / place a crafting table". Pure priority ranking, no plan.
Stuck in barren biomes / pits — local 32-block food scan, no
biome awareness, no "leave this area" escalation.
Overnight crash — trigger-tuner called runOnce().catch() on a
sync function (TypeError after 1h) + perf_hooks measure-buffer leak
(1M entries → OOM).
survive.scout-food — biome check → scan 32/64 → commit a cardinal
for 200b, rescanning; leaves barren biomes toward food-capable ones;
blind/tunnel fallback + 12s step timeout so it degrades instead of
hanging.
runtime/awareness/wedge-detector.js + village.relocate — rolling
10-min position bbox; <50b + unmet need + 3 skill cycles → walk 300b
in a fresh cardinal (above the skill layer, can't be reset on re-entry).
recovery.escape-pit-safe — surveys 4 cardinals + ceiling, picks the
safest exit instead of blindly retrying tunnel-out/pillar-up.
Food behaviour fix (the big one)
manifesto L1 + storyline first_food treat hunger bar ≥14 as
satisfied even with empty food inventory. A full bot makes tools and
grabs food opportunistically; only hard-pursues food when actually
hungry. Distant chicken / cod no longer fools acquire-food.
Fuzzy dedup for improvement_requests (token-overlap; closed gaps not
resurrected).
Monitor TUI
tui/monitor.tsx — fullscreen read-only dashboard (opencode-style):
header+storyline bar, activity, MC chat, advisor recs, improvement
queue, 24h token cost in ₽. npm run tui; old action TUI → npm run tui:legacy.
Cost-optimization PRD (design only)
dev/v0.3.1/PRD.md — spec to cut advisor prompt ~800→~250 tokens
(compact registry, need-scoping, snapshot pruning, caching probe).
Not implemented; next session.
Behaviour diff
Situation
Before
After
Sated (food 17), empty food inv
loops scout/acquire-food
works L2 tools_wood
Barren biome, no food in 32b
local scan loop forever
scout heads to food-capable biome
Wandering same 50×50 for 10min
random walk
village.relocate 300b jump
In a pit, tunnel+pillar fail
alternates both forever
escape-pit-safe surveys, picks exit
1h uptime
tuner crash → dead
survives (sync guard + perf reaper)
Test plan
npm test — 407 green (was 257 at v0.2.0-rc.3)
scripts/lint-patch.js clean
Live: bot runs in tmux pepa, observed transition off the
food-loop onto L2 tools_wood → craft.planks
Post-merge: watch a multi-hour run survives (perf reaper + tuner
fix) and storyline advances past step 5
Operator tooling
npm run tui # live monitor
node scripts/show-story.js # storyline progress
node scripts/list-improvements.js # gap queue (now fuzzy-deduped)
node scripts/list-improvements.js --stats # advisor token cost
ssh pepa "docker exec minecraft rcon-cli 'tp pepa_bot X Y Z'" # rescue
Supersedes the storyline-only scope this PR opened with.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
What
Behaviour-focused iteration on top of v0.3.0. The bot was "walking
back and forth for three days burning tokens" — this PR makes it
actually progress through the survival arc. 9 commits, all on
v0.3.1.Why (observed failure modes)
manifesto required 2+ food items in inventory, so it looped
scout/acquire-food for hours instead of working toward tools.
that tree / place a crafting table". Pure priority ranking, no plan.
biome awareness, no "leave this area" escalation.
trigger-tunercalledrunOnce().catch()on async function (TypeError after 1h) + perf_hooks measure-buffer leak
(1M entries → OOM).
with reworded titles; exact-title dedup missed them.
What's in it
Storyline — canonical Minecraft survival quest
runtime/goal/storyline.js+state.js— 11 ordered steps(orient → wood → crafting → tools → food → shelter → stone → food
security → iron → settle → village). Each owns
completed(),suggestSkill(),emergencyPause(), RU chat narration.storyline > manifesto L1+ > curriculum.
orient_selfhas a 120s timeout fallback so barren biomes don't block.Real survival patterns (Voyager / Plan4MC / GITM research)
runtime/biome-affordances.js— 40-biome table (mobs/trees/water).survive.scout-food— biome check → scan 32/64 → commit a cardinalfor 200b, rescanning; leaves barren biomes toward food-capable ones;
blind/tunnel fallback + 12s step timeout so it degrades instead of
hanging.
runtime/awareness/wedge-detector.js+village.relocate— rolling10-min position bbox; <50b + unmet need + 3 skill cycles → walk 300b
in a fresh cardinal (above the skill layer, can't be reset on re-entry).
recovery.escape-pit-safe— surveys 4 cardinals + ceiling, picks thesafest exit instead of blindly retrying tunnel-out/pillar-up.
Food behaviour fix (the big one)
satisfied even with empty food inventory. A full bot makes tools and
grabs food opportunistically; only hard-pursues food when actually
hungry. Distant chicken / cod no longer fools acquire-food.
Robustness
trigger-tunercrash fixed (sync runOnce, try/catch guard) +regression test.
clearMeasures/clearMarksreaper in bot.js.resurrected).
Monitor TUI
tui/monitor.tsx— fullscreen read-only dashboard (opencode-style):header+storyline bar, activity, MC chat, advisor recs, improvement
queue, 24h token cost in ₽.
npm run tui; old action TUI →npm run tui:legacy.Cost-optimization PRD (design only)
dev/v0.3.1/PRD.md— spec to cut advisor prompt ~800→~250 tokens(compact registry, need-scoping, snapshot pruning, caching probe).
Not implemented; next session.
Behaviour diff
Test plan
npm test— 407 green (was 257 at v0.2.0-rc.3)scripts/lint-patch.jscleanpepa, observed transition off thefood-loop onto
L2 tools_wood → craft.planksfix) and storyline advances past step 5
Operator tooling
Supersedes the storyline-only scope this PR opened with.
🤖 Generated with Claude Code