Skip to content

HITL: Human-in-the-loop approval workflow for autonomous fixes #12

@michaeloboyle

Description

@michaeloboyle

Description

Formalize the human-in-the-loop approval workflow that connects the Fix Review panel (#10), pattern library (#8), and self-healing mode (#7) into a cohesive HITL system.

Current State (Delivered)

  • Fix Review panel: Before/after screenshots, Approve/Partial/Reject buttons
  • Pattern library: Stores successful fixes, matches on new issues
  • Telemetry: resolve() closes the feedback loop, metrics() shows dashboard

HITL Requirements

1. Approval Queue

  • Persistent queue of pending fixes (survives page refresh)
  • Queue items show: description, issue class, before/after screenshots, code diff
  • Batch approve/reject for same-class fixes
  • Queue badge count in the visualizer header bar

2. Code Diff View

  • Show the actual file edits made by Claude Code (parse session JSONL for Edit/Write tool calls)
  • Syntax-highlighted diff alongside the visual before/after
  • One-click revert if rejected (git checkout the changed files)

3. Approval Graduation (ADR-0007)

  • Track approval rate per issue class
  • When class hits 95%+ approval over 10+ fixes, propose auto-apply
  • "Graduate" button promotes class from HITL → autonomous
  • Graduated classes still log telemetry but skip the review queue
  • Regression detection: if a graduated fix fails, revoke auto-apply

4. Confidence Scoring

  • Display confidence score based on pattern match quality
  • High-confidence fixes (known class, strong pattern match) show green badge
  • Low-confidence fixes (novel class, no prior patterns) show orange badge
  • Confidence threshold configurable (default: auto-apply above 0.9)

5. Notification Integration

  • Desktop notification when fix is ready for review
  • Optional sound (via TTS feedback skill)
  • Slack/webhook notification for remote review

Architecture

__claude.fix() → Before screenshot → Claude Code session → After screenshot
                                                                    ↓
                                              Fix Review Panel (HITL)
                                              ├── Before/After images
                                              ├── Code diff
                                              ├── Confidence score
                                              └── [Approve] [Partial] [Reject]
                                                      ↓
                                              Pattern stored (success)
                                              → Metrics updated
                                              → Graduation check

Depends On

References

  • PKM ADR-0007: Always-On Agent Fleet (operational autonomy)
  • PKM ADR-0013 Benchmarks: Self-Improvement Loop 3 (Approval Lane Graduation)
  • PKM ADR-0013 Benchmarks: North Star principles

Metadata

Metadata

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions