rootcoz 4.0.0__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 (273) hide show
  1. rootcoz-4.0.0/.coderabbit.yaml +3 -0
  2. rootcoz-4.0.0/.dockerignore +40 -0
  3. rootcoz-4.0.0/.env.example +125 -0
  4. rootcoz-4.0.0/.flake8 +14 -0
  5. rootcoz-4.0.0/.git +1 -0
  6. rootcoz-4.0.0/.gitignore +63 -0
  7. rootcoz-4.0.0/.gitleaks.toml +20 -0
  8. rootcoz-4.0.0/.markdownlint.yaml +5 -0
  9. rootcoz-4.0.0/.pre-commit-config.yaml +71 -0
  10. rootcoz-4.0.0/AGENTS.md +1 -0
  11. rootcoz-4.0.0/CLAUDE.md +185 -0
  12. rootcoz-4.0.0/Dockerfile +123 -0
  13. rootcoz-4.0.0/OWNERS +4 -0
  14. rootcoz-4.0.0/PKG-INFO +26 -0
  15. rootcoz-4.0.0/README.md +138 -0
  16. rootcoz-4.0.0/config.example.toml +62 -0
  17. rootcoz-4.0.0/docker-compose.yaml +135 -0
  18. rootcoz-4.0.0/docs/.nojekyll +0 -0
  19. rootcoz-4.0.0/docs/analyze-a-jenkins-job.html +526 -0
  20. rootcoz-4.0.0/docs/analyze-a-jenkins-job.md +148 -0
  21. rootcoz-4.0.0/docs/analyze-your-first-jenkins-job.html +480 -0
  22. rootcoz-4.0.0/docs/analyze-your-first-jenkins-job.md +174 -0
  23. rootcoz-4.0.0/docs/assets/callouts.js +26 -0
  24. rootcoz-4.0.0/docs/assets/codelabels.js +75 -0
  25. rootcoz-4.0.0/docs/assets/copy.js +41 -0
  26. rootcoz-4.0.0/docs/assets/github.js +38 -0
  27. rootcoz-4.0.0/docs/assets/scrollspy.js +49 -0
  28. rootcoz-4.0.0/docs/assets/search.js +125 -0
  29. rootcoz-4.0.0/docs/assets/style.css +1545 -0
  30. rootcoz-4.0.0/docs/assets/theme.js +22 -0
  31. rootcoz-4.0.0/docs/cli-command-reference.html +3000 -0
  32. rootcoz-4.0.0/docs/cli-command-reference.md +1082 -0
  33. rootcoz-4.0.0/docs/configuration-and-environment-reference.html +2005 -0
  34. rootcoz-4.0.0/docs/configuration-and-environment-reference.md +545 -0
  35. rootcoz-4.0.0/docs/configure-your-profile-and-notifications.html +436 -0
  36. rootcoz-4.0.0/docs/configure-your-profile-and-notifications.md +88 -0
  37. rootcoz-4.0.0/docs/copy-common-analysis-recipes.html +536 -0
  38. rootcoz-4.0.0/docs/copy-common-analysis-recipes.md +261 -0
  39. rootcoz-4.0.0/docs/copy-common-deployment-recipes.html +576 -0
  40. rootcoz-4.0.0/docs/copy-common-deployment-recipes.md +284 -0
  41. rootcoz-4.0.0/docs/create-github-issues-and-jira-bugs.html +441 -0
  42. rootcoz-4.0.0/docs/create-github-issues-and-jira-bugs.md +127 -0
  43. rootcoz-4.0.0/docs/customize-ai-analysis.html +530 -0
  44. rootcoz-4.0.0/docs/customize-ai-analysis.md +183 -0
  45. rootcoz-4.0.0/docs/index.html +450 -0
  46. rootcoz-4.0.0/docs/investigate-failure-history.html +423 -0
  47. rootcoz-4.0.0/docs/investigate-failure-history.md +116 -0
  48. rootcoz-4.0.0/docs/llms-full.txt +4982 -0
  49. rootcoz-4.0.0/docs/llms.txt +30 -0
  50. rootcoz-4.0.0/docs/manage-users-access-and-token-usage.html +495 -0
  51. rootcoz-4.0.0/docs/manage-users-access-and-token-usage.md +165 -0
  52. rootcoz-4.0.0/docs/organize-jobs-with-metadata.html +459 -0
  53. rootcoz-4.0.0/docs/organize-jobs-with-metadata.md +140 -0
  54. rootcoz-4.0.0/docs/push-classifications-to-report-portal.html +469 -0
  55. rootcoz-4.0.0/docs/push-classifications-to-report-portal.md +130 -0
  56. rootcoz-4.0.0/docs/rest-api-reference.html +3050 -0
  57. rootcoz-4.0.0/docs/rest-api-reference.md +1373 -0
  58. rootcoz-4.0.0/docs/review-and-classify-failures.html +421 -0
  59. rootcoz-4.0.0/docs/review-and-classify-failures.md +86 -0
  60. rootcoz-4.0.0/docs/search-index.json +1 -0
  61. rootcoz-4.0.0/entrypoint.sh +56 -0
  62. rootcoz-4.0.0/examples/pytest-junitxml/conftest_junit_ai.py +67 -0
  63. rootcoz-4.0.0/examples/pytest-junitxml/conftest_junit_ai_utils.py +123 -0
  64. rootcoz-4.0.0/frontend/.gitignore +24 -0
  65. rootcoz-4.0.0/frontend/README.md +73 -0
  66. rootcoz-4.0.0/frontend/eslint.config.js +23 -0
  67. rootcoz-4.0.0/frontend/index.html +16 -0
  68. rootcoz-4.0.0/frontend/package-lock.json +5335 -0
  69. rootcoz-4.0.0/frontend/package.json +49 -0
  70. rootcoz-4.0.0/frontend/public/favicon.svg +1 -0
  71. rootcoz-4.0.0/frontend/public/icons.svg +24 -0
  72. rootcoz-4.0.0/frontend/public/sw.js +37 -0
  73. rootcoz-4.0.0/frontend/src/App.tsx +42 -0
  74. rootcoz-4.0.0/frontend/src/changelog.json +13 -0
  75. rootcoz-4.0.0/frontend/src/components/layout/Layout.tsx +13 -0
  76. rootcoz-4.0.0/frontend/src/components/layout/NavBar.tsx +211 -0
  77. rootcoz-4.0.0/frontend/src/components/layout/UserBadge.tsx +38 -0
  78. rootcoz-4.0.0/frontend/src/components/shared/ClassificationBadge.tsx +28 -0
  79. rootcoz-4.0.0/frontend/src/components/shared/ConfirmDialog.tsx +56 -0
  80. rootcoz-4.0.0/frontend/src/components/shared/DateRangeFilter.tsx +45 -0
  81. rootcoz-4.0.0/frontend/src/components/shared/ExpandCollapseButtons.tsx +26 -0
  82. rootcoz-4.0.0/frontend/src/components/shared/FeedbackDialog.tsx +334 -0
  83. rootcoz-4.0.0/frontend/src/components/shared/FieldLabel.tsx +3 -0
  84. rootcoz-4.0.0/frontend/src/components/shared/LinkedText.tsx +31 -0
  85. rootcoz-4.0.0/frontend/src/components/shared/LoadingSpinner.tsx +24 -0
  86. rootcoz-4.0.0/frontend/src/components/shared/MetadataBadges.tsx +41 -0
  87. rootcoz-4.0.0/frontend/src/components/shared/MetadataFilterBar.tsx +203 -0
  88. rootcoz-4.0.0/frontend/src/components/shared/ModelCombobox.tsx +205 -0
  89. rootcoz-4.0.0/frontend/src/components/shared/NavBadge.tsx +30 -0
  90. rootcoz-4.0.0/frontend/src/components/shared/NotificationPrompt.tsx +110 -0
  91. rootcoz-4.0.0/frontend/src/components/shared/Pagination.tsx +38 -0
  92. rootcoz-4.0.0/frontend/src/components/shared/PeerRoundEntry.tsx +59 -0
  93. rootcoz-4.0.0/frontend/src/components/shared/ProfileForm.tsx +477 -0
  94. rootcoz-4.0.0/frontend/src/components/shared/ProtectedRoute.tsx +26 -0
  95. rootcoz-4.0.0/frontend/src/components/shared/SearchInput.tsx +24 -0
  96. rootcoz-4.0.0/frontend/src/components/shared/Section.tsx +38 -0
  97. rootcoz-4.0.0/frontend/src/components/shared/SectionDivider.tsx +9 -0
  98. rootcoz-4.0.0/frontend/src/components/shared/SortableHeader.tsx +37 -0
  99. rootcoz-4.0.0/frontend/src/components/shared/StatusChip.tsx +24 -0
  100. rootcoz-4.0.0/frontend/src/components/shared/Toggle.tsx +20 -0
  101. rootcoz-4.0.0/frontend/src/components/shared/WhatsNewDialog.tsx +104 -0
  102. rootcoz-4.0.0/frontend/src/components/shared/__tests__/DateRangeFilter.test.tsx +91 -0
  103. rootcoz-4.0.0/frontend/src/components/shared/__tests__/FeedbackDialog.test.tsx +303 -0
  104. rootcoz-4.0.0/frontend/src/components/shared/__tests__/LinkedText.test.tsx +37 -0
  105. rootcoz-4.0.0/frontend/src/components/shared/__tests__/NotificationPrompt.test.tsx +154 -0
  106. rootcoz-4.0.0/frontend/src/components/shared/__tests__/StatusChip.test.tsx +30 -0
  107. rootcoz-4.0.0/frontend/src/components/shared/__tests__/WhatsNewDialog.test.tsx +53 -0
  108. rootcoz-4.0.0/frontend/src/components/ui/badge.tsx +32 -0
  109. rootcoz-4.0.0/frontend/src/components/ui/button.tsx +53 -0
  110. rootcoz-4.0.0/frontend/src/components/ui/card.tsx +50 -0
  111. rootcoz-4.0.0/frontend/src/components/ui/dialog.tsx +97 -0
  112. rootcoz-4.0.0/frontend/src/components/ui/input.tsx +21 -0
  113. rootcoz-4.0.0/frontend/src/components/ui/select.tsx +80 -0
  114. rootcoz-4.0.0/frontend/src/components/ui/skeleton.tsx +12 -0
  115. rootcoz-4.0.0/frontend/src/components/ui/table.tsx +70 -0
  116. rootcoz-4.0.0/frontend/src/components/ui/textarea.tsx +20 -0
  117. rootcoz-4.0.0/frontend/src/components/ui/tooltip.tsx +27 -0
  118. rootcoz-4.0.0/frontend/src/constants/classifications.ts +15 -0
  119. rootcoz-4.0.0/frontend/src/index.css +2 -0
  120. rootcoz-4.0.0/frontend/src/lib/__tests__/api.test.ts +76 -0
  121. rootcoz-4.0.0/frontend/src/lib/__tests__/autoLink.test.ts +343 -0
  122. rootcoz-4.0.0/frontend/src/lib/__tests__/cookies.test.ts +120 -0
  123. rootcoz-4.0.0/frontend/src/lib/__tests__/errorCapture.test.ts +42 -0
  124. rootcoz-4.0.0/frontend/src/lib/__tests__/format.test.ts +75 -0
  125. rootcoz-4.0.0/frontend/src/lib/__tests__/grouping.test.ts +63 -0
  126. rootcoz-4.0.0/frontend/src/lib/__tests__/peerDebate.test.ts +70 -0
  127. rootcoz-4.0.0/frontend/src/lib/api.ts +108 -0
  128. rootcoz-4.0.0/frontend/src/lib/auth.tsx +105 -0
  129. rootcoz-4.0.0/frontend/src/lib/autoLink.ts +200 -0
  130. rootcoz-4.0.0/frontend/src/lib/childJobHash.ts +36 -0
  131. rootcoz-4.0.0/frontend/src/lib/constants.ts +2 -0
  132. rootcoz-4.0.0/frontend/src/lib/cookies.ts +201 -0
  133. rootcoz-4.0.0/frontend/src/lib/dateRange.ts +13 -0
  134. rootcoz-4.0.0/frontend/src/lib/errorCapture.ts +43 -0
  135. rootcoz-4.0.0/frontend/src/lib/failureKeys.ts +42 -0
  136. rootcoz-4.0.0/frontend/src/lib/format.ts +33 -0
  137. rootcoz-4.0.0/frontend/src/lib/grouping.ts +56 -0
  138. rootcoz-4.0.0/frontend/src/lib/notifications.ts +141 -0
  139. rootcoz-4.0.0/frontend/src/lib/peerDebate.ts +20 -0
  140. rootcoz-4.0.0/frontend/src/lib/reviewKey.ts +5 -0
  141. rootcoz-4.0.0/frontend/src/lib/useClipboard.ts +24 -0
  142. rootcoz-4.0.0/frontend/src/lib/useExpandCollapseAll.ts +17 -0
  143. rootcoz-4.0.0/frontend/src/lib/useSessionState.ts +36 -0
  144. rootcoz-4.0.0/frontend/src/lib/useTableSort.ts +34 -0
  145. rootcoz-4.0.0/frontend/src/lib/utils.ts +68 -0
  146. rootcoz-4.0.0/frontend/src/main.tsx +18 -0
  147. rootcoz-4.0.0/frontend/src/pages/DashboardPage.tsx +734 -0
  148. rootcoz-4.0.0/frontend/src/pages/HistoryPage.tsx +263 -0
  149. rootcoz-4.0.0/frontend/src/pages/MentionsPage.tsx +306 -0
  150. rootcoz-4.0.0/frontend/src/pages/NewAnalysisPage.tsx +703 -0
  151. rootcoz-4.0.0/frontend/src/pages/RegisterPage.tsx +49 -0
  152. rootcoz-4.0.0/frontend/src/pages/ReportPage.tsx +580 -0
  153. rootcoz-4.0.0/frontend/src/pages/SettingsPage.tsx +30 -0
  154. rootcoz-4.0.0/frontend/src/pages/StatusPage.tsx +480 -0
  155. rootcoz-4.0.0/frontend/src/pages/TestHistoryPage.tsx +138 -0
  156. rootcoz-4.0.0/frontend/src/pages/TokenUsagePage.tsx +426 -0
  157. rootcoz-4.0.0/frontend/src/pages/UsersPage.tsx +487 -0
  158. rootcoz-4.0.0/frontend/src/pages/report/AllReviewedPrompt.tsx +86 -0
  159. rootcoz-4.0.0/frontend/src/pages/report/BugCreationDialog.tsx +517 -0
  160. rootcoz-4.0.0/frontend/src/pages/report/ChildJobSection.tsx +173 -0
  161. rootcoz-4.0.0/frontend/src/pages/report/ClassificationSelect.tsx +91 -0
  162. rootcoz-4.0.0/frontend/src/pages/report/CommentsSection.tsx +291 -0
  163. rootcoz-4.0.0/frontend/src/pages/report/FailureCard.tsx +539 -0
  164. rootcoz-4.0.0/frontend/src/pages/report/MentionTextarea.tsx +237 -0
  165. rootcoz-4.0.0/frontend/src/pages/report/PeerAnalysisSummary.tsx +211 -0
  166. rootcoz-4.0.0/frontend/src/pages/report/PeerDebateSection.tsx +61 -0
  167. rootcoz-4.0.0/frontend/src/pages/report/ReAnalyzeDialog.tsx +495 -0
  168. rootcoz-4.0.0/frontend/src/pages/report/ReportContext.tsx +244 -0
  169. rootcoz-4.0.0/frontend/src/pages/report/ReportPortalButton.tsx +195 -0
  170. rootcoz-4.0.0/frontend/src/pages/report/ReviewToggle.tsx +90 -0
  171. rootcoz-4.0.0/frontend/src/pages/report/TokenUsageBadge.tsx +35 -0
  172. rootcoz-4.0.0/frontend/src/pages/report/__tests__/AllReviewedPrompt.test.tsx +391 -0
  173. rootcoz-4.0.0/frontend/src/pages/report/__tests__/CodeFixLiteralBlock.test.tsx +52 -0
  174. rootcoz-4.0.0/frontend/src/pages/report/__tests__/CommentsSection.test.tsx +223 -0
  175. rootcoz-4.0.0/frontend/src/pages/report/__tests__/MentionTextarea.test.tsx +140 -0
  176. rootcoz-4.0.0/frontend/src/pages/report/__tests__/ReportContext.test.ts +16 -0
  177. rootcoz-4.0.0/frontend/src/pages/report/__tests__/useReviewSuggestion.test.tsx +213 -0
  178. rootcoz-4.0.0/frontend/src/pages/report/useReviewSuggestion.ts +74 -0
  179. rootcoz-4.0.0/frontend/src/test/setup.ts +1 -0
  180. rootcoz-4.0.0/frontend/src/theme.css +91 -0
  181. rootcoz-4.0.0/frontend/src/types/index.ts +416 -0
  182. rootcoz-4.0.0/frontend/tsconfig.app.json +32 -0
  183. rootcoz-4.0.0/frontend/tsconfig.json +7 -0
  184. rootcoz-4.0.0/frontend/tsconfig.node.json +26 -0
  185. rootcoz-4.0.0/frontend/vite.config.ts +47 -0
  186. rootcoz-4.0.0/package-lock.json +6 -0
  187. rootcoz-4.0.0/pypi-dist/.gitignore +1 -0
  188. rootcoz-4.0.0/pyproject.toml +47 -0
  189. rootcoz-4.0.0/skills/rootcoz-analyze/SKILL.md +140 -0
  190. rootcoz-4.0.0/src/rootcoz/__init__.py +3 -0
  191. rootcoz-4.0.0/src/rootcoz/ai-prompts/FAILURE_HISTORY_ANALYSIS.md +128 -0
  192. rootcoz-4.0.0/src/rootcoz/ai_models.py +326 -0
  193. rootcoz-4.0.0/src/rootcoz/analyzer.py +2050 -0
  194. rootcoz-4.0.0/src/rootcoz/bug_creation.py +746 -0
  195. rootcoz-4.0.0/src/rootcoz/cli/__init__.py +1 -0
  196. rootcoz-4.0.0/src/rootcoz/cli/client.py +862 -0
  197. rootcoz-4.0.0/src/rootcoz/cli/config.py +320 -0
  198. rootcoz-4.0.0/src/rootcoz/cli/main.py +2579 -0
  199. rootcoz-4.0.0/src/rootcoz/cli/output.py +89 -0
  200. rootcoz-4.0.0/src/rootcoz/comment_enrichment.py +258 -0
  201. rootcoz-4.0.0/src/rootcoz/config.py +510 -0
  202. rootcoz-4.0.0/src/rootcoz/encryption.py +342 -0
  203. rootcoz-4.0.0/src/rootcoz/feedback.py +388 -0
  204. rootcoz-4.0.0/src/rootcoz/github_issues.py +282 -0
  205. rootcoz-4.0.0/src/rootcoz/issue_matching.py +153 -0
  206. rootcoz-4.0.0/src/rootcoz/jenkins.py +152 -0
  207. rootcoz-4.0.0/src/rootcoz/jenkins_artifacts.py +493 -0
  208. rootcoz-4.0.0/src/rootcoz/jira.py +499 -0
  209. rootcoz-4.0.0/src/rootcoz/llm_pricing.py +272 -0
  210. rootcoz-4.0.0/src/rootcoz/logging_context.py +28 -0
  211. rootcoz-4.0.0/src/rootcoz/main.py +5247 -0
  212. rootcoz-4.0.0/src/rootcoz/metadata_rules.py +202 -0
  213. rootcoz-4.0.0/src/rootcoz/models.py +939 -0
  214. rootcoz-4.0.0/src/rootcoz/monitoring.py +698 -0
  215. rootcoz-4.0.0/src/rootcoz/notifications.py +129 -0
  216. rootcoz-4.0.0/src/rootcoz/peer_analysis.py +748 -0
  217. rootcoz-4.0.0/src/rootcoz/reportportal.py +510 -0
  218. rootcoz-4.0.0/src/rootcoz/repository.py +350 -0
  219. rootcoz-4.0.0/src/rootcoz/request_resolution.py +31 -0
  220. rootcoz-4.0.0/src/rootcoz/storage.py +3494 -0
  221. rootcoz-4.0.0/src/rootcoz/token_tracking.py +137 -0
  222. rootcoz-4.0.0/src/rootcoz/utils.py +69 -0
  223. rootcoz-4.0.0/src/rootcoz/vapid.py +170 -0
  224. rootcoz-4.0.0/src/rootcoz/xml_enrichment.py +358 -0
  225. rootcoz-4.0.0/tests/__init__.py +1 -0
  226. rootcoz-4.0.0/tests/conftest.py +199 -0
  227. rootcoz-4.0.0/tests/test_ai_models.py +333 -0
  228. rootcoz-4.0.0/tests/test_allow_list.py +333 -0
  229. rootcoz-4.0.0/tests/test_analyzer.py +3229 -0
  230. rootcoz-4.0.0/tests/test_api_notifications.py +384 -0
  231. rootcoz-4.0.0/tests/test_api_token_usage.py +189 -0
  232. rootcoz-4.0.0/tests/test_auth.py +1076 -0
  233. rootcoz-4.0.0/tests/test_bug_creation.py +639 -0
  234. rootcoz-4.0.0/tests/test_cli_client.py +1694 -0
  235. rootcoz-4.0.0/tests/test_cli_config.py +809 -0
  236. rootcoz-4.0.0/tests/test_cli_main.py +3416 -0
  237. rootcoz-4.0.0/tests/test_cli_output.py +86 -0
  238. rootcoz-4.0.0/tests/test_comment_enrichment.py +361 -0
  239. rootcoz-4.0.0/tests/test_comment_intent.py +339 -0
  240. rootcoz-4.0.0/tests/test_comments.py +212 -0
  241. rootcoz-4.0.0/tests/test_config.py +598 -0
  242. rootcoz-4.0.0/tests/test_debug_request_logging.py +305 -0
  243. rootcoz-4.0.0/tests/test_encryption.py +374 -0
  244. rootcoz-4.0.0/tests/test_feedback.py +951 -0
  245. rootcoz-4.0.0/tests/test_github_issues.py +525 -0
  246. rootcoz-4.0.0/tests/test_history.py +614 -0
  247. rootcoz-4.0.0/tests/test_issue_matching.py +364 -0
  248. rootcoz-4.0.0/tests/test_jenkins.py +141 -0
  249. rootcoz-4.0.0/tests/test_jenkins_artifacts.py +495 -0
  250. rootcoz-4.0.0/tests/test_jira.py +645 -0
  251. rootcoz-4.0.0/tests/test_job_metadata.py +624 -0
  252. rootcoz-4.0.0/tests/test_llm_pricing.py +540 -0
  253. rootcoz-4.0.0/tests/test_logging_context.py +82 -0
  254. rootcoz-4.0.0/tests/test_main.py +4547 -0
  255. rootcoz-4.0.0/tests/test_mentions.py +561 -0
  256. rootcoz-4.0.0/tests/test_metadata_rules.py +635 -0
  257. rootcoz-4.0.0/tests/test_models.py +1112 -0
  258. rootcoz-4.0.0/tests/test_monitoring.py +545 -0
  259. rootcoz-4.0.0/tests/test_notifications.py +316 -0
  260. rootcoz-4.0.0/tests/test_peer_analysis.py +2697 -0
  261. rootcoz-4.0.0/tests/test_reportportal.py +849 -0
  262. rootcoz-4.0.0/tests/test_reportportal_cli.py +46 -0
  263. rootcoz-4.0.0/tests/test_reportportal_config.py +110 -0
  264. rootcoz-4.0.0/tests/test_reportportal_endpoint.py +1583 -0
  265. rootcoz-4.0.0/tests/test_repository.py +973 -0
  266. rootcoz-4.0.0/tests/test_storage.py +1018 -0
  267. rootcoz-4.0.0/tests/test_storage_push.py +215 -0
  268. rootcoz-4.0.0/tests/test_storage_token_usage.py +308 -0
  269. rootcoz-4.0.0/tests/test_token_tracking.py +299 -0
  270. rootcoz-4.0.0/tests/test_vapid.py +182 -0
  271. rootcoz-4.0.0/tests/test_xml_enrichment.py +251 -0
  272. rootcoz-4.0.0/tox.toml +42 -0
  273. rootcoz-4.0.0/uv.lock +1403 -0
