Innovation Engine — automation

Feedback Daemon Graveyard Resurrector

April 29, 2026

Cross-references daemon-graveyard-digest output against the joyos-feedback-daemon and ora-feedback-daemon logs to detect when a feedback item silently died because its processing daemon crashed mid-flight. When found, it auto-requeues the orphaned feedback ID and pings notify-focus so Ethan knows which user-facing item is actually unblocked, not just which daemon got resurrected.

daemon-graveyard-digestjoyos-feedback-daemonstdbnotify-focus

Create ~/bin/feedback-orphan-rescuer (bash, ~80 lines) and a systemd timer at ~/.config/systemd/user/feedback-orphan-rescuer.timer firing every 15min. Script: (1) parse last 24h of ~/.local/state/daemon-graveyard/*.log for crashed feedback-* daemons, (2) for each crash, grep the daemon's own log for the last 'processing feedback #NNNN' line before death, (3) check joyos SpacetimeDB via `stdb sql` whether that feedback row still has status='processing', (4) if yes, reset to status='pending' and call notify-focus with the feedback title + user email. Wire into existing daemon-graveyard-digest by reading its JSON state file at ~/.local/state/daemon-graveyard/state.json instead of re-parsing logs.

Built & Ready
Live run succeeded against both joyos-labs and ora-feedback databases — no orphans currently, which is correct.

## Summary

**What was requested:** Detect feedback items silently orphaned when their daemon crashes mid-flight, requeue them, and notify Ethan with the user-facing title.

**How it went:** Built and shipped on first try. The plan referenced `~/.local/state/daemon-graveyard/state.json`, which doesn't exist — that "graveyard" actually archives daemon *script backups*, not crash logs. Adapted the heuristic to use the real signals: a stuck `in_progress` row + dead/missing daemon lockfile + the daemon log's last "Processing feedback #N" mark.

**Files created:**
- `~/bin/feedback-orphan-rescuer` (96 lines, executable) — checks both `joyos-labs` and `ora-feedback` SpacetimeDB modules, resets stuck `in_progress` → `planned`, fires `notify-focus` with feedback title. Dedup state at `~/.local/state/feedback-orphan-rescuer/rescued.tsv` (24h window).
- `~/bin/feedback-orphan-rescuer.test.sh` — smoke test (passes).
- `~/.config/systemd/user/feedback-orphan-rescuer.service` + `.timer` — every 15 min, enabled and running.

**Hangups:** Status values in the actual codebase are `in_progress`/`planned` (not `processing`/`pending` as the plan specified) — matched real schema. Title column differs between modules; script tries `title` then `text`.

**New tests:** `feedback-orphan-rescuer.test.sh` (PASS — verifies graceful degradation when spacetime CLI absent and when daemon is ali
Active Projects
innovation-engine, russ-telegram, bys-website, .claude
Category
automation