From d3ef7b45a2e1b7c42e08e07337ab70cb9bb7fbc9 Mon Sep 17 00:00:00 2001 From: Umut CAN Date: Tue, 22 Sep 2026 10:51:21 +0300 Subject: [PATCH] feat(discovery): style golden queries; dimstyle/textstyle set_current and drawing_apply_standard join the lean profile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Five tuning cases for the styles surface (DDIM, the ISO-25 set-current paraphrase, the one-call drafting-standard paraphrase, the isocp text style, and the dimstyle counting question) — measured against the live catalog every one ranks top-1, so no alias vocabulary changed. The docstring count moves to seventy-one (56 tuning + 15 holdout); the holdout set is untouched. Lean decision (spec §8.2): dimstyle_set_current, textstyle_set_current and drawing_apply_standard join LEAN_TOOL_NAMES (50 -> 53); the seven authoring/list tools stay full-only and all ten stay in core (no pack claims them). Pinned by the new profile test in tests/test_styles.py, written async like the rest of that module (its module-wide asyncio mark warns on a sync test). Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01FKFStjEFzpGyLq5bMpWxTd --- server.py | 6 ++++++ tests/data/discovery_golden.py | 14 +++++++++++++- tests/test_styles.py | 17 +++++++++++++++++ 3 files changed, 36 insertions(+), 1 deletion(-) diff --git a/server.py b/server.py index e98d8aa..fdab249 100644 --- a/server.py +++ b/server.py @@ -932,6 +932,12 @@ LEAN_TOOL_NAMES = frozenset( "pid_symbol_insert", "pid_line_draw", "pid_graph", + # Styles (track E) — a lean client *uses* a style far more often than + # it authors one; drawing_apply_standard authors the whole set in one + # call when it must. + "dimstyle_set_current", + "textstyle_set_current", + "drawing_apply_standard", } ) diff --git a/tests/data/discovery_golden.py b/tests/data/discovery_golden.py index 3ed8b4c..fb20aaa 100644 --- a/tests/data/discovery_golden.py +++ b/tests/data/discovery_golden.py @@ -1,6 +1,6 @@ """Golden query set for tool discovery: English in, one right tool out. -Sixty-six cases (51 tuning + 15 holdout) split into a **tuning** set and a +Seventy-one cases (56 tuning + 15 holdout) split into a **tuning** set and a **holdout** set. The split is the point of the file. Ranking work is measured against :data:`TUNING_CASES` only; :data:`HOLDOUT_CASES` were written at the same time, @@ -143,6 +143,18 @@ TUNING_CASES: tuple[GoldenCase, ...] = ( "counting", risk="read", ), + # Styles (track E). DIMSTYLE / STYLE / MLEADERSTYLE are umbrella commands + # shared by their list/create/modify/set-current tools, so the one command + # case uses the command unique to a single tool and the rest are phrased. + GoldenCase("DDIM", "dimstyle_create", "command"), + GoldenCase("make ISO-25 the current dimension style", "dimstyle_set_current", "paraphrase"), + GoldenCase( + "set the drawing up to the ISO drafting standard in one go", + "drawing_apply_standard", + "paraphrase", + ), + GoldenCase("create a text style that uses the isocp font", "textstyle_create", "paraphrase"), + GoldenCase("which dimension styles are defined", "dimstyle_list", "counting", risk="read"), ) diff --git a/tests/test_styles.py b/tests/test_styles.py index c4995cc..1c91e5b 100644 --- a/tests/test_styles.py +++ b/tests/test_styles.py @@ -1716,3 +1716,20 @@ async def test_com_apply_standard_creates_both_styles_and_sets_units(com_backend assert ("ActiveTextStyle", "ISOCP") in document.calls assert document.ActiveDimStyle.Name == "ISO-25" assert document.variables["DIMDSEP"] == "," and document.variables["INSUNITS"] == 4 + + +# ── profile decision ──────────────────────────────────────────────────────── + + +async def test_lean_carries_the_two_set_current_tools_and_apply_standard_only(): + import server + + lean = server.LEAN_TOOL_NAMES + assert {"dimstyle_set_current", "textstyle_set_current", "drawing_apply_standard"} <= lean + assert not (STYLE_TOOLS - {"dimstyle_set_current", "textstyle_set_current"}) & lean, ( + "authoring and listing styles is full-profile work" + ) + claimed = set().union(*server.PACK_TOOL_NAMES.values()) + assert not claimed & (STYLE_TOOLS | {"drawing_apply_standard"}), ( + "styles are core: no pack may claim them" + )