From d867c47bd5501984ade5bcf4cbaaf3583c2673ec Mon Sep 17 00:00:00 2001 From: Zachariah Farahany Date: Sun, 8 Nov 2026 16:38:45 -0500 Subject: [PATCH 1/2] feat(eval): add the marklassian mistune 3.4 link-label task (WIP, MIT-618) Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Qc1CQTb8r67J32HpkhS43y --- server/tests/test_eval_grader.py | 1 + tools/eval/github_tasks.py | 55 +++++++++++++++++++++++++++++++- 2 files changed, 55 insertions(+), 1 deletion(-) diff --git a/server/tests/test_eval_grader.py b/server/tests/test_eval_grader.py index a80ab5e..38ea72a 100644 --- a/server/tests/test_eval_grader.py +++ b/server/tests/test_eval_grader.py @@ -268,6 +268,7 @@ def test_the_cause_words_grader_v2_skips_are_exactly_the_versions() -> None: "2.1", "2.0", "8.5", + "3.4", } diff --git a/tools/eval/github_tasks.py b/tools/eval/github_tasks.py index e58eef4..861dbe3 100644 --- a/tools/eval/github_tasks.py +++ b/tools/eval/github_tasks.py @@ -263,6 +263,59 @@ def tests(*ids: str) -> str: ) +# Mistune 3.4.0 (2026-10-19) rewrote link parsing ("Refactor link and emphasis parsing", +# lepture/mistune@bde6ad7, committed 2026-07-22): it parses a link's or an image's label before +# it knows the text is a label, so inline plugins no longer see `state.in_link` or +# `state.in_image` set while they run on it. +# Release notes: https://github.com/lepture/mistune/releases/tag/v3.4.0 +MISTUNE_LINK_LABELS = Upstream( + library="mistune", + version="3.4.0", + released="2026-10-19", + changelog="https://github.com/lepture/mistune/releases/tag/v3.4.0", + upstream_change="mistune-3.4-label-parsed-first", +) + +# Issue: none in the repository; the fix's pull request reports it: on mistune 3.4 a Jira +# mention in link text or image alt text becomes a real mention node. +# Fix: https://github.com/mbroton/marklassian-py/pull/26 (merged 2026-10-30): the converter, not +# the mention plugin, decides link and image context. A merge commit: the base is its first +# parent. The laid-over file's new test and five existing ones fail at the base on mistune 3.4.0; +# the whole file passes at the base on 3.3.4 (checked). The file has no comments or docstrings +# about mistune. Not `in_link` or `in_image`: the base's plugin reads them. +MARKLASSIAN = GitHubTask( + name="gh-marklassian-link-labels", + repo="https://github.com/mbroton/marklassian-py", + base_commit="3ebadd312f4a3782512efb6bd9de8e75391cdf39", + fix_commit="89437cdbe9a74bac63535618f76ae5418aa6ae99", + issue_url="https://github.com/mbroton/marklassian-py/pull/26", + fix_url="https://github.com/mbroton/marklassian-py/pull/26", + test_paths=("tests/test_mentions.py",), + python="3.12", + pins=("mistune==3.4.0",), + setup=f"uv pip install --quiet {EXCLUDE_NEWER} -e . pytest==9.1.1 jsonschema", + test_command=tests("tests/test_mentions.py"), + upstream=MISTUNE_LINK_LABELS, + discovery=Discovery( + symptom_words=("mention", "link text", "alt text"), + cause_words=( + "parses link labels", + "parses link and image labels", + "parses the label", + "labels before", + "label before", + "parsed before", + "before it knows", + "new link parser", + "3.4", + ), + library="mistune", + ), + trigger="version_specific", + license="MIT", +) + + def scenario(task: GitHubTask) -> Scenario: """Return the scenario that replays a task: its project comes from the repository.""" return Scenario( @@ -276,6 +329,6 @@ def scenario(task: GitHubTask) -> Scenario: ) -TASKS: list[GitHubTask] = [PYTEST_BDD, TEKORE, PYDANTIC_SETTINGS, MLODA, PIP_TOOLS] +TASKS: list[GitHubTask] = [PYTEST_BDD, TEKORE, PYDANTIC_SETTINGS, MLODA, PIP_TOOLS, MARKLASSIAN] GITHUB = {task.name: scenario(task) for task in TASKS} From 0bf9316e526cafdee2c8b4bf019f265e60c22d2a Mon Sep 17 00:00:00 2001 From: Zachariah Farahany Date: Sun, 8 Nov 2026 16:50:50 -0500 Subject: [PATCH 2/2] fix(eval): drop marklassian cause words a symptom-only fix would use (MIT-618) Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Qc1CQTb8r67J32HpkhS43y --- tools/eval/github_tasks.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/tools/eval/github_tasks.py b/tools/eval/github_tasks.py index 861dbe3..f93fd66 100644 --- a/tools/eval/github_tasks.py +++ b/tools/eval/github_tasks.py @@ -264,9 +264,9 @@ def tests(*ids: str) -> str: # Mistune 3.4.0 (2026-10-19) rewrote link parsing ("Refactor link and emphasis parsing", -# lepture/mistune@bde6ad7, committed 2026-07-22): it parses a link's or an image's label before -# it knows the text is a label, so inline plugins no longer see `state.in_link` or -# `state.in_image` set while they run on it. +# lepture/mistune@bde6ad7, authored 2026-07-22, committed 2026-08-21): it parses a link's or an +# image's label before it knows the text is a label, so inline plugins no longer see +# `state.in_link` or `state.in_image` set while they run on it. # Release notes: https://github.com/lepture/mistune/releases/tag/v3.4.0 MISTUNE_LINK_LABELS = Upstream( library="mistune", @@ -298,13 +298,12 @@ def tests(*ids: str) -> str: upstream=MISTUNE_LINK_LABELS, discovery=Discovery( symptom_words=("mention", "link text", "alt text"), + # No phrase built on a bare "before" or "label" ("labels before", "parsed before"): a fix + # that only treats the symptom says them too ("strip mentions from the label before + # building the link mark"). Nothing with `in_link` or `in_image`: the base reads them. cause_words=( "parses link labels", "parses link and image labels", - "parses the label", - "labels before", - "label before", - "parsed before", "before it knows", "new link parser", "3.4",