From 01ea6559fe2b98441e7341072e55ff1e104ebaa8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 28 Oct 2026 10:38:09 +0000 Subject: [PATCH 1/3] build(deps-dev): bump ty from 0.0.84 to 0.0.91 Bumps [ty](https://github.com/astral-sh/ty) from 0.0.84 to 0.0.91. - [Release notes](https://github.com/astral-sh/ty/releases) - [Changelog](https://github.com/astral-sh/ty/blob/main/CHANGELOG.md) - [Commits](https://github.com/astral-sh/ty/compare/0.0.84...0.0.91) --- updated-dependencies: - dependency-name: ty dependency-version: 0.0.91 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- uv.lock | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/uv.lock b/uv.lock index 395f644f11..fdbc64823d 100644 --- a/uv.lock +++ b/uv.lock @@ -3923,27 +3923,27 @@ wheels = [ [[package]] name = "ty" -version = "0.0.84" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/e1/f6/34f8869c45ea87fe6a931ffa824b1fe4428167173543d92988d631add355/ty-0.0.84.tar.gz", hash = "sha256:0cefdb0cd5d399418dbe83c349ba605047b7dff815ae6f460c80e8522b40be67", size = 7409537, upload-time = "2026-09-24T13:16:24.367Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/aa/0c/600648778e1c79133ce6b6a5c4c2531ae16b90c9b30f5041b38b574f61b8/ty-0.0.84-py3-none-linux_armv6l.whl", hash = "sha256:868438e2b9abfc835dd5b5b07ed693db95d8348ac40e3228252511d63ae87695", size = 13935333, upload-time = "2026-09-24T13:15:31.167Z" }, - { url = "https://files.pythonhosted.org/packages/c5/3b/27f06f49945c36170765fad82076898039ae3873338e9865f876dd62f12c/ty-0.0.84-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:b00f39b521f0b559cde0f6abf8dd47213b513b04f33d58efeb9b98486a16bb17", size = 13511328, upload-time = "2026-09-24T13:15:34.446Z" }, - { url = "https://files.pythonhosted.org/packages/fc/b6/b12dd130e7f30141f0645614f454c925991cd389b1cc6c8284fd6bf32326/ty-0.0.84-py3-none-macosx_11_0_arm64.whl", hash = "sha256:8f78c2915567f2ee62ce0c24d86091bc76f81577677755e242d09951db588b9a", size = 13445445, upload-time = "2026-09-24T13:15:37.476Z" }, - { url = "https://files.pythonhosted.org/packages/44/96/f012de4b3c1d9a4773326621380d768b4d48c47e620dc012775c5e01c7d7/ty-0.0.84-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:61155cad0921e890d86d1d911a40b3a0e924ef4bdc3b4f3865a6c89c7e3012dc", size = 13471235, upload-time = "2026-09-24T13:15:40.64Z" }, - { url = "https://files.pythonhosted.org/packages/05/32/dca630f5f5353fa7bf67eebccf1549df99b16656d21071d0df6677c826a5/ty-0.0.84-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:417c3bf14947ed16b0b92976ab333c27915590354e96d4f581709068d3811355", size = 13680704, upload-time = "2026-09-24T13:15:43.817Z" }, - { url = "https://files.pythonhosted.org/packages/44/8d/33702c8f62f05ad45b33644fb914d483de6a0a7bc8e51884e9b8773e6d69/ty-0.0.84-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e06ef117759f654f5379efe9ae79bda8a186016c016f1023d05c34f8e15c1546", size = 14518923, upload-time = "2026-09-24T13:15:46.802Z" }, - { url = "https://files.pythonhosted.org/packages/c8/a1/da3246e6ef2ae0e842bca4058b25c54bee55ab058ffff4ee54e72517ec01/ty-0.0.84-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a05d1d53db8b64410ab38c6e32c5898510584869d1d5dd9c0605db81c9aef7df", size = 15027731, upload-time = "2026-09-24T13:15:49.755Z" }, - { url = "https://files.pythonhosted.org/packages/20/17/b0099098a560aeb4f9fde6c912f9a81622c3e44e6555e1fbe322b368ec31/ty-0.0.84-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b92400494ab855cfb1204ac1101e3f53b2d09a8e21d171758b2cf9acdab1809e", size = 14748260, upload-time = "2026-09-24T13:15:52.713Z" }, - { url = "https://files.pythonhosted.org/packages/60/d5/32cd67aedb271f006e716ad093806c96c5d7e2af86be8255469dbd3d76c8/ty-0.0.84-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:af17eb391ae3027fed9be1780bea555c2b8a25ba68e184c627b4981b2c9eaab7", size = 14205858, upload-time = "2026-09-24T13:15:55.677Z" }, - { url = "https://files.pythonhosted.org/packages/43/c4/638ac62ca2e8eca1b92e3e16273085744fada728b993500819b5c258ca15/ty-0.0.84-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:44cf06af0e7ec78ea6d8ff33a3450fc19627756a4fba681f7410d4e3ef63047a", size = 14573196, upload-time = "2026-09-24T13:15:59.165Z" }, - { url = "https://files.pythonhosted.org/packages/a6/f6/9ee81c5d8921e5fd5f10889ae563c95cd3272b31df2ada528919ca1cef6b/ty-0.0.84-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:c6e56b443ff9ba462e34bfbc1e582004c2719ed35f8f93a433744b0ba0afb2d9", size = 13480760, upload-time = "2026-09-24T13:16:02.313Z" }, - { url = "https://files.pythonhosted.org/packages/f6/83/fbe5d1177667ae16d84c3242846b143809c9cc09568b333e5a9b4d5908f6/ty-0.0.84-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:8b6562fcc48820c1030e2a4509ef2c14ef93043ca4860280074314ac3a825b95", size = 13696346, upload-time = "2026-09-24T13:16:05.391Z" }, - { url = "https://files.pythonhosted.org/packages/86/9a/1b4ac9ddc34cc0ab4624bc219825d66af52f1ad87f4778ad08ad03fa06d5/ty-0.0.84-py3-none-musllinux_1_2_i686.whl", hash = "sha256:dee7421451efcbd70f03e95a8f2c8d9e5ec3d35edcd27b4095ee00ee062abfc4", size = 13959410, upload-time = "2026-09-24T13:16:08.661Z" }, - { url = "https://files.pythonhosted.org/packages/c9/04/70e289437a67dfd686056ab4fd91880261a8233033a6a95d29393741fb97/ty-0.0.84-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:31e96307cf621babe969307dd657783d672e2d8bdbd06493710da635bf63fa07", size = 14350294, upload-time = "2026-09-24T13:16:11.865Z" }, - { url = "https://files.pythonhosted.org/packages/9c/f4/ae7dbd118425c850981d23efb850f0d9d7f6b8d2b852bde2767434f668b4/ty-0.0.84-py3-none-win32.whl", hash = "sha256:4bdc85f91cbaae35825f2b17bb4ac5de0563367875cb0f42b2bf07a1bf7ff2ba", size = 13176439, upload-time = "2026-09-24T13:16:15.049Z" }, - { url = "https://files.pythonhosted.org/packages/29/ec/994d87252f065dda5a500bc8afc726d18f6582d81d6f4ff1feb8a267c800/ty-0.0.84-py3-none-win_amd64.whl", hash = "sha256:71cc9aa7a7c89d4e12c6a814e9c0c3310ad5bee44efedbd6f5a42d91e9ac0f0d", size = 13962879, upload-time = "2026-09-24T13:16:18.191Z" }, - { url = "https://files.pythonhosted.org/packages/6d/1c/e6e91852b72566b1ab9aca504712857dfb89324c12092a5bd61d42d34427/ty-0.0.84-py3-none-win_arm64.whl", hash = "sha256:6c9d3718c4a0d318bc9c92af9b2aa85c3294e7dff54cf1d69ad79568f56516da", size = 13656453, upload-time = "2026-09-24T13:16:21.51Z" }, +version = "0.0.91" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/08/c0/9e26817a5c94d504aab30bffbbf53f836f4763dd0a947089246ff555eebe/ty-0.0.91.tar.gz", hash = "sha256:b9c434cc1e3b106b6b9353b78ef304d5904c82cf440abcafef7134270a22b41a", size = 8035848, upload-time = "2026-10-22T18:24:52.086Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/be/ad/0a850c1ca8e6e802e6b0f730f0d59c9769845b2fc956e3acd7f429b665f2/ty-0.0.91-py3-none-linux_armv6l.whl", hash = "sha256:5d39e6e485854838eb7fcdb747495f5b90283d58bce869c17445120fe0c7e40a", size = 14255787, upload-time = "2026-10-22T18:24:11.284Z" }, + { url = "https://files.pythonhosted.org/packages/33/87/9ccfa2d97b8b043e4d6fab10febc50ac7856b02cf7cd64910085db806bbe/ty-0.0.91-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:dcf953e25f90fbccf6cc27ef43fc4ef0961c89f54866e32cd1d7f24891b96084", size = 13822267, upload-time = "2026-10-22T18:24:14.31Z" }, + { url = "https://files.pythonhosted.org/packages/13/33/be8f62444c7840d1b0928c6d174540c0fe6b1b193ae9324c8249e8ed52b9/ty-0.0.91-py3-none-macosx_11_0_arm64.whl", hash = "sha256:78e3e66e88a9ae903afe0981ff9bd225d452ade2aeb070715842510dfcbf6de4", size = 12957620, upload-time = "2026-10-22T18:24:16.961Z" }, + { url = "https://files.pythonhosted.org/packages/31/9f/a742f273c065c4f5a054cc2b44076207136ff1cd346adfb23da38d8894d8/ty-0.0.91-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:89ecaf87b3d7b508f9ea1ef8715d4cf47942719659028c92fad819d82a82ccfa", size = 13746018, upload-time = "2026-10-22T18:24:19.221Z" }, + { url = "https://files.pythonhosted.org/packages/5a/a0/3eecf8717cbe4e05d6e02b53679aebad79f1bfcff6c9c03d7601cb7df5f9/ty-0.0.91-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:0ec8fe4243aab445abece38a2b8e9b3010230d5e6b3f4e15bfa811a914d99e73", size = 13993220, upload-time = "2026-10-22T18:24:21.328Z" }, + { url = "https://files.pythonhosted.org/packages/09/b0/fb3edee2857e97d85b6c735901469fd523cf6792382e4fbbb00b065c186c/ty-0.0.91-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:577701ec2a9cf7a50f6059069399b9437bb8af7a99df24012776e95d8a55831f", size = 14936911, upload-time = "2026-10-22T18:24:24.393Z" }, + { url = "https://files.pythonhosted.org/packages/b7/2c/82f29ee86f4171807af8ab2feaf4e51211143118a3e53e9da2c2e77eca7d/ty-0.0.91-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:fc683f49197d63ec47b2eaa9763ddb32dafb2a31190d938b9bb8ebecc5b25173", size = 15336384, upload-time = "2026-10-22T18:24:26.472Z" }, + { url = "https://files.pythonhosted.org/packages/0b/85/e2419b19577ead84b8afa9137c12eb4bde19f926423bfe01e615db12c52c/ty-0.0.91-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b8bb2784572fa22f77e417844936f6a9f831a6b0ba64749ca1065c407aefcd23", size = 15332319, upload-time = "2026-10-22T18:24:28.979Z" }, + { url = "https://files.pythonhosted.org/packages/83/06/dc28cea0796ee0268bf987d1d6f0f168605bec8898dbdbc7676049d2667b/ty-0.0.91-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f68bb6bfc8171910335a47c7e84070f28bbbc0326bcd6ef08fe3690d0509556b", size = 14600250, upload-time = "2026-10-22T18:24:31.359Z" }, + { url = "https://files.pythonhosted.org/packages/1e/71/83dd28e628698059ba6fe7081acafa7a8f65cfd90fe6573907ca8219d561/ty-0.0.91-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:63f268c80697d614d18e988476d2517177d66ec732ae104d86e57b60f197a416", size = 14812339, upload-time = "2026-10-22T18:24:33.689Z" }, + { url = "https://files.pythonhosted.org/packages/9d/5a/63c0eae2d5b02cef98a9b327b1a16b36287c140b3a7d2306ff7560177f9c/ty-0.0.91-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:b0f34630aa92e222d7754d66222d116f027025cb2b9ed66e1b4b73623de74e84", size = 13703060, upload-time = "2026-10-22T18:24:36.278Z" }, + { url = "https://files.pythonhosted.org/packages/47/ac/fd6d20d00202949d775043c5f70679f38d0e48ea30eeacbffaf6e0a9754e/ty-0.0.91-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:e62f8bbc17d481e01cce39bdfbe36beefda0478cb210e8045ef618d3f674a731", size = 14006236, upload-time = "2026-10-22T18:24:38.464Z" }, + { url = "https://files.pythonhosted.org/packages/fa/26/53dddd4f927dfaa73ea14cd71d97b4d92d685e365b5b037bac457e271403/ty-0.0.91-py3-none-musllinux_1_2_i686.whl", hash = "sha256:f8bf4514a383b13d7cf86eddb55f0eb9f356fc7efeae0de714ad4fe5fc54fee8", size = 14356612, upload-time = "2026-10-22T18:24:40.621Z" }, + { url = "https://files.pythonhosted.org/packages/89/40/ccebba145dd244b2f6058ce2e4a6ff34dea36d4a5b38dd7a6ae983b65a3b/ty-0.0.91-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:a6d93ab988c4c5ed92b52389b888d46ddede78e4646fe28db615bbeff89cdf82", size = 14674843, upload-time = "2026-10-22T18:24:43.325Z" }, + { url = "https://files.pythonhosted.org/packages/08/6f/8a7701adf1f539a893274358f12ba62773d5bb40920bfc53e0d852bfd576/ty-0.0.91-py3-none-win32.whl", hash = "sha256:b9f4bba8486a3d13babc11f8115369d0a0dc8bef127b7cf4f4c5eed9d4dbfa01", size = 13260545, upload-time = "2026-10-22T18:24:45.715Z" }, + { url = "https://files.pythonhosted.org/packages/fc/63/27c8051a72328ee81f47dace5e2c63e7db43bcae935db25a9dbd4d0e59b2/ty-0.0.91-py3-none-win_amd64.whl", hash = "sha256:5ac9eaf938e7fba4dd6c3358f852e6eb3127aa7bde0a76d9807c41f60ad73a29", size = 13759484, upload-time = "2026-10-22T18:24:48.111Z" }, + { url = "https://files.pythonhosted.org/packages/aa/a9/1f6c3694b7b33be4ae9a272f71a99a7dd27ec020c32a22049e9c0e79f576/ty-0.0.91-py3-none-win_arm64.whl", hash = "sha256:35820957639db1fb8c643273670967192c308038836005bdf3bfef111aff64a0", size = 13318343, upload-time = "2026-10-22T18:24:50.116Z" }, ] [[package]] From 1cc02c6f73a5399d3f204862c90bd533e2ec459e Mon Sep 17 00:00:00 2001 From: Vitali Avagyan Date: Wed, 28 Oct 2026 21:35:14 +0000 Subject: [PATCH 2/3] fix(types): clear the errors ty 0.0.91 reports ty 0.0.91 checks inherited attribute conflicts and mutable overrides more strictly, which turned five spots red: - ClassIngestMixin and JsTsModuleSystemMixin declared function_locations as a plain dict, so DefinitionProcessor's FunctionLocations narrowed a writable attribute. Declare the FunctionLocations it always holds. - JavaVariableAnalyzerMixin annotated two resolver methods with Callable parameter lists, which are positional-only and so no longer match the named parameters of JavaMethodResolverMixin's defs. Use `...` like the annotation above them. - _add_dependency built its relationship properties as dict[str, str], which invariance keeps from passing as a PropertyDict. Annotate it. - nn.Module declares forward as a writable Callable attribute, so a def narrows it (astral-sh/ty issue 4823). Bind the method to a forward attribute of that shape instead. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01ChfULxobdZjsLoanhnTc9f --- codebase_rag/parsers/class_ingest/mixin.py | 3 ++- codebase_rag/parsers/definition_processor.py | 4 +++- codebase_rag/parsers/java/variable_analyzer.py | 8 +++++--- codebase_rag/parsers/js_ts/module_system.py | 5 ++--- codebase_rag/unixcoder.py | 10 +++++++++- 5 files changed, 21 insertions(+), 9 deletions(-) diff --git a/codebase_rag/parsers/class_ingest/mixin.py b/codebase_rag/parsers/class_ingest/mixin.py index e5e9ee092f..88584c98b7 100644 --- a/codebase_rag/parsers/class_ingest/mixin.py +++ b/codebase_rag/parsers/class_ingest/mixin.py @@ -21,6 +21,7 @@ DeferredCppInherit, DeferredInherit, FunctionLocation, + FunctionLocations, FunctionSpanKey, NodeType, PendingTypeFact, @@ -387,7 +388,7 @@ class ClassIngestMixin: rust_impl_owner_module: dict[str, str] rehydrated_definition_paths: dict[str, str] go_interfaces: dict[str, go_ifaces.GoInterfaceDecl] - function_locations: dict[FunctionSpanKey, FunctionLocation] + function_locations: FunctionLocations cpp_definition_spans: dict[str, list[CppDefinitionSpan]] _deferred_forward_decls: list[_DeferredForwardDecl] _deferred_parent_links: list[DeferredParentLink] diff --git a/codebase_rag/parsers/definition_processor.py b/codebase_rag/parsers/definition_processor.py index 045ac76728..23c0302e8f 100644 --- a/codebase_rag/parsers/definition_processor.py +++ b/codebase_rag/parsers/definition_processor.py @@ -1049,7 +1049,9 @@ def _add_dependency( cs.NodeLabel.EXTERNAL_PACKAGE, {cs.KEY_NAME: dep_name} ) - rel_properties = {cs.KEY_VERSION_SPEC: dep_spec} if dep_spec else {} + rel_properties: PropertyDict = ( + {cs.KEY_VERSION_SPEC: dep_spec} if dep_spec else {} + ) if properties: rel_properties |= properties diff --git a/codebase_rag/parsers/java/variable_analyzer.py b/codebase_rag/parsers/java/variable_analyzer.py index d0362c9664..916d0ad102 100644 --- a/codebase_rag/parsers/java/variable_analyzer.py +++ b/codebase_rag/parsers/java/variable_analyzer.py @@ -114,10 +114,12 @@ class JavaVariableAnalyzerMixin: _lookup_in_progress: set[str] # Annotation only, never a def: this mixin precedes JavaMethodResolverMixin # in the MRO, so even an @abstractmethod stub here would SHADOW the real - # implementation and silently resolve every call to None. + # implementation and silently resolve every call to None. `...` because a + # Callable's parameters are positional-only, and ty rejects that as an + # override of the resolver's methods, whose parameters have names. _do_resolve_java_method_call: Callable[..., tuple[str, str] | None] - _declared_return_type_of: Callable[[str], str | None] - _resolve_java_method_return_type: Callable[[str, str], str | None] + _declared_return_type_of: Callable[..., str | None] + _resolve_java_method_return_type: Callable[..., str | None] @abstractmethod def _resolve_java_type_name(self, type_name: str, module_qn: str) -> str: ... diff --git a/codebase_rag/parsers/js_ts/module_system.py b/codebase_rag/parsers/js_ts/module_system.py index e6bc5d8c97..0466b2c33f 100644 --- a/codebase_rag/parsers/js_ts/module_system.py +++ b/codebase_rag/parsers/js_ts/module_system.py @@ -25,9 +25,8 @@ if TYPE_CHECKING: from ...services import IngestorProtocol from ...types_defs import ( - FunctionLocation, + FunctionLocations, FunctionRegistryTrieProtocol, - FunctionSpanKey, LanguageQueries, SimpleNameLookup, ) @@ -54,7 +53,7 @@ class JsTsModuleSystemMixin: simple_name_lookup: SimpleNameLookup module_qn_to_file_path: dict[str, Path] import_processor: ImportProcessor - function_locations: dict[FunctionSpanKey, FunctionLocation] + function_locations: FunctionLocations _processed_imports: set[str] @abstractmethod diff --git a/codebase_rag/unixcoder.py b/codebase_rag/unixcoder.py index bdcdf35968..6d6ce5f66c 100644 --- a/codebase_rag/unixcoder.py +++ b/codebase_rag/unixcoder.py @@ -2,6 +2,8 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT license. +from collections.abc import Callable + import torch from torch import nn from transformers import RobertaConfig, RobertaModel, RobertaTokenizer @@ -96,7 +98,7 @@ def decode(self, source_ids: torch.Tensor) -> list[list[str]]: predictions.append(prediction) return predictions - def forward(self, source_ids: torch.Tensor) -> tuple[torch.Tensor, torch.Tensor]: + def _embed(self, source_ids: torch.Tensor) -> tuple[torch.Tensor, torch.Tensor]: pad_id = self.config.pad_token_id assert pad_id is not None mask = source_ids.ne(pad_id) @@ -107,6 +109,12 @@ def forward(self, source_ids: torch.Tensor) -> tuple[torch.Tensor, torch.Tensor] ).unsqueeze(-1) return token_embeddings, sentence_embeddings + # nn.Module declares `forward` as a writable Callable attribute, and ty + # rejects a `def forward` as narrowing it (invalid-mutable-override, + # astral-sh/ty issue 4823). Assigning the method to an attribute of that + # declared shape keeps the override valid and the return type precise. + forward: Callable[..., tuple[torch.Tensor, torch.Tensor]] = _embed + def generate( self, source_ids: torch.Tensor, From 0bb12f16ceabae5a2a95d5f802c69e48fecdebd9 Mon Sep 17 00:00:00 2001 From: Vitali Avagyan Date: Wed, 28 Oct 2026 21:35:15 +0000 Subject: [PATCH 3/3] refactor(types): clear the warnings ty 0.0.91 adds ty 0.0.91 deprecates annotating a @contextmanager as returning Iterator and now sees check_isolation's cast to PropertyDict as redundant. Return Generator from every context manager and drop the cast. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01ChfULxobdZjsLoanhnTc9f --- codebase_rag/check_isolation.py | 4 ++-- codebase_rag/cli.py | 10 +++++----- codebase_rag/editing/transaction.py | 6 +++--- codebase_rag/embedded_graph/limits.py | 4 ++-- codebase_rag/mcp/server.py | 4 ++-- codebase_rag/sqlite_vectors.py | 4 ++-- codebase_rag/stack/health.py | 6 +++--- codebase_rag/sync_guard.py | 6 +++--- codebase_rag/sync_lock.py | 4 ++-- codebase_rag/tools/health_checker.py | 4 ++-- evals/go_build_variants.py | 6 +++--- evals/oracle_guard.py | 4 ++-- 12 files changed, 31 insertions(+), 31 deletions(-) diff --git a/codebase_rag/check_isolation.py b/codebase_rag/check_isolation.py index c7e3f4a6c4..63c42d356e 100644 --- a/codebase_rag/check_isolation.py +++ b/codebase_rag/check_isolation.py @@ -45,7 +45,7 @@ from collections.abc import Sequence from pathlib import Path -from typing import Protocol, cast +from typing import Protocol from . import constants as cs from . import cypher_queries as cq @@ -138,7 +138,7 @@ def _props(raw: object) -> PropertyDict | None: scalars), but it is the graph's own property set read back, so it is written back as it was read. """ - return cast(PropertyDict, dict(raw)) if isinstance(raw, dict) else None + return dict(raw) if isinstance(raw, dict) else None def _discard_pending(store: GraphStore) -> None: diff --git a/codebase_rag/cli.py b/codebase_rag/cli.py index 9a91d84e4c..05b9797b64 100644 --- a/codebase_rag/cli.py +++ b/codebase_rag/cli.py @@ -8,7 +8,7 @@ import sys import tempfile import time -from collections.abc import Callable, Coroutine, Iterable, Iterator +from collections.abc import Callable, Coroutine, Generator, Iterable from contextlib import ExitStack, contextmanager from fnmatch import fnmatch from functools import partial, wraps @@ -574,7 +574,7 @@ def _start_active_projects( @contextmanager -def _console_on_stderr() -> Iterator[None]: +def _console_on_stderr() -> Generator[None]: console = app_context.console app_context.console = terminal_aware_console(stderr=True) try: @@ -946,7 +946,7 @@ def _release_project_claim(batch_size: int, project_name: str, repo: Path) -> No @contextmanager def _project_claim( batch_size: int, project_name: str, repo: Path, *, clean: bool, assume_yes: bool -) -> Iterator[list[str] | None]: +) -> Generator[list[str] | None]: """Hold this sync's claim on its project name while the sync runs (#2411). Yields the roots `_mark_sync_incomplete` must still find on the Project. @@ -984,7 +984,7 @@ def _mark_sync_incomplete( @contextmanager -def _sync_lock_or_exit(repo: Path, project_name: str) -> Iterator[None]: +def _sync_lock_or_exit(repo: Path, project_name: str) -> Generator[None]: """Hold the checkout's sync lock for the whole sync, or stop first (#2441). Taken before the `--clean` wipe and the `:IncompleteRun` marker, so a @@ -2257,7 +2257,7 @@ def check_command( @contextmanager def _guarded_edit_reingest( ingestor: MemgraphIngestor, updater: "GraphUpdater", project_name: str, repo: Path -) -> Iterator[tuple[EditReingest, "WriteMarker"]]: +) -> Generator[tuple[EditReingest, "WriteMarker"]]: """The re-ingest an applied edit is measured through, behind the marker. Refuses before anything is planned when a run left the project's graph diff --git a/codebase_rag/editing/transaction.py b/codebase_rag/editing/transaction.py index 690eb39697..9196f17fa8 100644 --- a/codebase_rag/editing/transaction.py +++ b/codebase_rag/editing/transaction.py @@ -23,7 +23,7 @@ import shutil import tempfile import uuid -from collections.abc import Callable, Iterator +from collections.abc import Callable, Generator, Iterator from contextlib import contextmanager, nullcontext from datetime import UTC, datetime from pathlib import Path @@ -82,7 +82,7 @@ class TransactionError(ValueError): @contextmanager -def _repo_lock(root: Path) -> Iterator[EditLock]: +def _repo_lock(root: Path) -> Generator[EditLock]: """Hold the checkout's edit lock (see `EditLock`) until the block ends.""" with EditLock(root) as lock: lock.acquire() @@ -619,7 +619,7 @@ def _undo_newest(root: Path) -> TransactionOutcome | None: @contextmanager -def transaction(repo_root: Path) -> Iterator[EditTransaction]: +def transaction(repo_root: Path) -> Generator[EditTransaction]: """`with transaction(root) as tx: tx.stage(...)`; rolls back on exception.""" tx = EditTransaction(repo_root) try: diff --git a/codebase_rag/embedded_graph/limits.py b/codebase_rag/embedded_graph/limits.py index f12d4afe91..3f8dca2f0d 100644 --- a/codebase_rag/embedded_graph/limits.py +++ b/codebase_rag/embedded_graph/limits.py @@ -10,7 +10,7 @@ from __future__ import annotations import time -from collections.abc import Iterator +from collections.abc import Generator from contextlib import contextmanager from contextvars import ContextVar from dataclasses import dataclass @@ -39,7 +39,7 @@ def passed(self) -> bool: @contextmanager -def running_until(deadline: Deadline) -> Iterator[None]: +def running_until(deadline: Deadline) -> Generator[None]: token = _current.set(deadline) try: yield diff --git a/codebase_rag/mcp/server.py b/codebase_rag/mcp/server.py index 45573148cb..d094636b9f 100644 --- a/codebase_rag/mcp/server.py +++ b/codebase_rag/mcp/server.py @@ -4,7 +4,7 @@ import json import os import sys -from collections.abc import Iterator +from collections.abc import Generator from pathlib import Path from typing import TYPE_CHECKING @@ -229,7 +229,7 @@ def _failed_call(message: str) -> CallToolResult: @contextlib.contextmanager -def _service_lifecycle(ingestor: MemgraphIngestor) -> Iterator[None]: +def _service_lifecycle(ingestor: MemgraphIngestor) -> Generator[None]: """Manage shared service lifetimes for the MCP server. Opens the Memgraph ingestor connection and releases the vector store client diff --git a/codebase_rag/sqlite_vectors.py b/codebase_rag/sqlite_vectors.py index 193b9ca1ad..3b12cc1544 100644 --- a/codebase_rag/sqlite_vectors.py +++ b/codebase_rag/sqlite_vectors.py @@ -10,7 +10,7 @@ import json import sqlite3 import threading -from collections.abc import Iterator, Sequence +from collections.abc import Generator, Sequence from contextlib import contextmanager from pathlib import Path from typing import NamedTuple @@ -104,7 +104,7 @@ def __init__(self, conn: sqlite3.Connection) -> None: self._lock = threading.Lock() @contextmanager - def _write(self) -> Iterator[sqlite3.Connection]: + def _write(self) -> Generator[sqlite3.Connection]: # The connection's own context manager commits, or rolls back when # the block raises, so a failed batch leaves no half-written point. with self._lock, self._conn: diff --git a/codebase_rag/stack/health.py b/codebase_rag/stack/health.py index 06f97f9e61..c127f22d68 100644 --- a/codebase_rag/stack/health.py +++ b/codebase_rag/stack/health.py @@ -9,7 +9,7 @@ import time import urllib.error import urllib.request -from collections.abc import Iterator +from collections.abc import Generator from contextlib import contextmanager from http.client import HTTPMessage from typing import IO, NamedTuple, Protocol @@ -199,7 +199,7 @@ def _login_refused(report: MgclientProbeReport) -> bool: @contextmanager -def _stderr_into(runtime: _CRuntime, capture: IO[bytes]) -> Iterator[None]: +def _stderr_into(runtime: _CRuntime, capture: IO[bytes]) -> Generator[None]: try: saved: int | None = runtime.dup(cs.NATIVE_STDERR_FD) except OSError: @@ -232,7 +232,7 @@ def _stderr_into(runtime: _CRuntime, capture: IO[bytes]) -> Iterator[None]: @contextmanager -def _mgclient_stderr_to_debug_log() -> Iterator[None]: +def _mgclient_stderr_to_debug_log() -> Generator[None]: with _NATIVE_STDERR_LOCK, tempfile.TemporaryFile() as capture: # Text Python still buffers for the terminal belongs there, not in # the capture. diff --git a/codebase_rag/sync_guard.py b/codebase_rag/sync_guard.py index 96079dc8e3..0a4df3c285 100644 --- a/codebase_rag/sync_guard.py +++ b/codebase_rag/sync_guard.py @@ -13,7 +13,7 @@ import os import uuid -from collections.abc import Iterator +from collections.abc import Generator from contextlib import contextmanager from pathlib import Path from typing import NamedTuple @@ -119,7 +119,7 @@ def release_project_claim( @contextmanager def project_claim( ingestor: QueryProtocol, project_name: str, repo: Path, *, assume_yes: bool -) -> Iterator[list[str] | None]: +) -> Generator[list[str] | None]: """Claim the project on `ingestor` for as long as the writer runs (#2411). Raises `SyncRefusedError`, before anything is written, when the name is @@ -151,7 +151,7 @@ def sync_marker_params(project_name: str) -> dict[str, PropertyValue]: @contextmanager -def sync_owner() -> Iterator[dict[str, PropertyValue]]: +def sync_owner() -> Generator[dict[str, PropertyValue]]: """Who this sync is, for its marker; registered as running while held.""" token = uuid.uuid4().hex RUNNING_SYNC_TOKENS.add(token) diff --git a/codebase_rag/sync_lock.py b/codebase_rag/sync_lock.py index 95dde9e390..826d2ecb0c 100644 --- a/codebase_rag/sync_lock.py +++ b/codebase_rag/sync_lock.py @@ -60,7 +60,7 @@ import sys import threading import time -from collections.abc import Callable, Iterator +from collections.abc import Callable, Generator from contextlib import contextmanager from dataclasses import dataclass from pathlib import Path @@ -330,7 +330,7 @@ def _reenter(key: str) -> bool: @contextmanager def repo_sync_lock( repo_path: Path, project_name: str, *, wait: bool = False -) -> Iterator[None]: +) -> Generator[None]: """Hold the sync lock of the checkout at `repo_path` for the block. Raises `SyncInProgressError`, naming the holder, when another writer diff --git a/codebase_rag/tools/health_checker.py b/codebase_rag/tools/health_checker.py index 6ab34cda55..08074c371f 100644 --- a/codebase_rag/tools/health_checker.py +++ b/codebase_rag/tools/health_checker.py @@ -3,7 +3,7 @@ import importlib import os import subprocess -from collections.abc import Iterator +from collections.abc import Generator from contextlib import contextmanager import httpx @@ -27,7 +27,7 @@ @contextmanager -def _backend_connection() -> Iterator[ConnectionProtocol]: +def _backend_connection() -> Generator[ConnectionProtocol]: """Open a connection to whichever graph engine is configured. Health output must describe the backend actually in use, so this diff --git a/evals/go_build_variants.py b/evals/go_build_variants.py index 52c4f05d87..476238717b 100644 --- a/evals/go_build_variants.py +++ b/evals/go_build_variants.py @@ -48,7 +48,7 @@ import shutil import subprocess import tempfile -from collections.abc import Iterator +from collections.abc import Generator from contextlib import contextmanager from dataclasses import dataclass, field from graphlib import TopologicalSorter @@ -504,7 +504,7 @@ class BuildFacts(NamedTuple): @contextmanager -def _environment(**values: str) -> Iterator[None]: +def _environment(**values: str) -> Generator[None]: old = {key: os.environ.get(key) for key in values} os.environ.update(values) try: @@ -612,7 +612,7 @@ def index(root: Path, frontend: str) -> _StatefulIngestor: @contextmanager -def _host() -> Iterator[None]: +def _host() -> Generator[None]: yield diff --git a/evals/oracle_guard.py b/evals/oracle_guard.py index cd41f35a7c..4adc06fa2f 100644 --- a/evals/oracle_guard.py +++ b/evals/oracle_guard.py @@ -9,7 +9,7 @@ from __future__ import annotations -from collections.abc import Callable, Iterator +from collections.abc import Callable, Generator from contextlib import contextmanager import typer @@ -49,7 +49,7 @@ def require_oracle( @contextmanager -def oracle_unavailable_exits() -> Iterator[None]: +def oracle_unavailable_exits() -> Generator[None]: try: yield except NodeOracleUnavailable as unavailable: