Repository navigation
fix(crates/handwriting-core): 让带中点条件标签的流程图正常出图 - #63
Merged
Merged
Conversation
背景:循环流程图的中点标签和不等式命令曾导致整个绘图环境逐字输出。 解决手段:解析受限的线段中点标签和不等式命令,验证标签位置与箭头端点。 收益:这类作业的流程图能随正文一起绘制。
Reviewer's GuideImplementation解析连线上的受限 midway 标签并将其放到路径中点,同时保留线段端点;支持标签中的 ≤ 和 ≥ 命令。
Tests验证直线与折线路径的中点标签位置、端点和箭头行为,以及无前置路径或未知选项时的拒绝行为。
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
SXP-Simon
marked this pull request as ready for review
November 27, 2026 06:28
|
Sorry @SXP-Simon, you've used your own review budget of 250,000 diff characters for the last 7 days. You can request another review in 2 days and 22 hours by commenting |
SXP-Simon
added a commit
that referenced
this pull request
Nov 27, 2026
## 为什么改 一份手写作业里,模型改用 PNG 画方框和箭头。缩小看整页时,模型把成品交了出来,使用者后来指出图线比文字粗很多。原有照片外观提示主要看文字和底纸,推荐区域可能没有框到图。 ## 这个草稿做什么 - 看普通成图时,若本节含内嵌位图的标记,返回一句针对图文混排页的提醒:选一段图线和附近字,在同一倍率下看粗细和墨色。普通成图仍可直接看。 - 整页检查利用已有的本页布局与调整后的坐标,找第一张位图和附近的非位图笔迹。二者能一起放进原尺寸裁图时,直接返回可复制的局部预览参数。区域过大或超出纸面时,改为提醒选小区域。比较同页图和字只需当前版本。 - 局部检查沿用已有只读预览。是否偏粗由看到的图像决定。若图确实太重,可以改插图源并复看,正文的墨色不需要跟着改。#58 讲的是导入时位图如何变成线稿,此处处理的是成图后怎样验收。 ## Windows 实际验证 - 合成纸上放入手写字和一张含方框、横线的 PNG。工具给出的 **179 × 178 像素**区域同时包含插图和正文字形,局部调用返回底纸与成图两张裁图,保持原倍率。纯文字页和纯图片页均不产生整页图文对照建议。局部取图没有新增整页检查记录。 - 用同一页有意画粗的方框图、同一随机种子和同一句「像同一支笔写的,能交吗」做独立会话对照。转发器省略启动说明,保留真实工具及图像,核对工具调用与回答。 | 版本 | Luna | Terra | | --- | --- | --- | | 当前 main | 从整页指出图粗,未取局部裁图 | 从整页指出图粗,未取局部裁图 | | 最终草稿 | 从整页指出图粗,未取局部裁图 | 按参数取回 **291 × 212** 裁图,再指出框和连线比字粗黑 | 中间版本还暴露了两个问题:只有整页检查带提示时,Luna 有一次只看普通成图,判断「可以交」。加入普通预览提示后,它又曾把同页对照误填为比较两个相同版本。因此最终两个入口都说明了同页如何检查。两模型每个版本各一次,最终对这张明显粗线图的识别均为 **2/2**。有证据的收益是 Terra 主动取到同倍率裁图,尚不能据此判断模型识别率提高。 MCP 的 16 项单元测试和 Clippy 通过。新增的真实 stdio 回归可用 `python crates/panache-mcp/tests/illustration_ink_check.py <panache-mcp>` 复跑。该自动建议聚焦每页第一张位图,原生流程图的生成问题由 #63 独立处理。 ## Summary by Sourcery Enable MCP reviews to identify and compare embedded illustration lines with nearby handwriting without changing the surrounding text ink. New Features: - Add image-preview guidance for comparing embedded diagram strokes with nearby handwriting at the same zoom. - Generate page-level review regions and native-scale preview parameters covering the first embedded image and adjacent text when available. Enhancements: - Track text versus illustration glyphs through rendering and fine-edit geometry to support mixed-content inspection. Documentation: - Document the recommended review workflow for comparing hand-drawn diagrams with nearby writing. Tests: - Add an end-to-end MCP regression covering mixed diagram and text previews, crop contents, and review-record behavior.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
为什么改
在循环分析作业里,模型用工具推荐的原生绘图语法画流程图,在两条分支箭头旁写上条件。解析器遇到
node[midway,right]和\le时,按现有保底行为把整段源代码当作正文。模型随后改用外部 PNG,图和正文的笔迹很难一致。这个草稿做什么
识别连线上的
midway标签,以及标签里的 ≤ 和 ≥ 命令。直线的标签放在中间,直角路径的标签放在转角,继续画线仍然从原来的端点出发。仅扩展已有绘图子集,其余未知样式继续保留原文。一个可单独重现的片段:
本机证据
Summary by Sourcery
Enable native rendering of circuit flowchart conditions placed along connection paths.
New Features:
midwaylabels on straight and right-angle circuit paths, including condition text using ≤ and ≥ symbols.Bug Fixes:
Tests: