codedd-cli 0.1.11__tar.gz → 0.1.12__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 (235) hide show
  1. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/PKG-INFO +35 -14
  2. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/README.md +32 -10
  3. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/__init__.py +1 -1
  4. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/api/client.py +61 -5
  5. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/auditor/archetype_classifier.py +51 -7
  6. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/auditor/architecture_analyzer.py +58 -18
  7. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/auditor/audit_checkpoint.py +316 -35
  8. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/auditor/audit_log.py +36 -4
  9. codedd_cli-0.1.12/codedd_cli/auditor/cross_repo_evidence.py +342 -0
  10. codedd_cli-0.1.12/codedd_cli/auditor/dependency_scanner.py +868 -0
  11. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/auditor/file_auditor.py +110 -33
  12. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/auditor/git_stats_collector.py +8 -1
  13. codedd_cli-0.1.12/codedd_cli/auditor/parity_overrides.py +488 -0
  14. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/auditor/response_parser.py +54 -3
  15. codedd_cli-0.1.12/codedd_cli/auditor/security_scope.py +446 -0
  16. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/MANIFEST.json +940 -0
  17. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/__init__.py +45 -0
  18. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/architecture_style.py +632 -0
  19. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/architecture_taxonomy.py +806 -0
  20. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/datastore_topology.py +1773 -0
  21. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/deployable_census.py +3128 -0
  22. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/deployment_profile.py +2467 -0
  23. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/deployment_runtime.py +1791 -0
  24. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/detector_catalog.py +721 -0
  25. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/detector_config.py +69 -0
  26. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/detector_paths.py +465 -0
  27. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/detector_registry.py +339 -0
  28. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/detector_runner.py +826 -0
  29. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/detector_text.py +163 -0
  30. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/detector_urls.py +281 -0
  31. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/evidence_extractor.py +2215 -0
  32. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/fact_readers.py +580 -0
  33. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/functions/__init__.py +29 -0
  34. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/functions/shared/__init__.py +1 -0
  35. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/functions/shared/architecture/__init__.py +1 -0
  36. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/functions/shared/architecture/detectors/__init__.py +19 -0
  37. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/functions/shared/architecture/detectors/detector_paths.py +465 -0
  38. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/functions/shared/architecture/repo_identity.py +280 -0
  39. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/functions/shared/dependencies/__init__.py +75 -0
  40. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/functions/shared/dependencies/cli_projection.py +1015 -0
  41. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/functions/shared/dependencies/data/commercial_registry_hosts.json +38 -0
  42. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/functions/shared/dependencies/data/public_registry_hosts.json +158 -0
  43. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/functions/shared/dependencies/data/vendored_single_files.json +134 -0
  44. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/functions/shared/dependencies/declarations.py +580 -0
  45. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/functions/shared/dependencies/identity.py +416 -0
  46. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/functions/shared/dependencies/inventory_scan.py +649 -0
  47. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/functions/shared/dependencies/manifests/__init__.py +23 -0
  48. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/functions/shared/dependencies/manifests/base.py +353 -0
  49. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/functions/shared/dependencies/manifests/ci_pipelines.py +1046 -0
  50. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/functions/shared/dependencies/manifests/clojure.py +609 -0
  51. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/functions/shared/dependencies/manifests/conda.py +994 -0
  52. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/functions/shared/dependencies/manifests/dart.py +668 -0
  53. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/functions/shared/dependencies/manifests/dotnet.py +1952 -0
  54. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/functions/shared/dependencies/manifests/elixir.py +671 -0
  55. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/functions/shared/dependencies/manifests/erlang.py +723 -0
  56. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/functions/shared/dependencies/manifests/golang.py +1233 -0
  57. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/functions/shared/dependencies/manifests/haskell.py +976 -0
  58. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/functions/shared/dependencies/manifests/javascript.py +3570 -0
  59. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/functions/shared/dependencies/manifests/julia.py +461 -0
  60. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/functions/shared/dependencies/manifests/jvm_gradle.py +3013 -0
  61. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/functions/shared/dependencies/manifests/jvm_maven.py +1274 -0
  62. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/functions/shared/dependencies/manifests/jvm_other.py +648 -0
  63. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/functions/shared/dependencies/manifests/jvm_sbt.py +701 -0
  64. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/functions/shared/dependencies/manifests/legacy_fallback.py +42 -0
  65. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/functions/shared/dependencies/manifests/lua.py +464 -0
  66. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/functions/shared/dependencies/manifests/native.py +2304 -0
  67. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/functions/shared/dependencies/manifests/nim.py +510 -0
  68. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/functions/shared/dependencies/manifests/ocaml.py +808 -0
  69. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/functions/shared/dependencies/manifests/perl.py +1041 -0
  70. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/functions/shared/dependencies/manifests/php.py +734 -0
  71. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/functions/shared/dependencies/manifests/python.py +3317 -0
  72. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/functions/shared/dependencies/manifests/r_lang.py +878 -0
  73. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/functions/shared/dependencies/manifests/registry.py +253 -0
  74. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/functions/shared/dependencies/manifests/ruby.py +877 -0
  75. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/functions/shared/dependencies/manifests/rust.py +666 -0
  76. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/functions/shared/dependencies/manifests/swift.py +2636 -0
  77. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/functions/shared/dependencies/manifests/vendored.py +2352 -0
  78. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/functions/shared/dependencies/records.py +914 -0
  79. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/functions/shared/dependencies/registry_config.py +3403 -0
  80. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/functions/shared/dependencies/taxonomy.py +833 -0
  81. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/functions/step_5/__init__.py +1 -0
  82. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/functions/step_5/dependency_processor/__init__.py +1 -0
  83. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/functions/step_5/dependency_processor/extension_package_parser.py +198 -0
  84. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/functions/step_5/dependency_processor/import_extractors/__init__.py +267 -0
  85. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/functions/step_5/dependency_processor/import_extractors/dotnet.py +143 -0
  86. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/functions/step_5/dependency_processor/import_extractors/golang.py +102 -0
  87. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/functions/step_5/dependency_processor/import_extractors/javascript.py +221 -0
  88. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/functions/step_5/dependency_processor/import_extractors/jvm.py +247 -0
  89. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/functions/step_5/dependency_processor/import_extractors/misc.py +598 -0
  90. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/functions/step_5/dependency_processor/import_extractors/native_apple.py +413 -0
  91. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/functions/step_5/dependency_processor/import_extractors/php_ruby_rust.py +345 -0
  92. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/functions/step_5/dependency_processor/import_extractors/python.py +337 -0
  93. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/functions/step_5/dependency_processor/registry_prefix_map.py +248 -0
  94. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/functions/step_5/dependency_processor/registry_prefix_mapper.py +505 -0
  95. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/functions/step_5/dependency_processor/version_resolver.py +1694 -0
  96. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/infra_scan.py +441 -0
  97. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/interface_evidence.py +1761 -0
  98. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/job_reliability.py +676 -0
  99. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/jvm_builds.py +195 -0
  100. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/kind_classifier.py +2475 -0
  101. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/auditor/server_parity/manifest_coordinate_resolver.py +36 -5
  102. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/mask_secrets.py +2586 -0
  103. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/observability_setup.py +734 -0
  104. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/pack_compose.py +136 -0
  105. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/pack_container.py +311 -0
  106. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/pack_deployment.py +59 -0
  107. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/pack_django.py +249 -0
  108. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/pack_dotnet.py +308 -0
  109. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/pack_ecs.py +90 -0
  110. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/pack_env.py +97 -0
  111. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/pack_go.py +225 -0
  112. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/pack_kubernetes.py +217 -0
  113. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/pack_laravel.py +200 -0
  114. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/pack_node.py +374 -0
  115. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/pack_paas.py +337 -0
  116. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/pack_python.py +293 -0
  117. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/pack_rails.py +453 -0
  118. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/pack_serverless.py +348 -0
  119. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/pack_spring.py +522 -0
  120. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/pack_terraform.py +225 -0
  121. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/platform_capabilities.py +357 -0
  122. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/published_identity.py +561 -0
  123. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/reader_evidence.py +430 -0
  124. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/registry_prefix_map.py +248 -0
  125. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/repo_kind.py +273 -0
  126. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/repository_facts.py +436 -0
  127. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/runtime_images.py +78 -0
  128. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/runtime_packages.py +945 -0
  129. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/style_derivation.py +428 -0
  130. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/auditor/server_parity/taxonomy.py +39 -16
  131. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/tech_normalizer.py +1817 -0
  132. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/auditor/server_parity/technology_lists.py +2695 -185
  133. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/tier_definitions.py +2158 -0
  134. codedd_cli-0.1.12/codedd_cli/auditor/server_parity/url_userinfo.py +28 -0
  135. codedd_cli-0.1.12/codedd_cli/auditor/sub_audit_runner.py +2824 -0
  136. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/auditor/vulnerability_analysis/cli_orchestrator.py +49 -12
  137. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/auditor/vulnerability_analysis/file_io.py +10 -7
  138. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/auditor/vulnerability_analysis/semgrep_runner.py +8 -1
  139. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/auditor/vulnerability_analysis/tools.py +8 -3
  140. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/auditor/vulnerability_validator.py +3 -0
  141. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/commands/ai_docs_cmd.py +8 -0
  142. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/commands/audit_cmd.py +1104 -110
  143. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/commands/config_cmd.py +41 -2
  144. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/config/settings.py +47 -6
  145. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/scanner/file_walker.py +27 -11
  146. codedd_cli-0.1.12/codedd_cli/utils/child_process.py +29 -0
  147. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/utils/display.py +14 -0
  148. codedd_cli-0.1.12/codedd_cli/utils/secret_masking.py +294 -0
  149. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/utils/transparency.py +51 -18
  150. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/pyproject.toml +17 -5
  151. codedd_cli-0.1.11/codedd_cli/auditor/cross_repo_evidence.py +0 -83
  152. codedd_cli-0.1.11/codedd_cli/auditor/dependency_scanner.py +0 -2653
  153. codedd_cli-0.1.11/codedd_cli/auditor/parity_overrides.py +0 -294
  154. codedd_cli-0.1.11/codedd_cli/auditor/server_parity/MANIFEST.json +0 -55
  155. codedd_cli-0.1.11/codedd_cli/auditor/server_parity/__init__.py +0 -16
  156. codedd_cli-0.1.11/codedd_cli/auditor/server_parity/evidence_extractor.py +0 -801
  157. codedd_cli-0.1.11/codedd_cli/auditor/server_parity/infra_scan.py +0 -158
  158. codedd_cli-0.1.11/codedd_cli/auditor/server_parity/published_identity.py +0 -290
  159. codedd_cli-0.1.11/codedd_cli/auditor/server_parity/repo_kind.py +0 -103
  160. codedd_cli-0.1.11/codedd_cli/auditor/server_parity/tech_normalizer.py +0 -141
  161. codedd_cli-0.1.11/codedd_cli/auditor/server_parity/tier_definitions.py +0 -703
  162. codedd_cli-0.1.11/codedd_cli/auditor/sub_audit_runner.py +0 -1096
  163. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/LICENSE +0 -0
  164. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/NOTICE +0 -0
  165. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/__main__.py +0 -0
  166. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/api/__init__.py +0 -0
  167. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/api/endpoints.py +0 -0
  168. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/api/exceptions.py +0 -0
  169. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/auditor/__init__.py +0 -0
  170. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/auditor/architecture_prompts.py +0 -0
  171. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/auditor/architecture_schema_contract.py +0 -0
  172. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/auditor/audit_progress_sync.py +0 -0
  173. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/auditor/commit_classifier.py +0 -0
  174. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/auditor/complexity_analyzer.py +0 -0
  175. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/auditor/server_parity/enhanced_relationship_detector.py +0 -0
  176. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/auditor/server_parity/enhanced_technology_detector.py +0 -0
  177. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/auditor/server_parity/repo_file.py +0 -0
  178. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/auditor/tier_definitions.py +0 -0
  179. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/auditor/vulnerability_analysis/__init__.py +0 -0
  180. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/auditor/vulnerability_analysis/agents.py +0 -0
  181. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/auditor/vulnerability_analysis/cli_ai_auditor.py +0 -0
  182. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/auditor/vulnerability_analysis/cli_settings.py +0 -0
  183. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/auditor/vulnerability_analysis/lang_ast/__init__.py +0 -0
  184. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/auditor/vulnerability_analysis/lang_ast/_common.py +0 -0
  185. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/auditor/vulnerability_analysis/lang_ast/_generic.py +0 -0
  186. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/auditor/vulnerability_analysis/lang_ast/c_cpp.py +0 -0
  187. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/auditor/vulnerability_analysis/lang_ast/csharp.py +0 -0
  188. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/auditor/vulnerability_analysis/lang_ast/go.py +0 -0
  189. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/auditor/vulnerability_analysis/lang_ast/java.py +0 -0
  190. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/auditor/vulnerability_analysis/lang_ast/js_ts.py +0 -0
  191. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/auditor/vulnerability_analysis/lang_ast/kotlin.py +0 -0
  192. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/auditor/vulnerability_analysis/lang_ast/php.py +0 -0
  193. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/auditor/vulnerability_analysis/lang_ast/ruby.py +0 -0
  194. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/auditor/vulnerability_analysis/lang_ast/rust.py +0 -0
  195. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/auditor/vulnerability_analysis/lang_ast/scala.py +0 -0
  196. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/auditor/vulnerability_analysis/lang_ast/shell.py +0 -0
  197. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/auditor/vulnerability_analysis/lang_ast/swift.py +0 -0
  198. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/auditor/vulnerability_analysis/lang_ast/taint.py +0 -0
  199. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/auditor/vulnerability_analysis/lang_snippets.py +0 -0
  200. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/auditor/vulnerability_analysis/langgraph_runner.py +0 -0
  201. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/auditor/vulnerability_analysis/planner.py +0 -0
  202. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/auditor/vulnerability_analysis/prompts.py +0 -0
  203. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/auditor/vulnerability_analysis/scope.py +0 -0
  204. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/auditor/vulnerability_analysis/security_patterns.py +0 -0
  205. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/auditor/vulnerability_analysis/state.py +0 -0
  206. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/auth/__init__.py +0 -0
  207. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/auth/session.py +0 -0
  208. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/auth/token_manager.py +0 -0
  209. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/cli.py +0 -0
  210. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/commands/__init__.py +0 -0
  211. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/commands/audits_cmd.py +0 -0
  212. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/commands/auth_cmd.py +0 -0
  213. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/commands/fix_cmd.py +0 -0
  214. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/commands/scope_cmd.py +0 -0
  215. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/config/__init__.py +0 -0
  216. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/config/constants.py +0 -0
  217. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/config/fix_session.py +0 -0
  218. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/config/url_validation.py +0 -0
  219. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/llm/__init__.py +0 -0
  220. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/llm/anthropic_utils.py +0 -0
  221. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/llm/call_attempts.py +0 -0
  222. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/llm/key_manager.py +0 -0
  223. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/models/__init__.py +0 -0
  224. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/models/account.py +0 -0
  225. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/models/audit.py +0 -0
  226. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/models/local_directory.py +0 -0
  227. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/scanner/__init__.py +0 -0
  228. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/scanner/file_classifier.py +0 -0
  229. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/scanner/line_counter.py +0 -0
  230. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/utils/__init__.py +0 -0
  231. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/utils/directory_validator.py +0 -0
  232. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/utils/payload_inspector.py +0 -0
  233. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/utils/safe_path.py +0 -0
  234. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/utils/security.py +0 -0
  235. {codedd_cli-0.1.11 → codedd_cli-0.1.12}/codedd_cli/utils/validators.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: codedd-cli
