Skip to content

feat: Fix-It Button - Agent-Proposed Code/SQL Fixes#104

Merged
bordumb merged 6 commits intomainfrom
feat/fn-50-fix-it-button
Jan 29, 2026
Merged

feat: Fix-It Button - Agent-Proposed Code/SQL Fixes#104
bordumb merged 6 commits intomainfrom
feat/fn-50-fix-it-button

Conversation

@bordumb
Copy link
Owner

@bordumb bordumb commented Jan 29, 2026

Summary

  • Add FixProposal model for LLM-generated fix proposals (sql_dml, sql_ddl, dbt_patch, python_patch, manual_instruction)
  • Extend synthesis agent to generate fixes when confidence > 0.7
  • Implement SQL fix validator with sqlglot-based parsing and safety checks (no DROP TABLE, require WHERE clause)
  • Build React FixPreview widget with syntax highlighting, confidence indicator, risks display, and rollback section
  • Implement FixExecutionService with pre-validation, timeout support, audit logging, and 5-minute rollback window
  • Add FixFeedbackService for collecting user feedback (yes/no/partially), aggregating success rates, alerting on low success, and exporting for fine-tuning

Test plan

  • 33 unit tests for FixProposal model validation
  • 34 unit tests for SQL fix validator
  • 16 unit tests for fix execution service
  • 22 unit tests for feedback service
  • TypeScript build passes for frontend widget
  • All pre-commit hooks pass

🤖 Generated with Claude Code

bordumb and others added 6 commits January 29, 2026 01:00
- Add FixProposal Pydantic model with typed fix types (sql_ddl, sql_dml,
  dbt_patch, python_patch, manual_instruction)
- Add validators for SQL DDL (ALTER/CREATE/DROP) and DML (INSERT/UPDATE/DELETE)
- DDL fixes always require confirmation for safety
- Handle Jinja templates in dbt patches
- Add comprehensive unit tests (33 tests)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add fix_proposal field to SynthesisResponse model
- Extend synthesis prompt with fix generation instructions (when confidence > 0.7)
- Add fix type mapping guidance (schema issues → DDL, data issues → DML, etc.)
- Include safety rules (no DROP TABLE, require WHERE clause)
- Add unit tests for fix_proposal in SynthesisResponse
- Add tests for fix proposal prompt guidance

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add fix_validator.py with comprehensive fix validation
- Syntax validation via sqlglot parsing (dialect-aware)
- Safety validation: no DROP/TRUNCATE, require WHERE for DELETE/UPDATE
- Scope validation: fixes only touch allowed tables
- Row estimation heuristics for sanity checks
- validate_fix_sql for raw SQL validation
- validate_fix_proposal for FixProposal objects
- Export FixValidationResult, validate_fix_sql, validate_fix_proposal from safety module
- 34 unit tests covering all validation scenarios

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add FixPreview component for displaying fix proposals
- Add FixProposal, FixValidationResult, FixExecutionResult types
- Implement expandable card with confidence indicator (color coded)
- Show risks as warning callouts with yellow background
- Add collapsible rollback statement section
- Add Preview Impact, Copy, and Apply buttons
- Require confirmation checkbox for apply action
- Add comprehensive CSS styles for JupyterLab integration
- TypeScript build passes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add FixExecutionService for executing LLM-generated fixes:
- Pre-execution validation using fix_validator
- Transaction safety with timeout support
- Audit logging to database and in-memory cache
- 5-minute rollback window for executed fixes
- Support for DML, DDL, and manual instruction fix types

Includes dataclasses: FixExecutionResult, RollbackResult, FixExecutionRecord

Refs: fn-50.5

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implement FixFeedbackService for collecting user feedback on applied fixes:
- Record feedback with rating (yes/no/partially) and optional comment
- Aggregate success rates by fix_type and root_cause_category
- Alert mechanism when success rate falls below threshold
- Export feedback for fine-tuning analysis
- Emit FEEDBACK_FIX events via InvestigationFeedbackAdapter

Add new event types to EventType enum: FEEDBACK_FIX, FIX_PROPOSED,
FIX_APPLIED, FIX_ROLLED_BACK

Includes: FixFeedback, FixSuccessStats, FixSuccessAlert, FeedbackExportRecord

Refs: fn-50.6

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Jan 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
dataing Ready Ready Preview, Comment Jan 29, 2026 1:24am
dataing-app Ready Ready Preview, Comment Jan 29, 2026 1:24am
dataing-docs Ready Ready Preview, Comment Jan 29, 2026 1:24am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant