Phase 6 of plans/autonomous-survival-bot-prd.md. Self-improvement v2:
the bot can spot no-progress stagnation, not just exception-class
failures, and the proposal it writes carries a structured edit scope.
runtime/stuck-incident.js — when the same noProgressReason
persists for ≥5 min, files a proposal whose body includes runtimeState, the milestone, the suggested skill,
a slim snapshot, last action result, per-skill success/failure
metrics, and an explicit edit-scope list. Cooldown 30 min.
runtime/skill-metrics.js — in-memory per-skill ok/fail
counters. Stamped on snapshot.skillMetrics.
runtime/state-store.js — writeProposal({editScope})
persists the allowed paths in frontmatter; readProposalEditScope(filename) reads them back so future scripts/auto-patch.js can refuse cherry-picks that touch other
areas.
runtime/bot.js — tick() invokes the detector each tick;
dispatchAction records into skillMetrics on both the resolved
result and the exception path.
Tests — 6 new tests in runtime/stuck-incident.test.js. npm test is now 46/46.
Remaining for true Phase 6 completion: actually wiring scripts/auto-patch.js to honour editScope and to run npm test
before cherry-pick. Tracked in the PRD checklist.
Test plan
npm test — 46/46
Detector ignores null/empty reasons
Detector does not fire before threshold
Reason change resets the timer (no premature fire)
Cooldown blocks back-to-back firings
Body includes milestone + suggested skill + metrics
Skill metrics record both ok and fail counters
Live-server: stuck on no_food_source → exactly one proposal
in 5 min, with editScope: [runtime/skills/survive-eat.js, …]
## Summary
Phase 6 of `plans/autonomous-survival-bot-prd.md`. Self-improvement v2:
the bot can spot **no-progress stagnation**, not just exception-class
failures, and the proposal it writes carries a structured edit scope.
- **`runtime/stuck-incident.js`** — when the same `noProgressReason`
persists for ≥5 min, files a proposal whose body includes
`runtimeState`, the milestone, the suggested skill,
a slim snapshot, last action result, per-skill success/failure
metrics, and an explicit edit-scope list. Cooldown 30 min.
- **`runtime/skill-metrics.js`** — in-memory per-skill ok/fail
counters. Stamped on `snapshot.skillMetrics`.
- **`runtime/state-store.js`** — `writeProposal({editScope})`
persists the allowed paths in frontmatter;
`readProposalEditScope(filename)` reads them back so future
`scripts/auto-patch.js` can refuse cherry-picks that touch other
areas.
- **`runtime/bot.js`** — tick() invokes the detector each tick;
dispatchAction records into `skillMetrics` on both the resolved
result and the exception path.
- **Tests** — 6 new tests in `runtime/stuck-incident.test.js`. `npm
test` is now 46/46.
Remaining for true Phase 6 completion: actually wiring
`scripts/auto-patch.js` to honour `editScope` and to run `npm test`
before cherry-pick. Tracked in the PRD checklist.
## Test plan
- [x] `npm test` — 46/46
- [x] Detector ignores null/empty reasons
- [x] Detector does not fire before threshold
- [x] Reason change resets the timer (no premature fire)
- [x] Cooldown blocks back-to-back firings
- [x] Body includes milestone + suggested skill + metrics
- [x] Skill metrics record both ok and fail counters
- [ ] Live-server: stuck on `no_food_source` → exactly one proposal
in 5 min, with `editScope: [runtime/skills/survive-eat.js, …]`
🤖 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 6 of
plans/autonomous-survival-bot-prd.md. Self-improvement v2:the bot can spot no-progress stagnation, not just exception-class
failures, and the proposal it writes carries a structured edit scope.
runtime/stuck-incident.js— when the samenoProgressReasonpersists for ≥5 min, files a proposal whose body includes
runtimeState, the milestone, the suggested skill,a slim snapshot, last action result, per-skill success/failure
metrics, and an explicit edit-scope list. Cooldown 30 min.
runtime/skill-metrics.js— in-memory per-skill ok/failcounters. Stamped on
snapshot.skillMetrics.runtime/state-store.js—writeProposal({editScope})persists the allowed paths in frontmatter;
readProposalEditScope(filename)reads them back so futurescripts/auto-patch.jscan refuse cherry-picks that touch otherareas.
runtime/bot.js— tick() invokes the detector each tick;dispatchAction records into
skillMetricson both the resolvedresult and the exception path.
runtime/stuck-incident.test.js.npm testis now 46/46.Remaining for true Phase 6 completion: actually wiring
scripts/auto-patch.jsto honoureditScopeand to runnpm testbefore cherry-pick. Tracked in the PRD checklist.
Test plan
npm test— 46/46no_food_source→ exactly one proposalin 5 min, with
editScope: [runtime/skills/survive-eat.js, …]🤖 Generated with Claude Code