3
- Version: 0.1.11
3
+ Version: 0.1.12
4
4
  Summary: CLI tool for CodeDD — run code audits from your terminal
5
5
  License: Apache-2.0
6
6
  License-File: LICENSE
@@ -8,13 +8,12 @@ License-File: NOTICE
8
8
  Keywords: code-audit,security,cli,codedd
9
9
  Author: CodeDD
10
10
  Author-email: info@codedd.ai
11
- Requires-Python: >=3.10,<4.0
11
+ Requires-Python: >=3.11,<4.0
12
12
  Classifier: Development Status :: 3 - Alpha
13
13
  Classifier: Environment :: Console
14
14
  Classifier: Intended Audience :: Developers
15
15
  Classifier: License :: OSI Approved :: Apache Software License
16
16
  Classifier: Programming Language :: Python :: 3
17
- Classifier: Programming Language :: Python :: 3.10
18
17
  Classifier: Programming Language :: Python :: 3.11
19
18
  Classifier: Programming Language :: Python :: 3.12
20
19
  Classifier: Programming Language :: Python :: 3.13
@@ -29,10 +28,10 @@ Requires-Dist: httpx (>=0.27.0)
29
28
  Requires-Dist: keyring (>=25.0.0)
30
29
  Requires-Dist: langgraph (>=0.2.0)
