[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
Collaborator

Fixes #1007

What this adds

src/infrastructure/self_correction.py

SQLite-backed logger for self-correction events. Records original_intent, detected_error, correction_strategy, final_outcome, outcome_status (success/partial/failed), and error_type for pattern analysis. Exposes log_self_correction(), get_corrections(), get_patterns(), and get_stats().

src/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.

src/dashboard/routes/self_correction.py

Three endpoints:

  • GET /self-correction/ui — full dashboard
  • GET /self-correction/timeline — HTMX partial (auto-refreshes every 30 s)
  • GET /self-correction/patterns — HTMX partial (auto-refreshes every 60 s)

Templates

  • self_correction.html — main page with stats panel + correction rate progress bar
  • partials/self_correction_timeline.html — timeline of events with status badges
  • partials/self_correction_patterns.html — recurring failure pattern table

Navigation

SELF-CORRECT link added to the INTEL dropdown (desktop and mobile nav).

CSS

New .sc-* component styles appended to mission-control.css (no inline CSS).

Tests

18 unit tests in tests/unit/test_self_correction.py covering all four public functions. All 435 existing tests continue to pass.

Fixes #1007 ## What this adds ### `src/infrastructure/self_correction.py` SQLite-backed logger for self-correction events. Records `original_intent`, `detected_error`, `correction_strategy`, `final_outcome`, `outcome_status` (success/partial/failed), and `error_type` for pattern analysis. Exposes `log_self_correction()`, `get_corrections()`, `get_patterns()`, and `get_stats()`. ### `src/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. ### `src/dashboard/routes/self_correction.py` Three endpoints: - `GET /self-correction/ui` — full dashboard - `GET /self-correction/timeline` — HTMX partial (auto-refreshes every 30 s) - `GET /self-correction/patterns` — HTMX partial (auto-refreshes every 60 s) ### Templates - `self_correction.html` — main page with stats panel + correction rate progress bar - `partials/self_correction_timeline.html` — timeline of events with status badges - `partials/self_correction_patterns.html` — recurring failure pattern table ### Navigation `SELF-CORRECT` link added to the INTEL dropdown (desktop and mobile nav). ### CSS New `.sc-*` component styles appended to `mission-control.css` (no inline CSS). ### Tests 18 unit tests in `tests/unit/test_self_correction.py` covering all four public functions. All 435 existing tests continue to pass.
claude added 1 commit 2026-03-24 01:38:34 +00:00
feat: agent self-correction dashboard (#1007)
Some checks failed
Tests / lint (pull_request) Failing after 31s
Tests / test (pull_request) Has been skipped
a082607f75
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>
Timmy merged commit 2d6bfe6ba1 into main 2026-03-24 01:40:42 +00:00
Timmy deleted branch claude/issue-1007 2026-03-24 01:40:42 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/Timmy-time-dashboard#1269