repodna-engine 1.0.1__py3-none-any.whl

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 (173) hide show
  1. repodna/__init__.py +3 -0
  2. repodna/__main__.py +10 -0
  3. repodna/advisor/__init__.py +17 -0
  4. repodna/advisor/engine.py +502 -0
  5. repodna/advisor/models.py +101 -0
  6. repodna/agent/__init__.py +87 -0
  7. repodna/agent/context.py +558 -0
  8. repodna/agent/deltas.py +198 -0
  9. repodna/agent/evidence.py +134 -0
  10. repodna/agent/expansion.py +447 -0
  11. repodna/agent/localization.py +518 -0
  12. repodna/agent/models.py +695 -0
  13. repodna/agent/patch.py +378 -0
  14. repodna/agent/postflight.py +278 -0
  15. repodna/agent/preflight.py +336 -0
  16. repodna/agent/ranking.py +318 -0
  17. repodna/agent/repo_map.py +392 -0
  18. repodna/agent/safety.py +111 -0
  19. repodna/agent/service.py +574 -0
  20. repodna/agent/sessions.py +264 -0
  21. repodna/agent/task.py +660 -0
  22. repodna/agent/telemetry.py +101 -0
  23. repodna/agent/token_budget.py +231 -0
  24. repodna/api/__init__.py +1 -0
  25. repodna/api/agent_routes.py +248 -0
  26. repodna/api/app.py +2904 -0
  27. repodna/benchmarks/__init__.py +29 -0
  28. repodna/benchmarks/baselines.py +126 -0
  29. repodna/benchmarks/budget_bench.py +162 -0
  30. repodna/benchmarks/engine.py +418 -0
  31. repodna/benchmarks/evaluator.py +310 -0
  32. repodna/benchmarks/metrics.py +206 -0
  33. repodna/benchmarks/models.py +194 -0
  34. repodna/benchmarks/scalability.py +166 -0
  35. repodna/brain/__init__.py +46 -0
  36. repodna/brain/evidence.py +276 -0
  37. repodna/brain/extractor.py +1207 -0
  38. repodna/brain/indexer.py +766 -0
  39. repodna/brain/models.py +275 -0
  40. repodna/brain/multilang_extractors.py +889 -0
  41. repodna/brain/retrieval.py +469 -0
  42. repodna/brain/tracer.py +203 -0
  43. repodna/cli/__init__.py +1 -0
  44. repodna/cli/__main__.py +10 -0
  45. repodna/cli/agent_cmd.py +228 -0
  46. repodna/cli/installer.py +590 -0
  47. repodna/cli/main.py +2173 -0
  48. repodna/cli/plugin_cmd.py +130 -0
  49. repodna/cli/workspace_cmd.py +211 -0
  50. repodna/context/__init__.py +9 -0
  51. repodna/context/builder.py +379 -0
  52. repodna/context/models.py +133 -0
  53. repodna/contract/__init__.py +39 -0
  54. repodna/contract/evaluator.py +318 -0
  55. repodna/contract/loader.py +260 -0
  56. repodna/contract/models.py +185 -0
  57. repodna/core/__init__.py +1 -0
  58. repodna/core/analyzer.py +1424 -0
  59. repodna/diff/__init__.py +35 -0
  60. repodna/diff/engine.py +332 -0
  61. repodna/diff/models.py +117 -0
  62. repodna/diff/snapshot.py +248 -0
  63. repodna/ecosystem/__init__.py +27 -0
  64. repodna/ecosystem/contracts.py +129 -0
  65. repodna/ecosystem/doctor.py +253 -0
  66. repodna/git_insights/__init__.py +1 -0
  67. repodna/git_insights/analyzer.py +273 -0
  68. repodna/graph/__init__.py +1 -0
  69. repodna/graph/engine.py +562 -0
  70. repodna/guardian/__init__.py +17 -0
  71. repodna/guardian/engine.py +369 -0
  72. repodna/guardian/models.py +104 -0
  73. repodna/history/__init__.py +40 -0
  74. repodna/history/cache.py +240 -0
  75. repodna/history/diff.py +394 -0
  76. repodna/history/engine.py +557 -0
  77. repodna/history/evidence.py +160 -0
  78. repodna/history/models.py +258 -0
  79. repodna/history/timeline.py +164 -0
  80. repodna/intelligence/__init__.py +33 -0
  81. repodna/intelligence/models.py +165 -0
  82. repodna/intelligence/service.py +570 -0
  83. repodna/live/__init__.py +94 -0
  84. repodna/live/alerts.py +443 -0
  85. repodna/live/coordinator.py +351 -0
  86. repodna/live/diff.py +444 -0
  87. repodna/live/events.py +471 -0
  88. repodna/live/filtering.py +329 -0
  89. repodna/live/history.py +637 -0
  90. repodna/live/models.py +505 -0
  91. repodna/live/observer.py +653 -0
  92. repodna/live/reconciliation.py +253 -0
  93. repodna/live/session.py +1547 -0
  94. repodna/mcp/__init__.py +5 -0
  95. repodna/mcp/__main__.py +6 -0
  96. repodna/mcp/agent_tools.py +258 -0
  97. repodna/mcp/server.py +3283 -0
  98. repodna/mcp/workspace_tools.py +200 -0
  99. repodna/parsers/__init__.py +13 -0
  100. repodna/parsers/base.py +126 -0
  101. repodna/parsers/capabilities.py +361 -0
  102. repodna/parsers/project_metadata.py +232 -0
  103. repodna/parsers/resolver.py +621 -0
  104. repodna/parsers/treesitter_parser.py +830 -0
  105. repodna/passport/__init__.py +64 -0
  106. repodna/passport/generator.py +546 -0
  107. repodna/passport/migrator.py +139 -0
  108. repodna/passport/models.py +224 -0
  109. repodna/passport/validator.py +143 -0
  110. repodna/performance/__init__.py +89 -0
  111. repodna/performance/cache.py +1584 -0
  112. repodna/performance/identity.py +341 -0
  113. repodna/performance/incremental.py +317 -0
  114. repodna/performance/models.py +157 -0
  115. repodna/performance/parallel.py +291 -0
  116. repodna/plugins/__init__.py +47 -0
  117. repodna/plugins/evaluator.py +334 -0
  118. repodna/plugins/models.py +113 -0
  119. repodna/plugins/validator.py +256 -0
  120. repodna/quality/__init__.py +91 -0
  121. repodna/quality/complexity.py +352 -0
  122. repodna/quality/config.py +159 -0
  123. repodna/quality/debt.py +73 -0
  124. repodna/quality/duplicates.py +330 -0
  125. repodna/quality/engine.py +282 -0
  126. repodna/quality/impact.py +198 -0
  127. repodna/quality/models.py +427 -0
  128. repodna/quality/rules.py +364 -0
  129. repodna/quality/sarif.py +107 -0
  130. repodna/quality/security_signals.py +278 -0
  131. repodna/quality/test_mapping.py +271 -0
  132. repodna/quality/unused.py +201 -0
  133. repodna/reports/__init__.py +1 -0
  134. repodna/reports/exporter.py +374 -0
  135. repodna/rules/__init__.py +1 -0
  136. repodna/rules/health.py +436 -0
  137. repodna/schemas/__init__.py +1 -0
  138. repodna/schemas/models.py +348 -0
  139. repodna/security/__init__.py +1 -0
  140. repodna/security/safe_yaml.py +81 -0
  141. repodna/security/validators.py +583 -0
  142. repodna/skills/__init__.py +0 -0
  143. repodna/skills/repodna/SKILL.md +59 -0
  144. repodna/skills/repodna/__init__.py +0 -0
  145. repodna/skills/repodna/examples/workflows.md +85 -0
  146. repodna/skills/repodna/references/architecture-rules.md +26 -0
  147. repodna/storage/__init__.py +1 -0
  148. repodna/storage/workspace.py +199 -0
  149. repodna/webui/__init__.py +1 -0
  150. repodna/webui/assets/DependencyGraph-km_Qo-nG.js +43 -0
  151. repodna/webui/assets/HealthReportView-WVL39aNO.js +1 -0
  152. repodna/webui/assets/index-ByZ5e5pe.js +506 -0
  153. repodna/webui/assets/index-CDj3e8hw.css +1 -0
  154. repodna/webui/index.html +21 -0
  155. repodna/workspace/__init__.py +131 -0
  156. repodna/workspace/compatibility.py +317 -0
  157. repodna/workspace/context.py +175 -0
  158. repodna/workspace/contracts.py +369 -0
  159. repodna/workspace/federation.py +411 -0
  160. repodna/workspace/identity.py +202 -0
  161. repodna/workspace/impact.py +111 -0
  162. repodna/workspace/manifest.py +266 -0
  163. repodna/workspace/models.py +461 -0
  164. repodna/workspace/packages.py +494 -0
  165. repodna/workspace/policies.py +142 -0
  166. repodna/workspace/services.py +238 -0
  167. repodna/workspace/topology.py +316 -0
  168. repodna_engine-1.0.1.dist-info/METADATA +129 -0
  169. repodna_engine-1.0.1.dist-info/RECORD +173 -0
  170. repodna_engine-1.0.1.dist-info/WHEEL +5 -0
  171. repodna_engine-1.0.1.dist-info/entry_points.txt +2 -0
  172. repodna_engine-1.0.1.dist-info/licenses/LICENSE +21 -0
  173. repodna_engine-1.0.1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,165 @@
