codetrust 2.2.2__tar.gz → 2.3.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 (293) hide show
  1. codetrust-2.3.0/.env.example +74 -0
  2. {codetrust-2.2.2 → codetrust-2.3.0}/.gitignore +10 -11
  3. {codetrust-2.2.2 → codetrust-2.3.0}/CHANGELOG.md +111 -1
  4. {codetrust-2.2.2 → codetrust-2.3.0}/PKG-INFO +49 -14
  5. {codetrust-2.2.2 → codetrust-2.3.0}/README.md +47 -12
  6. {codetrust-2.2.2 → codetrust-2.3.0}/action/entrypoint.sh +6 -0
  7. codetrust-2.3.0/action/scan_runner.py +928 -0
  8. {codetrust-2.2.2 → codetrust-2.3.0}/action.yml +22 -2
  9. codetrust-2.3.0/dashboard/.env.example +20 -0
  10. {codetrust-2.2.2 → codetrust-2.3.0}/hooks/pre-commit +42 -34
  11. {codetrust-2.2.2 → codetrust-2.3.0}/metrics.json +6 -6
  12. {codetrust-2.2.2 → codetrust-2.3.0}/pyproject.toml +17 -2
  13. {codetrust-2.2.2 → codetrust-2.3.0}/src/api.py +16 -1
  14. codetrust-2.3.0/src/cli.py +3052 -0
  15. {codetrust-2.2.2 → codetrust-2.3.0}/src/config.py +1 -1
  16. {codetrust-2.2.2 → codetrust-2.3.0}/src/middleware/ip_rate_limit.py +1 -1
  17. {codetrust-2.2.2 → codetrust-2.3.0}/src/rules/anti_patterns.py +12 -4
  18. codetrust-2.3.0/src/templates/CLAUDE.md +42 -0
  19. codetrust-2.3.0/src/templates/codetrust.schema.json +81 -0
  20. {codetrust-2.2.2 → codetrust-2.3.0}/src/templates/pre-commit +58 -37
  21. codetrust-2.3.0/src/templates/taplo.toml +9 -0
  22. {codetrust-2.2.2 → codetrust-2.3.0}/src/utils/parsers.py +4 -0
  23. codetrust-2.2.2/.codetrust/.gitkeep +0 -1
  24. codetrust-2.2.2/.codetrust/audit.jsonl +0 -17
  25. codetrust-2.2.2/.github/dependabot.yml +0 -63
  26. codetrust-2.2.2/.github/workflows/ci.yml +0 -166
  27. codetrust-2.2.2/.github/workflows/codetrust-scan.yml +0 -117
  28. codetrust-2.2.2/.github/workflows/release.yml +0 -158
  29. codetrust-2.2.2/action/scan_runner.py +0 -441
  30. codetrust-2.2.2/dashboard/e2e/dashboard.spec.ts +0 -75
  31. codetrust-2.2.2/dashboard/next.config.js +0 -9
  32. codetrust-2.2.2/dashboard/package-lock.json +0 -8930
  33. codetrust-2.2.2/dashboard/package.json +0 -43
  34. codetrust-2.2.2/dashboard/playwright.config.ts +0 -28
  35. codetrust-2.2.2/dashboard/postcss.config.js +0 -6
  36. codetrust-2.2.2/dashboard/prisma/schema.prisma +0 -55
  37. codetrust-2.2.2/dashboard/src/__tests__/dashboard-nav.test.tsx +0 -49
  38. codetrust-2.2.2/dashboard/src/__tests__/governance-audit.test.tsx +0 -117
  39. codetrust-2.2.2/dashboard/src/__tests__/scan-history.test.tsx +0 -87
  40. codetrust-2.2.2/dashboard/src/__tests__/setup.ts +0 -1
  41. codetrust-2.2.2/dashboard/src/app/api/auth/[...nextauth]/route.ts +0 -6
  42. codetrust-2.2.2/dashboard/src/app/api/webhooks/stripe/route.ts +0 -52
  43. codetrust-2.2.2/dashboard/src/app/dashboard/api-keys/page.tsx +0 -26
  44. codetrust-2.2.2/dashboard/src/app/dashboard/governance/page.tsx +0 -75
  45. codetrust-2.2.2/dashboard/src/app/dashboard/layout.tsx +0 -23
  46. codetrust-2.2.2/dashboard/src/app/dashboard/page.tsx +0 -60
  47. codetrust-2.2.2/dashboard/src/app/dashboard/settings/page.tsx +0 -22
  48. codetrust-2.2.2/dashboard/src/app/globals.css +0 -26
  49. codetrust-2.2.2/dashboard/src/app/layout.tsx +0 -23
  50. codetrust-2.2.2/dashboard/src/app/login/page.tsx +0 -34
  51. codetrust-2.2.2/dashboard/src/app/page.tsx +0 -118
  52. codetrust-2.2.2/dashboard/src/app/pricing/page.tsx +0 -114
  53. codetrust-2.2.2/dashboard/src/components/api-key-manager.tsx +0 -171
  54. codetrust-2.2.2/dashboard/src/components/dashboard-nav.tsx +0 -70
  55. codetrust-2.2.2/dashboard/src/components/governance-audit.tsx +0 -163
  56. codetrust-2.2.2/dashboard/src/components/providers.tsx +0 -7
  57. codetrust-2.2.2/dashboard/src/components/scan-history.tsx +0 -87
  58. codetrust-2.2.2/dashboard/src/components/settings-form.tsx +0 -112
  59. codetrust-2.2.2/dashboard/src/components/usage-chart.tsx +0 -48
  60. codetrust-2.2.2/dashboard/src/lib/api.ts +0 -166
  61. codetrust-2.2.2/dashboard/src/lib/auth.ts +0 -48
  62. codetrust-2.2.2/dashboard/src/lib/prisma.ts +0 -11
  63. codetrust-2.2.2/dashboard/tailwind.config.ts +0 -28
  64. codetrust-2.2.2/dashboard/tsconfig.json +0 -40
  65. codetrust-2.2.2/dashboard/vitest.config.ts +0 -17
  66. codetrust-2.2.2/deploy/helm/codetrust/Chart.yaml +0 -18
  67. codetrust-2.2.2/deploy/helm/codetrust/templates/_helpers.tpl +0 -69
  68. codetrust-2.2.2/deploy/helm/codetrust/templates/configmap.yaml +0 -16
  69. codetrust-2.2.2/deploy/helm/codetrust/templates/deployment.yaml +0 -110
  70. codetrust-2.2.2/deploy/helm/codetrust/templates/hpa.yaml +0 -32
  71. codetrust-2.2.2/deploy/helm/codetrust/templates/ingress.yaml +0 -41
  72. codetrust-2.2.2/deploy/helm/codetrust/templates/secret.yaml +0 -18
  73. codetrust-2.2.2/deploy/helm/codetrust/templates/service.yaml +0 -19
  74. codetrust-2.2.2/deploy/helm/codetrust/templates/serviceaccount.yaml +0 -12
  75. codetrust-2.2.2/deploy/helm/codetrust/values.yaml +0 -151
  76. codetrust-2.2.2/docs/apple-touch-icon.png +0 -0
  77. codetrust-2.2.2/docs/compliance/soc2-controls.md +0 -170
  78. codetrust-2.2.2/docs/favicon-16.png +0 -0
  79. codetrust-2.2.2/docs/favicon-32.png +0 -0
  80. codetrust-2.2.2/docs/favicon.png +0 -0
  81. codetrust-2.2.2/docs/favicon.svg +0 -15
  82. codetrust-2.2.2/docs/index.html +0 -2541
  83. codetrust-2.2.2/docs/logo.png +0 -0
  84. codetrust-2.2.2/docs/openapi.json +0 -2052
  85. codetrust-2.2.2/extension/.eslintrc.json +0 -30
  86. codetrust-2.2.2/extension/.vscodeignore +0 -9
  87. codetrust-2.2.2/extension/LICENSE +0 -28
  88. codetrust-2.2.2/extension/README.md +0 -163
  89. codetrust-2.2.2/extension/images/icon.png +0 -0
  90. codetrust-2.2.2/extension/out/api-client.d.ts +0 -36
  91. codetrust-2.2.2/extension/out/api-client.d.ts.map +0 -1
  92. codetrust-2.2.2/extension/out/api-client.js +0 -169
  93. codetrust-2.2.2/extension/out/api-client.js.map +0 -1
  94. codetrust-2.2.2/extension/out/code-actions.d.ts +0 -26
  95. codetrust-2.2.2/extension/out/code-actions.d.ts.map +0 -1
  96. codetrust-2.2.2/extension/out/code-actions.js +0 -201
  97. codetrust-2.2.2/extension/out/code-actions.js.map +0 -1
  98. codetrust-2.2.2/extension/out/commands.d.ts +0 -22
  99. codetrust-2.2.2/extension/out/commands.d.ts.map +0 -1
  100. codetrust-2.2.2/extension/out/commands.js +0 -447
  101. codetrust-2.2.2/extension/out/commands.js.map +0 -1
  102. codetrust-2.2.2/extension/out/config.d.ts +0 -8
  103. codetrust-2.2.2/extension/out/config.d.ts.map +0 -1
  104. codetrust-2.2.2/extension/out/config.js +0 -68
  105. codetrust-2.2.2/extension/out/config.js.map +0 -1
  106. codetrust-2.2.2/extension/out/diagnostics.d.ts +0 -28
  107. codetrust-2.2.2/extension/out/diagnostics.d.ts.map +0 -1
  108. codetrust-2.2.2/extension/out/diagnostics.js +0 -181
  109. codetrust-2.2.2/extension/out/diagnostics.js.map +0 -1
  110. codetrust-2.2.2/extension/out/embedded-scanner.d.ts +0 -18
  111. codetrust-2.2.2/extension/out/embedded-scanner.d.ts.map +0 -1
  112. codetrust-2.2.2/extension/out/embedded-scanner.js +0 -822
  113. codetrust-2.2.2/extension/out/embedded-scanner.js.map +0 -1
  114. codetrust-2.2.2/extension/out/extension.d.ts +0 -16
  115. codetrust-2.2.2/extension/out/extension.d.ts.map +0 -1
  116. codetrust-2.2.2/extension/out/extension.js +0 -125
  117. codetrust-2.2.2/extension/out/extension.js.map +0 -1
  118. codetrust-2.2.2/extension/out/parsers.d.ts +0 -15
  119. codetrust-2.2.2/extension/out/parsers.d.ts.map +0 -1
  120. codetrust-2.2.2/extension/out/parsers.js +0 -176
  121. codetrust-2.2.2/extension/out/parsers.js.map +0 -1
  122. codetrust-2.2.2/extension/out/status-bar.d.ts +0 -23
  123. codetrust-2.2.2/extension/out/status-bar.d.ts.map +0 -1
  124. codetrust-2.2.2/extension/out/status-bar.js +0 -134
  125. codetrust-2.2.2/extension/out/status-bar.js.map +0 -1
  126. codetrust-2.2.2/extension/out/test/runTest.d.ts +0 -6
  127. codetrust-2.2.2/extension/out/test/runTest.d.ts.map +0 -1
  128. codetrust-2.2.2/extension/out/test/runTest.js +0 -56
  129. codetrust-2.2.2/extension/out/test/runTest.js.map +0 -1
  130. codetrust-2.2.2/extension/out/test/suite/api-client.test.d.ts +0 -6
  131. codetrust-2.2.2/extension/out/test/suite/api-client.test.d.ts.map +0 -1
  132. codetrust-2.2.2/extension/out/test/suite/api-client.test.js +0 -112
  133. codetrust-2.2.2/extension/out/test/suite/api-client.test.js.map +0 -1
  134. codetrust-2.2.2/extension/out/test/suite/embedded-scanner.test.d.ts +0 -6
  135. codetrust-2.2.2/extension/out/test/suite/embedded-scanner.test.d.ts.map +0 -1
  136. codetrust-2.2.2/extension/out/test/suite/embedded-scanner.test.js +0 -285
  137. codetrust-2.2.2/extension/out/test/suite/embedded-scanner.test.js.map +0 -1
  138. codetrust-2.2.2/extension/out/test/suite/index.d.ts +0 -5
  139. codetrust-2.2.2/extension/out/test/suite/index.d.ts.map +0 -1
  140. codetrust-2.2.2/extension/out/test/suite/index.js +0 -67
  141. codetrust-2.2.2/extension/out/test/suite/index.js.map +0 -1
  142. codetrust-2.2.2/extension/out/test/suite/parsers.test.d.ts +0 -6
  143. codetrust-2.2.2/extension/out/test/suite/parsers.test.d.ts.map +0 -1
  144. codetrust-2.2.2/extension/out/test/suite/parsers.test.js +0 -178
  145. codetrust-2.2.2/extension/out/test/suite/parsers.test.js.map +0 -1
  146. codetrust-2.2.2/extension/out/test/suite/types.test.d.ts +0 -5
  147. codetrust-2.2.2/extension/out/test/suite/types.test.d.ts.map +0 -1
  148. codetrust-2.2.2/extension/out/test/suite/types.test.js +0 -78
  149. codetrust-2.2.2/extension/out/test/suite/types.test.js.map +0 -1
  150. codetrust-2.2.2/extension/out/types.d.ts +0 -137
  151. codetrust-2.2.2/extension/out/types.d.ts.map +0 -1
  152. codetrust-2.2.2/extension/out/types.js +0 -20
  153. codetrust-2.2.2/extension/out/types.js.map +0 -1
  154. codetrust-2.2.2/extension/out/verification-cache.d.ts +0 -43
  155. codetrust-2.2.2/extension/out/verification-cache.d.ts.map +0 -1
  156. codetrust-2.2.2/extension/out/verification-cache.js +0 -143
  157. codetrust-2.2.2/extension/out/verification-cache.js.map +0 -1
  158. codetrust-2.2.2/extension/package-lock.json +0 -5186
  159. codetrust-2.2.2/extension/package.json +0 -222
  160. codetrust-2.2.2/extension/src/api-client.ts +0 -182
  161. codetrust-2.2.2/extension/src/code-actions.ts +0 -249
  162. codetrust-2.2.2/extension/src/commands.ts +0 -612
  163. codetrust-2.2.2/extension/src/config.ts +0 -35
  164. codetrust-2.2.2/extension/src/diagnostics.ts +0 -213
  165. codetrust-2.2.2/extension/src/embedded-scanner.ts +0 -938
  166. codetrust-2.2.2/extension/src/extension.ts +0 -123
  167. codetrust-2.2.2/extension/src/parsers.ts +0 -222
  168. codetrust-2.2.2/extension/src/status-bar.ts +0 -120
  169. codetrust-2.2.2/extension/src/test/runTest.ts +0 -23
  170. codetrust-2.2.2/extension/src/test/suite/api-client.test.ts +0 -83
  171. codetrust-2.2.2/extension/src/test/suite/embedded-scanner.test.ts +0 -290
  172. codetrust-2.2.2/extension/src/test/suite/index.ts +0 -28
  173. codetrust-2.2.2/extension/src/test/suite/parsers.test.ts +0 -165
  174. codetrust-2.2.2/extension/src/test/suite/types.test.ts +0 -53
  175. codetrust-2.2.2/extension/src/types.ts +0 -171
  176. codetrust-2.2.2/extension/src/verification-cache.ts +0 -170
  177. codetrust-2.2.2/extension/tsconfig.json +0 -27
  178. codetrust-2.2.2/generate_icons.py +0 -87
  179. codetrust-2.2.2/sandbox/go/Dockerfile +0 -10
  180. codetrust-2.2.2/sandbox/node/Dockerfile +0 -9
  181. codetrust-2.2.2/sandbox/python/Dockerfile +0 -15
  182. codetrust-2.2.2/sandbox/rust/Dockerfile +0 -10
  183. codetrust-2.2.2/src/cli.py +0 -1222
  184. codetrust-2.2.2/tests/__init__.py +0 -0
  185. codetrust-2.2.2/tests/conftest.py +0 -60
  186. codetrust-2.2.2/tests/load/README.md +0 -121
  187. codetrust-2.2.2/tests/load/locustfile.py +0 -227
  188. codetrust-2.2.2/tests/test_api_coverage.py +0 -296
  189. codetrust-2.2.2/tests/test_api_endpoints.py +0 -492
  190. codetrust-2.2.2/tests/test_ast.py +0 -786
  191. codetrust-2.2.2/tests/test_auth_service.py +0 -240
  192. codetrust-2.2.2/tests/test_billing.py +0 -257
  193. codetrust-2.2.2/tests/test_cache.py +0 -96
  194. codetrust-2.2.2/tests/test_cache_service.py +0 -108
  195. codetrust-2.2.2/tests/test_cli.py +0 -664
  196. codetrust-2.2.2/tests/test_cli_coverage.py +0 -360
  197. codetrust-2.2.2/tests/test_custom_rules.py +0 -287
  198. codetrust-2.2.2/tests/test_dashboard_api.py +0 -242
  199. codetrust-2.2.2/tests/test_database.py +0 -332
  200. codetrust-2.2.2/tests/test_deep_scan.py +0 -325
  201. codetrust-2.2.2/tests/test_devops_rules.py +0 -195
  202. codetrust-2.2.2/tests/test_docker.py +0 -332
  203. codetrust-2.2.2/tests/test_e2e_integration.py +0 -382
  204. codetrust-2.2.2/tests/test_gateway.py +0 -732
  205. codetrust-2.2.2/tests/test_gateway_server.py +0 -193
  206. codetrust-2.2.2/tests/test_gdpr.py +0 -235
  207. codetrust-2.2.2/tests/test_github_action.py +0 -433
  208. codetrust-2.2.2/tests/test_go_rust_registry.py +0 -558
  209. codetrust-2.2.2/tests/test_import_verifier.py +0 -500
  210. codetrust-2.2.2/tests/test_ip_rate_limit.py +0 -205
  211. codetrust-2.2.2/tests/test_metrics.py +0 -164
  212. codetrust-2.2.2/tests/test_moat.py +0 -765
  213. codetrust-2.2.2/tests/test_models.py +0 -393
  214. codetrust-2.2.2/tests/test_new_rules.py +0 -486
  215. codetrust-2.2.2/tests/test_oidc_integration.py +0 -315
  216. codetrust-2.2.2/tests/test_parity.py +0 -328
  217. codetrust-2.2.2/tests/test_parsers.py +0 -262
  218. codetrust-2.2.2/tests/test_rate_limit.py +0 -147
  219. codetrust-2.2.2/tests/test_registry.py +0 -527
  220. codetrust-2.2.2/tests/test_sandbox.py +0 -980
  221. codetrust-2.2.2/tests/test_sarif.py +0 -388
  222. codetrust-2.2.2/tests/test_siem.py +0 -319
  223. codetrust-2.2.2/tests/test_similarity.py +0 -98
  224. codetrust-2.2.2/tests/test_sql_rules.py +0 -258
  225. codetrust-2.2.2/tests/test_sso.py +0 -431
  226. codetrust-2.2.2/tests/test_static.py +0 -339
  227. codetrust-2.2.2/tests/test_tenant.py +0 -178
  228. codetrust-2.2.2/tests/test_webhooks.py +0 -273
  229. {codetrust-2.2.2 → codetrust-2.3.0}/.codetrust.toml +0 -0
  230. {codetrust-2.2.2 → codetrust-2.3.0}/.cursorrules +0 -0
  231. {codetrust-2.2.2 → codetrust-2.3.0}/CONTRIBUTING.md +0 -0
  232. {codetrust-2.2.2 → codetrust-2.3.0}/Dockerfile +0 -0
  233. {codetrust-2.2.2 → codetrust-2.3.0}/LICENSE +0 -0
  234. {codetrust-2.2.2 → codetrust-2.3.0}/Procfile +0 -0
  235. {codetrust-2.2.2 → codetrust-2.3.0}/SECURITY.md +0 -0
  236. {codetrust-2.2.2 → codetrust-2.3.0}/action/action.yml +0 -0
  237. {codetrust-2.2.2 → codetrust-2.3.0}/action/scan.py +0 -0
  238. {codetrust-2.2.2 → codetrust-2.3.0}/alembic/README +0 -0
  239. {codetrust-2.2.2 → codetrust-2.3.0}/alembic/env.py +0 -0
  240. {codetrust-2.2.2 → codetrust-2.3.0}/alembic/script.py.mako +0 -0
  241. {codetrust-2.2.2 → codetrust-2.3.0}/alembic/versions/b74aff4dff57_initial_schema_users_api_keys_scan_logs_.py +0 -0
  242. {codetrust-2.2.2 → codetrust-2.3.0}/alembic.ini +0 -0
  243. {codetrust-2.2.2 → codetrust-2.3.0}/docker-compose.yml +0 -0
  244. {codetrust-2.2.2 → codetrust-2.3.0}/icon.png +0 -0
  245. {codetrust-2.2.2 → codetrust-2.3.0}/railway.toml +0 -0
  246. {codetrust-2.2.2 → codetrust-2.3.0}/scripts/export_openapi.py +0 -0
  247. {codetrust-2.2.2 → codetrust-2.3.0}/scripts/generate_icons.py +0 -0
  248. {codetrust-2.2.2 → codetrust-2.3.0}/scripts/generate_metrics.py +0 -0
  249. {codetrust-2.2.2 → codetrust-2.3.0}/scripts/validate_readme_metrics.py +0 -0
  250. {codetrust-2.2.2 → codetrust-2.3.0}/setup.sh +0 -0
  251. {codetrust-2.2.2 → codetrust-2.3.0}/smoke_test.sh +0 -0
  252. {codetrust-2.2.2 → codetrust-2.3.0}/src/__init__.py +0 -0
  253. {codetrust-2.2.2 → codetrust-2.3.0}/src/formatters/__init__.py +0 -0
  254. {codetrust-2.2.2 → codetrust-2.3.0}/src/formatters/sarif.py +0 -0
  255. {codetrust-2.2.2 → codetrust-2.3.0}/src/gateway/__init__.py +0 -0
  256. {codetrust-2.2.2 → codetrust-2.3.0}/src/gateway/audit.py +0 -0
  257. {codetrust-2.2.2 → codetrust-2.3.0}/src/gateway/custom_rules.py +0 -0
  258. {codetrust-2.2.2 → codetrust-2.3.0}/src/gateway/interceptor.py +0 -0
  259. {codetrust-2.2.2 → codetrust-2.3.0}/src/gateway/policies.py +0 -0
  260. {codetrust-2.2.2 → codetrust-2.3.0}/src/gateway/server.py +0 -0
  261. {codetrust-2.2.2 → codetrust-2.3.0}/src/gateway/siem.py +0 -0
  262. {codetrust-2.2.2 → codetrust-2.3.0}/src/gateway/webhooks.py +0 -0
  263. {codetrust-2.2.2 → codetrust-2.3.0}/src/middleware/__init__.py +0 -0
  264. {codetrust-2.2.2 → codetrust-2.3.0}/src/middleware/metrics.py +0 -0
  265. {codetrust-2.2.2 → codetrust-2.3.0}/src/models/__init__.py +0 -0
  266. {codetrust-2.2.2 → codetrust-2.3.0}/src/models/database.py +0 -0
  267. {codetrust-2.2.2 → codetrust-2.3.0}/src/models/enums.py +0 -0
  268. {codetrust-2.2.2 → codetrust-2.3.0}/src/models/requests.py +0 -0
  269. {codetrust-2.2.2 → codetrust-2.3.0}/src/models/responses.py +0 -0
  270. {codetrust-2.2.2 → codetrust-2.3.0}/src/rules/__init__.py +0 -0
  271. {codetrust-2.2.2 → codetrust-2.3.0}/src/rules/enterprise.py +0 -0
  272. {codetrust-2.2.2 → codetrust-2.3.0}/src/server.py +0 -0
  273. {codetrust-2.2.2 → codetrust-2.3.0}/src/services/__init__.py +0 -0
  274. {codetrust-2.2.2 → codetrust-2.3.0}/src/services/ast_analyzer.py +0 -0
  275. {codetrust-2.2.2 → codetrust-2.3.0}/src/services/auth.py +0 -0
  276. {codetrust-2.2.2 → codetrust-2.3.0}/src/services/billing.py +0 -0
  277. {codetrust-2.2.2 → codetrust-2.3.0}/src/services/cache.py +0 -0
  278. {codetrust-2.2.2 → codetrust-2.3.0}/src/services/database.py +0 -0
  279. {codetrust-2.2.2 → codetrust-2.3.0}/src/services/docker_verify.py +0 -0
  280. {codetrust-2.2.2 → codetrust-2.3.0}/src/services/gdpr.py +0 -0
  281. {codetrust-2.2.2 → codetrust-2.3.0}/src/services/import_verifier.py +0 -0
  282. {codetrust-2.2.2 → codetrust-2.3.0}/src/services/rate_limiter.py +0 -0
  283. {codetrust-2.2.2 → codetrust-2.3.0}/src/services/registry.py +0 -0
  284. {codetrust-2.2.2 → codetrust-2.3.0}/src/services/sandbox.py +0 -0
  285. {codetrust-2.2.2 → codetrust-2.3.0}/src/services/sso.py +0 -0
  286. {codetrust-2.2.2 → codetrust-2.3.0}/src/services/static_analyzer.py +0 -0
  287. {codetrust-2.2.2 → codetrust-2.3.0}/src/services/tenant.py +0 -0
  288. {codetrust-2.2.2 → codetrust-2.3.0}/src/templates/__init__.py +0 -0
  289. {codetrust-2.2.2 → codetrust-2.3.0}/src/templates/codetrust-scan.yml +0 -0
  290. {codetrust-2.2.2 → codetrust-2.3.0}/src/templates/codetrust.toml +0 -0
  291. {codetrust-2.2.2 → codetrust-2.3.0}/src/templates/cursorrules +0 -0
  292. {codetrust-2.2.2 → codetrust-2.3.0}/src/utils/__init__.py +0 -0
  293. {codetrust-2.2.2 → codetrust-2.3.0}/src/utils/similarity.py +0 -0
