Skip to content

[3.3] Create Knowledge Base for Common Errors #63

@adnaan

Description

@adnaan

Description

Create a knowledge base that maps error patterns to known fixes. Patterns are stored in a markdown file for git tracking, easy reading, and LLM editability. This is the foundation for automated fix proposals.

Depends on: #3.1

Tasks

  • Create internal/evolution/knowledge/ package
  • Create evolution/patterns.md - the source of truth for all patterns
  • Define Pattern struct (matcher + fixes)
  • Implement markdown parser to load patterns from file
  • Implement pattern matching against errors
  • Seed with known patterns from git history:
    • EditingID type mismatch
    • Modal state persistence
    • Form sync issues
    • Session not cleared
    • Import path errors
  • Add CLI command: lvt evolution patterns to list all patterns

Acceptance Criteria

  • Patterns stored in evolution/patterns.md (git-tracked)
  • At least 10 patterns seeded from known issues
  • Pattern matching is fast (<1ms per error)
  • Patterns include confidence scores
  • LLMs can propose pattern additions via PR to markdown file
  • lvt evolution patterns lists all patterns with stats

Files to Create

evolution/
└── patterns.md            # Source of truth - git tracked

internal/evolution/knowledge/
├── knowledge.go           # Knowledge base API
├── parser.go              # Markdown parser for patterns.md
├── patterns.go            # Pattern types
├── matcher.go             # Pattern matching logic
└── knowledge_test.go

Benefits of Markdown Storage

  1. Git tracked - full history of pattern changes
  2. Human readable - easy to review and understand
  3. LLM editable - evolution system can propose pattern additions
  4. PR reviewable - pattern changes go through normal review
  5. No recompile - add patterns without rebuilding lvt

Note: evolution/patterns.md already exists with 13 patterns seeded from git history.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions