codetrust 2.2.4__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 (294) hide show
  1. codetrust-2.3.0/.env.example +74 -0
  2. {codetrust-2.2.4 → codetrust-2.3.0}/.gitignore +10 -12
  3. {codetrust-2.2.4 → codetrust-2.3.0}/CHANGELOG.md +58 -4
  4. {codetrust-2.2.4 → codetrust-2.3.0}/PKG-INFO +47 -10
  5. {codetrust-2.2.4 → codetrust-2.3.0}/README.md +45 -8
  6. {codetrust-2.2.4 → codetrust-2.3.0}/action/entrypoint.sh +6 -0
  7. codetrust-2.3.0/action/scan_runner.py +928 -0
  8. {codetrust-2.2.4 → codetrust-2.3.0}/action.yml +22 -2
  9. codetrust-2.3.0/dashboard/.env.example +20 -0
  10. {codetrust-2.2.4 → codetrust-2.3.0}/hooks/pre-commit +42 -34
  11. {codetrust-2.2.4 → codetrust-2.3.0}/metrics.json +3 -3
  12. {codetrust-2.2.4 → codetrust-2.3.0}/pyproject.toml +17 -2
  13. {codetrust-2.2.4 → codetrust-2.3.0}/src/api.py +16 -1
  14. codetrust-2.3.0/src/cli.py +3052 -0
  15. {codetrust-2.2.4 → codetrust-2.3.0}/src/config.py +1 -1
  16. codetrust-2.3.0/src/templates/CLAUDE.md +42 -0
  17. codetrust-2.3.0/src/templates/codetrust.schema.json +81 -0
  18. {codetrust-2.2.4 → codetrust-2.3.0}/src/templates/pre-commit +58 -37
  19. codetrust-2.3.0/src/templates/taplo.toml +9 -0
  20. codetrust-2.2.4/.codetrust/.gitkeep +0 -1
  21. codetrust-2.2.4/.codetrust/audit.jsonl +0 -19
  22. codetrust-2.2.4/.github/dependabot.yml +0 -75
  23. codetrust-2.2.4/.github/workflows/ci.yml +0 -166
  24. codetrust-2.2.4/.github/workflows/codetrust-scan.yml +0 -117
  25. codetrust-2.2.4/.github/workflows/release.yml +0 -156
  26. codetrust-2.2.4/action/scan_runner.py +0 -441
  27. codetrust-2.2.4/dashboard/e2e/dashboard.spec.ts +0 -75
  28. codetrust-2.2.4/dashboard/next.config.js +0 -9
  29. codetrust-2.2.4/dashboard/package-lock.json +0 -9004
  30. codetrust-2.2.4/dashboard/package.json +0 -44
  31. codetrust-2.2.4/dashboard/playwright.config.ts +0 -28
  32. codetrust-2.2.4/dashboard/postcss.config.js +0 -6
  33. codetrust-2.2.4/dashboard/prisma/schema.prisma +0 -55
  34. codetrust-2.2.4/dashboard/src/__tests__/dashboard-nav.test.tsx +0 -49
  35. codetrust-2.2.4/dashboard/src/__tests__/governance-audit.test.tsx +0 -117
  36. codetrust-2.2.4/dashboard/src/__tests__/scan-history.test.tsx +0 -87
  37. codetrust-2.2.4/dashboard/src/__tests__/setup.ts +0 -1
  38. codetrust-2.2.4/dashboard/src/app/api/auth/[...nextauth]/route.ts +0 -6
  39. codetrust-2.2.4/dashboard/src/app/api/webhooks/stripe/route.ts +0 -76
  40. codetrust-2.2.4/dashboard/src/app/dashboard/api-keys/page.tsx +0 -26
  41. codetrust-2.2.4/dashboard/src/app/dashboard/governance/page.tsx +0 -75
  42. codetrust-2.2.4/dashboard/src/app/dashboard/layout.tsx +0 -23
  43. codetrust-2.2.4/dashboard/src/app/dashboard/page.tsx +0 -60
  44. codetrust-2.2.4/dashboard/src/app/dashboard/settings/page.tsx +0 -22
  45. codetrust-2.2.4/dashboard/src/app/globals.css +0 -26
  46. codetrust-2.2.4/dashboard/src/app/layout.tsx +0 -23
  47. codetrust-2.2.4/dashboard/src/app/login/page.tsx +0 -34
  48. codetrust-2.2.4/dashboard/src/app/page.tsx +0 -118
  49. codetrust-2.2.4/dashboard/src/app/pricing/page.tsx +0 -114
  50. codetrust-2.2.4/dashboard/src/components/api-key-manager.tsx +0 -171
  51. codetrust-2.2.4/dashboard/src/components/dashboard-nav.tsx +0 -70
  52. codetrust-2.2.4/dashboard/src/components/governance-audit.tsx +0 -163
  53. codetrust-2.2.4/dashboard/src/components/providers.tsx +0 -7
  54. codetrust-2.2.4/dashboard/src/components/scan-history.tsx +0 -87
  55. codetrust-2.2.4/dashboard/src/components/settings-form.tsx +0 -112
  56. codetrust-2.2.4/dashboard/src/components/usage-chart.tsx +0 -48
  57. codetrust-2.2.4/dashboard/src/lib/api.ts +0 -166
  58. codetrust-2.2.4/dashboard/src/lib/auth.ts +0 -48
  59. codetrust-2.2.4/dashboard/src/lib/prisma.ts +0 -11
  60. codetrust-2.2.4/dashboard/tailwind.config.ts +0 -28
  61. codetrust-2.2.4/dashboard/tsconfig.json +0 -40
  62. codetrust-2.2.4/dashboard/vitest.config.ts +0 -17
  63. codetrust-2.2.4/deploy/helm/codetrust/Chart.yaml +0 -18
  64. codetrust-2.2.4/deploy/helm/codetrust/templates/_helpers.tpl +0 -69
  65. codetrust-2.2.4/deploy/helm/codetrust/templates/configmap.yaml +0 -16
  66. codetrust-2.2.4/deploy/helm/codetrust/templates/deployment.yaml +0 -110
  67. codetrust-2.2.4/deploy/helm/codetrust/templates/hpa.yaml +0 -32
  68. codetrust-2.2.4/deploy/helm/codetrust/templates/ingress.yaml +0 -41
  69. codetrust-2.2.4/deploy/helm/codetrust/templates/secret.yaml +0 -18
  70. codetrust-2.2.4/deploy/helm/codetrust/templates/service.yaml +0 -19
  71. codetrust-2.2.4/deploy/helm/codetrust/templates/serviceaccount.yaml +0 -12
  72. codetrust-2.2.4/deploy/helm/codetrust/values.yaml +0 -151
  73. codetrust-2.2.4/docs/apple-touch-icon.png +0 -0
  74. codetrust-2.2.4/docs/compliance/soc2-controls.md +0 -170
  75. codetrust-2.2.4/docs/favicon-16.png +0 -0
  76. codetrust-2.2.4/docs/favicon-32.png +0 -0
  77. codetrust-2.2.4/docs/favicon.png +0 -0
  78. codetrust-2.2.4/docs/favicon.svg +0 -15
  79. codetrust-2.2.4/docs/index.html +0 -2540
  80. codetrust-2.2.4/docs/logo.png +0 -0
  81. codetrust-2.2.4/docs/openapi.json +0 -2052
  82. codetrust-2.2.4/extension/.eslintrc.json +0 -30
  83. codetrust-2.2.4/extension/.vscodeignore +0 -9
  84. codetrust-2.2.4/extension/LICENSE +0 -28
  85. codetrust-2.2.4/extension/README.md +0 -163
  86. codetrust-2.2.4/extension/images/icon.png +0 -0
  87. codetrust-2.2.4/extension/out/api-client.d.ts +0 -36
  88. codetrust-2.2.4/extension/out/api-client.d.ts.map +0 -1
  89. codetrust-2.2.4/extension/out/api-client.js +0 -169
  90. codetrust-2.2.4/extension/out/api-client.js.map +0 -1
  91. codetrust-2.2.4/extension/out/code-actions.d.ts +0 -26
  92. codetrust-2.2.4/extension/out/code-actions.d.ts.map +0 -1
  93. codetrust-2.2.4/extension/out/code-actions.js +0 -201
  94. codetrust-2.2.4/extension/out/code-actions.js.map +0 -1
  95. codetrust-2.2.4/extension/out/commands.d.ts +0 -22
  96. codetrust-2.2.4/extension/out/commands.d.ts.map +0 -1
  97. codetrust-2.2.4/extension/out/commands.js +0 -447
  98. codetrust-2.2.4/extension/out/commands.js.map +0 -1
  99. codetrust-2.2.4/extension/out/config.d.ts +0 -8
  100. codetrust-2.2.4/extension/out/config.d.ts.map +0 -1
  101. codetrust-2.2.4/extension/out/config.js +0 -68
  102. codetrust-2.2.4/extension/out/config.js.map +0 -1
  103. codetrust-2.2.4/extension/out/diagnostics.d.ts +0 -28
  104. codetrust-2.2.4/extension/out/diagnostics.d.ts.map +0 -1
  105. codetrust-2.2.4/extension/out/diagnostics.js +0 -181
  106. codetrust-2.2.4/extension/out/diagnostics.js.map +0 -1
  107. codetrust-2.2.4/extension/out/embedded-scanner.d.ts +0 -18
  108. codetrust-2.2.4/extension/out/embedded-scanner.d.ts.map +0 -1
  109. codetrust-2.2.4/extension/out/embedded-scanner.js +0 -822
  110. codetrust-2.2.4/extension/out/embedded-scanner.js.map +0 -1
  111. codetrust-2.2.4/extension/out/extension.d.ts +0 -16
  112. codetrust-2.2.4/extension/out/extension.d.ts.map +0 -1
  113. codetrust-2.2.4/extension/out/extension.js +0 -125
  114. codetrust-2.2.4/extension/out/extension.js.map +0 -1
  115. codetrust-2.2.4/extension/out/parsers.d.ts +0 -15
  116. codetrust-2.2.4/extension/out/parsers.d.ts.map +0 -1
  117. codetrust-2.2.4/extension/out/parsers.js +0 -176
  118. codetrust-2.2.4/extension/out/parsers.js.map +0 -1
  119. codetrust-2.2.4/extension/out/status-bar.d.ts +0 -23
  120. codetrust-2.2.4/extension/out/status-bar.d.ts.map +0 -1
  121. codetrust-2.2.4/extension/out/status-bar.js +0 -133
  122. codetrust-2.2.4/extension/out/status-bar.js.map +0 -1
  123. codetrust-2.2.4/extension/out/test/runTest.d.ts +0 -6
  124. codetrust-2.2.4/extension/out/test/runTest.d.ts.map +0 -1
  125. codetrust-2.2.4/extension/out/test/runTest.js +0 -56
  126. codetrust-2.2.4/extension/out/test/runTest.js.map +0 -1
  127. codetrust-2.2.4/extension/out/test/suite/api-client.test.d.ts +0 -6
  128. codetrust-2.2.4/extension/out/test/suite/api-client.test.d.ts.map +0 -1
  129. codetrust-2.2.4/extension/out/test/suite/api-client.test.js +0 -112
  130. codetrust-2.2.4/extension/out/test/suite/api-client.test.js.map +0 -1
  131. codetrust-2.2.4/extension/out/test/suite/embedded-scanner.test.d.ts +0 -6
  132. codetrust-2.2.4/extension/out/test/suite/embedded-scanner.test.d.ts.map +0 -1
  133. codetrust-2.2.4/extension/out/test/suite/embedded-scanner.test.js +0 -285
  134. codetrust-2.2.4/extension/out/test/suite/embedded-scanner.test.js.map +0 -1
  135. codetrust-2.2.4/extension/out/test/suite/index.d.ts +0 -5
  136. codetrust-2.2.4/extension/out/test/suite/index.d.ts.map +0 -1
  137. codetrust-2.2.4/extension/out/test/suite/index.js +0 -67
  138. codetrust-2.2.4/extension/out/test/suite/index.js.map +0 -1
  139. codetrust-2.2.4/extension/out/test/suite/parsers.test.d.ts +0 -6
  140. codetrust-2.2.4/extension/out/test/suite/parsers.test.d.ts.map +0 -1
  141. codetrust-2.2.4/extension/out/test/suite/parsers.test.js +0 -178
  142. codetrust-2.2.4/extension/out/test/suite/parsers.test.js.map +0 -1
  143. codetrust-2.2.4/extension/out/test/suite/types.test.d.ts +0 -5
  144. codetrust-2.2.4/extension/out/test/suite/types.test.d.ts.map +0 -1
  145. codetrust-2.2.4/extension/out/test/suite/types.test.js +0 -78
  146. codetrust-2.2.4/extension/out/test/suite/types.test.js.map +0 -1
  147. codetrust-2.2.4/extension/out/types.d.ts +0 -137
  148. codetrust-2.2.4/extension/out/types.d.ts.map +0 -1
  149. codetrust-2.2.4/extension/out/types.js +0 -20
  150. codetrust-2.2.4/extension/out/types.js.map +0 -1
  151. codetrust-2.2.4/extension/out/verification-cache.d.ts +0 -43
  152. codetrust-2.2.4/extension/out/verification-cache.d.ts.map +0 -1
  153. codetrust-2.2.4/extension/out/verification-cache.js +0 -143
  154. codetrust-2.2.4/extension/out/verification-cache.js.map +0 -1
  155. codetrust-2.2.4/extension/package-lock.json +0 -5186
  156. codetrust-2.2.4/extension/package.json +0 -222
  157. codetrust-2.2.4/extension/scripts/check-release-sync.js +0 -59
  158. codetrust-2.2.4/extension/src/api-client.ts +0 -182
  159. codetrust-2.2.4/extension/src/code-actions.ts +0 -249
  160. codetrust-2.2.4/extension/src/commands.ts +0 -612
  161. codetrust-2.2.4/extension/src/config.ts +0 -35
  162. codetrust-2.2.4/extension/src/diagnostics.ts +0 -213
  163. codetrust-2.2.4/extension/src/embedded-scanner.ts +0 -938
  164. codetrust-2.2.4/extension/src/extension.ts +0 -123
  165. codetrust-2.2.4/extension/src/parsers.ts +0 -222
  166. codetrust-2.2.4/extension/src/status-bar.ts +0 -119
  167. codetrust-2.2.4/extension/src/test/runTest.ts +0 -23
  168. codetrust-2.2.4/extension/src/test/suite/api-client.test.ts +0 -83
  169. codetrust-2.2.4/extension/src/test/suite/embedded-scanner.test.ts +0 -290
  170. codetrust-2.2.4/extension/src/test/suite/index.ts +0 -28
  171. codetrust-2.2.4/extension/src/test/suite/parsers.test.ts +0 -165
  172. codetrust-2.2.4/extension/src/test/suite/types.test.ts +0 -53
  173. codetrust-2.2.4/extension/src/types.ts +0 -171
  174. codetrust-2.2.4/extension/src/verification-cache.ts +0 -170
  175. codetrust-2.2.4/extension/tsconfig.json +0 -27
  176. codetrust-2.2.4/generate_icons.py +0 -87
  177. codetrust-2.2.4/sandbox/go/Dockerfile +0 -10
  178. codetrust-2.2.4/sandbox/node/Dockerfile +0 -9
  179. codetrust-2.2.4/sandbox/python/Dockerfile +0 -15
  180. codetrust-2.2.4/sandbox/rust/Dockerfile +0 -10
  181. codetrust-2.2.4/src/cli.py +0 -1222
  182. codetrust-2.2.4/tests/__init__.py +0 -0
  183. codetrust-2.2.4/tests/conftest.py +0 -60
  184. codetrust-2.2.4/tests/load/README.md +0 -121
  185. codetrust-2.2.4/tests/load/locustfile.py +0 -227
  186. codetrust-2.2.4/tests/test_api_coverage.py +0 -296
  187. codetrust-2.2.4/tests/test_api_endpoints.py +0 -492
  188. codetrust-2.2.4/tests/test_ast.py +0 -786
  189. codetrust-2.2.4/tests/test_auth_service.py +0 -240
  190. codetrust-2.2.4/tests/test_billing.py +0 -257
  191. codetrust-2.2.4/tests/test_cache.py +0 -96
  192. codetrust-2.2.4/tests/test_cache_service.py +0 -108
  193. codetrust-2.2.4/tests/test_cli.py +0 -664
  194. codetrust-2.2.4/tests/test_cli_coverage.py +0 -360
  195. codetrust-2.2.4/tests/test_custom_rules.py +0 -287
  196. codetrust-2.2.4/tests/test_dashboard_api.py +0 -242
  197. codetrust-2.2.4/tests/test_database.py +0 -332
  198. codetrust-2.2.4/tests/test_deep_scan.py +0 -325
  199. codetrust-2.2.4/tests/test_devops_rules.py +0 -195
  200. codetrust-2.2.4/tests/test_docker.py +0 -332
  201. codetrust-2.2.4/tests/test_e2e_integration.py +0 -382
  202. codetrust-2.2.4/tests/test_gateway.py +0 -732
  203. codetrust-2.2.4/tests/test_gateway_server.py +0 -193
  204. codetrust-2.2.4/tests/test_gdpr.py +0 -235
  205. codetrust-2.2.4/tests/test_github_action.py +0 -433
  206. codetrust-2.2.4/tests/test_go_rust_registry.py +0 -558
  207. codetrust-2.2.4/tests/test_import_verifier.py +0 -500
  208. codetrust-2.2.4/tests/test_ip_rate_limit.py +0 -205
  209. codetrust-2.2.4/tests/test_metrics.py +0 -164
  210. codetrust-2.2.4/tests/test_moat.py +0 -765
  211. codetrust-2.2.4/tests/test_models.py +0 -393
  212. codetrust-2.2.4/tests/test_new_rules.py +0 -486
  213. codetrust-2.2.4/tests/test_oidc_integration.py +0 -315
  214. codetrust-2.2.4/tests/test_parity.py +0 -328
  215. codetrust-2.2.4/tests/test_parsers.py +0 -262
  216. codetrust-2.2.4/tests/test_rate_limit.py +0 -147
  217. codetrust-2.2.4/tests/test_registry.py +0 -544
  218. codetrust-2.2.4/tests/test_sandbox.py +0 -980
  219. codetrust-2.2.4/tests/test_sarif.py +0 -388
  220. codetrust-2.2.4/tests/test_siem.py +0 -319
  221. codetrust-2.2.4/tests/test_similarity.py +0 -98
  222. codetrust-2.2.4/tests/test_sql_rules.py +0 -258
  223. codetrust-2.2.4/tests/test_sso.py +0 -431
  224. codetrust-2.2.4/tests/test_static.py +0 -339
  225. codetrust-2.2.4/tests/test_tenant.py +0 -178
  226. codetrust-2.2.4/tests/test_webhooks.py +0 -273
  227. {codetrust-2.2.4 → codetrust-2.3.0}/.codetrust.toml +0 -0
  228. {codetrust-2.2.4 → codetrust-2.3.0}/.cursorrules +0 -0
  229. {codetrust-2.2.4 → codetrust-2.3.0}/CONTRIBUTING.md +0 -0
  230. {codetrust-2.2.4 → codetrust-2.3.0}/Dockerfile +0 -0
  231. {codetrust-2.2.4 → codetrust-2.3.0}/LICENSE +0 -0
  232. {codetrust-2.2.4 → codetrust-2.3.0}/Procfile +0 -0
  233. {codetrust-2.2.4 → codetrust-2.3.0}/SECURITY.md +0 -0
  234. {codetrust-2.2.4 → codetrust-2.3.0}/action/action.yml +0 -0
  235. {codetrust-2.2.4 → codetrust-2.3.0}/action/scan.py +0 -0
  236. {codetrust-2.2.4 → codetrust-2.3.0}/alembic/README +0 -0
  237. {codetrust-2.2.4 → codetrust-2.3.0}/alembic/env.py +0 -0
  238. {codetrust-2.2.4 → codetrust-2.3.0}/alembic/script.py.mako +0 -0
  239. {codetrust-2.2.4 → codetrust-2.3.0}/alembic/versions/b74aff4dff57_initial_schema_users_api_keys_scan_logs_.py +0 -0
  240. {codetrust-2.2.4 → codetrust-2.3.0}/alembic.ini +0 -0
  241. {codetrust-2.2.4 → codetrust-2.3.0}/docker-compose.yml +0 -0
  242. {codetrust-2.2.4 → codetrust-2.3.0}/icon.png +0 -0
  243. {codetrust-2.2.4 → codetrust-2.3.0}/railway.toml +0 -0
  244. {codetrust-2.2.4 → codetrust-2.3.0}/scripts/export_openapi.py +0 -0
  245. {codetrust-2.2.4 → codetrust-2.3.0}/scripts/generate_icons.py +0 -0
  246. {codetrust-2.2.4 → codetrust-2.3.0}/scripts/generate_metrics.py +0 -0
  247. {codetrust-2.2.4 → codetrust-2.3.0}/scripts/validate_readme_metrics.py +0 -0
  248. {codetrust-2.2.4 → codetrust-2.3.0}/setup.sh +0 -0
  249. {codetrust-2.2.4 → codetrust-2.3.0}/smoke_test.sh +0 -0
  250. {codetrust-2.2.4 → codetrust-2.3.0}/src/__init__.py +0 -0
  251. {codetrust-2.2.4 → codetrust-2.3.0}/src/formatters/__init__.py +0 -0
  252. {codetrust-2.2.4 → codetrust-2.3.0}/src/formatters/sarif.py +0 -0
  253. {codetrust-2.2.4 → codetrust-2.3.0}/src/gateway/__init__.py +0 -0
  254. {codetrust-2.2.4 → codetrust-2.3.0}/src/gateway/audit.py +0 -0
  255. {codetrust-2.2.4 → codetrust-2.3.0}/src/gateway/custom_rules.py +0 -0
  256. {codetrust-2.2.4 → codetrust-2.3.0}/src/gateway/interceptor.py +0 -0
  257. {codetrust-2.2.4 → codetrust-2.3.0}/src/gateway/policies.py +0 -0
  258. {codetrust-2.2.4 → codetrust-2.3.0}/src/gateway/server.py +0 -0
  259. {codetrust-2.2.4 → codetrust-2.3.0}/src/gateway/siem.py +0 -0
  260. {codetrust-2.2.4 → codetrust-2.3.0}/src/gateway/webhooks.py +0 -0
  261. {codetrust-2.2.4 → codetrust-2.3.0}/src/middleware/__init__.py +0 -0
  262. {codetrust-2.2.4 → codetrust-2.3.0}/src/middleware/ip_rate_limit.py +0 -0
  263. {codetrust-2.2.4 → codetrust-2.3.0}/src/middleware/metrics.py +0 -0
  264. {codetrust-2.2.4 → codetrust-2.3.0}/src/models/__init__.py +0 -0
  265. {codetrust-2.2.4 → codetrust-2.3.0}/src/models/database.py +0 -0
  266. {codetrust-2.2.4 → codetrust-2.3.0}/src/models/enums.py +0 -0
  267. {codetrust-2.2.4 → codetrust-2.3.0}/src/models/requests.py +0 -0
  268. {codetrust-2.2.4 → codetrust-2.3.0}/src/models/responses.py +0 -0
  269. {codetrust-2.2.4 → codetrust-2.3.0}/src/rules/__init__.py +0 -0
  270. {codetrust-2.2.4 → codetrust-2.3.0}/src/rules/anti_patterns.py +0 -0
  271. {codetrust-2.2.4 → codetrust-2.3.0}/src/rules/enterprise.py +0 -0
  272. {codetrust-2.2.4 → codetrust-2.3.0}/src/server.py +0 -0
  273. {codetrust-2.2.4 → codetrust-2.3.0}/src/services/__init__.py +0 -0
  274. {codetrust-2.2.4 → codetrust-2.3.0}/src/services/ast_analyzer.py +0 -0
  275. {codetrust-2.2.4 → codetrust-2.3.0}/src/services/auth.py +0 -0
  276. {codetrust-2.2.4 → codetrust-2.3.0}/src/services/billing.py +0 -0
  277. {codetrust-2.2.4 → codetrust-2.3.0}/src/services/cache.py +0 -0
  278. {codetrust-2.2.4 → codetrust-2.3.0}/src/services/database.py +0 -0
  279. {codetrust-2.2.4 → codetrust-2.3.0}/src/services/docker_verify.py +0 -0
  280. {codetrust-2.2.4 → codetrust-2.3.0}/src/services/gdpr.py +0 -0
  281. {codetrust-2.2.4 → codetrust-2.3.0}/src/services/import_verifier.py +0 -0
  282. {codetrust-2.2.4 → codetrust-2.3.0}/src/services/rate_limiter.py +0 -0
  283. {codetrust-2.2.4 → codetrust-2.3.0}/src/services/registry.py +0 -0
  284. {codetrust-2.2.4 → codetrust-2.3.0}/src/services/sandbox.py +0 -0
  285. {codetrust-2.2.4 → codetrust-2.3.0}/src/services/sso.py +0 -0
  286. {codetrust-2.2.4 → codetrust-2.3.0}/src/services/static_analyzer.py +0 -0
  287. {codetrust-2.2.4 → codetrust-2.3.0}/src/services/tenant.py +0 -0
  288. {codetrust-2.2.4 → codetrust-2.3.0}/src/templates/__init__.py +0 -0
  289. {codetrust-2.2.4 → codetrust-2.3.0}/src/templates/codetrust-scan.yml +0 -0
  290. {codetrust-2.2.4 → codetrust-2.3.0}/src/templates/codetrust.toml +0 -0
  291. {codetrust-2.2.4 → codetrust-2.3.0}/src/templates/cursorrules +0 -0
  292. {codetrust-2.2.4 → codetrust-2.3.0}/src/utils/__init__.py +0 -0
  293. {codetrust-2.2.4 → codetrust-2.3.0}/src/utils/parsers.py +0 -0
  294. {codetrust-2.2.4 → 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,5 +61,3 @@ codetrust-results.sarif
61
61
  # VS Code Extension builds
62
62
  *.vsix
63
63
  CTfavicon.png
64
- .gitignore
65
- scan_all_projects.py
@@ -9,20 +9,69 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9
9
 
10
10
  ### Added
11
11
 
12
+ ### Fixed
13
+
14
+ ---
15
+
16
+ ## [2.3.0] - 2026-02-16
17
+
18
+ ### Added
19
+
12
20
  - New `database_url_credentials` rule — catches database URLs with embedded passwords
13
21
  (e.g. `postgresql+asyncpg://user:pass@host/db`). Handles `+asyncpg`, `+pymysql`, etc.
14
22
  - Path alias test (`test_path_alias_skipped`) for `@/`, `~/`, `#/` aliases
15
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
+
16
48
  ### Fixed
17
49
 
18
50
  - `hardcoded_secret` rule now handles Python type annotations (`secret_key: str = "change-me"`)
19
51
  and compound names (`secret_key`, `secret_token`, etc.)
20
- - `api_key_in_config` rule no longer restricted to `.yml/.yaml/.toml/.json` applies to all files
21
- - `api_key_in_config` rule now handles Python type annotations
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
22
54
  - JS/TS import verification no longer flags `@/components`, `@/lib`, `~/config`, `#/db`
23
55
  as hallucinated packages — these are Next.js/Vite/TypeScript path aliases
24
56
  - Rule count updated: 76 scan + 57 gateway = 133 total
25
- - Test count: 1315
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
26
75
 
27
76
  ---
28
77
 
@@ -39,6 +88,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
39
88
 
40
89
  - Prepared manual release candidate `2.2.4` locally (no deploy, no push)
41
90
 
91
+ ### Released
92
+
93
+ - Published `codetrust==2.2.4` to PyPI
94
+ - Published `SaidBorna.codetrust v2.2.4` to VS Code Marketplace
95
+
42
96
  ---
43
97
 
44
98
  ## [2.2.3] - 2026-02-13
@@ -298,7 +352,7 @@ Not just a snapshot — a real metric that tracks how your codebase is evolving.
298
352
  - **Procfile** — removed `alembic upgrade head &&` that blocked server start; migration now handled by `preDeployCommand`
299
353
  - **railway.toml** — removed `preDeployCommand` (alembic migration was hanging on DB lock)
300
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`
301
- - **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`
302
356
  - **4 except_swallow BLOCK violations** in production code:
303
357
  - `src/cli.py:522` — `except: pass` → `hooks_path_set = False`
304
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.4
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, 1315 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** — 133 rules across 10 enforcement layers, 17 MCP tools, 27 API endpoints. 1,315 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
 
@@ -229,7 +233,7 @@ 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
238
  | **REST API** | 27 endpoints with rate limiting | Integrate into any pipeline or platform |
235
239
 
@@ -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,14 +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
322
 
289
- - 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
290
327
  if: always()
291
328
  with:
292
329
  sarif_file: codetrust-results.sarif
@@ -359,7 +396,7 @@ See `codetrust init` for a starter configuration.
359
396
  |---------|---------|
360
397
  | **PyPI** | `pip install codetrust` |
361
398
  | **VS Code Marketplace** | `code --install-extension SaidBorna.codetrust` |
362
- | **GitHub Action** | `uses: S-Borna/codetrust@v2` |
399
+ | **GitHub Action** | `uses: S-Borna/codetrust@v2.3.0` |
363
400
  | **Cloud API** | Available at `codetrust-api.saidborna.com` |
364
401
  | **MCP Server** | Included in the package |
365
402
  | **Website** | [codetrust.saidborna.com](https://codetrust.saidborna.com) |
@@ -370,7 +407,7 @@ See `codetrust init` for a starter configuration.
370
407
 
371
408
  ```bash
372
409
  pip install -e ".[dev]"
373
- pytest tests/ -v # 1315 tests
410
+ pytest tests/ -v # 1358 tests
374
411
  ruff check src/ tests/ # zero warnings
375
412
  ```
376
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** — 133 rules across 10 enforcement layers, 17 MCP tools, 27 API endpoints. 1,315 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
 
@@ -180,7 +184,7 @@ 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
189
  | **REST API** | 27 endpoints with rate limiting | Integrate into any pipeline or platform |
186
190
 
@@ -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,14 +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
273
 
240
- - 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
241
278
  if: always()
242
279
  with:
243
280
  sarif_file: codetrust-results.sarif
@@ -310,7 +347,7 @@ See `codetrust init` for a starter configuration.
310
347
  |---------|---------|
311
348
  | **PyPI** | `pip install codetrust` |
312
349
  | **VS Code Marketplace** | `code --install-extension SaidBorna.codetrust` |
313
- | **GitHub Action** | `uses: S-Borna/codetrust@v2` |
350
+ | **GitHub Action** | `uses: S-Borna/codetrust@v2.3.0` |
314
351
  | **Cloud API** | Available at `codetrust-api.saidborna.com` |
315
352
  | **MCP Server** | Included in the package |
316
353
  | **Website** | [codetrust.saidborna.com](https://codetrust.saidborna.com) |
@@ -321,7 +358,7 @@ See `codetrust init` for a starter configuration.
321
358
 
322
359
  ```bash
323
360
  pip install -e ".[dev]"
324
- pytest tests/ -v # 1315 tests
361
+ pytest tests/ -v # 1358 tests
325
362
  ruff check src/ tests/ # zero warnings
326
363
  ```
327
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