feat(runtime): early-game survival curriculum (Phase 3) #15

Merged
halofourteen merged 1 commits from feat/survival-pivot-phase-3 into main 2026-05-25 22:23:33 +03:00
halofourteen commented 2026-05-25 22:23:27 +03:00 (Migrated from github.com)

Summary

Phase 3 of plans/autonomous-survival-bot-prd.md. The bot now has a
deterministic early-game curriculum from spawn → stone-tier tools +
basic storage, without any LLM call per tick.

  • runtime/curriculum.js — ordered milestones
    (wood.16 → wood.planks-and-sticks → wood.tools → stone.32 → stone.tools → food.basic → storage.chest → shelter.torch). Each
    exposes isDone(inventory, snapshot) and suggest() returning a
    { skillId } plan. isDone is stateful via "stage reached"
    escapes so progress is monotonic (crafting planks doesn't bounce
    back to "gather 16 logs").
  • runtime/skills/gather-stone.jsgather.stone with
    pickaxe-required precondition + blacklist + registry-aware block
    matching (stone / cobblestone / deepslate / cobbled_deepslate /
    andesite / diorite / granite).
  • runtime/skills/craft.js — factory + concrete skills:
    craft.planks, craft.sticks, craft.wooden-axe/-pickaxe/-sword,
    craft.stone-axe/-pickaxe/-sword, craft.furnace, craft.chest,
    craft.torch (torch requires coal or charcoal in inventory).
  • runtime/curriculum.test.js — 14 tests on chooser ordering,
    per-milestone skill suggestion, inventoryFull threshold, monotonic
    advancement. npm test is 28/28 passing.
  • Snapshot wiringlastSnapshot.curriculum carries
    { milestone, plan, inventoryFull } on every tick.
  • TUI — milestone row shows the suggested skill id and an
    [inventory full] badge when the threshold (32 distinct stacks)
    is reached.

Reflex.js still calls actions.js directly; wiring the scheduler to
runSkill(plan.skillId, …) lands in Phase 4.

Test plan

  • npm test — 28/28 passing (curriculum + contract + groups)
  • Stateful isDone predicates: post-craft inventories don't
    regress the chooser to an earlier gather milestone
  • gather.stone rejects when no pickaxe in inventory
  • craft.torch rejects when no coal/charcoal
  • All recipe-driven skills emit code:"unsupported_version" when
    the item is missing from bot.registry
  • Live-server: from empty inventory, the bot reaches at least
    milestone 4 (stone.tools) or logs a precise blocker via
    noProgressReason

🤖 Generated with Claude Code

## Summary Phase 3 of `plans/autonomous-survival-bot-prd.md`. The bot now has a deterministic early-game curriculum from spawn → stone-tier tools + basic storage, without any LLM call per tick. - **`runtime/curriculum.js`** — ordered milestones (`wood.16 → wood.planks-and-sticks → wood.tools → stone.32 → stone.tools → food.basic → storage.chest → shelter.torch`). Each exposes `isDone(inventory, snapshot)` and `suggest()` returning a `{ skillId }` plan. `isDone` is stateful via "stage reached" escapes so progress is monotonic (crafting planks doesn't bounce back to "gather 16 logs"). - **`runtime/skills/gather-stone.js`** — `gather.stone` with pickaxe-required precondition + blacklist + registry-aware block matching (stone / cobblestone / deepslate / cobbled_deepslate / andesite / diorite / granite). - **`runtime/skills/craft.js`** — factory + concrete skills: `craft.planks`, `craft.sticks`, `craft.wooden-axe/-pickaxe/-sword`, `craft.stone-axe/-pickaxe/-sword`, `craft.furnace`, `craft.chest`, `craft.torch` (torch requires coal or charcoal in inventory). - **`runtime/curriculum.test.js`** — 14 tests on chooser ordering, per-milestone skill suggestion, inventoryFull threshold, monotonic advancement. `npm test` is 28/28 passing. - **Snapshot wiring** — `lastSnapshot.curriculum` carries `{ milestone, plan, inventoryFull }` on every tick. - **TUI** — milestone row shows the suggested skill id and an `[inventory full]` badge when the threshold (32 distinct stacks) is reached. Reflex.js still calls `actions.js` directly; wiring the scheduler to `runSkill(plan.skillId, …)` lands in Phase 4. ## Test plan - [x] `npm test` — 28/28 passing (curriculum + contract + groups) - [x] Stateful `isDone` predicates: post-craft inventories don't regress the chooser to an earlier gather milestone - [x] `gather.stone` rejects when no pickaxe in inventory - [x] `craft.torch` rejects when no coal/charcoal - [x] All recipe-driven skills emit `code:"unsupported_version"` when the item is missing from `bot.registry` - [ ] Live-server: from empty inventory, the bot reaches at least milestone 4 (stone.tools) or logs a precise blocker via `noProgressReason` 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.