Phase 5 of plans/autonomous-survival-bot-prd.md. The bot now feels
present in chat without ever becoming a command executor.
runtime/social/intent.js — classifyIntent returns one of GREETING / STATUS_QUESTION / ADDRESSED_BANTER / COMMAND_LIKE
/ UNSAFE_REQUEST / AMBIENT. Unicode-aware word boundaries (so
"Привет всем" → GREETING).
runtime/social/reply.js — templated short replies; status pulls
from activeSkill, currentMilestone, hp/food/position, noProgressReason, last diary line. ADDRESSED_BANTER returns escalate: true (Pi is not actually called here — kept out of the
hot path until Phase 6).
runtime/social/memory.js — per-speaker LRU buffer (default 8
lines × 16 speakers); redacts password / api_key / JWT-shaped
tokens before they ever leave the runtime.
runtime/state-store.js — adds readDiaryTail(n) and writeEscalation({…}) / listEscalations() writing to state/<host>/escalations.jsonl.
runtime/bot.js — handleChat() routes through the new social
layer (replaces Phase-0 inline regexes), records every line into
chat memory, and writes an escalation on UNSAFE_REQUEST. Phase-0
dialog-only / command-like-ignored behaviour is preserved.
Tests — 12 new tests in runtime/social/social.test.js. npm test
is now 40/40.
Test plan
npm test — 40/40
Cyrillic + latin greetings both classify correctly
Addressed banter does not auto-spawn Pi
Command-like chat still triggers dialog-only notice + diary
Unsafe chat writes to escalations.jsonl
Chat memory redacts secrets at append time, not at read time
Live-server: <bot> what are you doing? returns a real status
line including current milestone + no-progress reason
## Summary
Phase 5 of `plans/autonomous-survival-bot-prd.md`. The bot now feels
present in chat without ever becoming a command executor.
- **`runtime/social/intent.js`** — `classifyIntent` returns one of
`GREETING` / `STATUS_QUESTION` / `ADDRESSED_BANTER` / `COMMAND_LIKE`
/ `UNSAFE_REQUEST` / `AMBIENT`. Unicode-aware word boundaries (so
"Привет всем" → `GREETING`).
- **`runtime/social/reply.js`** — templated short replies; status pulls
from `activeSkill`, `currentMilestone`, hp/food/position,
`noProgressReason`, last diary line. `ADDRESSED_BANTER` returns
`escalate: true` (Pi is not actually called here — kept out of the
hot path until Phase 6).
- **`runtime/social/memory.js`** — per-speaker LRU buffer (default 8
lines × 16 speakers); redacts password / api_key / JWT-shaped
tokens before they ever leave the runtime.
- **`runtime/state-store.js`** — adds `readDiaryTail(n)` and
`writeEscalation({…})` / `listEscalations()` writing to
`state/<host>/escalations.jsonl`.
- **`runtime/bot.js`** — `handleChat()` routes through the new social
layer (replaces Phase-0 inline regexes), records every line into
chat memory, and writes an escalation on UNSAFE_REQUEST. Phase-0
dialog-only / command-like-ignored behaviour is preserved.
- **Tests** — 12 new tests in `runtime/social/social.test.js`. `npm test`
is now 40/40.
## Test plan
- [x] `npm test` — 40/40
- [x] Cyrillic + latin greetings both classify correctly
- [x] Addressed banter does not auto-spawn Pi
- [x] Command-like chat still triggers dialog-only notice + diary
- [x] Unsafe chat writes to `escalations.jsonl`
- [x] Chat memory redacts secrets at append time, not at read time
- [ ] Live-server: `<bot> what are you doing?` returns a real status
line including current milestone + no-progress reason
🤖 Generated with [Claude Code](https://claude.com/claude-code)
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.
Summary
Phase 5 of
plans/autonomous-survival-bot-prd.md. The bot now feelspresent in chat without ever becoming a command executor.
runtime/social/intent.js—classifyIntentreturns one ofGREETING/STATUS_QUESTION/ADDRESSED_BANTER/COMMAND_LIKE/
UNSAFE_REQUEST/AMBIENT. Unicode-aware word boundaries (so"Привет всем" →
GREETING).runtime/social/reply.js— templated short replies; status pullsfrom
activeSkill,currentMilestone, hp/food/position,noProgressReason, last diary line.ADDRESSED_BANTERreturnsescalate: true(Pi is not actually called here — kept out of thehot path until Phase 6).
runtime/social/memory.js— per-speaker LRU buffer (default 8lines × 16 speakers); redacts password / api_key / JWT-shaped
tokens before they ever leave the runtime.
runtime/state-store.js— addsreadDiaryTail(n)andwriteEscalation({…})/listEscalations()writing tostate/<host>/escalations.jsonl.runtime/bot.js—handleChat()routes through the new sociallayer (replaces Phase-0 inline regexes), records every line into
chat memory, and writes an escalation on UNSAFE_REQUEST. Phase-0
dialog-only / command-like-ignored behaviour is preserved.
runtime/social/social.test.js.npm testis now 40/40.
Test plan
npm test— 40/40escalations.jsonl<bot> what are you doing?returns a real statusline including current milestone + no-progress reason
🤖 Generated with Claude Code