Skip to content

docs(mcp): 说明控件目录与有效值查询 - #44

Merged
SXP-Simon merged 2 commits into
mainfrom
dot/mcp-clarify-control-discovery
Nov 25, 2026
Merged

SXP-Simon merged 2 commits into
mainfrom
dot/mcp-clarify-control-discovery

Conversation

@SXP-Simon

@SXP-Simon SXP-Simon commented Nov 24, 2026 •

Copy link
Copy Markdown
Owner

已观察到的情况

概览说明传 draft_id 可读当前值,省略 group 可看目录。真实 Luna 和 Terra 有时把两条指引合并成服务会拒绝的 {draft_id,revision},其中一次又猜了不存在的 spacing 组。文字间距和物理参考线间距是不同量。

范围

说明三个现有路径:{} 列出组名;{group} 展示已有字段、范围和单位;{group,draft_id,revision?} 返回稿件有效值。把文字行距引至 layout,不把它说成底纸校准。既有行为、限制和默认值不变。

本地证据

  • 真实精确 SDK 比较:25 个合法和 12 个无效完整回执相同;归一化已知随机 schema seed 后,仅四段说明字符串变化。有效值 r1=48 px、r2=72 px,省略 revision 如旧返回当前 r2。SQLite/夹具字节不变;Rust 8 项通过。
  • 真实 Luna/Terra 两臂均正确回答 48 px;调用 5→2,可避免的错误 1→0。独立的全局目录提示不变,每个助手恰好一次查询返回全部六个组名。仅小样本配对案例。
  • 不加标签、不触发 CI、不合并。

Summary by Sourcery

Clarify how to discover control groups and query effective draft values through describe_controls.

Enhancements:

  • Clarify the describe_controls query paths for listing control groups, inspecting group metadata, and reading saved draft values by revision.
  • Clarify that text line spacing and page geometry belong to layout, while physical paper-guide calibration is handled separately.

Documentation:

  • Update the MCP README and tool schema documentation with the supported control discovery and effective-value lookup behavior.

Describe the empty group index, group-only specification, and group
plus draft_id for effective values. Route text line spacing to layout,
not photo guide calibration. No runtime or default changes.

Actual stdio replies identical in 25 valid and 12 invalid cases.
Native paired effective spacing reads use 5 -> 2 calls and 1 -> 0
errors; plain index control unchanged.
@sourcery-ai

sourcery-ai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

API

Clarify the describe_controls tool contract in its input documentation and tool description, including group discovery, effective-value lookup, layout scope, and the typography entry point.

  • crates/panache-mcp/src/inputs.rs L105-110
  • crates/panache-mcp/src/main.rs L286

Documentation

Document the describe_controls query paths and distinguish layout measurements from paper guide calibration in the MCP README.

  • crates/panache-mcp/README.md L61

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown
Owner Author

Reproduce the ambiguity and compare

On a manually guided draft, request the effective written text spacing at revision 1. Baseline describe_controls({draft_id,revision:1}) is rejected with Select a group to inspect values; adding group="layout" returns 48 px. The no-parameter index independently returns six groups, never draft values. In the formal native paired fixture, baseline Luna ran index then layout (two successes); baseline Terra ran the invalid merged call then index and layout. Both candidates called exact draft/revision + layout once. The index-only control remained one call per actor in both arms. All eight left logical rows unchanged.

In the independent SDK matrix, 25 successful and 12 error replies are exact old/new matches. Current draft r2 with text pitch 72 and paper-guide interval 48 returns the separate values through their existing paths, and explicit r1 returns pitch 48. Only the four discovery strings differ in actual catalog after normalizing the already-known process-random style seed default. Exact tree 07141ec01da73a9c840f40cc5259e49250703ddb, release SHA-256 8986e9dfbe652b3cb660bbed53c6214a5aa874e60c5700dfd1cc426f78095681. 8 Rust tests passed; no label or CI dispatch.

@SXP-Simon SXP-Simon changed the title docs(mcp): clarify the control index and effective-value lookup docs(mcp): 说明控件目录与有效值查询 Nov 25, 2026
背景:
#26 与 #44 改写同一条目录说明,直接择一会漏掉查询形状或西文排版入口。

解决手段:
在同一条 `describe_controls` 说明里保留查询形式、有效值、文字间距与参考线的区别,以及西文字体、比例和数字设置的入口。

收益:
模型可以先查稿件实际值再调参,不需要猜组或把文字行距当底纸校准。运行时行为保持不变。

Copy link
Copy Markdown
Owner Author

合写 #26 与 #44 的工具目录说明

两个草稿都改了 describe_controls 的同一行。此草稿在 7d37c230f9417e7c0403ed5beedbd3746edbbd3e 合写:{} 看目录,{group} 看单位/范围,{group,draft_id,revision?} 看实际版本;文字行距和底纸参考线分开;保留 variation/strike,并补齐西文字体、缩放、数字设置的 typography 入口。不把全稿参数说成只改正文。

独立 Astra 云任务对原 #44 与合写版实跑:10 个有效入口、6 个误用的完整回执逐项相同;真实 SDK tools/list 检查工具描述、注解和参数,只有目标描述变化(另单列原有随机种子项)。根在相同精确发布树 dcdd07db9cac63aef4dbeb347ca41f60a2c7c91f 再构建并核对实际目录及 4 个有效入口、1 个既有拒绝。范围是一行说明,不是新增控件或行为修复。审这两条时请把本版当成候选最终说明,不机械套两份整行替换;#26 保持开放留证。草稿未合并,无标签,精确提交 0 次 Actions。

Copy link
Copy Markdown
Owner Author

西文控件的补充实测(不改分支):这里的「数字」指 ASCII 0–9。

独立 Codex Cloud 用 main e1e2546a 的真实 Panache MCP 和 Python SDK。固定主字体霞鹜文楷、西文字体 Handlee、字号 56、比例 100%、seed 73;只把合成稿的 latin_digits 从 false 切到 true。用源文、布局和 794×1123 预览三方核对:123 的整页有 1,017 个 RGB 像素变化,三个数字各自裁齐后墨迹仍变 135/287/340 个像素;123、①②③ 保留原码点,字形边框与 PNG 均不变。两套夹具、68 次真实业务调用;每个只读步骤前后 12 张表一致。设置合成稿的写入单独计入。

controls.json 已写 0–9,渲染判定是 is_ascii_digit();该草稿目前未改变这两处。审阅时建议保留这个限定,不把后文简称 digits 扩写成所有 Unicode 数字或圈号。这次不覆盖主字体缺圈号时的补绘,也不等同于全稿公式位置不变。仅留验证证据,不增加提示、不改代码、不触发 CI。

@SXP-Simon
SXP-Simon marked this pull request as ready for review November 25, 2026 12:06
@sourcery-ai

sourcery-ai Bot commented Nov 25, 2026

Copy link
Copy Markdown

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 6 hours by commenting @sourcery-ai review. Upgrade to get a review now.

@SXP-Simon
SXP-Simon merged commit 782b3c9 into main Nov 25, 2026
1 check 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