Innovation Engine — automation

Feedback Error Signature Clusterer

April 22, 2026

The last 5 Claude sessions all started with the same SpacetimeDB 'Failed to fetch' feedback row (id 8399) — Ethan keeps re-analyzing the same error because the joyos-feedback-daemon has no memory of what it already triaged. This tool fingerprints each feedback error by normalized signature, caches the triage verdict, and short-circuits repeat analysis so the daemon only wakes Claude for genuinely new signatures.

joyos-feedback-daemonmorning-tablet-brieftablet-sync

Create ~/bin/feedback-signature-cache (bash+sqlite, ~60 lines): (1) ~/.local/state/feedback-signatures.db with table signatures(hash TEXT PRIMARY KEY, first_seen, last_seen, occurrence_count, verdict_json, merge_plan_path). (2) Hash = sha1 of feedback text stripped of IDs/timestamps/UUIDs via sed. (3) Wrap joyos-feedback-daemon invocation: before calling Claude, check cache — if hash exists and verdict is <7 days old, bump last_seen/occurrence_count and skip. If new or stale, run the MERGE_PLAN analysis, store verdict + path to MERGE_PLAN.md. (4) Add ~/bin/feedback-signature-report for weekly tablet brief: top-5 recurring signatures with occurrence counts, piped into morning-tablet-brief. Wires into existing joyos-feedback-daemon + morning-tablet-brief + tablet sync — no new infra.

Built & Ready
## Summary

**Created files:**
- `~/bin/feedback-signature-cache` (executable, Python) — normalizes feedback error text (strips IDs, timestamps, UUIDs, hex addrs, long numbers), SHA1-hashes the shape, and caches verdicts in SQLite at `~/.local/state/feedback-signatures.db`. Commands: `check`, `record`, `hash`.
- `~/bin/feedback-signature-report` (executable, Python) — prints top-N recurring signatures as HTML (default) or plaintext (`--text`) for the `morning-tablet-brief` pipeline.
- `~/bin/tests/test-feedback-signature-cache.sh` — 8 assertions covering new/duplicate/stale/bump/report paths.

**Schema:** `signatures(hash PK, first_seen, last_seen, occurrence_count, verdict_json, merge_plan_path, sample_text)`.

**Runtime note:** Switched from the `sqlite3` CLI to Python's stdlib `sqlite3` module — the CLI isn't installed on this machine, `python3` always is.

**Wire-up contract** (no existing files modified, per task rules):
```bash
verdict=$(feedback-signature-cache check "$FB_ID" "$FB_TEXT")
[[ $verdict == SKIP* ]] && { log "skip duplicate $verdict"; exit 0; }
# ...run MERGE_PLAN analysis...
feedback-signature-cache record "$FB_ID" "$FB_TEXT" "$verdict_json" "$merge_plan_path"
```
Inside `morning-tablet-brief`, inject `$(feedback-signature-report 5)` into the brief body.

**Verification:** `~/bin/tests/test-feedback-signature-cache.sh` → 8 passed, 0 failed. End-to-end smoke test confirmed new text returns `RUN`, same-shape different-IDs text returns `SKIP` with bumped occu
Active Projects
russ-telegram, innovation-engine, bys-website, .claude, note-ocr
Category
automation