31
30
  Requires-Dist: lizard (>=1.17.0)
31
+ Requires-Dist: packaging (>=23.0)
32
32
  Requires-Dist: pyyaml (>=6.0.0)
33
33
  Requires-Dist: radon (>=6.0.0)
34
34
  Requires-Dist: rich (>=13.0.0)
35
- Requires-Dist: tomli (>=2.0.0) ; python_version < "3.11"
36
35
  Requires-Dist: tomli-w (>=1.0.0)
37
36
  Requires-Dist: typer (>=0.9.0)
38
37
  Project-URL: Homepage, https://codedd.ai
@@ -54,7 +53,7 @@ Description-Content-Type: text/markdown
54
53
  CodeDD CLI is the official command-line interface for the CodeDD platform. You:
55
54
 
56
55
  - **Define scope** — Add one or more local Git repository roots to an audit.
57
- - **Run analysis locally** — File audits, vulnerability validation, complexity, dependencies, git history, and architecture are analysed on your machine.
56
+ - **Run analysis locally** — File audits, vulnerability validation, complexity, dependencies, git history, and architecture are analysed on your machine. When an audit runs without security analysis (a CodeDD admin setting, or `codedd audit start --no-security-analysis` on a CodeDD server that supports it), the security sections and vulnerability validation are skipped; dependency and CVE scanning still run.
58
57
  - **Sync to CodeDD** — Findings and metrics are submitted to CodeDD, where consolidation, dependency enrichment, security scoring, and recommendations run on the server.
59
58
 
60
59
  Built for teams that want CodeDD’s analytics, recommendations, and reporting without handing over their source code.
@@ -66,13 +65,27 @@ Built for teams that want CodeDD’s analytics, recommendations, and reporting w
66
65
  | Data | Stays local | Sent to your LLM provider | Sent to CodeDD |
67
66
  |------|:-----------:|:-------------------------:|:--------------:|
68
67
  | Source files | ✓ | Files and snippets under analysis, using **your** API key | — |
69
- | File audit and vulnerability findings | | | ✓ (file paths, line ranges, findings text) |
68
+ | File audit and vulnerability findings | | | ✓ (file paths, line ranges, findings text; no security assessment, flags or validations for repositories where CodeDD excludes security analysis) |
70
69
  | Complexity metrics, LoC, file types | | | ✓ |
