Skip to content

feat(lint): add Wiki Fixer with LLM-driven auto-repair#267

Open
6tizer wants to merge 1 commit into
nashsu:mainfrom
6tizer:feat/wiki-fixer
Open

feat(lint): add Wiki Fixer with LLM-driven auto-repair#267
6tizer wants to merge 1 commit into
nashsu:mainfrom
6tizer:feat/wiki-fixer

Conversation

@6tizer
Copy link
Copy Markdown

@6tizer 6tizer commented May 26, 2026

Fixes #196 - lint now has auto-repair capability for broken links, missing cross-references, contradictions, stale content, and missing pages.

Summary

Introduces a Wiki Fixer Agent that automatically repairs LLM Wiki issues detected by the lint system. Previously, lint could only identify problems; users had to manually review and fix each issue. This PR adds LLM-powered auto-repair for most issue types.

Features

  • Auto Fix button on each fixable lint item
  • Fix All button for batch repair of all fixable issues
  • 6 fix strategies:
    • orphan → direct index.md update (no LLM)
    • broken-link → LLM removes or replaces broken [[wikilink]]
    • no-outlinks → LLM adds relevant [[wikilinks]] to existing pages
    • contradiction → LLM resolves conflicting claims across pages
    • stale → LLM updates outdated content or adds review notes
    • missing-page → LLM creates new entity/concept page from references
  • Excludes suggestion type — requires human judgment
  • Progress tracking via activity store

Changes

  • src/lib/lint-fixer.ts — core fixer logic with fixLintResult(), fixAllLintResults(), isFixable()
  • src/lib/lint-fixer.test.ts — 18 unit tests (all passing)
  • src/components/lint/lint-view.tsx — UI enhancements (Auto Fix + Fix All buttons)
  • src/i18n/en.json + src/i18n/zh.json — new translation keys

Test plan

  • TypeScript compilation: 0 errors
  • All mock tests: 1157/1157 passing (+18 new fixer tests)
  • Manual: Run Lint → verify Auto Fix buttons appear on fixable items
  • Manual: Click Fix All → verify batch repair
  • Manual: Verify suggestion type does not show Auto Fix button

🤖 Generated with Claude Code
via Happy

Introduces an automatic wiki issue fixer powered by LLM, addressing
Issue nashsu#196 where lint detects errors but cannot auto-correct.

Features:
- Auto Fix button on each fixable lint item (broken-link, no-outlinks, semantic types)
- Fix All button for batch repair of all fixable issues
- 6 fix strategies: orphan (direct), others via LLM prompts
- Progress tracking via activity store
- Excludes "suggestion" type from auto-fix (requires human judgment)

Changes:
- New src/lib/lint-fixer.ts with fixLintResult/fixAllLintResults/isFixable
- New src/lib/lint-fixer.test.ts with 18 unit tests (all passing)
- LintView UI: Auto Fix (Sparkles) + Fix All (Zap) buttons
- i18n: autoFix/fixAll/fixingAll in en.json + zh.json

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
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.

指出并检查wiki错误描述后不能自动修正wiki页面内容。

1 participant