← back to Morning Review Features

specs/SPECS.md

71 lines

# Morning-Review Feature Backlog (#6-10)

Server: `~/.claude/skills/morning-review/scripts/server.js`
Frontend: `~/.claude/skills/morning-review/templates/report.html`
Pm2: `morning-review` on :9762

Build features in order. After each:
1. Restart server: `pm2 restart morning-review`
2. Smoke: `curl -s -o /dev/null -w "%{http_code}\n" http://127.0.0.1:9762/`
3. Single git-style commit message (no actual git repo here, just include in summary).

## #6 — One-click "Disapprove all from {reviewer}" (15 min)

Add a top-of-page reviewer-stats summary table in the LEFT pane. Each row = one reviewer with: count, signal_rate (from `/api/reviewer-stats`), and a [DISAPPROVE ALL] button.

- New endpoint `POST /api/disapprove-bulk` body `{reviewer, severity?, only_hallucinated?}` → loops findings matching the filter, appends a `disapprove` decision for each.
- Frontend: render the table from `/api/reviewer-stats` + `/api/findings`. Wire button to POST + reload.

## #7 — Dry-run preview before Apply (3 hr)

Today: clicking Apply spawns Claude CLI which writes files immediately.
Goal: clicking Preview spawns Claude CLI in `--dry-run` mode (or with a prompt that says "produce a unified diff but do NOT write files or commit"). Stash the diff in `data/preview-{finding_id}.diff`. Right-pane shows the diff; Apply button uses that exact diff.

- New endpoint `POST /api/preview` body `{finding_id}` → spawns Claude in plan-only mode with prompt: "Plan the fix and output ONLY a unified diff to stdout, no other text. Do not write files. Do not commit."
- Save to `data/preview-{finding_id}.diff`.
- Frontend: replace single Apply button with Preview → review-the-diff → Apply (the existing Apply uses the saved diff directly via `git apply`).

## #8 — Cross-project finding consolidation (2 hr)

When multiple findings flag the SAME pattern (same regex on body's first 200 chars), group them.

- New helper `consolidateFindings(list)` that buckets findings by similarity hash (Levenshtein on first sentence).
- Group becomes one card showing N member-findings; approve/disapprove cascades to all.
- Add `?consolidate=1` query param to `/api/findings`; UI defaults to consolidated view, toggle to flat.

## #9 — Voice approve (1 hr)

Use macOS dictation + a shell-listening daemon: Steve says "approve all small-business-builder commits" → script POSTs approve for each.

- New skill or simple bash daemon that polls macOS dictation output (or accepts STDIN) and parses commands.
- For now: simpler one-shot — `~/Projects/morning-review-features/voice-approve.sh "approve all smb-builder"` parses the command and does the bulk action via existing `/api/decision`.
- No real-time mic listening required for v1; just the parse + action path.

## #10 — Daily digest commit (30 min)

At end of each day's review session (or via cron at 6pm PT), generate `~/Projects/morning-review-features/digests/{date}.md` summarizing:
- Approved findings → list with the resulting commit hash + project
- Disapproved findings → reviewer + reason snippet
- Errored / orphaned findings still pending
- Reviewer scorecard (pulled from `/api/reviewer-stats`)

Email via George: `curl -sS -X POST http://localhost:9850/api/send -u admin:DWSecure2024! -H content-type:application/json -d {to:"steveabramsdesigns@gmail.com",subject:"Morning-review digest YYYY-MM-DD",body:...}`

- New endpoint `GET /api/digest?date=YYYY-MM-DD` returns the markdown.
- New script `~/Projects/morning-review-features/generate-digest.sh` calls it, saves, optionally emails.
- Launchd plist fires daily 18:00 PT.

## Constraints

- NO `git push`, NO pm2 restart on cncp-listed domains, NO modifications to `dw_unified`.
- Local commits only. Single-commit-per-feature when modifying files in this skill.
- Smoke test the morning-review server after each feature; revert that feature's changes if /api/findings starts 5xxing.
- Total Claude CLI budget: 90 minutes. If over, write FIXME blocks where remaining work would go and exit cleanly.

## Verification checklist

After all features attempted, write `~/Projects/morning-review-features/logs/build-{date}.md` with:
- Each feature: SHIPPED / PARTIAL / SKIPPED + 1-line reason
- Endpoint smoke results
- Any new files created