Skip to content

feat(qa): add rule-based consistency checker for MVP-β #14#39

Merged
DankerMu merged 2 commits into
mainfrom
feat/consistency-check
Feb 21, 2026
Merged

feat(qa): add rule-based consistency checker for MVP-β #14#39
DankerMu merged 2 commits into
mainfrom
feat/consistency-check

Conversation

@DankerMu
Copy link
Copy Markdown
Owner

Summary

  • 实现 5 种一致性检查规则:
    • character_status: 检测已死亡角色在后续场景中出现
    • timeline: 检测 narrative_day 与章节顺序冲突
    • possession: 检测物品被多个角色同时拥有
    • plot_thread: 检测已解决的情节线在后续场景中被引用
    • repetition: 可配置的 n-gram 重复检测
  • API 端点: POST /api/qa/check (支持 project_id, ngram_n, ngram_threshold 参数)
  • 完整测试覆盖: 12 个测试用例,覆盖所有检查类型和 API 端点

Test plan

  • 所有 12 个测试通过 (character_status, possession, repetition, timeline, plot_thread)
  • API 端点返回正确的 ConsistencyResult 格式
  • 可配置的 ngram 参数正常工作
  • 前端 UI 集成测试 (待后续 PR)

🤖 Generated with Claude Code

DankerMu and others added 2 commits February 21, 2026 11:03
Implements 5 consistency checks:
- character_status: dead characters appearing in later scenes
- timeline: narrative_day conflicts with chapter order
- possession: items owned by multiple characters
- plot_thread: resolved threads referenced again
- repetition: configurable n-gram detection

API: POST /api/qa/check with project_id, ngram_n, ngram_threshold
Service: run_consistency_check() with scene indexing and KG analysis
Tests: 12 tests covering all check types and API endpoint

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove extra blank line after imports to pass ruff check.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@DankerMu DankerMu merged commit ff84515 into main Feb 21, 2026
6 of 7 checks passed
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