71
- | Dependencies (manifests, lockfiles, imports) | | | ✓ (package names and versions) |
70
+ | Dependencies (manifests, lockfiles, imports) | | | ✓ (package names, versions and import specifiers; [details below](#dependency-data)) |
72
71
  | Git statistics | | | ✓ (commit history metadata, author names) |
73
- | Architecture components and relationships | | Optional LLM enhancement | ✓ |
72
+ | Architecture components and relationships | | Optional LLM enhancement | ✓ (the `--verbose` local tier estimate is not sent) |
73
+ | Cross-repo evidence (group audits) | | | ✓ (service identities and outbound references from infrastructure, runtime-configuration and interface source files; git-tracked files only when the scope folder is a repository root, and none when git cannot list them) |
74
74
  | CLI token, LLM API keys | ✓ (OS keychain or environment) | | — |
75
75
 
76
+ <a id="dependency-data"></a>**Dependency data.** The CLI reads manifests, lockfiles and imports with the same parsers CodeDD uses for cloud audits, and sends CodeDD:
77
+
78
+ - package names, the version constraints as written in manifests (a tarball URL without its credentials, query or access-token path segments), and the versions resolved in lockfiles;
79
+ - lockfile integrity hashes and the licence identifiers lockfiles record;
80
+ - repository-relative manifest paths (for example `web/package.json`);
81
+ - the import specifiers of each audited file (for example `requests.adapters`), with the package each belongs to; a specifier that is a URL, an absolute or drive path, or looks like a credential is left empty;
82
+ - the package names this repository itself publishes, so its own code is not counted as a dependency;
83
+ - private registry hosts and package-name patterns from registry config files such as `.npmrc` or `pip.conf` (never credentials or tokens);
84
+ - workspace member paths;
85
+ - the git remote's host and owner (for example `github.com` and `acme`), not the full URL.
86
+
87
+ Nothing of the source code is sent. CodeDD looks up vulnerabilities and licences itself. Large repositories are sent in several requests.
88
+
76
89
  Run `codedd audit start --show` to review what is sent to CodeDD. You choose whether the audit pauses once per stage (file results, security validation, complexity, dependencies, git statistics, cross-repo evidence, architecture) or before every request and batch. Either way, every payload is saved as JSON under `~/.codedd/transparency/<audit>/<run>/`, with an `index.md` listing each request, so you can check all batches afterwards. Declining a payload stops the audit before it is sent; run `codedd audit start` again to resume.
77
90
 
78
91
  ---
@@ -82,11 +95,13 @@ Run `codedd audit start --show` to review what is sent to CodeDD. You choose whe
82
95
  - **Scope management** — Add/remove local directories, sync with CodeDD, detect changes and re-confirm scope (delta updates). Removing a repo from local scope also attempts a best-effort removal of the matching repository on CodeDD.
83
96
  - **Local file auditing** — LLM-based file analysis using your Anthropic, OpenAI, Google Gemini, or xAI Grok API key, with batching, configurable concurrency, and progress feedback.
84
97
  - **Vulnerability validation** — Candidate findings are checked by an agentic LLM pipeline that reads the surrounding code, traces reachability, and looks for existing mitigations. Uses [Semgrep](https://semgrep.dev) when it is installed.
98
+ - **Security scope from CodeDD** — When CodeDD excludes security analysis for an audit or a single repository (set by a CodeDD admin before the audit starts), the CLI audits those files with CodeDD's no-security form: no section 5 security assessment, no due-diligence flags, no vulnerability validation. Dependency and CVE scanning still run. The summaries say "Security analysis: excluded"; a resumed audit stops before any LLM call if CodeDD's plan no longer matches how its files were audited.
99
+ - **Start without security analysis** — The auditor can ask CodeDD to start an audit without LLM security analysis: `codedd audit start --no-security-analysis`, `CODEDD_SECURITY_ANALYSIS=off`, or `codedd config set security_analysis off` (in that order of precedence). It applies to every repository in the audit and is fixed once the audit starts: it cannot be re-enabled from the CLI, and a later `--security-analysis` or `--no-security-analysis` that disagrees with the audit stops the run (an environment or config setting only prints a notice). The CLI shows what is excluded and asks for confirmation unless `--yes`. Dependency and CVE scanning still run. This needs a CodeDD server that supports the option; other servers refuse it before the audit starts and before any payment, so nothing is deducted.
85
100
  - **Complexity analysis** — Cyclomatic complexity, Halstead, and maintainability metrics (Radon/Lizard).
86
- - **Dependency scanning** — Lockfile/manifest and import parsing; CodeDD enriches the results with vulnerability and licence data.
101
+ - **Dependency scanning** — Manifest, lockfile and import parsing with the same parsers CodeDD uses for cloud audits; CodeDD enriches the results with vulnerability and licence data.
87
102
  - **Git statistics** — Commit history and repository activity for team and delivery metrics.
88
103
  - **Architecture analysis** — Local component and relationship extraction, technology detection, and cross-repository evidence for group audits.
89
- - **Resumable audits** — Progress is checkpointed; an interrupted `codedd audit start` resumes where it stopped.
104
+ - **Resumable audits** — Progress is checkpointed; an interrupted `codedd audit start` resumes where it stopped. Ctrl-C stops new LLM calls at once, submits the results that are already back, and exits once the calls in flight return. If CodeDD's rate limit holds up those results, the CLI waits at most 90 s in total; results not sent by then are redone on resume. A second Ctrl-C exits immediately.
90
105
  - **Issue remediation (`codedd fix`)** — Work through audit flags and dependency vulnerabilities from the terminal, by priority, per repository, or from an Issue Compass saved list. Built for interactive use and AI-agent loops (`context`, `summarize`, `--json`, exit codes).
91
106
  - **Payment and budget** — Pre-flight checks, LoC budget deduction, or Stripe checkout when additional payment is required.
92
107
  - **Secure auth** — Tokens and keys stored in the OS credential store (Windows Credential Locker, macOS Keychain, Linux Secret Service), or supplied through environment variables.
@@ -97,7 +112,7 @@ Run `codedd audit start --show` to review what is sent to CodeDD. You choose whe
97
112
 
98
113
  ### Requirements
99
114
 
100
- - **Python 3.10–3.13**
115
+ - **Python 3.11–3.13** (CI tests 3.11, 3.12 and 3.13; 0.1.11 was the last release for Python 3.10)
101
116
  - A [CodeDD](https://codedd.ai) account and a CLI token (Account → CLI Access → Generate Token)
102
117
  - An API key for at least one LLM provider (Anthropic, OpenAI, Google Gemini, or xAI Grok)
103
118
  - Optional: [Semgrep](https://semgrep.dev/docs/getting-started/) on your `PATH` for additional vulnerability evidence
@@ -193,7 +208,8 @@ What `codedd audit start` does, in order:
193
208
  A. Scope sync -> re-confirm prompt if local files changed
194
209
  B. Pre-flight -> checks audit status, payment, and budget on CodeDD
195
210
  C. Payment -> budget deduction or browser checkout
196
- D. Local analysis -> file audit (LLM), vulnerability validation, complexity,
211
+ D. Local analysis -> file audit (LLM), vulnerability validation (skipped when
212
+ CodeDD excludes security analysis), complexity,
197
213
  dependencies, git stats, architecture
198
214
  E. Submission -> structured results to CodeDD (retries on transient errors)
199
215
  F. Completion -> server-side consolidation and recommendations
@@ -287,6 +303,8 @@ Every command supports `--help`.
287
303
  | `--show-force-interactive` | With `--show-interactive`, skip the offer to switch to per-stage review on large audits |
288
304
  | `--debug-llm` | Print LLM request/response debug output |
289
305
  | `--debug-llm-full-prompt` | Include the full system prompt in `--debug-llm` output (sensitive) |
306
+ | `--verbose` | Show the local architecture tier estimate (labelled; CodeDD computes the tier itself) and one architecture row per repository in the final summary |
307
+ | `--no-security-analysis` | Start the audit without LLM security analysis: no section 5 assessment, no due-diligence flags, no vulnerability validation (dependency and CVE scanning still run). For every repository, fixed at audit start, auditor only, and needs CodeDD server support. `--security-analysis` asks for it explicitly and stops if CodeDD excluded it. Default: `CODEDD_SECURITY_ANALYSIS`, then `[audit] security_analysis`, then on |
290
308
 
291
309
  ### Issue remediation (`codedd fix`)
292
310
 
@@ -319,7 +337,7 @@ Comment text can also be supplied with `--comment-file <path>` or on stdin (`cod
319
337
  | Command | Description |
320
338
  |--------|-------------|
321
339
  | `codedd config show` | Show current config (API URL, active audit, scope, etc.) |
322
- | `codedd config set <key> <value>` | Set a config value |
340
+ | `codedd config set <key> <value>` | Set a config value (`api_url`, `security_analysis`) |
323
341
  | `codedd config set-key [anthropic\|openai\|gemini\|grok]` | Store an LLM API key in the OS keychain |
324
342
  | `codedd config show-keys` | List which providers have keys configured (not the keys themselves) |
325
343
  | `codedd config remove-key <provider>` | Remove a stored LLM API key |
@@ -346,6 +364,8 @@ Optional `[audit]` keys (defaults shown) tune how long the CLI waits after openi
346
364
  - `payment_poll_interval_seconds` (default `5`)
347
365
  - `payment_poll_max_wait_seconds` (default `600`)
348
366
 
367
+ `[audit] security_analysis` (default `true`; set with `codedd config set security_analysis on|off`) is the default for `codedd audit start --security-analysis/--no-security-analysis`. When it is off, every start asks for confirmation unless `--yes`.
368
+
349
369
  ### Environment variables
350
370
 
351
371
  | Variable | Purpose |
@@ -355,6 +375,7 @@ Optional `[audit]` keys (defaults shown) tune how long the CLI waits after openi
355
375
  | `CODEDD_OPENAI_API_KEY` / `OPENAI_API_KEY` | OpenAI API key. |
356
376
  | `CODEDD_GEMINI_API_KEY` / `GEMINI_API_KEY` / `GOOGLE_API_KEY` | Google Gemini API key. |
357
377
  | `CODEDD_GROK_API_KEY` / `XAI_API_KEY` / `GROK_API_KEY` | xAI Grok API key. |
378
+ | `CODEDD_SECURITY_ANALYSIS` | `on` or `off` (also `1`/`0`, `true`/`false`, `yes`/`no`): default for `codedd audit start --security-analysis/--no-security-analysis`, over `[audit] security_analysis`. Any other value stops `codedd audit start` with exit status 2. |
358
379
 
359
380
  Headless / CI example:
360
381
 
@@ -372,7 +393,7 @@ codedd audit start --yes
372
393
  |---------|-----|
373
394
  | Keyring / credential-store error on Linux | No Secret Service provider is running. Use `CODEDD_API_TOKEN` and a provider key environment variable instead. |
374
395
  | “No active audit selected” | Run `codedd audits select`. For flag remediation, `codedd fix selections use <n>` also works. |
375
- | Audit was interrupted | Run `codedd audit start` again; completed stages are skipped. `codedd audit status` shows where it stopped. |
396
+ | Audit was interrupted | Run `codedd audit start` again; completed stages are skipped. `codedd audit status` shows where it stopped. After Ctrl-C the CLI exits with status 130 once in-flight LLM calls return (up to the 240 s read timeout) and finished results are submitted (up to 90 s in total of waiting on CodeDD's rate limit); press Ctrl-C again to exit at once. |
376
397
  | Scope drift prompt on every run | Files changed since `scope confirm`. Confirm the new scope, or use `--skip-sync` if the change is intentional and already registered. |
377
398
  | `codedd --version` shows an old version | Another install is earlier on your `PATH`; see [Upgrade and uninstall](#upgrade-and-uninstall). |
378
399
  | Garbled symbols in the Windows console | Update to the latest CLI (it switches the console to UTF-8), or set `PYTHONIOENCODING=utf-8`. |
@@ -13,7 +13,7 @@
13
13
  CodeDD CLI is the official command-line interface for the CodeDD platform. You:
14
14
 
15
15
  - **Define scope** — Add one or more local Git repository roots to an audit.
16
- - **Run analysis locally** — File audits, vulnerability validation, complexity, dependencies, git history, and architecture are analysed on your machine.
16
+ - **Run analysis locally** — File audits, vulnerability validation, complexity, dependencies, git history, and architecture are analysed on your machine. When an audit runs without security analysis (a CodeDD admin setting, or `codedd audit start --no-security-analysis` on a CodeDD server that supports it), the security sections and vulnerability validation are skipped; dependency and CVE scanning still run.
17
17
  - **Sync to CodeDD** — Findings and metrics are submitted to CodeDD, where consolidation, dependency enrichment, security scoring, and recommendations run on the server.
18
18
 
19
19
  Built for teams that want CodeDD’s analytics, recommendations, and reporting without handing over their source code.
@@ -25,13 +25,27 @@ Built for teams that want CodeDD’s analytics, recommendations, and reporting w
25
25
  | Data | Stays local | Sent to your LLM provider | Sent to CodeDD |
26
26
  |------|:-----------:|:-------------------------:|:--------------:|
27
27
  | Source files | ✓ | Files and snippets under analysis, using **your** API key | — |
28
- | File audit and vulnerability findings | | | ✓ (file paths, line ranges, findings text) |
28
+ | File audit and vulnerability findings | | | ✓ (file paths, line ranges, findings text; no security assessment, flags or validations for repositories where CodeDD excludes security analysis) |
29
29
  | Complexity metrics, LoC, file types | | | ✓ |
30
- | Dependencies (manifests, lockfiles, imports) | | | ✓ (package names and versions) |
30
+ | Dependencies (manifests, lockfiles, imports) | | | ✓ (package names, versions and import specifiers; [details below](#dependency-data)) |
31
31
  | Git statistics | | | ✓ (commit history metadata, author names) |
32
- | Architecture components and relationships | | Optional LLM enhancement | ✓ |
32
+ | Architecture components and relationships | | Optional LLM enhancement | ✓ (the `--verbose` local tier estimate is not sent) |
33
+ | Cross-repo evidence (group audits) | | | ✓ (service identities and outbound references from infrastructure, runtime-configuration and interface source files; git-tracked files only when the scope folder is a repository root, and none when git cannot list them) |
33
34
  | CLI token, LLM API keys | ✓ (OS keychain or environment) | | — |
34
35
 
36
+ <a id="dependency-data"></a>**Dependency data.** The CLI reads manifests, lockfiles and imports with the same parsers CodeDD uses for cloud audits, and sends CodeDD:
37
+
38
+ - package names, the version constraints as written in manifests (a tarball URL without its credentials, query or access-token path segments), and the versions resolved in lockfiles;
39
+ - lockfile integrity hashes and the licence identifiers lockfiles record;
40
+ - repository-relative manifest paths (for example `web/package.json`);
41
+ - the import specifiers of each audited file (for example `requests.adapters`), with the package each belongs to; a specifier that is a URL, an absolute or drive path, or looks like a credential is left empty;
42
+ - the package names this repository itself publishes, so its own code is not counted as a dependency;
43
+ - private registry hosts and package-name patterns from registry config files such as `.npmrc` or `pip.conf` (never credentials or tokens);
44
+ - workspace member paths;
45
+ - the git remote's host and owner (for example `github.com` and `acme`), not the full URL.
46
+
47
+ Nothing of the source code is sent. CodeDD looks up vulnerabilities and licences itself. Large repositories are sent in several requests.
48
+
35
49
  Run `codedd audit start --show` to review what is sent to CodeDD. You choose whether the audit pauses once per stage (file results, security validation, complexity, dependencies, git statistics, cross-repo evidence, architecture) or before every request and batch. Either way, every payload is saved as JSON under `~/.codedd/transparency/<audit>/<run>/`, with an `index.md` listing each request, so you can check all batches afterwards. Declining a payload stops the audit before it is sent; run `codedd audit start` again to resume.
36
50
 
37
51
  ---
@@ -41,11 +55,13 @@ Run `codedd audit start --show` to review what is sent to CodeDD. You choose whe
41
55
  - **Scope management** — Add/remove local directories, sync with CodeDD, detect changes and re-confirm scope (delta updates). Removing a repo from local scope also attempts a best-effort removal of the matching repository on CodeDD.
42
56
  - **Local file auditing** — LLM-based file analysis using your Anthropic, OpenAI, Google Gemini, or xAI Grok API key, with batching, configurable concurrency, and progress feedback.
43
57
  - **Vulnerability validation** — Candidate findings are checked by an agentic LLM pipeline that reads the surrounding code, traces reachability, and looks for existing mitigations. Uses [Semgrep](https://semgrep.dev) when it is installed.
58
+ - **Security scope from CodeDD** — When CodeDD excludes security analysis for an audit or a single repository (set by a CodeDD admin before the audit starts), the CLI audits those files with CodeDD's no-security form: no section 5 security assessment, no due-diligence flags, no vulnerability validation. Dependency and CVE scanning still run. The summaries say "Security analysis: excluded"; a resumed audit stops before any LLM call if CodeDD's plan no longer matches how its files were audited.
59
+ - **Start without security analysis** — The auditor can ask CodeDD to start an audit without LLM security analysis: `codedd audit start --no-security-analysis`, `CODEDD_SECURITY_ANALYSIS=off`, or `codedd config set security_analysis off` (in that order of precedence). It applies to every repository in the audit and is fixed once the audit starts: it cannot be re-enabled from the CLI, and a later `--security-analysis` or `--no-security-analysis` that disagrees with the audit stops the run (an environment or config setting only prints a notice). The CLI shows what is excluded and asks for confirmation unless `--yes`. Dependency and CVE scanning still run. This needs a CodeDD server that supports the option; other servers refuse it before the audit starts and before any payment, so nothing is deducted.
44
60
  - **Complexity analysis** — Cyclomatic complexity, Halstead, and maintainability metrics (Radon/Lizard).
45
- - **Dependency scanning** — Lockfile/manifest and import parsing; CodeDD enriches the results with vulnerability and licence data.
61
+ - **Dependency scanning** — Manifest, lockfile and import parsing with the same parsers CodeDD uses for cloud audits; CodeDD enriches the results with vulnerability and licence data.
46
62
  - **Git statistics** — Commit history and repository activity for team and delivery metrics.
47
63
  - **Architecture analysis** — Local component and relationship extraction, technology detection, and cross-repository evidence for group audits.
48
- - **Resumable audits** — Progress is checkpointed; an interrupted `codedd audit start` resumes where it stopped.
64
+ - **Resumable audits** — Progress is checkpointed; an interrupted `codedd audit start` resumes where it stopped. Ctrl-C stops new LLM calls at once, submits the results that are already back, and exits once the calls in flight return. If CodeDD's rate limit holds up those results, the CLI waits at most 90 s in total; results not sent by then are redone on resume. A second Ctrl-C exits immediately.
49
65
  - **Issue remediation (`codedd fix`)** — Work through audit flags and dependency vulnerabilities from the terminal, by priority, per repository, or from an Issue Compass saved list. Built for interactive use and AI-agent loops (`context`, `summarize`, `--json`, exit codes).
50
66
  - **Payment and budget** — Pre-flight checks, LoC budget deduction, or Stripe checkout when additional payment is required.
51
67
  - **Secure auth** — Tokens and keys stored in the OS credential store (Windows Credential Locker, macOS Keychain, Linux Secret Service), or supplied through environment variables.
@@ -56,7 +72,7 @@ Run `codedd audit start --show` to review what is sent to CodeDD. You choose whe
56
72
 
57
73
  ### Requirements
58
74
 
59
- - **Python 3.10–3.13**
75
+ - **Python 3.11–3.13** (CI tests 3.11, 3.12 and 3.13; 0.1.11 was the last release for Python 3.10)
60
76
  - A [CodeDD](https://codedd.ai) account and a CLI token (Account → CLI Access → Generate Token)
61
77
  - An API key for at least one LLM provider (Anthropic, OpenAI, Google Gemini, or xAI Grok)
62
78
  - Optional: [Semgrep](https://semgrep.dev/docs/getting-started/) on your `PATH` for additional vulnerability evidence
@@ -152,7 +168,8 @@ What `codedd audit start` does, in order:
152
168
  A. Scope sync -> re-confirm prompt if local files changed
153
169
  B. Pre-flight -> checks audit status, payment, and budget on CodeDD
154
170
  C. Payment -> budget deduction or browser checkout
155
- D. Local analysis -> file audit (LLM), vulnerability validation, complexity,
171
+ D. Local analysis -> file audit (LLM), vulnerability validation (skipped when
172
+ CodeDD excludes security analysis), complexity,
156
173
  dependencies, git stats, architecture
157
174
  E. Submission -> structured results to CodeDD (retries on transient errors)
158
175
  F. Completion -> server-side consolidation and recommendations
@@ -246,6 +263,8 @@ Every command supports `--help`.
246
263
  | `--show-force-interactive` | With `--show-interactive`, skip the offer to switch to per-stage review on large audits |
247
264
  | `--debug-llm` | Print LLM request/response debug output |
248
265
  | `--debug-llm-full-prompt` | Include the full system prompt in `--debug-llm` output (sensitive) |
266
+ | `--verbose` | Show the local architecture tier estimate (labelled; CodeDD computes the tier itself) and one architecture row per repository in the final summary |
267
+ | `--no-security-analysis` | Start the audit without LLM security analysis: no section 5 assessment, no due-diligence flags, no vulnerability validation (dependency and CVE scanning still run). For every repository, fixed at audit start, auditor only, and needs CodeDD server support. `--security-analysis` asks for it explicitly and stops if CodeDD excluded it. Default: `CODEDD_SECURITY_ANALYSIS`, then `[audit] security_analysis`, then on |
249
268
 
250
269
  ### Issue remediation (`codedd fix`)
251
270
 
@@ -278,7 +297,7 @@ Comment text can also be supplied with `--comment-file <path>` or on stdin (`cod
278
297
  | Command | Description |
279
298
  |--------|-------------|
280
299
  | `codedd config show` | Show current config (API URL, active audit, scope, etc.) |
281
- | `codedd config set <key> <value>` | Set a config value |
300
+ | `codedd config set <key> <value>` | Set a config value (`api_url`, `security_analysis`) |
282
301
  | `codedd config set-key [anthropic\|openai\|gemini\|grok]` | Store an LLM API key in the OS keychain |
283
302
  | `codedd config show-keys` | List which providers have keys configured (not the keys themselves) |
284
303
  | `codedd config remove-key <provider>` | Remove a stored LLM API key |
@@ -305,6 +324,8 @@ Optional `[audit]` keys (defaults shown) tune how long the CLI waits after openi
305
324
  - `payment_poll_interval_seconds` (default `5`)
306
325
  - `payment_poll_max_wait_seconds` (default `600`)
307
326
 
327
+ `[audit] security_analysis` (default `true`; set with `codedd config set security_analysis on|off`) is the default for `codedd audit start --security-analysis/--no-security-analysis`. When it is off, every start asks for confirmation unless `--yes`.
328
+
308
329
  ### Environment variables
309
330
 
310
331
  | Variable | Purpose |
@@ -314,6 +335,7 @@ Optional `[audit]` keys (defaults shown) tune how long the CLI waits after openi
314
335
  | `CODEDD_OPENAI_API_KEY` / `OPENAI_API_KEY` | OpenAI API key. |
315
336
  | `CODEDD_GEMINI_API_KEY` / `GEMINI_API_KEY` / `GOOGLE_API_KEY` | Google Gemini API key. |
316
337
  | `CODEDD_GROK_API_KEY` / `XAI_API_KEY` / `GROK_API_KEY` | xAI Grok API key. |
338
+ | `CODEDD_SECURITY_ANALYSIS` | `on` or `off` (also `1`/`0`, `true`/`false`, `yes`/`no`): default for `codedd audit start --security-analysis/--no-security-analysis`, over `[audit] security_analysis`. Any other value stops `codedd audit start` with exit status 2. |
317
339
 
318
340
  Headless / CI example:
319
341
 
@@ -331,7 +353,7 @@ codedd audit start --yes
331
353
  |---------|-----|
332
354
  | Keyring / credential-store error on Linux | No Secret Service provider is running. Use `CODEDD_API_TOKEN` and a provider key environment variable instead. |
333
355
  | “No active audit selected” | Run `codedd audits select`. For flag remediation, `codedd fix selections use <n>` also works. |
334
- | Audit was interrupted | Run `codedd audit start` again; completed stages are skipped. `codedd audit status` shows where it stopped. |
356
+ | Audit was interrupted | Run `codedd audit start` again; completed stages are skipped. `codedd audit status` shows where it stopped. After Ctrl-C the CLI exits with status 130 once in-flight LLM calls return (up to the 240 s read timeout) and finished results are submitted (up to 90 s in total of waiting on CodeDD's rate limit); press Ctrl-C again to exit at once. |
335
357
  | Scope drift prompt on every run | Files changed since `scope confirm`. Confirm the new scope, or use `--skip-sync` if the change is intentional and already registered. |
336
358
  | `codedd --version` shows an old version | Another install is earlier on your `PATH`; see [Upgrade and uninstall](#upgrade-and-uninstall). |
337
359
  | Garbled symbols in the Windows console | Update to the latest CLI (it switches the console to UTF-8), or set `PYTHONIOENCODING=utf-8`. |
@@ -1,3 +1,3 @@
1
1
  """CodeDD CLI — run code audits from your terminal."""
2
2
 
3
- __version__ = "0.1.11"
3
+ __version__ = "0.1.12"
@@ -164,17 +164,29 @@ class CodeDDClient:
164
164
  def get(self, path: str, **kwargs: Any) -> httpx.Response:
165
165
  return self._request("GET", path, **kwargs)
166
166
 
167
- def post(self, path: str, **kwargs: Any) -> httpx.Response:
168
- return self._request("POST", path, **kwargs)
167
+ def post(self, path: str, *, idempotent: bool = True, **kwargs: Any) -> httpx.Response:
168
+ """POST *path*. ``idempotent=False`` (the audit start) retries only
169
+ when the request never reached CodeDD: see :meth:`_request`."""
170
+ return self._request("POST", path, idempotent=idempotent, **kwargs)
169
171
 
170
172
  # ---- internal ----
171
173
 
172
- def _request(self, method: str, path: str, **kwargs: Any) -> httpx.Response:
174
+ def _request(self, method: str, path: str, *, idempotent: bool = True, **kwargs: Any) -> httpx.Response:
173
175
  """
174
176
  Execute an HTTP request with automatic retries on transient errors.
175
177
 
176
178
  Retries on 5xx responses and connection errors using exponential
177
- back-off (1s, 2s, 4s …).
179
+ back-off (1s, 2s, 4s …). With ``idempotent=False`` only a request
180
+ that certainly never reached CodeDD is retried (it could not connect,
181
+ or no pooled connection was free); a 5xx is returned and a timeout or
182
+ broken connection after sending raises :class:`CodeDDConnectionError`
183
+ at once, because CodeDD may have acted on it. A 503 ``profile_unavailable`` is returned
184
+ at once, for every method: its callers wait for the server's
185
+ ``Retry-After`` before asking again. They are
186
+ ``audit_cmd._with_profile_retry`` (the plan and pre-flight GETs and
187
+ the audit start POST) and ``sub_audit_runner._post_with_retry`` (the
188
+ file-results and validation POSTs). A new caller that can get this
189
+ 503 has to retry it the same way.
178
190
  """
179
191
  last_exc: Exception | None = None
180
192
 
@@ -184,7 +196,7 @@ class CodeDDClient:
184
196
  resp = self._client.request(method, path, **kwargs)
185
197
 
186
198
  # Don't retry client errors (4xx)
187
- if resp.status_code < 500:
199
+ if resp.status_code < 500 or _caller_retries(resp) or not idempotent:
188
200
  return resp
189
201
 
190
202
  # Retry on server errors
@@ -196,6 +208,8 @@ class CodeDDClient:
196
208
 
197
209
  except httpx.RequestError as exc:
198
210
  last_exc = exc
211
+ if not idempotent and not isinstance(exc, _NOT_SENT_ERRORS):
212
+ raise CodeDDConnectionError() from None
199
213
  if attempt < MAX_RETRIES:
200
214
  time.sleep(2 ** (attempt - 1))
201
215
  continue
@@ -214,3 +228,45 @@ class CodeDDClient:
214
228
 
215
229
  def __exit__(self, *args):
216
230
  self.close()
231
+
232
+
233
+ # Transport errors raised before the request was sent: safe to retry even for
234
+ # a non-idempotent POST (``idempotent=False``).
235
+ _NOT_SENT_ERRORS = (httpx.ConnectError, httpx.ConnectTimeout, httpx.PoolTimeout)
236
+
237
+ # CodeDD could not read an audit's security profile (a transient database
238
+ # error): 503 with ``Retry-After: 5``.
239
+ PROFILE_UNAVAILABLE_CODE = "profile_unavailable"
240
+ # How callers retry it (audit_cmd's plan, pre-flight and start; the runner's
241
+ # results and validation POSTs): wait for ``Retry-After`` (this default when
242
+ # absent, capped at the maximum), at most this many times.
243
+ PROFILE_UNAVAILABLE_MAX_RETRIES = 5
244
+ PROFILE_UNAVAILABLE_DEFAULT_WAIT_SECONDS = 5.0
245
+ PROFILE_UNAVAILABLE_MAX_WAIT_SECONDS = 30.0
246
+
247
+ # 503 codes whose retry cadence the caller owns (it honours ``Retry-After``,
248
+ # see ``CodeDDClient._request``): a client-level 1 s / 2 s retry would hit the
249
+ # server before it asked.
250
+ _CALLER_RETRIED_503_CODES = frozenset({PROFILE_UNAVAILABLE_CODE})
251
+
252
+
253
+ def _503_code(resp: Any) -> str | None:
254
+ """The body ``code`` of a 503 response, else None."""
255
+ if getattr(resp, "status_code", None) != 503:
256
+ return None
257
+ try:
258
+ body = resp.json()
259
+ except Exception:
260
+ return None
261
+ code = body.get("code") if isinstance(body, dict) else None
262
+ return code if isinstance(code, str) else None
263
+
264
+
265
+ def is_profile_unavailable(resp: Any) -> bool:
266
+ """True for a 503 ``profile_unavailable``: retry after its ``Retry-After``."""
267
+ return _503_code(resp) == PROFILE_UNAVAILABLE_CODE
268
+
269
+
270
+ def _caller_retries(resp: httpx.Response) -> bool:
271
+ """True for a 503 whose body ``code`` the caller retries itself."""
272
+ return _503_code(resp) in _CALLER_RETRIED_503_CODES
@@ -24,6 +24,7 @@ import math
24
24
  import os
25
25
  import re
26
26
  import time
27
+ from collections.abc import Iterable
27
28
  from typing import Any
28
29
 
29
30
  try:
@@ -41,6 +42,49 @@ from codedd_cli.auditor.server_parity.tech_normalizer import canonical_tech_name
41
42
  logger = logging.getLogger(__name__)
42
43
 
43
44
 
45
+ # ---------------------------------------------------------------------------
46
+ # Repository kind (first classifier) - decides the tier-ladder abstain path
47
+ # ---------------------------------------------------------------------------
48
+
49
+ def _legacy_classify_repo_kind(
50
+ detected_techs: Iterable[str],
51
+ detected_patterns: Iterable[str] | None = None,
52
+ ) -> str:
53
+ """Classify the repository kind from technology and pattern names.
54
+
55
+ The server's first repo-kind classifier, kept CLI-side: the vendored
56
+ ``repo_kind.classify_repo_kind`` now runs the kind classifier, which
57
+ needs catalog categories, a file census and a deployable census the
58
+ local classification does not have. The signal lists stay on the
59
+ vendored module (``REPO_KIND_SIGNALS``, ``LIBRARY_PACKAGING_SIGNALS``,
60
+ ``SERVICE_RUNTIME_SIGNALS``) and are read at call time, so the audit
61
+ plan's ``repo_kind_signals`` block still applies.
62
+
63
+ Returns one of: 'service' (default), 'library', 'serverless',
64
+ 'mobile_client', 'data_pipeline'.
65
+ """
66
+ haystack = [str(t).lower() for t in detected_techs or []] + \
67
+ [str(p).lower() for p in detected_patterns or []]
68
+
69
+ def _hit(signals: Iterable[str]) -> bool:
70
+ return any(sig in item for item in haystack for sig in signals)
71
+
72
+ for kind in ('mobile_client', 'data_pipeline', 'serverless'):
73
+ if _hit(rk.REPO_KIND_SIGNALS.get(kind, ())):
74
+ # A repo with real service runtime signals alongside e.g. spark
75
+ # is still a service estate; only classify as non-service when
76
+ # service runtime evidence is absent.
77
+ if kind != 'serverless' and _hit(rk.SERVICE_RUNTIME_SIGNALS):
78
+ continue
79
+ return kind
80
+
81
+ # Library/SDK: packaging/publish tooling without any service runtime.
82
+ if _hit(rk.LIBRARY_PACKAGING_SIGNALS) and not _hit(rk.SERVICE_RUNTIME_SIGNALS):
83
+ return 'library'
84
+
85
+ return 'service'
86
+
87
+
44
88
  # ---------------------------------------------------------------------------
45
89
  # Architecture style (topology) - orthogonal to the operational-scale tier
46
90
  # ---------------------------------------------------------------------------
@@ -70,7 +114,7 @@ def derive_architecture_style(
70
114
  ) -> str:
71
115
  """Topology-derived architecture style, independent of the tier ladder."""
72
116
  kind = str(repo_kind or 'service').strip().lower()
73
- if kind in rk.ABSTAIN_REPO_KINDS:
117
+ if kind in rk.LEGACY_ABSTAIN_REPO_KINDS:
74
118
  return kind
75
119
 
76
120
  patterns_l = [str(p).lower() for p in (detected_patterns or [])]
@@ -1588,11 +1632,11 @@ def compute_tier_gap_analysis(
1588
1632
  'gap': 0,
1589
1633
  }
1590
1634
  else:
1591
- recs = td.GAP_RECOMMENDATIONS.get(dim_key, {})
1592
- recommendation = recs.get(
1593
- primary_tier,
1635
+ # The style-neutral advice (the default family's steps joined):
1636
+ # nothing is known locally about the repository's style.
1637
+ recommendation = td.default_gap_recommendation(dim_key, primary_tier) or (
1594
1638
  f'Advance {td.DIMENSION_LABELS.get(dim_key, dim_key)} '
1595
- f'capabilities toward Tier {next_tier}.',
1639
+ f'capabilities toward Tier {next_tier}.'
1596
1640
  )
1597
1641
  recommendation_adjusted = False
1598
1642
  if _recommendation_contradicts_evidence(
@@ -1653,8 +1697,8 @@ def classify_local(
1653
1697
  # Pre-classify the repository kind (server parity). Non-service kinds
1654
1698
  # (library, mobile client, data pipeline) abstain from the
1655
1699
  # service-oriented tier ladder instead of being forced onto it.
1656
- repo_kind_value = rk.classify_repo_kind(scorer.detected_techs, scorer.detected_patterns)
1657
- tier_not_applicable = repo_kind_value in rk.ABSTAIN_REPO_KINDS
1700
+ repo_kind_value = _legacy_classify_repo_kind(scorer.detected_techs, scorer.detected_patterns)
1701
+ tier_not_applicable = repo_kind_value in rk.LEGACY_ABSTAIN_REPO_KINDS
1658
1702
 
1659
1703
  consistency_gate = scorer.apply_graph_consistency_gate(dimension_scores)
1660
1704
 
@@ -21,7 +21,7 @@ import re
21
21
  import threading
22
22
  import time
23
23
  from collections.abc import Callable
24
- from concurrent.futures import ThreadPoolExecutor, as_completed
24
+ from concurrent.futures import FIRST_COMPLETED, ThreadPoolExecutor, as_completed, wait
25
25
  from typing import Any
26
26
 
27
27
  from codedd_cli.auditor.archetype_classifier import classify_local
@@ -50,6 +50,7 @@ from codedd_cli.auditor.architecture_schema_contract import (
50
50
  normalize_llm_category_payload,
51
51
  )
52
52
  from codedd_cli.utils.safe_path import resolve_path_within_base
53
+ from codedd_cli.utils.secret_masking import mask_source_prefix
53
54
 
54
55
  logger = logging.getLogger(__name__)
55
56
 
@@ -1393,7 +1394,12 @@ def _read_file_safely_local(
1393
1394
  *,
1394
1395
  local_base: str | None = None,
1395
1396
  ) -> str | None:
1396
- """Read file content with size limit; truncate by character count. Returns None on error."""
1397
+ """Read file content with size limit, secrets masked; truncate by character count.
1398
+
1399
+ Returns None on error, including a failed masking (the file is then not
1400
+ sent). Only the part that is sent is masked, with enough text past the
1401
+ cut that a secret straddling it is masked whole.
1402
+ """
1397
1403
  try:
1398
1404
  if local_base:
1399
1405
  try:
@@ -1413,9 +1419,12 @@ def _read_file_safely_local(
1413
1419
  if size > _MAX_FILE_BYTES:
1414
1420
  return None
1415
1421
  with open(local_path, encoding="utf-8", errors="replace") as fh:
1416
- content = fh.read()
1417
- if len(content) > max_chars:
1418
- content = content[:max_chars] + "\n... (truncated)"
1422
+ raw = fh.read()
1423
+ content = mask_source_prefix(raw, local_path, max_chars)
1424
+ if content is None:
1425
+ return None
1426
+ if len(raw) > max_chars:
1427
+ content += "\n... (truncated)"
1419
1428
  return content
1420
1429
  except OSError:
1421
1430
  return None
@@ -2926,6 +2935,7 @@ def run_phase2_with_llm(
2926
2935
  on_debug: Callable[[str], None] | None = None,
2927
2936
  max_workers: int = 4,
2928
2937
  on_file_progress: Callable[[int, int], None] | None = None,
2938
+ cancel: threading.Event | None = None,
2929
2939
  ) -> dict[str, Any]:
2930
2940
  """
2931
2941
  Run full Phase 2 using local paths from scope_dirs (server parity ordering):
@@ -2936,6 +2946,8 @@ def run_phase2_with_llm(
2936
2946
  4. Synthesis — components, relationships, insights (LLM; uses enhanced data)
2937
2947
 
2938
2948
  Returns phase2 dict with category_analyses populated; server handles Phase 3.
2949
+ Once *cancel* is set, no new per-file LLM call starts and synthesis is
2950
+ skipped; the caller must not submit the (partial) result.
2939
2951
  """
2940
2952
  from codedd_cli.llm.key_manager import LLMKeyManager
2941
2953
 
@@ -3065,8 +3077,13 @@ def run_phase2_with_llm(
3065
3077
  if count and on_progress:
3066
3078
  on_progress(f"Category {cat}: {count} files queued.")
3067
3079
 
3080
+ def _cancelled() -> bool:
3081
+ return cancel is not None and cancel.is_set()
3082
+
3068
3083
  def _analyse_item(item: tuple[str, str, str]) -> tuple[str, dict[str, Any] | None]:
3069
3084
  cat, fp, lp = item
3085
+ if _cancelled():
3086
+ return cat, None
3070
3087
  # Each worker creates its own clients — httpx.Client is not thread-safe.
3071
3088
  a_client, o_client, g_client, x_client = _make_llm_clients(
3072
3089
  anthropic_key,
@@ -3102,14 +3119,27 @@ def run_phase2_with_llm(
3102
3119
  executor.submit(contextvars.copy_context().run, _analyse_item, item): item
3103
3120
  for item in work_items
3104
3121
  }
3105
- for future in as_completed(futures):
3106
- try:
3107
- cat, result = future.result()
3108
- if result:
3109
- with results_lock:
3110
- category_analyses.setdefault(cat, []).append(result)
3111
- except Exception as exc:
3112
- logger.warning("Architecture per-file worker failed: %s", exc)
3122
+ pending = set(futures)
3123
+ stopping = False
3124
+ while pending:
3125
+ if not stopping and _cancelled():
3126
+ # Drop the queued files; in-flight calls finish on their own.
3127
+ # wait() never reports futures cancelled by shutdown().
3128
+ stopping = True
3129
+ executor.shutdown(wait=False, cancel_futures=True)
3130
+ pending = {future for future in pending if not future.cancelled()}
3131
+ done, pending = wait(pending, timeout=0.5, return_when=FIRST_COMPLETED)
3132
+ for future in done:
3133
+ try:
3134
+ cat, result = future.result()
3135
+ if result:
3136
+ with results_lock:
3137
+ category_analyses.setdefault(cat, []).append(result)
3138
+ except Exception as exc:
3139
+ logger.warning("Architecture per-file worker failed: %s", exc)
3140
+
3141
+ if _cancelled():
3142
+ return build_phase2_results_empty("Cancelled before architecture synthesis")
3113
3143
 
3114
3144
  if on_progress:
3115
3145
  on_progress(
@@ -3248,6 +3278,8 @@ def run_architecture_analysis(
3248
3278
  on_debug: Callable[[str], None] | None = None,
3249
3279
  max_workers: int = 6,
3250
3280
  on_file_progress: Callable[[int, int], None] | None = None,
3281
+ local_classification: bool = False,
3282
+ cancel: threading.Event | None = None,
3251
3283
  ) -> tuple[dict[str, Any], dict[str, Any]]:
3252
3284
  """
3253
3285
  Run local architecture Phase 1, Phase 2 and synthesis for one sub-audit.
@@ -3261,6 +3293,11 @@ def run_architecture_analysis(
3261
3293
  insights) locally using the user's LLM API keys. The server only needs
3262
3294
  to run Phase 3 (graph construction + TypeDB storage) — no server-side LLM
3263
3295
  calls are required.
3296
+
3297
+ local_classification: also run the local archetype classification and
3298
+ store it under ``archetype_classification`` (a labelled estimate for
3299
+ ``--verbose``; CodeDD computes the tier itself and the submit drops it).
3300
+ cancel: stop starting per-file LLM calls once set (see run_phase2_with_llm).
3264
3301
  """
3265
3302
 
3266
3303
  def prog(msg: str) -> None:
@@ -3290,6 +3327,7 @@ def run_architecture_analysis(
3290
3327
  on_debug=on_debug,
3291
3328
  max_workers=max_workers,
3292
3329
  on_file_progress=on_file_progress,
3330
+ cancel=cancel,
3293
3331
  )
3294
3332
  else:
3295
3333
  prog("Preparing architecture payload (Phase 2 stub; no scope_dirs or LLM)...")
@@ -3297,9 +3335,11 @@ def run_architecture_analysis(
3297
3335
  "No scope_dirs for this repo or LLM not configured; run with --scope or set LLM keys for full Phase 2."
3298
3336
  )
3299
3337
 
3300
- # Run local archetype classification (T1-T5) using Phase 2 evidence.
3301
- # This gives the user immediate tier feedback in the CLI without waiting
3302
- # for the server's Phase 3 graph + classifier pipeline.
3338
+ # Local archetype classification (T1-T5) from Phase 2 evidence: only on
3339
+ # request (--verbose). It is an estimate CodeDD does not use; the tier
3340
+ # comes from the server's Phase 3 graph + classifier pipeline.
3341
+ if not local_classification or (cancel is not None and cancel.is_set()):
3342
+ return phase1, phase2
3303
3343
  has_components = bool(phase2.get("architectural_components"))
3304
3344
  has_tech = bool(phase2.get("enhanced_technology_detection", {}).get("detected_technologies"))
3305
3345
  if has_components or has_tech:
@@ -3316,9 +3356,9 @@ def run_architecture_analysis(
3316
3356
  name = classification.get("primary_archetype_name", "")
3317
3357
  style_label = classification.get("architecture_style_label", "")
3318
3358
  if style_label:
3319
- prog(f"Architecture classified: {style_label} — Tier {tier} ({name})")
3359
+ prog(f"Local estimate (not used by CodeDD): {style_label} — Tier {tier} ({name})")
3320
3360
  else:
3321
- prog(f"Architecture classified: Tier {tier} — {name}")
3361
+ prog(f"Local estimate (not used by CodeDD): Tier {tier} — {name}")
3322
3362
  except Exception as exc:
3323
3363
  logger.warning(f"Local archetype classification failed: {exc}")
3324
3364
  phase2["archetype_classification"] = None