{"instance_id": "sphinx-doc__sphinx-10466", "model_name_or_path": "cain-anthropic-e124", "model_patch": "diff --git a/sphinx/builders/gettext.py b/sphinx/builders/gettext.py\nindex e8bc547b7..ae5886530 100644\n--- a/sphinx/builders/gettext.py\n+++ b/sphinx/builders/gettext.py\n@@ -32,7 +32,7 @@ class Message:\n     \"\"\"An entry of translatable message.\"\"\"\n     def __init__(self, text: str, locations: List[Tuple[str, int]], uuids: List[str]):\n         self.text = text\n-        self.locations = locations\n+        self.locations = list(OrderedDict.fromkeys(locations))\n         self.uuids = uuids\n \n \n", "model": "claude-sonnet-5-5", "steps": 5, "finished": true, "patch_lines": 13, "candidates": [{"compile_ok": 0, "loc_hits": 0, "files": 1, "diff_lines": 18, "steps": 5}, {"compile_ok": 0, "loc_hits": 0, "files": 1, "diff_lines": 13, "steps": 5}], "ms": 23088}
{"instance_id": "sphinx-doc__sphinx-10614", "model_name_or_path": "cain-anthropic-e124", "model_patch": "diff --git a/sphinx/ext/inheritance_diagram.py b/sphinx/ext/inheritance_diagram.py\nindex 6e3985512..8978f51d0 100644\n--- a/sphinx/ext/inheritance_diagram.py\n+++ b/sphinx/ext/inheritance_diagram.py\n@@ -33,6 +33,7 @@ from __future__ import annotations\n import builtins\n import hashlib\n import inspect\n+import posixpath\n import re\n from collections.abc import Iterable\n from importlib import import_module\n@@ -413,7 +414,14 @@ def html_visit_inheritance_diagram(self: HTML5Translator, node: inheritance_diag\n     for child in pending_xrefs:\n         if child.get('refuri') is not None:\n             if graphviz_output_format == 'SVG':\n-                urls[child['reftitle']] = \"../\" + child.get('refuri')\n+                refuri = child.get('refuri')\n+                if re.match(r'^[a-zA-Z][a-zA-Z0-9+.-]*:', refuri):\n+                    urls[child['reftitle']] = refuri\n+                else:\n+                    # refuri is relative to the current document, but the SVG\n+                    # lives in the images dir directly below the output root\n+                    joined = posixpath.join(posixpath.dirname(current_filename), refuri)\n+                    urls[child['reftitle']] = '../' + posixpath.normpath(joined)\n             else:\n                 urls[child['reftitle']] = child.get('refuri')\n         elif child.get('refid') is not None:\n", "model": "claude-sonnet-5-5", "steps": 8, "finished": true, "patch_lines": 28, "candidates": [{"compile_ok": 0, "loc_hits": 1, "files": 1, "diff_lines": 28, "steps": 8}, {"compile_ok": 0, "loc_hits": 1, "files": 1, "diff_lines": 29, "steps": 8}], "ms": 49497}
{"instance_id": "sphinx-doc__sphinx-10673", "model_name_or_path": "cain-anthropic-e124", "model_patch": "diff --git a/sphinx/directives/other.py b/sphinx/directives/other.py\nindex 35e16e623..4df4fff29 100644\n--- a/sphinx/directives/other.py\n+++ b/sphinx/directives/other.py\n@@ -10,6 +10,7 @@ from docutils.parsers.rst.directives.misc import Include as BaseInclude\n \n from sphinx import addnodes\n from sphinx.domains.changeset import VersionChange  # NOQA  # for compatibility\n+from sphinx.domains.std import StandardDomain\n from sphinx.locale import _, __\n from sphinx.util import docname_join, logging, url_re\n from sphinx.util.docutils import SphinxDirective\n@@ -115,9 +116,14 @@ class TocTree(SphinxDirective):\n                         docname = docname[:-len(suffix)]\n                         break\n                 # absolutize filenames\n+                virtual_name = docname\n                 docname = docname_join(self.env.docname, docname)\n                 if url_re.match(ref) or ref == 'self':\n                     toctree['entries'].append((title, ref))\n+                elif (docname not in self.env.found_docs and\n+                        virtual_name in StandardDomain._virtual_doc_names):\n+                    # generated pages: genindex, modindex, search\n+                    toctree['entries'].append((title, virtual_name))\n                 elif docname not in self.env.found_docs:\n                     if excluded(self.env.doc2path(docname, False)):\n                         message = __('toctree contains reference to excluded document %r')\ndiff --git a/sphinx/domains/std.py b/sphinx/domains/std.py\nindex b0d21b492..1f35a9a3e 100644\n--- a/sphinx/domains/std.py\n+++ b/sphinx/domains/std.py\n@@ -584,6 +584,13 @@ class StandardDomain(Domain):\n         'doc':     XRefRole(warn_dangling=True, innernodeclass=nodes.inline),\n     }\n \n+    # virtual document name -> (docname, labelid, sectionname)\n+    _virtual_doc_names: Dict[str, Tuple[str, str, str]] = {\n+        'genindex': ('genindex', '', _('Index')),\n+        'modindex': ('py-modindex', '', _('Module Index')),\n+        'search':   ('search', '', _('Search Page')),\n+    }\n+\n     initial_data = {\n         'progoptions': {},      # (program, name) -> docname, labelid\n         'objects': {},          # (type, name) -> docname, labelid\ndiff --git a/sphinx/environment/adapters/toctree.py b/sphinx/environment/adapters/toctree.py\nindex 9678e3c7c..dfe385448 100644\n--- a/sphinx/environment/adapters/toctree.py\n+++ b/sphinx/environment/adapters/toctree.py\n@@ -139,6 +139,17 @@ class TocTree:\n                         item = nodes.list_item('', para)\n                         # don't show subitems\n                         toc = nodes.bullet_list('', item)\n+                    elif ref in StandardDomain._virtual_doc_names and ref not in self.env.tocs:\n+                        # generated pages: genindex, modindex, search\n+                        docname, _label, sectionname = StandardDomain._virtual_doc_names[ref]\n+                        if not title:\n+                            title = str(sectionname)\n+                        reference = nodes.reference('', '', internal=True,\n+                                                    refuri=docname, anchorname='',\n+                                                    *[nodes.Text(title)])\n+                        para = addnodes.compact_paragraph('', '', reference)\n+                        item = nodes.list_item('', para)\n+                        toc = nodes.bullet_list('', item)\n                     else:\n                         if ref in parents:\n                             logger.warning(__('circular toctree references '\ndiff --git a/sphinx/environment/collectors/toctree.py b/sphinx/environment/collectors/toctree.py\nindex 52a8fd8d1..05c26dfd1 100644\n--- a/sphinx/environment/collectors/toctree.py\n+++ b/sphinx/environment/collectors/toctree.py\n@@ -259,6 +259,9 @@ class TocTreeCollector(EnvironmentCollector):\n                         if url_re.match(subdocname) or subdocname == 'self':\n                             # don't mess with those\n                             continue\n+                        if subdocname not in env.found_docs:\n+                            # generated pages (genindex, modindex, search)\n+                            continue\n \n                         _walk_doc(subdocname, secnum)\n                 elif isinstance(subnode, nodes.Element):\n", "model": "claude-sonnet-5-5", "steps": 18, "finished": false, "patch_lines": 81, "candidates": [{"compile_ok": 0, "loc_hits": 2, "files": 4, "diff_lines": 81, "steps": 18}], "ms": 62394}
{"instance_id": "sphinx-doc__sphinx-11510", "model_name_or_path": "cain-anthropic-e124", "model_patch": "diff --git a/doc/extdev/appapi.rst b/doc/extdev/appapi.rst\nindex 78e88b063..34091985b 100644\n--- a/doc/extdev/appapi.rst\n+++ b/doc/extdev/appapi.rst\n@@ -260,6 +260,17 @@ Here is a more detailed list of these events.\n \n    .. versionadded:: 0.5\n \n+.. event:: include-read (app, relative_path, parent_docname, source)\n+\n+   Emitted when a file has been read with the :rst:dir:`include` directive.\n+   The *relative_path* argument is a :class:`~pathlib.Path` of the included\n+   file relative to the source directory, *parent_docname* is the name of the\n+   document containing the directive, and *source* is a list whose single\n+   element is the contents of the included file; replace it to transform the\n+   included text.\n+\n+   .. versionadded:: 7.2.5\n+\n .. event:: object-description-transform (app, domain, objtype, contentnode)\n \n    Emitted when an object description directive has run.  The *domain* and\ndiff --git a/sphinx/directives/other.py b/sphinx/directives/other.py\nindex 19f7c0a8d..96cbfb421 100644\n--- a/sphinx/directives/other.py\n+++ b/sphinx/directives/other.py\n@@ -1,10 +1,12 @@\n from __future__ import annotations\n \n import re\n+from pathlib import Path\n from typing import TYPE_CHECKING, Any, cast\n \n from docutils import nodes\n from docutils.parsers.rst import directives\n+from docutils.statemachine import StateMachine\n from docutils.parsers.rst.directives.admonitions import BaseAdmonition\n from docutils.parsers.rst.directives.misc import Class\n from docutils.parsers.rst.directives.misc import Include as BaseInclude\n@@ -369,6 +371,32 @@ class Include(BaseInclude, SphinxDirective):\n     \"\"\"\n \n     def run(self) -> list[Node]:\n+        # To properly emit \"include-read\" events from included RST text,\n+        # we must patch the ``StateMachine.insert_input()`` method.\n+        def _insert_input(include_lines: list[str], path: str) -> None:\n+            # Combine the lines back into text so that we can send it with\n+            # the event.  docutils adds two marker lines at the end; keep them\n+            # out of the event.\n+            text = '\\n'.join(include_lines[:-2])\n+\n+            arg = [text]\n+            try:\n+                relpath = Path(path).relative_to(self.env.srcdir)\n+            except ValueError:\n+                relpath = Path(path)\n+            self.env.events.emit('include-read', relpath, self.env.docname, arg)\n+            text = arg[0]\n+\n+            # Split back into lines and reattach the two marker lines\n+            include_lines = text.splitlines() + include_lines[-2:]\n+\n+            # Call the class implementation (the instance method is patched).\n+            StateMachine.insert_input(self.state_machine, include_lines, path)\n+\n+        # Only enable this patch if there are listeners for 'include-read'.\n+        if self.env.events.listeners.get('include-read'):\n+            self.state_machine.insert_input = _insert_input  # type: ignore[method-assign]\n+\n         if self.arguments[0].startswith('<') and \\\n            self.arguments[0].endswith('>'):\n             # docutils \"standard\" includes, do not do path processing\ndiff --git a/sphinx/events.py b/sphinx/events.py\nindex c3fdb37c1..dad33aa63 100644\n--- a/sphinx/events.py\n+++ b/sphinx/events.py\n@@ -38,6 +38,7 @@ core_events = {\n     'env-before-read-docs': 'env, docnames',\n     'env-check-consistency': 'env',\n     'source-read': 'docname, source text',\n+    'include-read': 'relative path, parent docname, source text',\n     'doctree-read': 'the doctree before being pickled',\n     'env-merge-info': 'env, read docnames, other env instance',\n     'missing-reference': 'env, node, contnode',\n", "model": "claude-sonnet-5-5", "steps": 13, "finished": true, "patch_lines": 84, "candidates": [{"compile_ok": 0, "loc_hits": 0, "files": 3, "diff_lines": 84, "steps": 13}], "ms": 105692}
{"instance_id": "sphinx-doc__sphinx-7440", "model_name_or_path": "cain-anthropic-e124", "model_patch": "diff --git a/sphinx/domains/std.py b/sphinx/domains/std.py\nindex d820cfe5c..d5e3cd18c 100644\n--- a/sphinx/domains/std.py\n+++ b/sphinx/domains/std.py\n@@ -305,7 +305,7 @@ def make_glossary_term(env: \"BuildEnvironment\", textnodes: Iterable[Node], index\n         term['ids'].append(node_id)\n \n     std = cast(StandardDomain, env.get_domain('std'))\n-    std.note_object('term', termtext.lower(), node_id, location=term)\n+    std.note_object('term', termtext, node_id, location=term)\n \n     # add an index entry too\n     indexnode = addnodes.index()\n@@ -565,7 +565,7 @@ class StandardDomain(Domain):\n         # links to tokens in grammar productions\n         'token':   TokenXRefRole(),\n         # links to terms in glossary\n-        'term':    XRefRole(lowercase=True, innernodeclass=nodes.inline,\n+        'term':    XRefRole(innernodeclass=nodes.inline,\n                             warn_dangling=True),\n         # links to headings or arbitrary labels\n         'ref':     XRefRole(lowercase=True, innernodeclass=nodes.inline,\n@@ -784,6 +784,8 @@ class StandardDomain(Domain):\n             resolver = self._resolve_doc_xref\n         elif typ == 'option':\n             resolver = self._resolve_option_xref\n+        elif typ == 'term':\n+            resolver = self._resolve_term_xref\n         elif typ == 'citation':\n             warnings.warn('pending_xref(domain=std, type=citation) is deprecated: %r' % node,\n                           RemovedInSphinx40Warning)\n@@ -923,6 +925,18 @@ class StandardDomain(Domain):\n         return make_refnode(builder, fromdocname, docname,\n                             labelid, contnode)\n \n+    def _resolve_term_xref(self, env: \"BuildEnvironment\", fromdocname: str,\n+                           builder: \"Builder\", typ: str, target: str,\n+                           node: pending_xref, contnode: Element) -> Element:\n+        result = self._resolve_obj_xref(env, fromdocname, builder, typ, target, node, contnode)\n+        if result:\n+            return result\n+        for objtype, term in self.objects:\n+            if objtype == 'term' and term.lower() == target.lower():\n+                docname, labelid = self.objects[objtype, term]\n+                return make_refnode(builder, fromdocname, docname, labelid, contnode)\n+        return None\n+\n     def _resolve_obj_xref(self, env: \"BuildEnvironment\", fromdocname: str,\n                           builder: \"Builder\", typ: str, target: str,\n                           node: pending_xref, contnode: Element) -> Element:\n@@ -953,7 +967,11 @@ class StandardDomain(Domain):\n         for objtype in self.object_types:\n             key = (objtype, target)\n             if objtype == 'term':\n-                key = (objtype, ltarget)\n+                if key not in self.objects:\n+                    for k in self.objects:\n+                        if k[0] == 'term' and k[1].lower() == ltarget:\n+                            key = k\n+                            break\n             if key in self.objects:\n                 docname, labelid = self.objects[key]\n                 results.append(('std:' + self.role_for_objtype(objtype),\n", "model": "claude-sonnet-5-5", "steps": 18, "finished": false, "patch_lines": 63, "candidates": [{"compile_ok": 0, "loc_hits": 1, "files": 1, "diff_lines": 63, "steps": 18}], "ms": 49996}
{"instance_id": "sphinx-doc__sphinx-7462", "model_name_or_path": "cain-anthropic-e124", "model_patch": "diff --git a/sphinx/domains/python.py b/sphinx/domains/python.py\nindex 3ca730e30..ab84c8c6b 100644\n--- a/sphinx/domains/python.py\n+++ b/sphinx/domains/python.py\n@@ -100,7 +100,8 @@ def _parse_annotation(annotation: str) -> List[Node]:\n             for elem in node.elts:\n                 result.extend(unparse(elem))\n                 result.append(addnodes.desc_sig_punctuation('', ', '))\n-            result.pop()\n+            if node.elts:\n+                result.pop()\n             result.append(addnodes.desc_sig_punctuation('', ']'))\n             return result\n         elif isinstance(node, ast.Module):\n@@ -114,6 +115,9 @@ def _parse_annotation(annotation: str) -> List[Node]:\n             result.append(addnodes.desc_sig_punctuation('', ']'))\n             return result\n         elif isinstance(node, ast.Tuple):\n+            if not node.elts:\n+                return [addnodes.desc_sig_punctuation('', '('),\n+                        addnodes.desc_sig_punctuation('', ')')]\n             result = []\n             for elem in node.elts:\n                 result.extend(unparse(elem))\n", "model": "claude-sonnet-5-5", "steps": 7, "finished": true, "patch_lines": 24, "candidates": [{"compile_ok": 0, "loc_hits": 0, "files": 1, "diff_lines": 24, "steps": 7}], "ms": 16627}
{"instance_id": "sphinx-doc__sphinx-7590", "model_name_or_path": "cain-anthropic-e124", "model_patch": "diff --git a/sphinx/domains/cpp.py b/sphinx/domains/cpp.py\nindex fe52d881d..8b97e0b89 100644\n--- a/sphinx/domains/cpp.py\n+++ b/sphinx/domains/cpp.py\n@@ -308,6 +308,7 @@ _operator_re = re.compile(r'''(?x)\n     |   [!<>=/*%+|&^~-]=?\n     |   (\\b(and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|xor|xor_eq)\\b)\n ''')\n+_udl_suffix_re = re.compile(r'[a-zA-Z_][a-zA-Z0-9_]*\\b')\n _fold_operator_re = re.compile(r'''(?x)\n         ->\\*    |    \\.\\*    |    \\,\n     |   (<<|>>)=?    |    &&    |    \\|\\|\n@@ -882,6 +883,26 @@ class ASTCharLiteral(ASTLiteral):\n         signode.append(nodes.Text(txt, txt))\n \n \n+class ASTUserDefinedLiteral(ASTLiteral):\n+    def __init__(self, literal: ASTLiteral, suffix: str) -> None:\n+        self.literal = literal\n+        self.suffix = suffix\n+\n+    def _stringify(self, transform: StringifyTransform) -> str:\n+        return transform(self.literal) + self.suffix\n+\n+    def get_id(self, version: int) -> str:\n+        # mangled as operator\"\" applied to the literal\n+        return \"clL_Zli%s%sE%s\" % (len(self.suffix), self.suffix,\n+                                   self.literal.get_id(version))\n+\n+    def describe_signature(self, signode: TextElement, mode: str,\n+                           env: \"BuildEnvironment\", symbol: \"Symbol\") -> None:\n+        self.literal.describe_signature(signode, mode, env, symbol)\n+        txt = self.suffix\n+        signode.append(nodes.Text(txt, txt))\n+\n+\n class ASTThisLiteral(ASTExpression):\n     def _stringify(self, transform: StringifyTransform) -> str:\n         return \"this\"\n@@ -4664,27 +4685,33 @@ class DefinitionParser(BaseParser):\n             if self.match(regex):\n                 while self.current_char in 'uUlLfF':\n                     self.pos += 1\n-                return ASTNumberLiteral(self.definition[pos:self.pos])\n+                return self._parse_literal_suffix(\n+                    ASTNumberLiteral(self.definition[pos:self.pos]))\n \n         string = self._parse_string()\n         if string is not None:\n-            return ASTStringLiteral(string)\n+            return self._parse_literal_suffix(ASTStringLiteral(string))\n \n         # character-literal\n         if self.match(char_literal_re):\n             prefix = self.last_match.group(1)  # may be None when no prefix\n             data = self.last_match.group(2)\n             try:\n-                return ASTCharLiteral(prefix, data)\n+                return self._parse_literal_suffix(ASTCharLiteral(prefix, data))\n             except UnicodeDecodeError as e:\n                 self.fail(\"Can not handle character literal. Internal error was: %s\" % e)\n             except UnsupportedMultiCharacterCharLiteral:\n                 self.fail(\"Can not handle character literal\"\n                           \" resulting in multiple decoded characters.\")\n \n-        # TODO: user-defined lit\n         return None\n \n+    def _parse_literal_suffix(self, literal: ASTLiteral) -> ASTLiteral:\n+        # user-defined-literal suffix: ud-suffix -> identifier\n+        if self.match(_udl_suffix_re):\n+            return ASTUserDefinedLiteral(literal, self.matched_text)\n+        return literal\n+\n     def _parse_fold_or_paren_expression(self) -> ASTExpression:\n         # \"(\" expression \")\"\n         # fold-expression\n", "model": "claude-sonnet-5-5", "steps": 15, "finished": true, "patch_lines": 77, "candidates": [{"compile_ok": 0, "loc_hits": 1, "files": 1, "diff_lines": 77, "steps": 15}], "ms": 46821}
{"instance_id": "sphinx-doc__sphinx-7748", "model_name_or_path": "cain-anthropic-e124", "model_patch": "diff --git a/sphinx/ext/autodoc/__init__.py b/sphinx/ext/autodoc/__init__.py\nindex f8e4be999..fa34e1dbf 100644\n--- a/sphinx/ext/autodoc/__init__.py\n+++ b/sphinx/ext/autodoc/__init__.py\n@@ -1044,31 +1044,33 @@ class DocstringSignatureMixin:\n                           RemovedInSphinx40Warning, stacklevel=2)\n         docstrings = self.get_doc()\n         self._new_docstrings = docstrings[:]\n+        self._signatures = []  # type: List[Tuple[str, str]]\n         result = None\n         for i, doclines in enumerate(docstrings):\n-            # no lines in docstring, no match\n-            if not doclines:\n-                continue\n-            # match first line of docstring against signature RE\n-            match = py_ext_sig_re.match(doclines[0])\n-            if not match:\n-                continue\n-            exmod, path, base, args, retann = match.groups()\n-            # the base name must match ours\n-            valid_names = [self.objpath[-1]]  # type: ignore\n-            if isinstance(self, ClassDocumenter):\n-                valid_names.append('__init__')\n-                if hasattr(self.object, '__mro__'):\n-                    valid_names.extend(cls.__name__ for cls in self.object.__mro__)\n-            if base not in valid_names:\n-                continue\n-            # re-prepare docstring to ignore more leading indentation\n-            tab_width = self.directive.state.document.settings.tab_width  # type: ignore\n-            self._new_docstrings[i] = prepare_docstring('\\n'.join(doclines[1:]),\n-                                                        tabsize=tab_width)\n-            result = args, retann\n-            # don't look any further\n-            break\n+            for j, line in enumerate(doclines):\n+                # no more lines or not a signature: stop in this docstring\n+                if not line:\n+                    break\n+                match = py_ext_sig_re.match(line)\n+                if not match:\n+                    break\n+                exmod, path, base, args, retann = match.groups()\n+                # the base name must match ours\n+                valid_names = [self.objpath[-1]]  # type: ignore\n+                if isinstance(self, ClassDocumenter):\n+                    valid_names.append('__init__')\n+                    if hasattr(self.object, '__mro__'):\n+                        valid_names.extend(cls.__name__ for cls in self.object.__mro__)\n+                if base not in valid_names:\n+                    break\n+                # re-prepare docstring to ignore more leading indentation\n+                tab_width = self.directive.state.document.settings.tab_width  # type: ignore\n+                self._new_docstrings[i] = prepare_docstring('\\n'.join(doclines[j + 1:]),\n+                                                            tabsize=tab_width)\n+                if result is None:\n+                    result = args, retann\n+                else:\n+                    self._signatures.append((args, retann))\n         return result\n \n     def get_doc(self, encoding: str = None, ignore: int = None) -> List[List[str]]:\n@@ -1088,7 +1090,12 @@ class DocstringSignatureMixin:\n             result = self._find_signature()\n             if result is not None:\n                 self.args, self.retann = result\n-        return super().format_signature(**kwargs)  # type: ignore\n+        sig = super().format_signature(**kwargs)  # type: ignore\n+        sigs = [sig]\n+        for args, retann in getattr(self, '_signatures', []):\n+            self.args, self.retann = args, retann\n+            sigs.append(super().format_signature(**kwargs))  # type: ignore\n+        return \"\\n\".join(sigs)\n \n \n class DocstringStripSignatureMixin(DocstringSignatureMixin):\n", "model": "claude-sonnet-5-5", "steps": 12, "finished": true, "patch_lines": 75, "candidates": [{"compile_ok": 0, "loc_hits": 1, "files": 1, "diff_lines": 82, "steps": 6}, {"compile_ok": 0, "loc_hits": 1, "files": 1, "diff_lines": 75, "steps": 12}], "ms": 71923}
{"instance_id": "sphinx-doc__sphinx-7889", "model_name_or_path": "cain-anthropic-e124", "model_patch": "diff --git a/sphinx/ext/autodoc/mock.py b/sphinx/ext/autodoc/mock.py\nindex 98a3a3a96..40258a135 100644\n--- a/sphinx/ext/autodoc/mock.py\n+++ b/sphinx/ext/autodoc/mock.py\n@@ -52,8 +52,8 @@ class _MockObject:\n     def __mro_entries__(self, bases: Tuple) -> Tuple:\n         return (self.__class__,)\n \n-    def __getitem__(self, key: str) -> \"_MockObject\":\n-        return _make_subclass(key, self.__display_name__, self.__class__)()\n+    def __getitem__(self, key: Any) -> \"_MockObject\":\n+        return _make_subclass(str(key), self.__display_name__, self.__class__)()\n \n     def __getattr__(self, key: str) -> \"_MockObject\":\n         return _make_subclass(key, self.__display_name__, self.__class__)()\n", "model": "claude-sonnet-5-5", "steps": 3, "finished": true, "patch_lines": 15, "candidates": [{"compile_ok": 0, "loc_hits": 0, "files": 1, "diff_lines": 24, "steps": 4}, {"compile_ok": 0, "loc_hits": 0, "files": 1, "diff_lines": 15, "steps": 3}], "ms": 18438}
{"instance_id": "sphinx-doc__sphinx-7985", "model_name_or_path": "cain-anthropic-e124", "model_patch": "diff --git a/sphinx/builders/linkcheck.py b/sphinx/builders/linkcheck.py\nindex dd5317087..5f1f16155 100644\n--- a/sphinx/builders/linkcheck.py\n+++ b/sphinx/builders/linkcheck.py\n@@ -35,6 +35,7 @@ from sphinx.util.requests import is_ssl_error\n \n logger = logging.getLogger(__name__)\n \n+uri_re = re.compile('[a-z]+://')\n \n DEFAULT_REQUEST_HEADERS = {\n     'Accept': 'text/html,application/xhtml+xml;q=0.9,*/*;q=0.8',\n@@ -210,10 +211,20 @@ class CheckExternalLinksBuilder(Builder):\n \n         def check() -> Tuple[str, str, int]:\n             # check for various conditions without bothering the network\n-            if len(uri) == 0 or uri.startswith(('#', 'mailto:', 'ftp:')):\n+            if len(uri) == 0 or uri.startswith(('#', 'mailto:')):\n                 return 'unchecked', '', 0\n             elif not uri.startswith(('http:', 'https:')):\n-                return 'local', '', 0\n+                if uri_re.match(uri):\n+                    # non supported URI schemes (ex. ftp)\n+                    return 'unchecked', '', 0\n+                else:\n+                    if path.exists(path.join(self.srcdir, uri)):\n+                        return 'working', '', 0\n+                    for rex in self.to_ignore:\n+                        if rex.match(uri):\n+                            return 'ignored', '', 0\n+                    self.broken[uri] = ''\n+                    return 'broken', '', 0\n             elif uri in self.good:\n                 return 'working', 'old', 0\n             elif uri in self.broken:\n", "model": "claude-sonnet-5-5", "steps": 10, "finished": true, "patch_lines": 35, "candidates": [{"compile_ok": 0, "loc_hits": 0, "files": 1, "diff_lines": 36, "steps": 7}, {"compile_ok": 0, "loc_hits": 0, "files": 1, "diff_lines": 35, "steps": 10}], "ms": 50387}
