victor-coding 0.7.1__tar.gz → 0.7.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (151) hide show
  1. {victor_coding-0.7.1 → victor_coding-0.7.2}/PKG-INFO +3 -3
  2. {victor_coding-0.7.1 → victor_coding-0.7.2}/README.md +1 -1
  3. {victor_coding-0.7.1 → victor_coding-0.7.2}/pyproject.toml +12 -21
  4. {victor_coding-0.7.1 → victor_coding-0.7.2}/tests/test_api_router_provider.py +2 -1
  5. {victor_coding-0.7.1 → victor_coding-0.7.2}/tests/test_extension_cache.py +3 -1
  6. victor_coding-0.7.2/tests/test_framework_lsp_adapter.py +198 -0
  7. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/__init__.py +20 -5
  8. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/assistant.py +43 -3
  9. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/codebase/architecture_analyzer.py +4 -1
  10. victor_coding-0.7.2/victor_coding/codebase/embeddings/__init__.py +56 -0
  11. victor_coding-0.7.2/victor_coding/codebase/embeddings/base.py +247 -0
  12. victor_coding-0.7.2/victor_coding/codebase/embeddings/chunker.py +466 -0
  13. victor_coding-0.7.2/victor_coding/codebase/embeddings/lancedb_provider.py +418 -0
  14. victor_coding-0.7.2/victor_coding/codebase/embeddings/models.py +530 -0
  15. victor_coding-0.7.2/victor_coding/codebase/embeddings/proximadb_provider.py +624 -0
  16. victor_coding-0.7.2/victor_coding/codebase/embeddings/registry.py +140 -0
  17. victor_coding-0.7.2/victor_coding/codebase/graph/__init__.py +31 -0
  18. victor_coding-0.7.2/victor_coding/codebase/graph/protocol.py +110 -0
  19. victor_coding-0.7.2/victor_coding/codebase/graph/registry.py +56 -0
  20. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/codebase/indexer.py +13 -3
  21. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/codebase/symbol_store.py +4 -1
  22. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/codebase/tree_sitter_analysis.py +17 -5
  23. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/codebase/tree_sitter_extractor.py +1 -3
  24. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/codebase_analyzer.py +46 -10
  25. victor_coding-0.7.2/victor_coding/compat/settings.py +113 -0
  26. victor_coding-0.7.2/victor_coding/completion/providers/__init__.py +25 -0
  27. victor_coding-0.7.2/victor_coding/completion/providers/ai.py +409 -0
  28. victor_coding-0.7.2/victor_coding/completion/providers/lsp.py +313 -0
  29. victor_coding-0.7.2/victor_coding/completion/providers/snippet.py +532 -0
  30. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/coverage/parser.py +1 -1
  31. victor_coding-0.7.2/victor_coding/coverage/parsers/__init__.py +40 -0
  32. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/editing/editor.py +9 -2
  33. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/handlers.py +3 -1
  34. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/languages/base.py +10 -1
  35. victor_coding-0.7.2/victor_coding/languages/plugins/__init__.py +130 -0
  36. victor_coding-0.7.2/victor_coding/languages/plugins/additional.py +3510 -0
  37. victor_coding-0.7.2/victor_coding/languages/plugins/config.py +319 -0
  38. victor_coding-0.7.2/victor_coding/languages/plugins/cpp.py +462 -0
  39. victor_coding-0.7.2/victor_coding/languages/plugins/go.py +296 -0
  40. victor_coding-0.7.2/victor_coding/languages/plugins/java.py +372 -0
  41. victor_coding-0.7.2/victor_coding/languages/plugins/javascript.py +372 -0
  42. victor_coding-0.7.2/victor_coding/languages/plugins/python.py +379 -0
  43. victor_coding-0.7.2/victor_coding/languages/plugins/rust.py +750 -0
  44. victor_coding-0.7.2/victor_coding/languages/plugins/typescript.py +378 -0
  45. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/lsp/client.py +82 -2
  46. victor_coding-0.7.2/victor_coding/lsp/framework_adapter.py +134 -0
  47. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/lsp/manager.py +20 -0
  48. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/middleware.py +7 -2
  49. victor_coding-0.7.2/victor_coding/native/__init__.py +132 -0
  50. victor_coding-0.7.2/victor_coding/performance/__init__.py +87 -0
  51. victor_coding-0.7.2/victor_coding/performance/factory.py +377 -0
  52. victor_coding-0.7.2/victor_coding/performance/protocols.py +350 -0
  53. victor_coding-0.7.2/victor_coding/performance/registry.py +456 -0
  54. victor_coding-0.7.2/victor_coding/performance/service_provider.py +181 -0
  55. victor_coding-0.7.2/victor_coding/performance/settings.py +234 -0
  56. victor_coding-0.7.2/victor_coding/performance/wrappers.py +408 -0
  57. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/refactor/manager.py +4 -1
  58. victor_coding-0.7.2/victor_coding/refactor/transforms/__init__.py +36 -0
  59. victor_coding-0.7.2/victor_coding/refactor/transforms/base.py +285 -0
  60. victor_coding-0.7.2/victor_coding/refactor/transforms/extract.py +464 -0
  61. victor_coding-0.7.2/victor_coding/refactor/transforms/rename.py +234 -0
  62. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/review/analyzers.py +5 -5
  63. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/teams/personas.py +3 -1
  64. victor_coding-0.7.2/victor_coding/tools/__init__.py +0 -0
  65. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/tools/code_search_tool.py +4 -1
  66. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding.egg-info/PKG-INFO +3 -3
  67. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding.egg-info/SOURCES.txt +41 -0
  68. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding.egg-info/requires.txt +1 -1
  69. {victor_coding-0.7.1 → victor_coding-0.7.2}/LICENSE +0 -0
  70. {victor_coding-0.7.1 → victor_coding-0.7.2}/setup.cfg +0 -0
  71. {victor_coding-0.7.1 → victor_coding-0.7.2}/tests/test_coding_capabilities.py +0 -0
  72. {victor_coding-0.7.1 → victor_coding-0.7.2}/tests/test_coding_vertical_rl.py +0 -0
  73. {victor_coding-0.7.1 → victor_coding-0.7.2}/tests/test_coding_vertical_teams.py +0 -0
  74. {victor_coding-0.7.1 → victor_coding-0.7.2}/tests/test_coding_vertical_workflows.py +0 -0
  75. {victor_coding-0.7.1 → victor_coding-0.7.2}/tests/test_enhanced_integration.py +0 -0
  76. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/api/__init__.py +0 -0
  77. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/api/router_provider.py +0 -0
  78. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/capabilities.py +0 -0
  79. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/codebase/__init__.py +0 -0
  80. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/codebase/ccg_builder.py +0 -0
  81. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/codebase/chunker.py +0 -0
  82. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/codebase/ignore_patterns.py +0 -0
  83. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/codebase/query_expander.py +0 -0
  84. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/codebase/symbol_extractor.py +0 -0
  85. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/codebase/symbol_resolver.py +0 -0
  86. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/codebase/tree_sitter_manager.py +0 -0
  87. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/codebase/tree_sitter_service.py +0 -0
  88. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/codebase/unified_extractor.py +0 -0
  89. {victor_coding-0.7.1/victor_coding/tools → victor_coding-0.7.2/victor_coding/compat}/__init__.py +0 -0
  90. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/completion/__init__.py +0 -0
  91. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/completion/manager.py +0 -0
  92. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/completion/protocol.py +0 -0
  93. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/completion/provider.py +0 -0
  94. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/completion/registry.py +0 -0
  95. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/composed_chains.py +0 -0
  96. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/conversation_enhanced.py +0 -0
  97. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/coverage/__init__.py +0 -0
  98. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/coverage/manager.py +0 -0
  99. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/coverage/protocol.py +0 -0
  100. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/coverage/visualizer.py +0 -0
  101. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/docgen/__init__.py +0 -0
  102. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/docgen/formatter.py +0 -0
  103. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/docgen/manager.py +0 -0
  104. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/docgen/parser.py +0 -0
  105. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/docgen/protocol.py +0 -0
  106. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/editing/__init__.py +0 -0
  107. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/enrichment.py +0 -0
  108. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/escape_hatches.py +0 -0
  109. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/languages/__init__.py +0 -0
  110. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/languages/manager.py +0 -0
  111. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/languages/registry.py +0 -0
  112. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/languages/tiers.py +0 -0
  113. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/lsp/__init__.py +0 -0
  114. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/lsp/config.py +0 -0
  115. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/mode_config.py +0 -0
  116. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/plugin.py +0 -0
  117. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/prompts.py +0 -0
  118. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/protocols.py +0 -0
  119. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/refactor/__init__.py +0 -0
  120. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/refactor/analyzer.py +0 -0
  121. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/refactor/protocol.py +0 -0
  122. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/review/__init__.py +0 -0
  123. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/review/manager.py +0 -0
  124. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/review/protocol.py +0 -0
  125. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/review/rules.py +0 -0
  126. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/rl/__init__.py +0 -0
  127. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/rl/config.py +0 -0
  128. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/rl/hooks.py +0 -0
  129. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/safety.py +0 -0
  130. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/safety_enhanced.py +0 -0
  131. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/service_provider.py +0 -0
  132. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/skills.py +0 -0
  133. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/teams/__init__.py +0 -0
  134. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/teams/specs.py +0 -0
  135. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/testgen/__init__.py +0 -0
  136. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/testgen/analyzer.py +0 -0
  137. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/testgen/generator.py +0 -0
  138. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/testgen/manager.py +0 -0
  139. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/testgen/protocol.py +0 -0
  140. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/tool_dependencies.py +0 -0
  141. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/tools/code_executor_tool.py +0 -0
  142. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/tools/code_intelligence_tool.py +0 -0
  143. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/tools/graph_tool.py +0 -0
  144. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/workflows/__init__.py +0 -0
  145. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/workflows/bugfix.py +0 -0
  146. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/workflows/feature.py +0 -0
  147. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/workflows/provider.py +0 -0
  148. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding/workflows/review.py +0 -0
  149. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding.egg-info/dependency_links.txt +0 -0
  150. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding.egg-info/entry_points.txt +0 -0
  151. {victor_coding-0.7.1 → victor_coding-0.7.2}/victor_coding.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: victor-coding