@@ -0,0 +1,3 @@
1
+ reviews:
2
+ auto_review:
3
+ auto_pause_after_reviewed_commits: 0
@@ -0,0 +1,40 @@
1
+ # Git
2
+ .git
3
+ .gitignore
4
+
5
+ # Python
6
+ __pycache__
7
+ *.py[cod]
8
+ *$py.class
9
+ *.so
10
+ .Python
11
+ .venv
12
+ venv
13
+ env
14
+ .eggs
15
+ *.egg-info
16
+ *.egg
17
+ dist
18
+ build
19
+
20
+ # IDE
21
+ .idea
22
+ .vscode
23
+ *.swp
24
+ *.swo
25
+
26
+ # Testing
27
+ .pytest_cache
28
+ .coverage
29
+ htmlcov
30
+ .tox
31
+
32
+ # Misc
33
+ *.log
34
+ *.sqlite
35
+ *.db
36
+ .env
37
+ .env.*
38
+ Dockerfile
39
+ .dockerignore
40
+ .dev
@@ -0,0 +1,125 @@
1
+ # Jenkins Job Insight - Environment Variables Template
2
+
3
+ # ===================
4
+ # Jenkins Configuration (Required)
5
+ # ===================
6
+ JENKINS_URL=https://jenkins.example.com
7
+ JENKINS_USER=your-username
8
+ JENKINS_PASSWORD=your-api-token
9
+ JENKINS_SSL_VERIFY=true
10
+
11
+ # ===================
12
+ # AI CLI Configuration
13
+ # ===================
14
+ # Choose AI provider (required): "claude", "gemini", or "cursor"
15
+ AI_PROVIDER=claude
16
+
17
+ # AI model to use (required, applies to any provider)
18
+ # Can also be set per-request in webhook body
19
+ AI_MODEL=your-model-name
20
+
21
+ # --- Claude CLI Options ---
22
+
23
+ # Option 1: Direct API key (simplest)
24
+ ANTHROPIC_API_KEY=your-anthropic-api-key
25
+
26
+ # Option 2: Vertex AI authentication
27
+ # CLAUDE_CODE_USE_VERTEX=1
28
+ # CLOUD_ML_REGION=us-east5
29
+ # ANTHROPIC_VERTEX_PROJECT_ID=your-project-id
30
+
31
+ # --- Gemini CLI Options ---
32
+
33
+ # Option 1: API key
34
+ GEMINI_API_KEY=your-gemini-api-key
35
+
36
+ # Option 2: OAuth (run: gemini auth login)
37
+ # No env vars needed for OAuth
38
+
39
+ # --- Cursor Agent CLI Options ---
40
+
41
+ # Choose ONE of the following authentication methods:
42
+
43
+ # API key
44
+ # CURSOR_API_KEY=your-cursor-api-key
45
+
46
+ # --- AI CLI Timeout ---
47
+
48
+ # Timeout for AI CLI calls in minutes (default: 10)
49
+ # Increase for slower models like gpt-5.2
50
+ # AI_CLI_TIMEOUT=10
51
+
52
+ # ===================
53
+ # Peer Analysis (Optional)
54
+ # ===================
55
+ # Enable multi-AI consensus by configuring peer AI providers
56
+ # PEER_AI_CONFIGS=cursor:gpt-5.4-xhigh,gemini:gemini-2.5-pro
57
+ # PEER_ANALYSIS_MAX_ROUNDS=3
58
+
59
+ # ===================
60
+ # Logging Configuration
61
+ # ===================
62
+ # Log level: DEBUG, INFO, WARNING, ERROR (default: INFO)
63
+ LOG_LEVEL=INFO
64
+
65
+ # ===================
66
+ # Optional Defaults (can be overridden per-request in webhook)
67
+ # ===================
68
+
69
+ # Tests repository URL
70
+ # TESTS_REPO_URL=https://github.com/org/test-repo
71
+
72
+ # ===================
73
+ # Jira Integration (Optional)
74
+ # ===================
75
+ # Enables searching Jira for existing bugs matching PRODUCT BUG failures.
76
+ # When configured, AI analysis includes search keywords and the system
77
+ # automatically finds potentially matching Jira issues.
78
+
79
+ # Jira server URL (Cloud or Server/DC)
80
+ # JIRA_URL=https://your-org.atlassian.net
81
+
82
+ # Personal Access Token (works for both Cloud and Server/DC)
83
+ # JIRA_PAT=your-personal-access-token
84
+
85
+ # Email for Jira Cloud authentication (determines auth mode):
86
+ # - If JIRA_EMAIL is set: Cloud auth (Basic with email:PAT)
87
+ # - If JIRA_EMAIL is not set: Server/DC auth (Bearer PAT)
88
+ # JIRA_EMAIL=your-email@example.com
89
+
90
+ # JIRA_API_TOKEN is kept for backward compatibility; prefer JIRA_PAT
91
+ # JIRA_API_TOKEN=your-jira-api-token
92
+
93
+ # Jira project key to scope searches (optional, searches all projects if not set)
94
+ # JIRA_PROJECT_KEY=PROJ
95
+
96
+ # SSL verification for Jira (set to false for self-signed certs)
97
+ # JIRA_SSL_VERIFY=true
98
+
99
+ # Maximum Jira results per search (default: 5)
100
+ # JIRA_MAX_RESULTS=5
101
+
102
+ # ===================
103
+ # GitHub Integration (Optional)
104
+ # ===================
105
+ # GitHub API token for private repo PR status in comments
106
+ # GITHUB_TOKEN=your-github-token
107
+
108
+ # Explicitly enable/disable GitHub issue creation (overrides auto-detection)
109
+ # When not set, auto-detected from TESTS_REPO_URL and GITHUB_TOKEN
110
+ # ENABLE_GITHUB_ISSUES=true
111
+
112
+ # ===================
113
+ # Access Control (Optional)
114
+ # ===================
115
+ # Comma-separated list of usernames allowed to create/modify data
116
+ # (submit analyses, add comments, set reviewed, override classifications, etc.)
117
+ # Empty = open access (all users allowed). Admin users always bypass.
118
+ # ALLOWED_USERS=alice,bob,carol
119
+
120
+ # ===================
121
+ # Development
122
+ # ===================
123
+
124
+ # Enable debug mode
125
+ DEBUG=false
rootcoz-4.0.0/.flake8 ADDED
@@ -0,0 +1,14 @@
1
+ [flake8]
2
+ select=M511
3
+
4
+ exclude =
5
+ doc,
6
+ .tox,
7
+ .git,
8
+ *.yml,
9
+ Pipfile.*,
10
+ docs/*,
11
+ .cache/*
12
+
13
+ per-file-ignores =
14
+ src/rootcoz/cli/main.py:M511
rootcoz-4.0.0/.git ADDED
@@ -0,0 +1 @@
1
+ gitdir: /tmp/github-webhook-rootcoz-jizntl1d/.git/worktrees/github-webhook-rootcoz-jizntl1d-worktree-4df6dc48-3349-4ae2-8997-d6fe155c1816
@@ -0,0 +1,63 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ /lib/
18
+ /lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ *.egg-info/
24
+ .installed.cfg
25
+ *.egg
26
+
27
+ # Virtual environments
28
+ .env
29
+ .venv/
30
+ venv/
31
+ ENV/
32
+
33
+ # Testing
34
+ .pytest_cache/
35
+ .coverage
36
+ htmlcov/
37
+
38
+ # Type checking / linting
39
+ .mypy_cache/
40
+ .ruff_cache/
41
+
42
+ # Logs
43
+ *.log
44
+
45
+ # Project specific
46
+ /data/
47
+
48
+ # Local development directory
49
+ .dev/
50
+
51
+ # Superpowers development tool artifacts
52
+ .superpowers/
53
+
54
+ # Frontend
55
+ node_modules/
56
+ frontend/node_modules/
57
+ frontend/dist/
58
+ frontend/.vite/
59
+
60
+ # Local config
61
+ .envrc
62
+ .claude/
63
+ jji.db
@@ -0,0 +1,20 @@
1
+ # Gitleaks configuration for rootcoz
2
+ # https://github.com/gitleaks/gitleaks#configuration
3
+
4
+ [extend]
5
+ # Use the default gitleaks config as a base
6
+ useDefault = true
7
+
8
+ [allowlist]
9
+ # Allowlist test files that contain fake/mock credentials for unit tests
10
+ paths = [
11
+ '''\.secrets\.baseline''',
12
+ '''tests/test_config\.py''',
13
+ '''tests/test_main\.py''',
14
+ '''tests/conftest\.py''',
15
+ '''tests/test_cli_main\.py''',
16
+ '''tests/test_cli_client\.py''',
17
+ '''tests/test_auth\.py''',
18
+ '''tests/test_debug_request_logging\.py''',
19
+ '''tests/test_feedback\.py''',
20
+ ]
@@ -0,0 +1,5 @@
1
+ ---
2
+ default: true
3
+ MD013:
4
+ # Number of characters
5
+ line_length: 120
@@ -0,0 +1,71 @@
1
+ ---
2
+ default_language_version:
3
+ python: python3
4
+
5
+ ci:
6
+ autofix_prs: false
7
+ autoupdate_commit_msg: "ci: [pre-commit.ci] pre-commit autoupdate"
8
+
9
+ repos:
10
+ - repo: https://github.com/pre-commit/pre-commit-hooks
11
+ rev: v6.0.0
12
+ hooks:
13
+ - id: check-added-large-files
14
+ - id: check-docstring-first
15
+ - id: check-executables-have-shebangs
16
+ - id: check-merge-conflict
17
+ - id: check-symlinks
18
+ - id: detect-private-key
19
+ - id: mixed-line-ending
20
+ - id: debug-statements
21
+ - id: trailing-whitespace
22
+ args: [--markdown-linebreak-ext=md] # Do not process Markdown files.
23
+ exclude: ^docs/
24
+ - id: end-of-file-fixer
25
+ exclude: ^docs/
26
+ - id: check-ast
27
+ - id: check-builtin-literals
28
+ - id: check-toml
29
+
30
+ - repo: https://github.com/PyCQA/flake8
31
+ rev: 7.3.0
32
+ hooks:
33
+ - id: flake8
34
+ args: [--config=.flake8]
35
+ additional_dependencies:
36
+ [git+https://github.com/RedHatQE/flake8-plugins.git, flake8-mutable]
37
+
38
+ - repo: https://github.com/Yelp/detect-secrets
39
+ rev: v1.5.0
40
+ hooks:
41
+ - id: detect-secrets
42
+ exclude: ^docs/
43
+
44
+ - repo: https://github.com/astral-sh/ruff-pre-commit
45
+ rev: v0.15.11
46
+ hooks:
47
+ - id: ruff
48
+ - id: ruff-format
49
+
50
+ - repo: https://github.com/gitleaks/gitleaks
51
+ rev: v8.30.0
52
+ hooks:
53
+ - id: gitleaks
54
+
55
+ - repo: https://github.com/pre-commit/mirrors-mypy
56
+ rev: v1.20.1
57
+ hooks:
58
+ - id: mypy
59
+ exclude: (tests/)
60
+ additional_dependencies:
61
+ [types-requests, types-PyYAML, types-colorama, types-aiofiles, pydantic]
62
+
63
+ - repo: https://github.com/pre-commit/mirrors-eslint
64
+ rev: v10.2.1
65
+ hooks:
66
+ - id: eslint
67
+ files: \.js$
68
+ exclude: (eslint\.config\.js|^docs/|^frontend/)
69
+ args: [--fix]
70
+ additional_dependencies:
71
+ - eslint@9.38.0
@@ -0,0 +1 @@
1
+ CLAUDE.md
@@ -0,0 +1,185 @@
1
+ # Project Coding Principles
2
+
3
+ ## Data Integrity
4
+
5
+ - Never truncate data arbitrarily (no `[:100]` or `[:2000]` slicing)
6
+ - Preserve full information; let consumers handle their own limits
7
+
8
+ ## No Dead Code
9
+
10
+ - Use everything you create: imports, variables, clones, instantiations
11
+ - Remove unused code rather than leaving it dormant
12
+
13
+ ## No Duplicate Code — MANDATORY
14
+
15
+ **ZERO tolerance for duplicate code. This is a hard rule, not a guideline.**
16
+
17
+ - If the same logic exists in 2+ places, it is a BUG. Extract it immediately.
18
+ - Before writing ANY code, search for existing helpers that do the same thing. Reuse first.
19
+ - This applies to ALL code: Python, JavaScript, CSS, HTML templates, SQL queries.
20
+ - Shared React components → extract to `components/shared/` or `components/ui/`
21
+ - Shared TypeScript logic → extract to `lib/` utilities
22
+ - Shared Python logic → extract functions, base classes, or mixins
23
+ - Copy-paste is NEVER acceptable. Not even "just this once." Not even "it's small."
24
+ - Every PR review will check for duplication. Duplicates found = code rejected.
25
+
26
+ ## Testing — MANDATORY
27
+
28
+ **`tox` must pass before every commit. No exceptions.**
29
+
30
+ Run all tests:
31
+
32
+ ```bash
33
+ uvx --with tox-uv tox
34
+ ```
35
+
36
+ This runs both environments:
37
+ - `backend` — Python tests via `uv run pytest tests/ -q`
38
+ - `frontend` — Frontend build (`vite build`) + Vitest tests (`npm test`)
39
+
40
+ Individual environments:
41
+
42
+ ```bash
43
+ uvx --with tox-uv tox -e backend # Python only
44
+ uvx --with tox-uv tox -e frontend # Frontend only
45
+ ```
46
+
47
+ ## Smart Context Management
48
+
49
+ - Prefer structured data (test reports, APIs) over raw logs
50
+ - When raw data is necessary, extract relevant content (errors, failures, warnings) instead of full dumps
51
+
52
+ ## Parallel Execution
53
+
54
+ - Run independent, stateless operations in parallel
55
+ - Handle failures gracefully: one failure should not crash all parallel tasks
56
+ - Capture exceptions and continue processing
57
+
58
+ ## File Handling
59
+
60
+ - Preserve user edits when modifying files
61
+ - Add missing elements rather than replacing entire content
62
+ - Never overwrite user customizations
63
+
64
+ ## Communication
65
+
66
+ - Explain data flow through the system, not just variable locations
67
+ - Show how components connect and interact
68
+
69
+ ## Architecture Rules
70
+
71
+ ### Tech Stack
72
+
73
+ - **Backend**: Python + FastAPI + TinyDB
74
+ - **Frontend**: Vite + React 19 + TypeScript + Tailwind CSS + shadcn/ui (in `/frontend/`)
75
+ - **AI Integration**: CLI-based (Claude CLI, Gemini CLI, Cursor Agent CLI) — no SDK dependencies, provider-agnostic, `AI_PROVIDER` env var selects provider
76
+ - **CLI**: `rootcoz` CLI tool for querying the API — run `rootcoz --help` for available commands
77
+
78
+ ### Frontend Patterns
79
+
80
+ - **State**: Page-scoped `useReducer` (e.g., `ReportContext` for the report page) — each page owns its own context; do NOT introduce global state (Redux, Zustand, etc.)
81
+ - **API**: Centralized `api.get/post/put/delete` wrapper in `lib/api.ts` — do NOT use raw `fetch` calls
82
+ - **User identification**: Cookie-based (`rootcoz_username`), display-only — NOT an authentication/authorization boundary
83
+
84
+ ### Auto-Generated Documentation
85
+
86
+ The `docs/` directory is **auto-generated** by [docsfy](https://github.com/myk-org/docsfy). **NEVER edit files in `docs/` manually** — all changes will be overwritten. To update documentation, modify source code and regenerate with docsfy, or edit `AGENTS.md` / `README.md` for project-level docs.
87
+
88
+ ### AI Tool Access (IMPORTANT)
89
+
90
+ Never pre-feed data to the AI in the prompt. Give the AI tools (API endpoints, scripts, commands) and let it decide what data it needs.
91
+
92
+ **DO:**
93
+ - Expose API endpoints the AI can curl
94
+ - Provide skill files documenting available tools
95
+ - Let the AI query, explore, and interpret data on its own
96
+
97
+ **DON'T:**
98
+ - Pre-query the database and stuff results into the prompt
99
+ - Summarize or filter data before the AI sees it
100
+ - Make decisions about what data the AI needs — let the AI decide
101
+
102
+ ### CLI Parity
103
+
104
+ Every new API endpoint MUST also be supported via the `rootcoz` CLI tool. When adding a new endpoint:
105
+ 1. Add the client method to `src/rootcoz/cli/client.py`
106
+ 2. Add the CLI command to `src/rootcoz/cli/main.py`
107
+ 3. Add tests for both in `tests/test_cli_client.py` and `tests/test_cli_main.py`
108
+
109
+ ### Failure Deduplication
110
+
111
+ When multiple tests fail with the same error:
112
+ 1. Failures are grouped by error signature (SHA-256 hash of error + stack trace)
113
+ 2. Only one AI CLI call per unique error type
114
+ 3. Analysis is applied to all failures with matching signature
115
+
116
+ ### Jira Integration (Optional)
117
+
118
+ When configured, searches Jira for existing bugs matching PRODUCT BUG failures:
119
+ 1. AI generates search keywords during analysis
120
+ 2. Keywords search Jira (configurable issue type, summary search)
121
+ 3. AI evaluates each candidate's relevance
122
+ 4. Only relevant matches are attached to the result
123
+ 5. Jira errors never crash the pipeline — all failures are swallowed gracefully
124
+
125
+ ### Report Portal Integration (Optional)
126
+
127
+ When `ENABLE_REPORTPORTAL=true`, users can push test classifications back to Report Portal via the `push-reportportal` endpoint and CLI command.
128
+
129
+ ### Feedback System
130
+
131
+ Users submit feedback (bugs, feature requests) via the FeedbackDialog component. Feedback is previewed with AI-generated issue content, then created as a GitHub issue. This replaces the old "Report Bug" flow.
132
+
133
+ ### Logging
134
+
135
+ Uses `python-simple-logger`:
136
+ - INFO: Milestones (job started, AI calls, completed)
137
+ - DEBUG: Detailed operations (response lengths, extracted data)
138
+ - Configured via `LOG_LEVEL` environment variable
139
+
140
+ ## API Design
141
+
142
+ ### Configuration Parity
143
+
144
+ For request-tunable analysis settings, keep these interfaces in sync:
145
+ 1. Environment variable (server-level default)
146
+ 2. API payload field (per-request override)
147
+ 3. CLI option (command-line flag)
148
+ 4. Config file (`~/.config/rootcoz/config.toml` per-server setting)
149
+
150
+ Client-only transport settings and server-only deployment settings stay scoped to their owning interface.
151
+
152
+ When adding a new analysis setting:
153
+ 1. Add the field to `Settings` in `config.py`
154
+ 2. Add the corresponding request field to `BaseAnalysisRequest` (or `AnalyzeRequest`) in `models.py`
155
+ 3. Add the field to `_merge_settings()` in `main.py` so request values override env defaults
156
+ 4. Add the CLI option to the relevant command in `cli/main.py`
157
+ 5. Add the field to `ServerConfig` in `cli/config.py`
158
+
159
+ Exceptions (server-level only, no payload equivalent):
160
+ - `ADMIN_KEY` — server-only bootstrap secret for admin superuser authentication; never expose via request payloads, CLI flags, or shared config files. Rotating `ADMIN_KEY` only affects the bootstrap admin login — delegated admin API keys use `ROOTCOZ_ENCRYPTION_KEY` for HMAC hashing and are not affected by `ADMIN_KEY` rotation.
161
+ - `ALLOWED_USERS` — server-only comma-separated allow list of usernames permitted to create/modify data; empty = open access (backward compatible); admin users always bypass; never expose via request payloads or CLI flags. Note: this is a trusted-network access guard, not a cryptographic security boundary — enforcement reads the client-supplied `rootcoz_username` cookie, so protection relies on network-level trust rather than server-verified identity
162
+ - `DEBUG` — server reload toggle
163
+ - `ENABLE_GITHUB_ISSUES` — server capability toggle for GitHub issue creation
164
+ - `ENABLE_REPORTPORTAL` — server capability toggle for Report Portal integration
165
+ - `ROOTCOZ_ENCRYPTION_KEY` — server-only secret for at-rest encryption AND HMAC secret for delegated admin API key hashes; never expose via request payloads, CLI flags, or shared config files. **Rotating this key invalidates both encrypted data (tokens) and all stored delegated admin API key hashes** — operators must re-issue delegated admin API keys after rotation
166
+ - `LOG_LEVEL` — server log verbosity
167
+ - `PUBLIC_BASE_URL` — trusted server-only origin for building absolute links; never derive from request headers to prevent host-header injection
168
+ - `METADATA_RULES_FILE` — server-only path to metadata classification rules file
169
+ - `SECURE_COOKIES` — server-only deployment toggle for HTTPS cookie flags (default: True, set False for local HTTP dev)
170
+ - `TRUST_PROXY_HEADERS` — server-only trust toggle for reverse-proxy user identification; only enable behind a trusted proxy
171
+ - `VAPID_CLAIM_EMAIL` — server-only contact email for VAPID claims (Web Push notifications)
172
+ - `VAPID_PRIVATE_KEY` — server-only VAPID private key for Web Push notifications; never expose via request payloads, CLI flags, or shared config files
173
+ - `VAPID_PUBLIC_KEY` — server-only VAPID public key for Web Push notifications; auto-generated with `VAPID_PRIVATE_KEY` if not set
174
+ - Security-sensitive credentials for preview/create-issue endpoints (`GITHUB_TOKEN`, `TESTS_REPO_URL`, Jira credentials, `REPORTPORTAL_URL`, `REPORTPORTAL_API_TOKEN`, `REPORTPORTAL_PROJECT`) — these use deployment config, not per-request overrides
175
+
176
+ ### Sensitive Data Handling
177
+
178
+ Sensitive data (passwords, API tokens, credentials) must be:
179
+ 1. **Encrypted at rest** — use `encrypt_sensitive_fields()` before storing to the database
180
+ 2. **Stripped from responses** — use `strip_sensitive_from_response()` before returning to API consumers
181
+ 3. **Never logged** — do not log passwords, tokens, or credentials at any log level
182
+
183
+ Sensitive fields: `jenkins_password`, `jenkins_user`, `jira_api_token`, `jira_pat`, `jira_email`, `github_token`, `tests_repo_token`, `reportportal_api_token`, `vapid_private_key`
184
+
185
+ Encryption uses Fernet (AES-128-CBC + HMAC-SHA256). Set `ROOTCOZ_ENCRYPTION_KEY` env var for production; falls back to an auto-generated file-based key under `$XDG_DATA_HOME/rootcoz/.encryption_key` (default: `~/.local/share/rootcoz/.encryption_key`) for development.
@@ -0,0 +1,123 @@
1
+ # Frontend build stage
2
+ FROM node:20-slim AS frontend-builder
3
+
4
+ WORKDIR /frontend
5
+
6
+ # Copy package files first for layer caching
7
+ COPY frontend/package.json frontend/package-lock.json ./
8
+
9
+ # Install dependencies
10
+ RUN npm ci
11
+
12
+ # Copy frontend source
13
+ COPY frontend/ .
14
+
15
+ # Build the frontend (vite build only — type checking runs in tox/CI)
16
+ RUN npx vite build
17
+
18
+ FROM python:3.12-slim AS builder
19
+
20
+ WORKDIR /app
21
+
22
+ # Install uv
23
+ COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
24
+
25
+ # Install git (needed for gitpython dependency)
26
+ RUN apt-get update && apt-get install -y --no-install-recommends \
27
+ git \
28
+ && rm -rf /var/lib/apt/lists/*
29
+
30
+ # Copy project files
31
+ COPY pyproject.toml uv.lock ./
32
+ COPY src/ src/
33
+
34
+ # Create venv and install dependencies
35
+ RUN uv sync --frozen --no-dev
36
+
37
+ # Production stage
38
+ FROM python:3.12-slim
39
+
40
+ WORKDIR /app
41
+
42
+ # Install bash (needed for CLI install scripts), git (required at runtime for gitpython), curl (for Claude CLI), and nodejs/npm (for Gemini CLI)
43
+ RUN apt-get update && apt-get install -y --no-install-recommends \
44
+ bash \
45
+ git \
46
+ curl \
47
+ nodejs \
48
+ npm \
49
+ && rm -rf /var/lib/apt/lists/*
50
+
51
+ # Create non-root user, data directory, and set permissions
52
+ # OpenShift runs containers as a random UID in the root group (GID 0)
53
+ RUN useradd --create-home --shell /bin/bash -g 0 appuser \
54
+ && mkdir -p /data \
55
+ && chown appuser:0 /data \
56
+ && chmod -R g+w /data
57
+
58
+ # Copy uv for runtime
59
+ COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
60
+
61
+ # Switch to non-root user for CLI installs
62
+ USER appuser
63
+
64
+ # Install Claude Code CLI (installs to ~/.local/bin)
65
+ RUN /bin/bash -o pipefail -c "curl -fsSL https://claude.ai/install.sh | bash"
66
+
67
+ # Install Cursor Agent CLI (installs to ~/.local/bin)
68
+ RUN /bin/bash -o pipefail -c "curl -fsSL https://cursor.com/install | bash"
69
+
70
+ # Configure npm for non-root global installs and install Gemini CLI
71
+ RUN mkdir -p /home/appuser/.npm-global \
72
+ && npm config set prefix '/home/appuser/.npm-global' \
73
+ && npm install -g @google/gemini-cli
74
+
75
+ # Switch to root for file copies and permission fixes
76
+ USER root
77
+
78
+ # Copy the virtual environment from builder
79
+ COPY --chown=appuser:0 --from=builder /app/.venv /app/.venv
80
+
81
+ # Copy project files needed by uv
82
+ COPY --chown=appuser:0 --from=builder /app/pyproject.toml /app/uv.lock ./
83
+
84
+ # Copy source code
85
+ COPY --chown=appuser:0 --from=builder /app/src /app/src
86
+
87
+ # Copy built frontend assets from frontend builder
88
+ COPY --chown=appuser:0 --from=frontend-builder /frontend/dist /app/frontend/dist
89
+
90
+ # Copy entrypoint script
91
+ COPY --chown=appuser:0 entrypoint.sh /app/entrypoint.sh
92
+ RUN chmod +x /app/entrypoint.sh
93
+
94
+ # Make /app group-writable for OpenShift compatibility
95
+ RUN chmod -R g+w /app
96
+
97
+ # Make appuser home accessible by OpenShift arbitrary UID
98
+ # Only chmod directories (not files) — files are already group-readable by default.
99
+ # Directories need group write+execute for OpenShift's arbitrary UID (in GID 0)
100
+ # to create config/cache files at runtime.
101
+ RUN find /home/appuser -type d -exec chmod g=u {} + \
102
+ && npm cache clean --force 2>/dev/null; \
103
+ rm -rf /home/appuser/.npm/_cacache
104
+
105
+ # Switch back to non-root user for runtime
106
+ USER appuser
107
+
108
+ # Ensure CLIs are in PATH
109
+ ENV PATH="/home/appuser/.local/bin:/home/appuser/.npm-global/bin:${PATH}"
110
+ # Set HOME for OpenShift compatibility (random UID has no passwd entry)
111
+ ENV HOME="/home/appuser"
112
+
113
+ EXPOSE 8000
114
+
115
+ HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
116
+ CMD curl -f http://localhost:${PORT:-8000}/health || exit 1
117
+
118
+ # Use uv run for uvicorn
119
+ # --no-sync prevents uv from attempting to modify the venv at runtime.
120
+ # This is required for OpenShift where containers run as an arbitrary UID
121
+ # and may not have write access to the .venv directory.
122
+ ENTRYPOINT ["/app/entrypoint.sh"]
123
+ CMD ["uv", "run", "--no-sync", "uvicorn", "rootcoz.main:app", "--host", "0.0.0.0"]
rootcoz-4.0.0/OWNERS ADDED
@@ -0,0 +1,4 @@
1
+ approvers:
2
+ - myakove
3
+ reviewers:
4
+ - myakove