feat(auto-patch): enforce editScope + npm test smoke gate #19

Merged
halofourteen merged 1 commits from feat/auto-patch-edit-scope into main 2026-05-26 10:39:18 +03:00
halofourteen commented 2026-05-26 10:39:14 +03:00 (Migrated from github.com)

Summary

Closes the last unchecked item in plans/autonomous-survival-bot-prd.md §7
Phase 6 — Smoke checks run before applying patch.

  • scripts/edit-scope.js — pure helpers to parse editScope: [...]
    from a proposal frontmatter (the field Phase 6 started writing) and
    to validate a list of changed files against it.
  • scripts/auto-patch.js — reads scope from the proposal, injects
    allowed paths into the Pi prompt, validates the diff (auto-allowing
    runtime/**/*.test.js), and runs npm test on the patched branch
    before cherry-picking. Any test failure → discard the patch.
  • 13 new tests, npm test is 92/92.

🤖 Generated with Claude Code

## Summary Closes the last unchecked item in `plans/autonomous-survival-bot-prd.md` §7 Phase 6 — *Smoke checks run before applying patch.* - `scripts/edit-scope.js` — pure helpers to parse `editScope: [...]` from a proposal frontmatter (the field Phase 6 started writing) and to validate a list of changed files against it. - `scripts/auto-patch.js` — reads scope from the proposal, injects allowed paths into the Pi prompt, validates the diff (auto-allowing `runtime/**/*.test.js`), and runs `npm test` on the patched branch before cherry-picking. Any test failure → discard the patch. - 13 new tests, `npm test` is 92/92. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.