feat(runtime): curriculum-driven scheduler + Pi banter + base-site (follow-ups) #20

Merged
halofourteen merged 1 commits from feat/scheduler-runskill into main 2026-05-26 10:46:14 +03:00
halofourteen commented 2026-05-26 10:46:11 +03:00 (Migrated from github.com)

Summary

Three remaining PRD follow-ups, one merge.

1. Scheduler now driven by the curriculum. reflex.js replaces
the old techTreeReflex + autonomousReflex with curriculumReflex
that dispatches the skill suggested by snapshot.curriculum.plan via
runSkill. Per-skill backoff for missing_tool /
missing_material / no_target / no_food_source /
unsupported_version. A skill's recover() returning
{hint:"wander"} swaps the next tick to wander for 60 s. Chain is
now: defend → eat → sleep → curriculum → idle.

2. Pi escalation for ADDRESSED_BANTER. When generateReply returns
{escalate:true}, bot.js spawns askPi with the bot's runtime
state + last 5 lines from that speaker (redacted via chatMemory).
Reply capped at 200 chars. Hard rate limit: 6 calls/hour, 90 s
minimum gap.

3. Phase 4 substrate. runtime/locations.js (atomic JSON store),
runtime/base-site.js (scoring on wood/stone/water/flatness/players/
foreign-builds), runtime/skills/choose-base.js
(village.choose-base skill). New final curriculum milestone
village.base-site until a base is established.

Test plan

  • npm test — 116/116 (was 92/92)
  • runtime/reflex.test.js exercises scheduler dispatch + all
    backoff branches
  • runtime/base-site.test.js covers max/zero/bumpy/foreign/
    owned-blocks score cases
  • runtime/locations.test.js round-trips real state/<host>/
  • bot.js still loads cleanly with dummy env

🤖 Generated with Claude Code

## Summary Three remaining PRD follow-ups, one merge. **1. Scheduler now driven by the curriculum.** `reflex.js` replaces the old `techTreeReflex` + `autonomousReflex` with `curriculumReflex` that dispatches the skill suggested by `snapshot.curriculum.plan` via `runSkill`. Per-skill backoff for `missing_tool` / `missing_material` / `no_target` / `no_food_source` / `unsupported_version`. A skill's `recover()` returning `{hint:"wander"}` swaps the next tick to wander for 60 s. Chain is now: `defend → eat → sleep → curriculum → idle`. **2. Pi escalation for ADDRESSED_BANTER.** When `generateReply` returns `{escalate:true}`, `bot.js` spawns `askPi` with the bot's runtime state + last 5 lines from that speaker (redacted via `chatMemory`). Reply capped at 200 chars. Hard rate limit: **6 calls/hour, 90 s minimum gap.** **3. Phase 4 substrate.** `runtime/locations.js` (atomic JSON store), `runtime/base-site.js` (scoring on wood/stone/water/flatness/players/ foreign-builds), `runtime/skills/choose-base.js` (`village.choose-base` skill). New final curriculum milestone `village.base-site` until a base is established. ## Test plan - [x] `npm test` — 116/116 (was 92/92) - [x] `runtime/reflex.test.js` exercises scheduler dispatch + all backoff branches - [x] `runtime/base-site.test.js` covers max/zero/bumpy/foreign/ owned-blocks score cases - [x] `runtime/locations.test.js` round-trips real `state/<host>/` - [x] `bot.js` still loads cleanly with dummy env 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.