Skip to content

feat: move range review with progression analysis and board text render#6

Closed
layiku wants to merge 6 commits into
wimi321:mainfrom
layiku:enhanced-move-range-analysis
Closed

feat: move range review with progression analysis and board text render#6
layiku wants to merge 6 commits into
wimi321:mainfrom
layiku:enhanced-move-range-analysis

Conversation

@layiku
Copy link
Copy Markdown
Contributor

@layiku layiku commented May 2, 2026

Summary

  • 区间复盘功能:用户可在胜率曲线图上 Alt+拖拽选中一段手数区间,老师 agent 自动提取走势和关键手,生成针对性复盘讲解
  • 走势计算:新增 buildMoveRangeProgression() 纯函数,从区间分析数据计算胜率/目差走势、单手最大波动、top-5 波动手
  • 棋盘文本渲染:从 teacherAgent 提取 renderBoardText() 到独立模块,使用 buildBoardState() 计算真实棋盘状态(含提子逻辑)
  • 测试增强:board-text-render 测试改为通过 ts.transpileModule() 编译产物导入真实函数测试,新增 14 个走势计算测试

Key changes

模块 改动
WinrateTimelineV2.tsx Alt+拖拽区间选区,Escape 清除
App.tsx 区间验证、摘要构建、多图发送
moveRangeAnalysis.ts (new) 走势计算纯函数
boardTextRender.ts (new) 从 teacherAgent 提取,含提子逻辑
moveRangeReview.ts (new) 区间摘要构建 + prompt 格式化
teacherAgent.ts move-range intent、精读 tool、文本棋盘 tool
moveRange.ts (new shared) 区间解析、验证、key-move 选择
tests 158 tests pass, typecheck pass, build pass

Test plan

  • node --test tests/board-text-render.test.mjs — 19 tests pass
  • node --test tests/move-range-analysis.test.mjs — 14 tests pass
  • pnpm check (test + typecheck + build) — all pass

🤖 Generated with Claude Code

layiku and others added 6 commits May 2, 2026 19:29
…l input

Add Alt+drag range selection on WinrateTimelineV2 to select a move range
(e.g., moves 221-250) for focused teaching analysis. Also supports manual
text input in Chinese, Japanese, Korean, and English.

- New shared parser (moveRange.ts) ensures consistent range detection
  across renderer and main process
- Timeline shows semi-transparent highlight and badge for selected range
- Auto-fills teacher input; sends key move screenshots + KataGo analysis
  to teacher agent for range review
- Uses local merged Map to avoid React stale state reads
- Controlled range props prevent highlight persistence bugs

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Split parser into contextual patterns (always safe) and bare numeric
  ranges (short commands only) to prevent false positives on dates,
  scores, and winrate descriptions
- Require gameId for parser-derived move-range intent classification
- Remove hardcoded 400 upper bound from analyzeMoveRange tool
- Add early gameId guard for mode='move-range' in runTeacherTask
- Add 28 parser tests and 5 intent classifier contract tests

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The test expected runTeacherAgentSession signature on a single line but
the actual function spans multiple lines. Use [\s\S]*? to match across
line breaks.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…move-range review)

Accept main branch version for overlapping files since main has more
mature move-range implementation with shared module, validation, and
key-move-only analysis.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…ext tool

Add MoveRangeProgression (shared pure function + type) computing absolute
winrate/score trajectory, total change, max swing, and key swing moves.
Extend key-move summaries with moveColor and blackWinrate/ScoreLead before
and after values. Update prompt formatter to output progression overview
with coverage-aware labels.

Add board.renderRangePosition agent tool for text-based board rendering
(reuses go/boardState with initialStones support). Update move-range
teaching prompt to guide knowledge.searchLocal and board tool usage.

Extract renderBoardText to go/boardTextRender.ts, fully reusing
coordToGtp/gtpToCoord from boardState (no local GTP_LETTERS).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…dText

Replace inline rendering logic with ts.transpileModule + dynamic import
of the real renderBoardText function. Use before/after hooks instead of
ordered test cases for setup and cleanup.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Copy link
Copy Markdown
Owner

wimi321 commented May 4, 2026

感谢 layiku 提供 PR #6 的区间走势计算和棋盘文本渲染。这两块对 GoMentor 的区间复盘很有价值:progression 能帮助老师先讲清一段棋的胜率/目差走势,board text render 则让工具链在没有截图时也能有稳定棋盘文本。本次已选择性吸收 buildMoveRangeProgression() 和 renderBoardText(),并与当前 shared move-range parser、key-move-only 精读、evidence boundary、quality gate 和 teacher persona/session 体系对齐;没有原样合并重复 moveRange 路径或逐手高成本长区间分析。再次感谢!

@layiku layiku closed this May 5, 2026
@layiku layiku deleted the enhanced-move-range-analysis branch May 5, 2026 14:14
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.

2 participants