@@ -0,0 +1,74 @@
1
+ # ============================================================
2
+ # CodeTrust — Environment Variables
3
+ # Copy to .env and fill in your values: cp .env.example .env
4
+ # All variables are prefixed with CODETRUST_.
5
+ # ============================================================
6
+
7
+ # --- Server ---
8
+ CODETRUST_HOST=0.0.0.0
9
+ CODETRUST_PORT=8000
10
+ CODETRUST_DEBUG=false
11
+
12
+ # --- Auth ---
13
+ # API key for authenticating requests (≥32 chars, leave empty for local dev)
14
+ # Generate with: openssl rand -hex 32
15
+ CODETRUST_API_KEY=
16
+
17
+ # --- Redis ---
18
+ CODETRUST_REDIS_URL=redis://localhost:6379
19
+ CODETRUST_REDIS_ENABLED=true
20
+
21
+ # --- Cache TTLs (seconds) ---
22
+ CODETRUST_CACHE_TTL_PACKAGE_EXISTS=86400
23
+ CODETRUST_CACHE_TTL_PACKAGE_VERSION=3600
24
+ CODETRUST_CACHE_TTL_DOCKER_TAG=86400
25
+ CODETRUST_CACHE_TTL_API_ENDPOINT=1800
26
+ CODETRUST_CACHE_TTL_NOT_FOUND=3600
27
+
28
+ # --- HTTP ---
29
+ CODETRUST_HTTP_TIMEOUT=10.0
30
+ CODETRUST_HTTP_MAX_CONNECTIONS=50
31
+ CODETRUST_HTTP_MAX_KEEPALIVE=20
32
+
33
+ # --- Sandbox ---
34
+ CODETRUST_SANDBOX_ENABLED=false
35
+ CODETRUST_SANDBOX_MEMORY_LIMIT=256m
36
+ CODETRUST_SANDBOX_DEFAULT_TIMEOUT=10
37
+ CODETRUST_SANDBOX_MAX_TIMEOUT=30
38
+
39
+ # --- Rate Limits ---
40
+ CODETRUST_FREE_TIER_DAILY_LIMIT=100
41
+ CODETRUST_PRO_TIER_DAILY_LIMIT=10000
42
+
43
+ # --- Database ---
44
+ # Local dev: sqlite. Production: PostgreSQL (Railway provides this)
45
+ CODETRUST_DATABASE_URL=sqlite+aiosqlite:///codetrust.db
46
+ # Production example:
47
+ # CODETRUST_DATABASE_URL=postgresql+asyncpg://user:pass@host:5432/codetrust
48
+ CODETRUST_DATABASE_ECHO=false
49
+ CODETRUST_DATABASE_POOL_SIZE=10
50
+ CODETRUST_DATABASE_MAX_OVERFLOW=20
51
+
52
+ # --- Stripe (required for billing) ---
53
+ # Dashboard: https://dashboard.stripe.com/apikeys
54
+ CODETRUST_STRIPE_SECRET_KEY=
55
+ CODETRUST_STRIPE_WEBHOOK_SECRET=
56
+ CODETRUST_STRIPE_PRICE_PRO=price_xxx
57
+ CODETRUST_STRIPE_PRICE_ENTERPRISE=price_xxx
58
+
59
+ # --- OAuth / GitHub (required for /v1/auth/github) ---
60
+ # Create app: https://github.com/settings/applications/new
61
+ # Callback URL: https://your-domain/auth/callback
62
+ CODETRUST_GITHUB_CLIENT_ID=
63
+ CODETRUST_GITHUB_CLIENT_SECRET=
64
+ # JWT secret (≥32 chars, generate with: openssl rand -hex 32)
65
+ CODETRUST_JWT_SECRET=
66
+ CODETRUST_JWT_ALGORITHM=HS256
67
+ CODETRUST_JWT_EXPIRE_MINUTES=1440
68
+
69
+ # --- Dashboard ---
70
+ CODETRUST_DASHBOARD_URL=http://localhost:3000
71
+
72
+ # --- SARIF ---
73
+ CODETRUST_SARIF_SCHEMA_URL=https://json.schemastore.org/sarif-2.1.0.json
74
+ CODETRUST_TOOL_INFO_URI=https://github.com/codetrust-ai/codetrust
@@ -14,7 +14,9 @@ venv/
14
14
  env/