1
+ """Typed Pydantic v2 schemas for RepoDNA AI Repository Intelligence."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from datetime import datetime
6
+ from typing import Any
7
+
8
+ from pydantic import BaseModel, Field
9
+
10
+ from repodna.schemas.models import LanguageSupportLevel, RuleFinding, SeverityLevel, SymbolItem
11
+
12
+
13
+ class ModuleOverviewItem(BaseModel):
14
+ id: str
15
+ name: str
16
+ directory: str
17
+ language: str
18
+ support_level: LanguageSupportLevel
19
+ lines_code: int
20
+ fan_in: int
21
+ fan_out: int
22
+ instability: float
23
+ in_cycle: bool
24
+ is_hub: bool
25
+
26
+
27
+ class RepositoryOverview(BaseModel):
28
+ repo_name: str
29
+ target_display: str
30
+ analyzed_at: datetime
31
+ analysis_version: str = "0.3.0"
32
+ total_files: int
33
+ total_lines_code: int
34
+ total_size_bytes: int
35
+ health_score: float | None = None
36
+ health_grade: str
37
+ health_status: str
38
+ confidence: str
39
+ ast_loc_coverage_pct: float
40
+ ast_file_coverage_pct: float
41
+ cycle_count: int
42
+ cyclic_scc_count: int
43
+ hub_modules_count: int
44
+ primary_languages: list[str]
45
+ unverified_rules: list[str]
46
+ key_architectural_hubs: list[str]
47
+ summary_text: str
48
+
49
+
50
+ class PackageCluster(BaseModel):
51
+ name: str
52
+ file_count: int
53
+ files: list[str]
54
+ external_dependencies: list[str] = Field(default_factory=list)
55
+
56
+
57
+ class ArchitectureMap(BaseModel):
58
+ level: str # "overview", "clusters", "full"
59
+ total_modules: int
60
+ total_clusters: int
61
+ clusters: list[PackageCluster]
62
+ inter_cluster_edges: list[dict[str, Any]] = Field(default_factory=list)
63
+ summary_text: str
64
+
65
+
66
+ class RelevantModuleMatch(BaseModel):
67
+ file_id: str
68
+ language: str
69
+ support_level: LanguageSupportLevel
70
+ relevance_score: float
71
+ match_reasons: list[str]
72
+ matching_symbols: list[SymbolItem] = Field(default_factory=list)
73
+ fan_in: int = 0
74
+ fan_out: int = 0
75
+ in_cycle: bool = False
76
+ is_hub: bool = False
77
+
78
+
79
+ class RelevantModulesResponse(BaseModel):
80
+ query: str
81
+ total_matches: int
82
+ matches: list[RelevantModuleMatch]
83
+ summary_text: str
84
+
85
+
86
+ class ModuleDetails(BaseModel):
87
+ file_id: str
88
+ name: str
89
+ directory: str
90
+ language: str
91
+ support_level: LanguageSupportLevel
92
+ size_bytes: int
93
+ lines_total: int
94
+ lines_code: int
95
+ lines_comment: int
96
+ fan_in: int
97
+ fan_out: int
98
+ instability: float
99
+ in_cycle: bool
100
+ cycle_ids: list[str] = Field(default_factory=list)
101
+ is_hub: bool
102
+ is_orphan: bool
103
+ symbols: list[SymbolItem] = Field(default_factory=list)
104
+ dependencies_internal: list[str] = Field(default_factory=list)
105
+ dependents_internal: list[str] = Field(default_factory=list)
106
+ external_packages: list[str] = Field(default_factory=list)
107
+ health_findings: list[RuleFinding] = Field(default_factory=list)
108
+ secret_warnings: list[str] = Field(default_factory=list)
109
+ analysis_limitations: list[str] = Field(default_factory=list)
110
+ summary_text: str
111
+
112
+
113
+ class DependencyTraceItem(BaseModel):
114
+ source: str
115
+ target: str
116
+ import_names: list[str] = Field(default_factory=list)
117
+ line: int = 1
118
+ depth: int = 1
119
+ in_cycle: bool = False
120
+
121
+
122
+ class DependencyQueryResponse(BaseModel):
123
+ root_file: str
124
+ direction: str # "outgoing", "incoming", "both"
125
+ depth: int
126
+ total_items: int
127
+ items: list[DependencyTraceItem]
128
+ summary_text: str
129
+
130
+
131
+ class ArchitectureFindingsResponse(BaseModel):
132
+ total_findings: int
133
+ critical_count: int
134
+ warning_count: int
135
+ info_count: int
136
+ findings: list[RuleFinding]
137
+ unverified_rules: list[str]
138
+ summary_text: str
139
+
140
+
141
+ class AnalysisCoverageReport(BaseModel):
142
+ confidence: str
143
+ confidence_reason: str
144
+ ast_file_coverage_pct: float
145
+ ast_loc_coverage_pct: float
146
+ supported_languages: list[str]
147
+ partial_static_languages: list[str]
148
+ partial_static_files_count: int
149
+ unsupported_languages: list[str]
150
+ unsupported_files_count: int
151
+ skipped_files_count: int
152
+ unverified_rules: list[str]
153
+ honest_coverage_guarantee: str
154
+ summary_text: str
155
+
156
+
157
+ class ChangeImpactResponse(BaseModel):
158
+ target_files: list[str]
159
+ direct_dependents: list[str]
160
+ transitive_dependents: list[str]
161
+ impacted_cycles: list[str]
162
+ impact_severity: SeverityLevel
163
+ risk_factors: list[str]
164
+ affected_hubs: list[str]
165
+ summary_text: str