3
- Version: 0.7.1
3
+ Version: 0.7.2
4
4
  Summary: Coding vertical for Victor AI - Software development, debugging, and code generation
5
5
  Author-email: Vijaykumar Singh <singhvjd@gmail.com>
6
6
  Maintainer-email: Vijaykumar Singh <singhvjd@gmail.com>
@@ -24,7 +24,7 @@ Requires-Dist: numpy<2.3,>=1.24
24
24
  Requires-Dist: victor-codegraph[treesitter]>=0.1.0
25
25
  Requires-Dist: defusedxml<1.0,>=0.7
26
26
  Provides-Extra: runtime
27
- Requires-Dist: victor-ai<1.0,>=0.6.0; extra == "runtime"
27
+ Requires-Dist: victor-ai<1.0,>=0.7.6; extra == "runtime"
28
28
  Provides-Extra: native
29
29
  Provides-Extra: proximadb
30
30
  Requires-Dist: proximadb<0.3,>=0.2; extra == "proximadb"
@@ -106,4 +106,4 @@ Apache License 2.0 - see [LICENSE](LICENSE) for details.
106
106
 
107
107
  - **Victor AI**: https://github.com/vijay-singh/codingagent
108
108
  - **Documentation**: https://docs.victor.dev/verticals/coding
