Skip to content

feat: Verdict-to-AutoFix pipeline - promote common Gemini corrections to Ponder #308

@martymcenroe

Description

@martymcenroe

Summary

Create a feedback loop where common Gemini verdict corrections become Ponder Stibbons auto-fixes, reducing LLM costs and improving iteration speed over time.

The Learning Loop

┌─────────────────────────────────────────────────────────────────────────┐
│                     THE LEARNING CYCLE                                  │
│                                                                         │
│   Gemini ──► Verdict ──► Analyzer ──► Pattern ──► Ponder Auto-Fix      │
│   Review     "BLOCK:     mines        detected    fixes it before      │
│              missing X"  patterns     (N>3)       Gemini sees it       │
│                              │                          │               │
│                              └────── Learning ──────────┘               │
│                                                                         │
└─────────────────────────────────────────────────────────────────────────┘

How It Works

Phase 1: Pattern Mining (Verdict Analyzer)

The Verdict Analyzer already processes Gemini verdicts. Extend it to track:

class VerdictPattern:
    pattern_type: str      # "missing_section", "wrong_format", "path_typo"
    regex_or_rule: str     # How to detect this in drafts
    fix_strategy: str      # How Ponder should fix it
    occurrence_count: int  # How many times seen
    example_verdicts: list # Sample verdict excerpts

Phase 2: Promotion Threshold

When a pattern occurs N times (configurable, default 3):

  1. Verdict Analyzer flags it as "promotion candidate"
  2. Human reviews and approves promotion
  3. Pattern becomes a Ponder auto-fix rule

Phase 3: Auto-Fix Integration

Ponder loads promoted rules and applies them pre-review:

# In Ponder's auto_fix.py
def load_promoted_fixes() -> list[AutoFixRule]:
    """Load fixes promoted from verdict analysis."""
    rules_path = Path("docs/auto-fix-rules/promoted/")
    return [AutoFixRule.from_yaml(f) for f in rules_path.glob("*.yaml")]

Phase 4: Impact Measurement

Track metrics:

  • Gemini calls saved (fixes that would have triggered BLOCK)
  • Time saved (auto-fix is instant vs 30s+ LLM call)
  • Accuracy (did the auto-fix actually match what Gemini would want?)

Example Pattern Promotion

Observed: Gemini blocks 5 LLDs for "Section 11 uses ### instead of ##"

Pattern extracted:

name: section_11_header_format
trigger: "Section 11" in verdict AND "header" in verdict
detection: r'^### 11\.'
fix: Replace with '## 11.'
promoted_from: verdicts/2026-02/LLD-099-v1.md, LLD-101-v2.md, ...

Result: Next time a draft has ### 11., Ponder fixes it before Gemini review.

Connection to "How the AgentOS Learns"

This is a key learning mechanism:

  1. Gemini teaches - Blocks drafts with issues
  2. Analyzer observes - Tracks patterns in blocks
  3. System learns - Promotes patterns to auto-fixes
  4. Quality improves - Fewer blocks, faster iteration

Update wiki page: How the AgentOS Learns

Files to Modify

File Change
agentos/workflows/requirements/verdict_analyzer.py Add pattern tracking
agentos/workflows/requirements/nodes/auto_fix.py Load promoted rules
docs/auto-fix-rules/promoted/ Store promoted patterns
wiki/How-the-AgentOS-Learns.md Document this loop

Dependencies

Success Criteria

  • Verdict Analyzer tracks correction patterns
  • Patterns with N+ occurrences flagged for promotion
  • Promoted patterns loaded by Ponder
  • Metrics show reduced Gemini round-trips
  • Wiki documents the learning loop

Labels

enhancement, workflow, learning

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions