sourcecode 1.35.9__tar.gz → 1.35.10__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 (103) hide show
  1. {sourcecode-1.35.9 → sourcecode-1.35.10}/PKG-INFO +3 -3
  2. {sourcecode-1.35.9 → sourcecode-1.35.10}/README.md +2 -2
  3. {sourcecode-1.35.9 → sourcecode-1.35.10}/pyproject.toml +1 -1
  4. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/__init__.py +1 -1
  5. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/file_classifier.py +32 -4
  6. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/serializer.py +9 -2
  7. {sourcecode-1.35.9 → sourcecode-1.35.10}/.github/workflows/build-windows.yml +0 -0
  8. {sourcecode-1.35.9 → sourcecode-1.35.10}/.gitignore +0 -0
  9. {sourcecode-1.35.9 → sourcecode-1.35.10}/.ruff.toml +0 -0
  10. {sourcecode-1.35.9 → sourcecode-1.35.10}/CHANGELOG.md +0 -0
  11. {sourcecode-1.35.9 → sourcecode-1.35.10}/CONTRIBUTING.md +0 -0
  12. {sourcecode-1.35.9 → sourcecode-1.35.10}/LICENSE +0 -0
  13. {sourcecode-1.35.9 → sourcecode-1.35.10}/SECURITY.md +0 -0
  14. {sourcecode-1.35.9 → sourcecode-1.35.10}/raw +0 -0
  15. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/adaptive_scanner.py +0 -0
  16. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/architecture_analyzer.py +0 -0
  17. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/architecture_summary.py +0 -0
  18. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/ast_extractor.py +0 -0
  19. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/cache.py +0 -0
  20. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/canonical_ir.py +0 -0
  21. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/cir_graphs.py +0 -0
  22. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/classifier.py +0 -0
  23. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/cli.py +0 -0
  24. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/code_notes_analyzer.py +0 -0
  25. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/confidence_analyzer.py +0 -0
  26. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/context_scorer.py +0 -0
  27. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/context_summarizer.py +0 -0
  28. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/contract_model.py +0 -0
  29. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/contract_pipeline.py +0 -0
  30. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/coverage_parser.py +0 -0
  31. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/dependency_analyzer.py +0 -0
  32. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/detectors/__init__.py +0 -0
  33. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/detectors/base.py +0 -0
  34. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/detectors/csproj_parser.py +0 -0
  35. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/detectors/dart.py +0 -0
  36. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/detectors/dotnet.py +0 -0
  37. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/detectors/elixir.py +0 -0
  38. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/detectors/go.py +0 -0
  39. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/detectors/heuristic.py +0 -0
  40. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/detectors/hybrid.py +0 -0
  41. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/detectors/java.py +0 -0
  42. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/detectors/jvm_ext.py +0 -0
  43. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/detectors/nodejs.py +0 -0
  44. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/detectors/parsers.py +0 -0
  45. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/detectors/php.py +0 -0
  46. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/detectors/project.py +0 -0
  47. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/detectors/python.py +0 -0
  48. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/detectors/ruby.py +0 -0
  49. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/detectors/rust.py +0 -0
  50. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/detectors/systems.py +0 -0
  51. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/detectors/terraform.py +0 -0
  52. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/detectors/tooling.py +0 -0
  53. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/doc_analyzer.py +0 -0
  54. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/entrypoint_classifier.py +0 -0
  55. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/env_analyzer.py +0 -0
  56. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/error_schema.py +0 -0
  57. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/flow_analyzer.py +0 -0
  58. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/git_analyzer.py +0 -0
  59. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/graph_analyzer.py +0 -0
  60. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/license.py +0 -0
  61. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/mcp/__init__.py +0 -0
  62. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/mcp/onboarding/__init__.py +0 -0
  63. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/mcp/onboarding/applier.py +0 -0
  64. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/mcp/onboarding/backup.py +0 -0
  65. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/mcp/onboarding/detector.py +0 -0
  66. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/mcp/onboarding/planner.py +0 -0
  67. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/mcp/orchestrator.py +0 -0
  68. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/mcp/registry.py +0 -0
  69. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/mcp/runner.py +0 -0
  70. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/mcp/server.py +0 -0
  71. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/mcp_nudge.py +0 -0
  72. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/metrics_analyzer.py +0 -0
  73. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/output_budget.py +0 -0
  74. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/path_filters.py +0 -0
  75. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/pr_comment_renderer.py +0 -0
  76. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/prepare_context.py +0 -0
  77. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/progress.py +0 -0
  78. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/ranking_engine.py +0 -0
  79. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/redactor.py +0 -0
  80. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/relevance_scorer.py +0 -0
  81. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/repo_classifier.py +0 -0
  82. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/repository_ir.py +0 -0
  83. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/ris.py +0 -0
  84. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/runtime_classifier.py +0 -0
  85. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/scanner.py +0 -0
  86. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/schema.py +0 -0
  87. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/semantic_analyzer.py +0 -0
  88. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/spring_event_topology.py +0 -0
  89. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/spring_findings.py +0 -0
  90. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/spring_impact.py +0 -0
  91. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/spring_model.py +0 -0
  92. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/spring_security_audit.py +0 -0
  93. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/spring_semantic.py +0 -0
  94. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/spring_tx_analyzer.py +0 -0
  95. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/summarizer.py +0 -0
  96. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/telemetry/__init__.py +0 -0
  97. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/telemetry/config.py +0 -0
  98. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/telemetry/consent.py +0 -0
  99. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/telemetry/events.py +0 -0
  100. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/telemetry/filters.py +0 -0
  101. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/telemetry/transport.py +0 -0
  102. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/tree_utils.py +0 -0
  103. {sourcecode-1.35.9 → sourcecode-1.35.10}/src/sourcecode/workspace.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sourcecode
