[claude] Agent Self-Correction Dashboard (#1007) #1269

Merged
Timmy merged 1 commits from claude/issue-1007 into main 2026-03-24 01:40:42 +00:00

1 Commits

Author SHA1 Message Date
Alexander Whitestone
a082607f75 feat: agent self-correction dashboard (#1007)
Some checks failed
Tests / lint (pull_request) Failing after 31s
Tests / test (pull_request) Has been skipped
Implements the Agent Self-Correction Dashboard from issue #1007:

- infrastructure/self_correction.py: SQLite-backed event logger.
  Records original_intent, detected_error, correction_strategy, and
  final_outcome with outcome_status (success/partial/failed) and
  error_type for pattern analysis.

- timmy/agentic_loop.py: Hooks _handle_step_failure to emit a
  self-correction event whenever the loop adapts or fails to adapt
  a step. Uses best-effort logging (never raises).

- dashboard/routes/self_correction.py: Three endpoints:
    GET /self-correction/ui       - full dashboard
    GET /self-correction/timeline - HTMX partial (refreshes 30 s)
    GET /self-correction/patterns - HTMX partial (refreshes 60 s)

- templates/self_correction.html + two partials: timeline and
  recurring-pattern table. Stats panel shows correction rate as a
  progress bar.

- base.html: "SELF-CORRECT" link added to INTEL dropdown (desktop
  and mobile nav).

- mission-control.css: new .sc-* component styles (no inline CSS).

- tests/unit/test_self_correction.py: 18 unit tests covering
  log, get_corrections, get_patterns, get_stats. All 435 existing
  tests continue to pass.

Fixes #1007

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 21:37:13 -04:00