feat(runtime): compatibility hardening (Phase 7) #18

Merged
halofourteen merged 1 commits from feat/survival-pivot-phase-7 into main 2026-05-25 22:39:38 +03:00
halofourteen commented 2026-05-25 22:39:30 +03:00 (Migrated from github.com)

Summary

Phase 7 of plans/autonomous-survival-bot-prd.md. Five small modules
that close the recurring "shared state" and "version-pinned list"
failure modes the PRD flags in §7 and §5.4.

  • runtime/movement-profiles.js — named GATHER / TRAVEL /
    FLEE / BUILD / RETURN_TO_BASE profiles as pure descriptors;
    applyProfile(profile, bot) writes a fresh Movements to pathfinder.
    Stops one skill's canDig=false from leaking into the next skill.
  • runtime/owned-blocks.js — JSONL ledger
    (state/<host>/owned-blocks.jsonl) of blocks this bot placed and
    removed; isOwned({x,y,z}) for O(1) lookups; ensureDir() makes
    the parent dir lazily.
  • runtime/claim-avoidance.jsclassifyArea({blocks, isOwned})
    returns player_build / natural_or_owned / insufficient_data
    based on man-made block density vs ownership ratio.
  • runtime/skills/compat.test.js — runs the dynamic groups
    against real minecraft-data registries for 1.18.2 / 1.20.4 /
    1.21.5; regression check that pale_oak_log is absent from 1.18.
  • runtime/compat.test.js — 10 tests covering movement
    descriptors, isManMadeBlockName, classifyArea, owned-blocks
    markPlaced / dedup / isOwned / markRemoved.

npm test is now 79/79.

Test plan

  • npm test — 79/79
  • minecraft-data 1.18.2 / 1.20.4 / 1.21.5 all produce sane groups
  • pale_oak_log correctly absent from 1.18.2
  • Movement profile descriptors are frozen + correctly typed
  • Owned-blocks ledger is idempotent on duplicate places
  • Claim avoidance flags high man-made density without ownership

🤖 Generated with Claude Code

## Summary Phase 7 of `plans/autonomous-survival-bot-prd.md`. Five small modules that close the recurring "shared state" and "version-pinned list" failure modes the PRD flags in §7 and §5.4. - **`runtime/movement-profiles.js`** — named `GATHER` / `TRAVEL` / `FLEE` / `BUILD` / `RETURN_TO_BASE` profiles as pure descriptors; `applyProfile(profile, bot)` writes a fresh Movements to pathfinder. Stops one skill's `canDig=false` from leaking into the next skill. - **`runtime/owned-blocks.js`** — JSONL ledger (`state/<host>/owned-blocks.jsonl`) of blocks this bot placed and removed; `isOwned({x,y,z})` for O(1) lookups; `ensureDir()` makes the parent dir lazily. - **`runtime/claim-avoidance.js`** — `classifyArea({blocks, isOwned})` returns `player_build` / `natural_or_owned` / `insufficient_data` based on man-made block density vs ownership ratio. - **`runtime/skills/compat.test.js`** — runs the dynamic groups against real `minecraft-data` registries for 1.18.2 / 1.20.4 / 1.21.5; regression check that `pale_oak_log` is absent from 1.18. - **`runtime/compat.test.js`** — 10 tests covering movement descriptors, `isManMadeBlockName`, `classifyArea`, owned-blocks `markPlaced` / dedup / `isOwned` / `markRemoved`. `npm test` is now **79/79**. ## Test plan - [x] `npm test` — 79/79 - [x] minecraft-data 1.18.2 / 1.20.4 / 1.21.5 all produce sane groups - [x] `pale_oak_log` correctly absent from 1.18.2 - [x] Movement profile descriptors are frozen + correctly typed - [x] Owned-blocks ledger is idempotent on duplicate places - [x] Claim avoidance flags high man-made density without ownership 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.