109
- - **Victor Registry**: https://github.com/vjsingh1984/victor-registry
109
+ - **Victor Registry**: https://github.com/anvai-labs/victor-registry
@@ -61,4 +61,4 @@ Apache License 2.0 - see [LICENSE](LICENSE) for details.
61
61
 
62
62
  - **Victor AI**: https://github.com/vijay-singh/codingagent
63
63
  - **Documentation**: https://docs.victor.dev/verticals/coding
64
- - **Victor Registry**: https://github.com/vjsingh1984/victor-registry
64
+ - **Victor Registry**: https://github.com/anvai-labs/victor-registry
@@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"
7
7
 
8
8
  [project]
9
9
  name = "victor-coding"
10
- version = "0.7.1"
10
+ version = "0.7.2"
11
11
  description = "Coding vertical for Victor AI - Software development, debugging, and code generation"
12
12
  readme = "README.md"
13
13
  requires-python = ">=3.11"
@@ -43,7 +43,7 @@ dependencies = [
43
43
 
44
44
  [project.optional-dependencies]
45
45
  runtime = [
46
- "victor-ai>=0.6.0,<1.0", # Runtime support - optional, contract-first architecture
46
+ "victor-ai>=0.7.6,<1.0", # Runtime support - optional, contract-first architecture
47
47
  ]
48
48
  native = [
49
49
  # Native extensions are handled by maturin
@@ -142,25 +142,16 @@ coding-hooks = "victor_coding.protocols:CodingHookProvider"
142
142
  [project.entry-points."victor.compaction.providers"]
143
143
  coding-compaction = "victor_coding.protocols:CodingCompactionProvider"
144
144
 
145
- [tool.setuptools]
146
- packages = [
147
- "victor_coding",
148
- "victor_coding.api",
149
- "victor_coding.codebase",
150
- "victor_coding.completion",
151
- "victor_coding.coverage",
152
- "victor_coding.docgen",
153
- "victor_coding.editing",
154
- "victor_coding.languages",
155
- "victor_coding.lsp",
156
- "victor_coding.refactor",
157
- "victor_coding.review",
158
- "victor_coding.rl",
159
- "victor_coding.teams",
160
- "victor_coding.testgen",
161
- "victor_coding.tools",
162
- "victor_coding.workflows",
163
- ]
145
+ [tool.setuptools.packages.find]
146
+ # Auto-discover all `victor_coding*` subpackages. An explicit `packages` list
147
+ # here previously omitted nested subpackages (languages.plugins,
148
+ # codebase.embeddings, codebase.graph, compat, completion.providers,
149
+ # coverage.parsers, native, performance, refactor.transforms), which silently
150
+ # broke the published wheel (ModuleNotFoundError) while editable installs
151
+ # worked — because the whole source tree is on sys.path under `-e`.
152
+ # Discovery makes the wheel match the source tree by construction.
153
+ include = ["victor_coding*"]
154
+ exclude = ["tests*", "docs*", "native*"]
164
155
 
165
156
  [tool.black]
166
157
  line-length = 100
@@ -22,7 +22,8 @@ else:
22
22
  get_fastapi_router_provider = None
23
23
 
24
24
  pytestmark = pytest.mark.skipif(
25
- not FASTAPI_AVAILABLE, reason="FastAPI not installed. Install with: pip install fastapi"
25
+ not FASTAPI_AVAILABLE,
26
+ reason="FastAPI not installed. Install with: pip install fastapi",
26
27
  )
27
28
 
28
29
 
@@ -655,7 +655,9 @@ class TestVerticalLoaderObservabilityEvents:
655
655
  assert "stats" in data
656
656
 
657
657
  @pytest.mark.asyncio
658
- async def test_discover_verticals_async_concurrent_cache_hit_telemetry_is_correct(self):
658
+ async def test_discover_verticals_async_concurrent_cache_hit_telemetry_is_correct(
659
+ self,
660
+ ):
659
661
  """Concurrent async discovery should report one miss and one cache hit."""
660
662
  loader = VerticalLoader()
661
663
  emitted = []
@@ -0,0 +1,198 @@
1
+ # Copyright 2026 Vijaykumar Singh <singhvjd@gmail.com>
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+
6
+ """Tests for the framework LSP adapter (victor-coding → FEP-0019 activation).
7
+
8
+ The adapter bridges victor-coding's ``LSPConnectionPool`` (display dicts +
9
+ ``victor_contracts`` types) to the LSP shape the FEP-0019 framework runtime
10
+ duck-types, so the diagnostic middleware + symbol context provider activate.
11
+ Uses a mock pool (no live language server).
12
+ """
13
+
14
+ from __future__ import annotations
15
+
16
+ from types import SimpleNamespace
17
+ from typing import List
18
+
19
+ import pytest
20
+
21
+ from victor_contracts.lsp_runtime import (
22
+ Diagnostic,
23
+ DiagnosticSeverity,
24
+ DocumentSymbol,
25
+ Position,
26
+ Range,
27
+ SymbolKind,
28
+ )
29
+
30
+
31
+ def _ds(name: str, kind: SymbolKind, children=None, detail=None) -> DocumentSymbol:
32
+ r = Range(start=Position(line=1, character=0), end=Position(line=9, character=0))
33
+ sel = Range(start=Position(line=1, character=6), end=Position(line=1, character=6))
34
+ return DocumentSymbol(
35
+ name=name,
36
+ kind=kind,
37
+ range=r,
38
+ selection_range=sel,
39
+ detail=detail,
40
+ children=children or [],
41
+ )
42
+
43
+
44
+ class _MockPool:
45
+ """Stand-in for LSPConnectionPool returning controlled data."""
46
+
47
+ def __init__(self, symbols=None):
48
+ self._symbols = symbols or []
49
+ self.calls: List[tuple] = []
50
+
51
+ async def open_document(self, file_path: str, text=None) -> bool:
52
+ self.calls.append(("open_document", file_path))
53
+ return True
54
+
55
+ async def update_document(self, file_path: str, text: str) -> bool:
56
+ self.calls.append(("update_document", file_path))
57
+ return True
58
+
59
+ def close_document(self, file_path: str) -> None:
60
+ self.calls.append(("close_document", file_path))
61
+
62
+ def get_diagnostics(self, file_path: str):
63
+ # Match the pool's real shape: severity as STRING, line 1-indexed.
64
+ return [
65
+ {
66
+ "line": 41,
67
+ "character": 5,
68
+ "message": "undefined name 'foo'",
69
+ "severity": "error",
70
+ "source": "pyright",
71
+ "code": None,
72
+ },
73
+ {
74
+ "line": 8,
75
+ "character": 0,
76
+ "message": "unused import",
77
+ "severity": "warning",
78
+ "source": "ruff",
79
+ "code": "F401",
80
+ },
81
+ ]
82
+
83
+ async def get_document_symbols(self, file_path: str):
84
+ self.calls.append(("get_document_symbols", file_path))
85
+ return self._symbols
86
+
87
+
88
+ def _adapter(pool=None):
89
+ from victor_coding.lsp.framework_adapter import FrameworkLSPAdapter
90
+
91
+ return FrameworkLSPAdapter(pool or _MockPool())
92
+
93
+
94
+ class TestDiagnosticsConversion:
95
+ def test_severity_name_to_enum_and_line_zero_indexed(self):
96
+ adapter = _adapter()
97
+ diags = adapter.get_diagnostics("a.py")
98
+ assert len(diags) == 2
99
+ assert all(isinstance(d, Diagnostic) for d in diags)
100
+ # "error" -> ERROR(1), line 41 (1-indexed) -> 40
101
+ assert diags[0].severity == DiagnosticSeverity.ERROR
102
+ assert int(diags[0].severity) == 1
103
+ assert diags[0].range.start.line == 40
104
+ assert diags[0].range.start.character == 5
105
+ assert diags[0].message == "undefined name 'foo'"
106
+ assert diags[0].source == "pyright"
107
+ # "warning" -> WARNING(2)
108
+ assert diags[1].severity == DiagnosticSeverity.WARNING
109
+ assert int(diags[1].severity) == 2
110
+ assert diags[1].code == "F401"
111
+
112
+ def test_unknown_severity_defaults_to_error(self):
113
+ pool = _MockPool()
114
+ pool.get_diagnostics = lambda fp: [
115
+ {"line": 1, "character": 0, "message": "x", "severity": "bogus"}
116
+ ]
117
+ diags = _adapter(pool).get_diagnostics("a.py")
118
+ assert diags[0].severity == DiagnosticSeverity.ERROR
119
+
120
+
121
+ class TestDocumentSymbols:
122
+ @pytest.mark.asyncio
123
+ async def test_symbols_returned_as_contracts_types(self):
124
+ pool = _MockPool(
125
+ symbols=[
126
+ _ds(
127
+ "SessionManager",
128
+ SymbolKind.CLASS,
129
+ detail="(store)",
130
+ children=[
131
+ _ds("__init__", SymbolKind.CONSTRUCTOR),
132
+ _ds("validate", SymbolKind.METHOD),
133
+ ],
134
+ ),
135
+ _ds("TOP_LEVEL_CONST", SymbolKind.CONSTANT),
136
+ ]
137
+ )
138
+ symbols = await _adapter(pool).get_document_symbols("a.py")
139
+ assert len(symbols) == 2
140
+ assert all(isinstance(s, DocumentSymbol) for s in symbols)
141
+ # kind is an IntEnum — the framework reads it as int.
142
+ assert symbols[0].name == "SessionManager"
143
+ assert int(symbols[0].kind) == int(SymbolKind.CLASS)
144
+ assert symbols[0].detail == "(store)"
145
+ assert len(symbols[0].children) == 2
146
+ assert int(symbols[0].children[0].kind) == int(SymbolKind.CONSTRUCTOR)
147
+
148
+ @pytest.mark.asyncio
149
+ async def test_empty_symbols(self):
150
+ symbols = await _adapter().get_document_symbols("a.py")
151
+ assert symbols == []
152
+
153
+
154
+ class TestPassthrough:
155
+ @pytest.mark.asyncio
156
+ async def test_open_and_update_delegate_to_pool(self):
157
+ pool = _MockPool()
158
+ adapter = _adapter(pool)
159
+ assert await adapter.open_document("a.py", "x = 1") is True
160
+ assert await adapter.update_document("a.py", "x = 2") is True
161
+ adapter.close_document("a.py")
162
+ names = [c[0] for c in pool.calls]
163
+ assert names == ["open_document", "update_document", "close_document"]
164
+
165
+
166
+ class TestGetLspWiring:
167
+ def test_coding_assistant_get_lsp_returns_adapter(self):
168
+ from victor_coding.assistant import CodingAssistant
169
+ from victor_coding.lsp.framework_adapter import FrameworkLSPAdapter
170
+
171
+ cap = CodingAssistant.get_lsp()
172
+ assert isinstance(cap, FrameworkLSPAdapter)
173
+
174
+
175
+ class TestEndToEndActivation:
176
+ """The real CodingAssistant flows through the framework's apply_lsp."""
177
+
178
+ def test_apply_lsp_wires_coding_assistant_capability(self):
179
+ from victor.framework.step_handlers import FrameworkStepHandler
180
+
181
+ from victor_coding.assistant import CodingAssistant
182
+ from victor_coding.lsp.framework_adapter import FrameworkLSPAdapter
183
+
184
+ class _Recorder:
185
+ def __init__(self) -> None:
186
+ self.set_calls: list = []
187
+
188
+ def set_lsp(self, capability) -> None:
189
+ self.set_calls.append(capability)
190
+
191
+ orch = _Recorder()
192
+ context = SimpleNamespace()
193
+ result = SimpleNamespace(add_info=lambda *a, **k: None, add_warning=lambda *a, **k: None)
194
+
195
+ FrameworkStepHandler().apply_lsp(orch, CodingAssistant, context, result)
196
+
197
+ assert len(orch.set_calls) == 1
198
+ assert isinstance(orch.set_calls[0], FrameworkLSPAdapter)
@@ -74,7 +74,10 @@ _EXPORTS = {
74
74
  "CodingPlugin": ("victor_coding.plugin", "CodingPlugin"),
75
75
  "plugin": ("victor_coding.plugin", "plugin"),
76
76
  "CodingMiddleware": ("victor_coding.middleware", "CodingMiddleware"),
77
- "CodeCorrectionMiddleware": ("victor_coding.middleware", "CodeCorrectionMiddleware"),
77
+ "CodeCorrectionMiddleware": (
78
+ "victor_coding.middleware",
79
+ "CodeCorrectionMiddleware",
80
+ ),
78
81
  "CodingSafetyExtension": ("victor_coding.safety", "CodingSafetyExtension"),
79
82
  "EnhancedCodingSafetyExtension": (
80
83
  "victor_coding.safety_enhanced",
@@ -87,10 +90,22 @@ _EXPORTS = {
87
90
  "CodingSafetyRules": ("victor_coding.safety_enhanced", "CodingSafetyRules"),
88
91
  "CodingContext": ("victor_coding.conversation_enhanced", "CodingContext"),
89
92
  "CodingPromptContributor": ("victor_coding.prompts", "CodingPromptContributor"),
90
- "CodingModeConfigProvider": ("victor_coding.mode_config", "CodingModeConfigProvider"),
91
- "CodingServiceProvider": ("victor_coding.service_provider", "CodingServiceProvider"),
92
- "CodingCapabilityProvider": ("victor_coding.capabilities", "CodingCapabilityProvider"),
93
- "get_coding_capabilities": ("victor_coding.capabilities", "get_coding_capabilities"),
93
+ "CodingModeConfigProvider": (
94
+ "victor_coding.mode_config",
95
+ "CodingModeConfigProvider",
96
+ ),
97
+ "CodingServiceProvider": (
98
+ "victor_coding.service_provider",
99
+ "CodingServiceProvider",
100
+ ),
101
+ "CodingCapabilityProvider": (
102
+ "victor_coding.capabilities",
103
+ "CodingCapabilityProvider",
104
+ ),
105
+ "get_coding_capabilities": (
106
+ "victor_coding.capabilities",
107
+ "get_coding_capabilities",
108
+ ),
94
109
  "create_coding_capability_loader": (
95
110
  "victor_coding.capabilities",
96
111
  "create_coding_capability_loader",
@@ -109,6 +109,31 @@ class CodingAssistant(VerticalBase):
109
109
 
110
110
  return list(CODING_SKILLS)
111
111
 
112
+ @classmethod
113
+ def get_lsp(cls):
114
+ """Expose victor-coding's LSP capability to the framework (FEP-0019).
115
+
116
+ Returns a ``FrameworkLSPAdapter`` over the shared ``LSPConnectionPool``.
117
+ The framework duck-types ``orchestrator.lsp``, and
118
+ ``FrameworkStepHandler.apply_lsp`` routes this object to
119
+ ``orchestrator.set_lsp`` during integration, activating the diagnostic
120
+ middleware (Phases 1+2) and the symbol-context provider (Phase 3).
121
+ Returns ``None`` if the pool/adapter cannot be built.
122
+ """
123
+ try:
124
+ from victor_coding.lsp.framework_adapter import FrameworkLSPAdapter
125
+ from victor_coding.lsp.manager import get_lsp_manager
126
+
127
+ return FrameworkLSPAdapter(get_lsp_manager())
128
+ except Exception:
129
+ import logging
130
+
131
+ logging.getLogger(__name__).debug(
132
+ "victor-coding LSP capability unavailable; FEP-0019 chain stays dormant",
133
+ exc_info=True,
134
+ )
135
+ return None
136
+
112
137
  # =========================================================================
113
138
  # Phase 3: Framework Capabilities
114
139
  # =========================================================================
@@ -224,14 +249,24 @@ You have access to 45+ tools. Use them efficiently to accomplish tasks."""
224
249
  "INITIAL": StageDefinition(
225
250
  name="INITIAL",
226
251
  description="Understanding the coding request",
227
- tools={ToolNames.READ, ToolNames.LS, ToolNames.OVERVIEW, ToolNames.GREP},
252
+ tools={
253
+ ToolNames.READ,
254
+ ToolNames.LS,
255
+ ToolNames.OVERVIEW,
256
+ ToolNames.GREP,
257
+ },
228
258
  keywords=["what", "how", "explain", "where", "show me"],
229
259
  next_stages={"PLANNING", "READING"},
230
260
  ),
231
261
  "PLANNING": StageDefinition(
232
262
  name="PLANNING",
233
263
  description="Planning the implementation approach",
234
- tools={ToolNames.GREP, ToolNames.PLAN, ToolNames.OVERVIEW, ToolNames.READ},
264
+ tools={
265
+ ToolNames.GREP,
266
+ ToolNames.PLAN,
267
+ ToolNames.OVERVIEW,
268
+ ToolNames.READ,
269
+ },
235
270
  keywords=["plan", "approach", "design", "architecture", "strategy"],
236
271
  next_stages={"READING", "EXECUTION"},
237
272
  ),
@@ -252,7 +287,12 @@ You have access to 45+ tools. Use them efficiently to accomplish tasks."""
252
287
  "ANALYSIS": StageDefinition(
253
288
  name="ANALYSIS",
254
289
  description="Analyzing code structure and dependencies",
255
- tools={ToolNames.LSP, ToolNames.SYMBOL, ToolNames.REFS, ToolNames.OVERVIEW},
290
+ tools={
291
+ ToolNames.LSP,
292
+ ToolNames.SYMBOL,
293
+ ToolNames.REFS,
294
+ ToolNames.OVERVIEW,
295
+ },
256
296
  keywords=["analyze", "review", "understand", "why", "how does"],
257
297
  next_stages={"EXECUTION", "PLANNING"},
258
298
  ),
@@ -167,7 +167,10 @@ class ArchitectureAnalyzer:
167
167
  def find_config_files(self) -> None:
168
168
  """Find important configuration files."""
169
169
  config_patterns = [
170
- ("pyproject.toml", "Project configuration, dependencies, and build settings"),
170
+ (
171
+ "pyproject.toml",
172
+ "Project configuration, dependencies, and build settings",
173
+ ),
171
174
  ("setup.py", "Legacy Python package setup"),
172
175
  ("setup.cfg", "Package configuration"),
173
176
  (".env.example", "Environment variable template"),
@@ -0,0 +1,56 @@
1
+ # Copyright 2025 Vijaykumar Singh <singhvjd@gmail.com>
2
+ # SPDX-License-Identifier: Apache-2.0
3
+
4
+ """Embedding system for Victor codebase intelligence.
5
+
6
+ This module combines:
7
+ 1. Generic vector storage infrastructure from victor-core (victor.storage.vector_stores)
8
+ 2. Code-specific AST-aware chunking (local to victor-coding)
9
+
10
+ For new code, prefer importing directly from victor.storage.vector_stores for
11
+ the generic embedding infrastructure:
12
+ from victor.storage.vector_stores import EmbeddingConfig, EmbeddingRegistry
13
+
14
+ The code-specific ASTAwareChunker remains in this module:
15
+ from victor_coding.codebase.embeddings.chunker import ASTAwareChunker
16
+ """
17
+
18
+ # Re-export from victor-core for backward compatibility
19
+ from victor.storage.vector_stores import (
20
+ # Base classes
21
+ BaseEmbeddingProvider,
22
+ BaseEmbeddingModel,
23
+ EmbeddingConfig,
24
+ EmbeddingModelConfig,
25
+ EmbeddingSearchResult,
26
+ # Embedding models
27
+ SentenceTransformerModel,
28
+ OllamaEmbeddingModel,
29
+ OpenAIEmbeddingModel,
30
+ CohereEmbeddingModel,
31
+ create_embedding_model,
32
+ # Registry
33
+ EmbeddingRegistry,
34
+ )
35
+
36
+ # Code-specific: AST-aware chunking (stays in victor-coding)
37
+ from victor_coding.codebase.embeddings.chunker import ASTAwareChunker
38
+
39
+ __all__ = [
40
+ # Base classes (from victor-core)
41
+ "BaseEmbeddingProvider",
42
+ "BaseEmbeddingModel",
43
+ "EmbeddingConfig",
44
+ "EmbeddingModelConfig",
45
+ "EmbeddingSearchResult",
46
+ # Embedding models (from victor-core)
47
+ "SentenceTransformerModel",
48
+ "OllamaEmbeddingModel",
49
+ "OpenAIEmbeddingModel",
50
+ "CohereEmbeddingModel",
51
+ "create_embedding_model",
52
+ # Registry (from victor-core)
53
+ "EmbeddingRegistry",
54
+ # Code-specific (local)
55
+ "ASTAwareChunker",
56
+ ]