15
15
 
16
16
  # IDE
17
- .vscode/
17
+ .vscode/*
18
+ !.vscode/extensions.json
19
+ !.vscode/settings.json
18
20
  .idea/
19
21
  *.swp
20
22
  *.swo
@@ -26,6 +28,7 @@ Thumbs.db
26
28
  # Environment
27
29
  .env
28
30
  .env.*
31
+ !.env.example
29
32
  *.secret
30
33
  *.pem
31
34
  *.key
@@ -41,19 +44,16 @@ docker-compose.override.yml
41
44
 
42
45
  # Local-only files (plans, notes, secrets)
43
46
  .local/
44
-
45
- # Internal docs — blueprints, specs, build plans (private, never committed)
46
47
  SESSION_LOG.md
47
- SPEC.md
48
- PLAN.md
49
- PRODUCT.md
50
- PITCH.md
51
- COMPARISON.md
52
- CLAUDE.md
53
- TEST_EVIDENCE.md
48
+
49
+ # CodeTrust runtime artifacts
50
+ .codetrust/
51
+ !.codetrust.toml
54
52
 
55
53
  # Node (in case of front-end components)
56
54
  node_modules/
55
+ .next/
56
+ next-env.d.ts
57
57
  codetrust.db
58
58
  codetrust-report.md
59
59
  codetrust-results.sarif
@@ -61,4 +61,3 @@ codetrust-results.sarif
61
61
  # VS Code Extension builds
62
62
  *.vsix
63
63
  CTfavicon.png
64
- .gitignore
@@ -5,6 +5,116 @@ All notable changes to CodeTrust will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [Unreleased]
9
+
10
+ ### Added
11
+
12
+ ### Fixed
13
+
14
+ ---
15
+
16
+ ## [2.3.0] - 2026-02-16
17
+
18
+ ### Added
19
+
20
+ - New `database_url_credentials` rule — catches database URLs with embedded passwords
21
+ (e.g. `postgresql+asyncpg://user:pass@host/db`). Handles `+asyncpg`, `+pymysql`, etc.
22
+ - Path alias test (`test_path_alias_skipped`) for `@/`, `~/`, `#/` aliases
23
+
24
+ - VS Code extension:
25
+ - Profile support commands: Create/Apply CodeTrust Profile
26
+ - Scan-on-type (opt-in, debounced, offline)
27
+ - Expanded Quick Fix coverage (deterministic transforms)
28
+ - Guided onboarding: configure API URL/key + run first scan
29
+ - API key now stored in VS Code Secret Storage (migrated from settings)
30
+ - Onboarding success confirmation message
31
+ - GitHub Action:
32
+ - PR-mode default (auto on pull_request): scans changed files and gates on new findings only
33
+ - New input `pr-mode: auto|always|never` to override behavior
34
+ - Markdown report + GitHub Actions step summary output (for PR review workflows)
35
+ - PR comment posted/updated automatically (requires `pull-requests: write`)
36
+ - Hard gate: new-findings-only baseline vs HEAD (fails PR if baseline cannot be computed)
37
+ - PR comment is idempotent (start/end markers), machine-readable, and includes actionable CLI commands
38
+ - Added a real-runner selftest workflow to verify action behavior on PRs (PASS/BLOCK + idempotent comment)
39
+ - CLI:
40
+ - `codetrust add` stack presets for `.vscode/settings.json` (`--stack auto|nextjs|node|python|go|generic`)
41
+ - Noise-control flags: `--dedupe`, `--changed-only`, `--suppress-lint-noise` (opt-in)
42
+ - Repo-aware commands: `codetrust pr-risk`, `codetrust trust-diff`, `codetrust trend record/show`
43
+ - Baseline-aware gating: `codetrust scan --baseline <ref> --fail-on-new BLOCK` (new findings only)
44
+ - Doctor onboarding: `codetrust doctor --fix` installs missing enforcement layers
45
+ - Safe autofix: `codetrust fix` (preview by default, `--apply` to write)
46
+ - Policy Wizard: `codetrust policy wizard` generates governance presets + installs `.taplo.toml` + `.codetrust.schema.json` for autocomplete
47
+
48
+ ### Fixed
49
+
50
+ - `hardcoded_secret` rule now handles Python type annotations (`secret_key: str = "change-me"`)
51
+ and compound names (`secret_key`, `secret_token`, etc.)
52
+ - `api_key_in_config` rule scoped to config file types (`.yml/.yaml/.toml/.ini/.cfg/.conf`) to avoid false BLOCK findings in Python runtime code
53
+ - CI self-scan (`fail-on: block`) stabilized by removing false-positive BLOCK on `settings.stripe_secret_key` assignment in Python service code
54
+ - JS/TS import verification no longer flags `@/components`, `@/lib`, `~/config`, `#/db`
55
+ as hallucinated packages — these are Next.js/Vite/TypeScript path aliases
56
+ - Rule count updated: 76 scan + 57 gateway = 133 total
57
+ - Test count: 1358
58
+
59
+ - Pre-commit and CLI interoperability:
60
+ - Deterministic `codetrust scan --json` output (pure JSON on stdout)
61
+ - Hook/template JSON parsing made robust (accurate warn/info counts)
62
+ - Extension tests now compile before running to ensure TS tests are executed
63
+
64
+ - Pre-commit hook reliability:
65
+ - Hook/template no longer crashes when `.venv/bin/python` is missing (new repo onboarding)
66
+ - Subprocess failures/timeouts now gracefully fall back instead of blocking commits
67
+
68
+ - API optional-auth semantics:
69
+ - When auth is not configured, `X-API-Key` / Bearer headers are ignored (no surprising 401)
70
+ - When auth is configured, invalid keys still return 401 with actionable guidance
71
+
72
+ - VS Code extension verification hardening:
73
+ - Added VS Code test-harness integration coverage for activation + `codetrust.scanFile` → diagnostics
74
+ - Added regression coverage for settings → SecretStorage API key migration
75
+
76
+ ---
77
+
78
+ ## [2.2.4] - 2026-02-13
79
+
80
+ ### Fixed
81
+
82
+ - Removed public release-process text from root README to keep product-facing docs clean
83
+ - Strengthened release sync guard to validate version parity across extension/package, pyproject,
84
+ changelog, and website (without depending on public README strings)
85
+ - Synced release-prep versioning across backend/API docs/site to `2.2.4`
86
+
87
+ ### Changed
88
+
89
+ - Prepared manual release candidate `2.2.4` locally (no deploy, no push)
90
+
91
+ ### Released
92
+
93
+ - Published `codetrust==2.2.4` to PyPI
94
+ - Published `SaidBorna.codetrust v2.2.4` to VS Code Marketplace
95
+
96
+ ---
97
+
98
+ ## [2.2.3] - 2026-02-13
99
+
100
+ ### Fixed
101
+
102
+ - VS Code extension lint blockers resolved:
103
+ - removed unnecessary regex escape in embedded scanner rules
104
+ - added explicit return types for registered command handlers
105
+ - removed unused status bar variable
106
+ - Dashboard build blockers resolved:
107
+ - added missing dependency `@next-auth/prisma-adapter`
108
+ - updated Stripe API version typing in webhook route
109
+ - deferred Stripe client initialization to request-time with env validation to avoid build-time failure
110
+
111
+ ### Released
112
+
113
+ - Published to VS Code Marketplace: `SaidBorna.codetrust` **v2.2.3**
114
+ - PyPI release remains pending (Python package version unchanged)
115
+
116
+ ---
117
+
8
118
  ## [2.2.2] - 2026-02-13
9
119
 
10
120
  ### Security
@@ -242,7 +352,7 @@ Not just a snapshot — a real metric that tracks how your codebase is evolving.
242
352
  - **Procfile** — removed `alembic upgrade head &&` that blocked server start; migration now handled by `preDeployCommand`
243
353
  - **railway.toml** — removed `preDeployCommand` (alembic migration was hanging on DB lock)
244
354
  - **blocking_prestart self-scan** — split regex string with concatenation to prevent rule definitions from self-matching in `cli.py`, `anti_patterns.py`, `pre-commit`, `templates/pre-commit`
245
- - **GitHub Action heredoc** — replaced `<<EOF` with dynamic delimiter in `.github/workflows/codetrust-scan.yml`
355
+ - **GitHub Action heredoc** — replaced a fixed heredoc delimiter with a dynamic delimiter in `.github/workflows/codetrust-scan.yml`
246
356
  - **4 except_swallow BLOCK violations** in production code:
247
357
  - `src/cli.py:522` — `except: pass` → `hooks_path_set = False`
248
358
  - `src/services/registry.py:539` — `except: pass` → `logger.debug()`
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: codetrust
3
- Version: 2.2.2
4
- Summary: AI code safety platform — 132 rules, 10 enforcement layers, 3 moats no other tool has. AI Governance Gateway blocks destructive AI agent actions before execution (57 real-time rules). Hallucination Detection verifies every import against PyPI/npm/crates.io/Go proxy. Trust Score tracks code safety drift over time. 27 API endpoints, 17 MCP tools, 1314 tests. CLI, VS Code extension, GitHub Action, and MCP server.
3
+ Version: 2.3.0
4
+ Summary: AI code safety platform — 133 rules, 10 enforcement layers, 3 moats no other tool has. AI Governance Gateway blocks destructive AI agent actions before execution (57 real-time rules). Hallucination Detection verifies every import against PyPI/npm/crates.io/Go proxy. Trust Score tracks code safety drift over time. 27 API endpoints, 17 MCP tools, 1358 tests. CLI, VS Code extension, GitHub Action, and MCP server.
5
5
  Project-URL: Homepage, https://codetrust.saidborna.com
6
6
  Project-URL: Repository, https://github.com/S-Borna/codetrust
7
7
  Project-URL: Documentation, https://codetrust.saidborna.com
@@ -48,13 +48,17 @@ Requires-Dist: ruff>=0.5.0; extra == 'dev'
48
48
  Description-Content-Type: text/markdown
49
49
 
50
50
  <p align="center">
51
- <img src="https://raw.githubusercontent.com/S-Borna/codetrust/main/docs/logo.png" alt="CodeTrust" width="420">
51
+ <img src="https://codetrust.saidborna.com/logo.png" alt="CodeTrust" width="420">
52
52
  </p>
53
53
 
54
54
  <p align="center">
55
55
  <strong>Trust the code. Ship with proof.</strong>
56
56
  </p>
57
57
 
58
+ <p align="center">
59
+ <code>Current: v2.3.0</code> &middot; <code>1358 tests</code> &middot; <code>133 rules</code> &middot; <code>10 layers</code>
60
+ </p>
61
+
58
62
  <p align="center">
59
63
  <a href="https://pypi.org/project/codetrust/"><img src="https://img.shields.io/pypi/v/codetrust?style=flat-square&color=38d8fd" alt="PyPI"></a>
60
64
  <a href="https://marketplace.visualstudio.com/items?itemName=SaidBorna.codetrust"><img src="https://img.shields.io/visual-studio-marketplace/v/SaidBorna.codetrust?style=flat-square&color=5bca78" alt="VS Code Marketplace"></a>
@@ -74,7 +78,7 @@ Description-Content-Type: text/markdown
74
78
 
75
79
  ## What CodeTrust Is
76
80
 
77
- **AI Governance Enforcement Platform** — 132 rules across 10 enforcement layers, 17 MCP tools, 27 API endpoints. 1,314 tests.
81
+ **AI Governance Enforcement Platform** — 133 rules across 10 enforcement layers, 17 MCP tools, 27 API endpoints. 1,358 tests.
78
82
 
79
83
  CodeTrust prevents unsafe, hallucinated, and destructive AI-generated code from reaching production. It enforces safety across the entire development lifecycle — before execution, during development, before commit, during CI/CD, and before deployment.
80
84
 
@@ -139,7 +143,7 @@ AI writes code fast. But fast doesn't mean safe. **78% of developers** use AI co
139
143
  | Failure Mode | What Happens | Who Catches It |
140
144
  |---|---|---|
141
145
  | **Hallucinated packages** | `pip install` fails — or worse: typosquatted malware installs | CodeTrust verifies imports against live registries |
142
- | **Destructive agent commands** | `rm -rf /`, `eval()`, `curl\|sh` — data loss, RCE, supply chain compromise | CodeTrust Gateway intercepts before execution |
146
+ | **Destructive agent commands** | `rm -rf /`, dynamic code execution, `curl\|sh` — data loss, RCE, supply chain compromise | CodeTrust Gateway intercepts before execution |
143
147
  | **Ghost Docker images** | AI references images that don't exist — build breaks at 2AM | CodeTrust validates images against Docker Hub |
144
148
  | **Invisible code drift** | AI code quality degrades gradually — no one measures it | CodeTrust tracks trust score over time |
145
149
 
@@ -160,7 +164,7 @@ Unlike traditional tools, CodeTrust uniquely combines pre-execution interception
160
164
 
161
165
  CodeTrust scans code across 10 layers covering static analysis, root cause analysis, SQL safety, AST structural analysis, container hardening, infrastructure-as-code, framework-specific rules (React, Kubernetes, CI/CD), live import verification, Docker image verification, and the real-time AI governance gateway.
162
166
 
163
- **75 scan rules + 57 gateway rules = 132 total.** Every rule produces a BLOCK, WARN, or INFO verdict.
167
+ **76 scan rules + 57 gateway rules = 133 total.** Every rule produces a BLOCK, WARN, or INFO verdict.
164
168
 
165
169
  ---
166
170
 
@@ -229,9 +233,9 @@ codetrust scan .
229
233
  |---------|---------|--------------|
230
234
  | **CLI** | `pip install codetrust` | Full scan from terminal with exit code enforcement |
231
235
  | **VS Code** | Install from Marketplace | Scan on save, inline diagnostics, AI governance |
232
- | **GitHub Action** | `uses: S-Borna/codetrust@v2` | PR checks with SARIF upload to Security tab |
236
+ | **GitHub Action** | `uses: S-Borna/codetrust@v2.3.0` | PR checks with SARIF upload to Security tab |
233
237
  | **MCP Server** | 17 tools for AI agents | Claude Code / Cursor get real-time safety feedback |
234
- | **REST API** | 27 endpoints, authenticated | Integrate into any pipeline or platform |
238
+ | **REST API** | 27 endpoints with rate limiting | Integrate into any pipeline or platform |
235
239
 
236
240
  ---
237
241
 
@@ -243,10 +247,19 @@ codetrust scan src/ # Scan a directory
243
247
  codetrust scan . --sarif # SARIF output for CI
244
248
  codetrust scan . --json # JSON output
245
249
  codetrust scan . --no-verify-imports # Skip registry checks (offline)
250
+ codetrust scan . --changed-only --dedupe # Reduce noise in large repos
251
+ codetrust scan . --suppress-lint-noise # Optional suppression for lint-heavy output
246
252
 
247
253
  codetrust status # Check enforcement status
248
254
  codetrust doctor # Diagnose installation
249
255
 
256
+ codetrust pr-risk # Repo-aware PR risk summary (git diff aware)
257
+ codetrust trust-diff # Compare trust score: HEAD vs working tree
258
+ codetrust trend record # Record a local snapshot
259
+ codetrust trend show # Show recorded snapshots
260
+
261
+ codetrust policy wizard # Generate governance policy presets + TOML autocomplete
262
+
250
263
  codetrust governance --status # Governance overview
251
264
  codetrust governance --mode audit # Switch to audit mode
252
265
  codetrust audit --hours 24 # Review recent actions
@@ -261,17 +274,28 @@ code --install-extension SaidBorna.codetrust
261
274
  ```
262
275
 
263
276
  - Scans on save (configurable)
277
+ - Scan on type (opt-in, debounced) using the embedded offline scanner
264
278
  - Inline diagnostics with severity levels
265
279
  - Works fully offline — all scan rules embedded
266
280
  - "Scan Workspace" — up to 500 files with progress UI
281
+ - Profile create/apply commands for quick setup
282
+ - Quick Fixes for common findings
283
+ - Health Check command for connectivity and config sanity
267
284
  - AI governance controls built in
268
285
  - Deep scan mode for full analysis
269
286
 
270
287
  | Setting | Default | Description |
271
288
  |---------|---------|-------------|
289
+ | `codetrust.apiUrl` | `https://codetrust-api-production.up.railway.app` | API server URL (or `http://localhost:8000` self-hosted) |
290
+ | `codetrust.apiKey` | `""` | API key for authentication (`X-API-Key`) |
272
291
  | `codetrust.scanOnSave` | `true` | Auto-scan on save |
292
+ | `codetrust.scanOnType` | `false` | Scan while typing (embedded offline scanner) |
293
+ | `codetrust.scanOnTypeDebounceMs` | `600` | Debounce delay for scan while typing |
273
294
  | `codetrust.severityThreshold` | `INFO` | Minimum severity to show |
295
+ | `codetrust.enabledLanguages` | `[...]` | Languages to scan |
274
296
  | `codetrust.scanType` | `static` | `static` or `deep` |
297
+ | `codetrust.verifyImportsOnSave` | `false` | Verify imports on save (network) |
298
+ | `codetrust.timeout` | `15000` | Request timeout in milliseconds |
275
299
  | `codetrust.governance.enabled` | `true` | Enable AI governance |
276
300
  | `codetrust.governance.mode` | `enforce` | `enforce` / `audit` / `off` |
277
301
 
@@ -279,16 +303,27 @@ code --install-extension SaidBorna.codetrust
279
303
 
280
304
  ## GitHub Action
281
305
 
306
+ Minimum permissions required for PR comments and SARIF upload:
307
+
282
308
  ```yaml
283
- - uses: S-Borna/codetrust@v2
309
+ permissions:
310
+ actions: read
311
+ contents: read
312
+ pull-requests: write
313
+ security-events: write
314
+ ```
315
+
316
+ ```yaml
317
+ - uses: S-Borna/codetrust@v2.3.0
284
318
  with:
285
319
  fail-on: block
286
320
  scan-type: static
287
321
  sarif: true
288
- env:
289
- CODETRUST_API_KEY: ${{ secrets.CODETRUST_API_KEY }}
290
322
 
291
- - uses: github/codeql-action/upload-sarif@v3
323
+ # Optional (default: auto on pull_request)
324
+ # pr-comment: auto|always|never
325
+
326
+ - uses: github/codeql-action/upload-sarif@v4
292
327
  if: always()
293
328
  with:
294
329
  sarif_file: codetrust-results.sarif
@@ -361,7 +396,7 @@ See `codetrust init` for a starter configuration.
361
396
  |---------|---------|
362
397
  | **PyPI** | `pip install codetrust` |
363
398
  | **VS Code Marketplace** | `code --install-extension SaidBorna.codetrust` |
364
- | **GitHub Action** | `uses: S-Borna/codetrust@v2` |
399
+ | **GitHub Action** | `uses: S-Borna/codetrust@v2.3.0` |
365
400
  | **Cloud API** | Available at `codetrust-api.saidborna.com` |
366
401
  | **MCP Server** | Included in the package |
367
402
  | **Website** | [codetrust.saidborna.com](https://codetrust.saidborna.com) |
@@ -372,7 +407,7 @@ See `codetrust init` for a starter configuration.
372
407
 
373
408
  ```bash
374
409
  pip install -e ".[dev]"
375
- pytest tests/ -v # 1314 tests
410
+ pytest tests/ -v # 1358 tests
376
411
  ruff check src/ tests/ # zero warnings
377
412
  ```
378
413
 
@@ -1,11 +1,15 @@
1
1
  <p align="center">
2
- <img src="https://raw.githubusercontent.com/S-Borna/codetrust/main/docs/logo.png" alt="CodeTrust" width="420">
2
+ <img src="https://codetrust.saidborna.com/logo.png" alt="CodeTrust" width="420">
3
3
  </p>
4
4
 
5
5
  <p align="center">
6
6
  <strong>Trust the code. Ship with proof.</strong>
7
7
  </p>
8
8
 
9
+ <p align="center">
10
+ <code>Current: v2.3.0</code> &middot; <code>1358 tests</code> &middot; <code>133 rules</code> &middot; <code>10 layers</code>
11
+ </p>
12
+
9
13
  <p align="center">
10
14
  <a href="https://pypi.org/project/codetrust/"><img src="https://img.shields.io/pypi/v/codetrust?style=flat-square&color=38d8fd" alt="PyPI"></a>
11
15
  <a href="https://marketplace.visualstudio.com/items?itemName=SaidBorna.codetrust"><img src="https://img.shields.io/visual-studio-marketplace/v/SaidBorna.codetrust?style=flat-square&color=5bca78" alt="VS Code Marketplace"></a>
@@ -25,7 +29,7 @@
25
29
 
26
30
  ## What CodeTrust Is
27
31
 
28
- **AI Governance Enforcement Platform** — 132 rules across 10 enforcement layers, 17 MCP tools, 27 API endpoints. 1,314 tests.
32
+ **AI Governance Enforcement Platform** — 133 rules across 10 enforcement layers, 17 MCP tools, 27 API endpoints. 1,358 tests.
29
33
 
30
34
  CodeTrust prevents unsafe, hallucinated, and destructive AI-generated code from reaching production. It enforces safety across the entire development lifecycle — before execution, during development, before commit, during CI/CD, and before deployment.
31
35
 
@@ -90,7 +94,7 @@ AI writes code fast. But fast doesn't mean safe. **78% of developers** use AI co
90
94
  | Failure Mode | What Happens | Who Catches It |
91
95
  |---|---|---|
92
96
  | **Hallucinated packages** | `pip install` fails — or worse: typosquatted malware installs | CodeTrust verifies imports against live registries |
93
- | **Destructive agent commands** | `rm -rf /`, `eval()`, `curl\|sh` — data loss, RCE, supply chain compromise | CodeTrust Gateway intercepts before execution |
97
+ | **Destructive agent commands** | `rm -rf /`, dynamic code execution, `curl\|sh` — data loss, RCE, supply chain compromise | CodeTrust Gateway intercepts before execution |
94
98
  | **Ghost Docker images** | AI references images that don't exist — build breaks at 2AM | CodeTrust validates images against Docker Hub |
95
99
  | **Invisible code drift** | AI code quality degrades gradually — no one measures it | CodeTrust tracks trust score over time |
96
100
 
@@ -111,7 +115,7 @@ Unlike traditional tools, CodeTrust uniquely combines pre-execution interception
111
115
 
112
116
  CodeTrust scans code across 10 layers covering static analysis, root cause analysis, SQL safety, AST structural analysis, container hardening, infrastructure-as-code, framework-specific rules (React, Kubernetes, CI/CD), live import verification, Docker image verification, and the real-time AI governance gateway.
113
117
 
114
- **75 scan rules + 57 gateway rules = 132 total.** Every rule produces a BLOCK, WARN, or INFO verdict.
118
+ **76 scan rules + 57 gateway rules = 133 total.** Every rule produces a BLOCK, WARN, or INFO verdict.
115
119
 
116
120
  ---
117
121
 
@@ -180,9 +184,9 @@ codetrust scan .
180
184
  |---------|---------|--------------|
181
185
  | **CLI** | `pip install codetrust` | Full scan from terminal with exit code enforcement |
182
186
  | **VS Code** | Install from Marketplace | Scan on save, inline diagnostics, AI governance |
183
- | **GitHub Action** | `uses: S-Borna/codetrust@v2` | PR checks with SARIF upload to Security tab |
187
+ | **GitHub Action** | `uses: S-Borna/codetrust@v2.3.0` | PR checks with SARIF upload to Security tab |
184
188
  | **MCP Server** | 17 tools for AI agents | Claude Code / Cursor get real-time safety feedback |
185
- | **REST API** | 27 endpoints, authenticated | Integrate into any pipeline or platform |
189
+ | **REST API** | 27 endpoints with rate limiting | Integrate into any pipeline or platform |
186
190
 
187
191
  ---
188
192
 
@@ -194,10 +198,19 @@ codetrust scan src/ # Scan a directory
194
198
  codetrust scan . --sarif # SARIF output for CI
195
199
  codetrust scan . --json # JSON output
196
200
  codetrust scan . --no-verify-imports # Skip registry checks (offline)
201
+ codetrust scan . --changed-only --dedupe # Reduce noise in large repos
202
+ codetrust scan . --suppress-lint-noise # Optional suppression for lint-heavy output
197
203
 
198
204
  codetrust status # Check enforcement status
199
205
  codetrust doctor # Diagnose installation
200
206
 
207
+ codetrust pr-risk # Repo-aware PR risk summary (git diff aware)
208
+ codetrust trust-diff # Compare trust score: HEAD vs working tree
209
+ codetrust trend record # Record a local snapshot
210
+ codetrust trend show # Show recorded snapshots
211
+
212
+ codetrust policy wizard # Generate governance policy presets + TOML autocomplete
213
+
201
214
  codetrust governance --status # Governance overview
202
215
  codetrust governance --mode audit # Switch to audit mode
203
216
  codetrust audit --hours 24 # Review recent actions
@@ -212,17 +225,28 @@ code --install-extension SaidBorna.codetrust
212
225
  ```
213
226
 
214
227
  - Scans on save (configurable)
228
+ - Scan on type (opt-in, debounced) using the embedded offline scanner
215
229
  - Inline diagnostics with severity levels
216
230
  - Works fully offline — all scan rules embedded
217
231
  - "Scan Workspace" — up to 500 files with progress UI
232
+ - Profile create/apply commands for quick setup
233
+ - Quick Fixes for common findings
234
+ - Health Check command for connectivity and config sanity
218
235
  - AI governance controls built in
219
236
  - Deep scan mode for full analysis
220
237
 
221
238
  | Setting | Default | Description |
222
239
  |---------|---------|-------------|
240
+ | `codetrust.apiUrl` | `https://codetrust-api-production.up.railway.app` | API server URL (or `http://localhost:8000` self-hosted) |
241
+ | `codetrust.apiKey` | `""` | API key for authentication (`X-API-Key`) |
223
242
  | `codetrust.scanOnSave` | `true` | Auto-scan on save |
243
+ | `codetrust.scanOnType` | `false` | Scan while typing (embedded offline scanner) |
244
+ | `codetrust.scanOnTypeDebounceMs` | `600` | Debounce delay for scan while typing |
224
245
  | `codetrust.severityThreshold` | `INFO` | Minimum severity to show |
246
+ | `codetrust.enabledLanguages` | `[...]` | Languages to scan |
225
247
  | `codetrust.scanType` | `static` | `static` or `deep` |
248
+ | `codetrust.verifyImportsOnSave` | `false` | Verify imports on save (network) |
249
+ | `codetrust.timeout` | `15000` | Request timeout in milliseconds |
226
250
  | `codetrust.governance.enabled` | `true` | Enable AI governance |
227
251
  | `codetrust.governance.mode` | `enforce` | `enforce` / `audit` / `off` |
228
252
 
@@ -230,16 +254,27 @@ code --install-extension SaidBorna.codetrust
230
254
 
231
255
  ## GitHub Action
232
256
 
257
+ Minimum permissions required for PR comments and SARIF upload:
258
+
233
259
  ```yaml
234
- - uses: S-Borna/codetrust@v2
260
+ permissions:
261
+ actions: read
262
+ contents: read
263
+ pull-requests: write
264
+ security-events: write
265
+ ```
266
+
267
+ ```yaml
268
+ - uses: S-Borna/codetrust@v2.3.0
235
269
  with:
236
270
  fail-on: block
237
271
  scan-type: static
238
272
  sarif: true
239
- env:
240
- CODETRUST_API_KEY: ${{ secrets.CODETRUST_API_KEY }}
241
273
 
242
- - uses: github/codeql-action/upload-sarif@v3
274
+ # Optional (default: auto on pull_request)
275
+ # pr-comment: auto|always|never
276
+
277
+ - uses: github/codeql-action/upload-sarif@v4
243
278
  if: always()
244
279
  with:
245
280
  sarif_file: codetrust-results.sarif
@@ -312,7 +347,7 @@ See `codetrust init` for a starter configuration.
312
347
  |---------|---------|
313
348
  | **PyPI** | `pip install codetrust` |
314
349
  | **VS Code Marketplace** | `code --install-extension SaidBorna.codetrust` |
315
- | **GitHub Action** | `uses: S-Borna/codetrust@v2` |
350
+ | **GitHub Action** | `uses: S-Borna/codetrust@v2.3.0` |
316
351
  | **Cloud API** | Available at `codetrust-api.saidborna.com` |
317
352
  | **MCP Server** | Included in the package |
318
353
  | **Website** | [codetrust.saidborna.com](https://codetrust.saidborna.com) |
@@ -323,7 +358,7 @@ See `codetrust init` for a starter configuration.
323
358
 
324
359
  ```bash
325
360
  pip install -e ".[dev]"
326
- pytest tests/ -v # 1314 tests
361
+ pytest tests/ -v # 1358 tests
327
362
  ruff check src/ tests/ # zero warnings
328
363
  ```
329
364
 
@@ -13,6 +13,9 @@ MAX_FILE_SIZE="${CODETRUST_MAX_FILE_SIZE:-500000}"
13
13
  INCLUDE_PATTERN="${CODETRUST_INCLUDE_PATTERN:-}"
14
14
  CT_AUTH="${CODETRUST_API_KEY:-}"
15
15
  API_URL="${CODETRUST_API_URL:-https://api.codetrust.dev}"
16
+ PR_MODE="${CODETRUST_PR_MODE:-auto}"
17
+ PR_COMMENT="${CODETRUST_PR_COMMENT:-auto}"
18
+ NEW_FINDINGS_ONLY="${CODETRUST_NEW_FINDINGS_ONLY:-auto}"
16
19
 
17
20
  # ---- Resolve action root ----
18
21
  ACTION_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
@@ -32,6 +35,9 @@ python3 "${ACTION_ROOT}/action/scan_runner.py" \
32
35
  --fail-on "${FAIL_ON}" \
33
36
  --max-file-size "${MAX_FILE_SIZE}" \
34
37
  --include-pattern "${INCLUDE_PATTERN}" \
38
+ --pr-mode "${PR_MODE}" \
39
+ --pr-comment "${PR_COMMENT}" \
40
+ --new-findings-only "${NEW_FINDINGS_ONLY}" \
35
41
  --api-key "${CT_AUTH}" \
36
42
  --api-url "${API_URL}"
37
43