3
- Version: 1.35.9
3
+ Version: 1.35.10
4
4
  Summary: Persistent structural context and ultra-fast repeated analysis for AI coding agents
5
5
  License-File: LICENSE
6
6
  Keywords: agents,ai,codebase,context,developer-tools,llm
@@ -39,7 +39,7 @@ Description-Content-Type: text/markdown
39
39
 
40
40
  **Persistent structural context and ultra-fast repeated analysis for AI coding agents.**
41
41
 
42
- ![Version](https://img.shields.io/badge/version-1.35.5-blue)
42
+ ![Version](https://img.shields.io/badge/version-1.35.10-blue)
43
43
  ![Python](https://img.shields.io/badge/python-3.10%2B-green)
44
44
 
45
45
  ---
@@ -113,7 +113,7 @@ pipx install sourcecode
113
113
 
114
114
  ```bash
115
115
  sourcecode version
116
- # sourcecode 1.35.5
116
+ # sourcecode 1.35.10
117
117
  ```
118
118
 
119
119
  ---
@@ -2,7 +2,7 @@
2
2
 
3
3
  **Persistent structural context and ultra-fast repeated analysis for AI coding agents.**
4
4
 
5
- ![Version](https://img.shields.io/badge/version-1.35.5-blue)
5
+ ![Version](https://img.shields.io/badge/version-1.35.10-blue)
6
6
  ![Python](https://img.shields.io/badge/python-3.10%2B-green)
7
7
 
8
8
  ---
@@ -76,7 +76,7 @@ pipx install sourcecode
76
76
 
77
77
  ```bash
78
78
  sourcecode version
79
- # sourcecode 1.35.5
79
+ # sourcecode 1.35.10
80
80
  ```
81
81
 
82
82
  ---
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "sourcecode"
7
- version = "1.35.9"
7
+ version = "1.35.10"
8
8
  description = "Persistent structural context and ultra-fast repeated analysis for AI coding agents"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"
@@ -1,3 +1,3 @@
1
1
  """sourcecode — Deterministic codebase context maps for AI coding agents."""
2
2
 
3
- __version__ = "1.35.9"
3
+ __version__ = "1.35.10"
@@ -83,18 +83,30 @@ _DEF_RE = re.compile(r"\b(class|def|function|const|export\s+class|interface|type
83
83
  _JAVA_ANNOTATION_RE = re.compile(
84
84
  r'@(RestController|Controller|Service|Repository|Mapper|Entity|Data|Configuration'
85
85
  r'|EnableWebSecurity|ControllerAdvice|Transactional'
86
+ r'|RequestMapping|GetMapping|PostMapping|PutMapping|DeleteMapping|PatchMapping' # HTTP mappings
86
87
  r'|Path|Provider' # JAX-RS
87
88
  r'|ApplicationScoped|RequestScoped|SessionScoped|Singleton|Dependent' # CDI
88
89
  r'|Inject|Named' # CDI DI
89
90
  r')\b'
90
91
  )
91
92
 
93
+ # Handler-count regex — method-level only (Get/Post/Put/Delete/Patch, not class-level RequestMapping)
94
+ _HANDLER_MAPPING_RE = re.compile(r'@(Get|Post|Put|Delete|Patch)Mapping\b')
95
+
92
96
  # (annotation_set, category, relevance, why_template)
93
97
  # Checked in priority order; first match wins.
98
+ # @Controller rules use 0.80 base; _count_handlers() bonus in classify() differentiates
99
+ # by HTTP handler count. @RestController stays at 0.90 (no boost — already high tier).
94
100
  _JAVA_STEREOTYPE_RULES: list[tuple[frozenset, str, float, str]] = [
95
101
  (frozenset({"EnableWebSecurity"}), "security", 0.85, "Spring Security configuration"),
96
102
  (frozenset({"RestController"}), "api_endpoint", 0.90, "Spring REST controller — defines HTTP API surface"),
97
103
  (frozenset({"Controller", "RequestMapping"}), "api_endpoint", 0.80, "Spring MVC controller"),
104
+ (frozenset({"Controller", "GetMapping"}), "api_endpoint", 0.80, "Spring MVC controller"),
105
+ (frozenset({"Controller", "PostMapping"}), "api_endpoint", 0.80, "Spring MVC controller"),
106
+ (frozenset({"Controller", "PutMapping"}), "api_endpoint", 0.80, "Spring MVC controller"),
107
+ (frozenset({"Controller", "DeleteMapping"}), "api_endpoint", 0.80, "Spring MVC controller"),
108
+ (frozenset({"Controller", "PatchMapping"}), "api_endpoint", 0.80, "Spring MVC controller"),
109
+ (frozenset({"Controller"}), "api_endpoint", 0.72, "Spring MVC controller"),
98
110
  (frozenset({"ControllerAdvice"}), "exception_handler", 0.75, "Spring @ControllerAdvice — cross-cutting exception handling"),
99
111
  # JAX-RS
100
112
  (frozenset({"Path"}), "api_endpoint", 0.85, "JAX-RS resource — defines REST endpoint surface"),
@@ -178,15 +190,27 @@ class FileClassifier:
178
190
  if norm in self.cli_entry_paths:
179
191
  return FileClassification(norm, "cli_entrypoint", "high", 1.0, "declared production CLI entrypoint", ["entry_points"])
180
192
 
181
- if norm in self.production_entry_paths:
182
- return FileClassification(norm, "runtime_core", "high", 0.95, "declared production runtime entrypoint", ["entry_points"])
183
-
184
- # Java Spring stereotype detection (Java/Kotlin files only)
193
+ # Java Spring stereotype detection runs BEFORE the generic entrypoint fallback
194
+ # so that controllers and services keep their content-based category and relevance
195
+ # rather than collapsing to runtime_core/0.95 for every declared entry point.
185
196
  if suffix in {".java", ".kt"}:
186
197
  java_class = self._classify_java_stereotype(norm, content)
187
198
  if java_class is not None:
199
+ if java_class.category == "api_endpoint" and java_class.relevance < 0.85:
200
+ # Boost @Controller-tier (base 0.72–0.80) by handler count so controllers
201
+ # with more HTTP handlers rank above single-endpoint system controllers.
202
+ # @RestController (0.90) and JAX-RS Path (0.85) are already high-tier — skip.
203
+ h = self._count_handlers(content)
204
+ if h > 0:
205
+ bonus = min(h * 0.03, 0.12)
206
+ java_class.relevance = round(min(0.95, java_class.relevance + bonus), 3)
207
+ if norm in self.production_entry_paths and "entry_points" not in java_class.evidence:
208
+ java_class.evidence = list(java_class.evidence) + ["entry_points"]
188
209
  return java_class
189
210
 
211
+ if norm in self.production_entry_paths:
212
+ return FileClassification(norm, "runtime_core", "high", 0.95, "declared production runtime entrypoint", ["entry_points"])
213
+
190
214
  # Fix 4: call _matched_imports once per category instead of twice
191
215
  # (_has_any_import was calling _matched_imports and discarding the result,
192
216
  # then the caller invoked it again to get the evidence — halving throughput).
@@ -262,6 +286,10 @@ class FileClassifier:
262
286
  return True
263
287
  return "@dataclass" in content or "pydantic" in content.lower()
264
288
 
289
+ def _count_handlers(self, content: str) -> int:
290
+ """Count method-level HTTP handler annotations as proxy for controller complexity."""
291
+ return len(_HANDLER_MAPPING_RE.findall(content))
292
+
265
293
  def _sample(self, imports: list[str]) -> list[str]:
266
294
  return [f"import:{imp}" for imp in imports[:4]]
267
295
 
@@ -954,12 +954,19 @@ def _file_relevance(sm: SourceMap, *, limit: int = _FILE_RELEVANCE_LIMIT) -> lis
954
954
  runtime_impact, dep_centrality, fw_signal, change_sev, test_risk
955
955
  )
956
956
 
957
- # T1 override: confirmed production entrypoints 0.92–1.00.
958
- # Only runtime_core / cli_entrypoint categories justify scores 0.92.
957
+ # T1 override: confirmed production entrypoints use content-evidence relevance as score.
958
+ # runtime_core/cli_entrypoint: 0.92 floor (bootstrap + non-Java entries).
959
+ # api_endpoint/security/exception_handler: stereotype relevance directly (0.70 floor)
960
+ # so that controllers differentiate by annotation table + handler-count bonus rather
961
+ # than collapsing to a flat 0.95.
959
962
  if path in entry_paths and cat in ("runtime_core", "cli_entrypoint"):
960
963
  score_val = round(
961
964
  min(1.0, max(0.92, file_class.relevance if file_class else 0.92)), 3
962
965
  )
966
+ elif path in entry_paths and cat in ("api_endpoint", "security", "exception_handler"):
967
+ score_val = round(
968
+ min(1.0, max(0.70, file_class.relevance if file_class else 0.75)), 3
969
+ )
963
970
  else:
964
971
  score_val = round(formula_raw, 3)
965
972
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes