Innovation Engine — automation

Daemon Graveyard Resurrector

April 28, 2026

Scans the daemon-graveyard-digest output for daemons that died with recoverable errors (transient network, missing PATH, expired tokens) and auto-generates a one-shot revival PR — patch + test + systemd reload command — dropped into ~/Tablet/ for stylus approval. Turns the existing graveyard from a passive obituary into an active recovery queue Ethan can triage from the couch.

daemon-graveyard-digesttablet-syncclaude-clisystemd-user-services

Create ~/bin/daemon-resurrector as a bash+python script run by cron every 6h. Parse latest ~/.local/share/daemon-graveyard/*.json (already produced by daemon-graveyard-digest), filter exits matching known-recoverable patterns (regex list: 'ENOENT.*node', 'PATH', 'token expired', 'ECONNREFUSED', '429'), then for each: use claude -p in batch mode (single call, numbered list per CLAUDE.md gotcha) to draft a minimal fix + a failing test reproducing the error. Write each proposal as a markdown card to ~/Tablet/inbox/resurrect--.md with: diff block, test block, 'systemctl --user restart X' command, and an [APPROVE]/[SKIP] checkbox. tablet-sync picks it up automatically. On next run, scan ~/Tablet/inbox/ for [APPROVE]-checked files and apply via git apply + systemctl restart, then notify-focus the result.

Built & Ready
## Summary

**What was requested:** Daemon Graveyard Resurrector — turn passive graveyard JSON into active recovery proposals approved via tablet.

**How it went:** TDD-first, single bash script (~95 lines), all 5 tests green.

**Files created:**
- `~/bin/daemon-resurrector` (executable, 95 lines) — scans `~/.local/share/daemon-graveyard/*.json`, filters stderr against recoverable regex (`ENOENT.*node|PATH|token expired|ECONNREFUSED|429`), drafts revival cards via `claude -p --model haiku` (single batched call per CLAUDE.md gotcha, 300s timeout), writes to `~/Tablet/inbox/resurrect-<daemon>-<date>.md` with diff/test/restart cmd + `[ ] APPROVE`/`[ ] SKIP` checkboxes. On each run also scans inbox for `[x] APPROVE` cards, applies the diff via `git apply --reject`, runs `systemctl --user restart`, renames card to `.applied.md`, and notify-focus's the result.
- `~/bin/test-daemon-resurrector.sh` (executable) — 5 tests using temp dirs + `DRY_RUN=1`:
1. Script exists and is executable
2. Empty graveyard exits clean
3. Recoverable error → card with all required sections
4. Non-recoverable (segfault) → no card
5. APPROVE-checked card triggers restart path

**Cron:** `0 */6 * * * /home/ethan/bin/daemon-resurrector >> ~/.local/share/daemon-resurrector.log 2>&1` (installed via safe-append).

**Hangups:** None. Existing `daemon-graveyard-digest` archives `.bak*` files (not JSON) so the resurrector currently has no live input to act on; it'll activate as soon as graveyard JSON en
Active Projects
russ-telegram, innovation-engine, bys-website, .claude
Category
automation