corgea-cli 1.9.2__tar.gz → 1.10.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 (180) hide show
  1. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/.github/workflows/release-binaries.yml +68 -6
  2. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/.github/workflows/test.yml +3 -1
  3. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/.gitignore +1 -0
  4. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/Cargo.lock +1 -1
  5. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/Cargo.toml +1 -1
  6. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/PKG-INFO +1 -1
  7. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/README.md +5 -0
  8. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/RELEASING.md +23 -2
  9. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/bin/corgea.js +1 -1
  10. corgea_cli-1.10.0/build_release.sh +48 -0
  11. corgea_cli-1.10.0/scripts/check-linux-binary.sh +84 -0
  12. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/scripts/npm/bundle-binaries.js +1 -1
  13. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/skills/corgea/SKILL.md +38 -2
  14. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/src/config.rs +8 -0
  15. corgea_cli-1.10.0/src/deps/catalog.rs +201 -0
  16. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/src/deps/ecosystems/evaluate.rs +46 -31
  17. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/src/deps/ecosystems/maven.rs +180 -2
  18. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/src/deps/ecosystems/mod.rs +10 -0
  19. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/src/deps/mod.rs +8 -0
  20. corgea_cli-1.10.0/src/deps/report.rs +261 -0
  21. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/src/deps/run.rs +3 -6
  22. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/src/deps/skill.rs +15 -0
  23. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/src/deps/tests/correctness_tests.rs +5 -0
  24. corgea_cli-1.10.0/src/deps/tests/findings_tests.rs +115 -0
  25. corgea_cli-1.10.0/src/deps/tests/maven_tests.rs +338 -0
  26. corgea_cli-1.10.0/src/deps/tests/report_tests.rs +218 -0
  27. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/src/list.rs +126 -48
  28. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/src/main.rs +217 -27
  29. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/src/precheck/mod.rs +34 -12
  30. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/src/precheck/test_support.rs +2 -2
  31. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/src/precheck/verdict.rs +1 -1
  32. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/src/scan.rs +110 -8
  33. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/src/scanners/blast.rs +437 -9
  34. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/src/scanners/fortify.rs +15 -9
  35. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/src/utils/api.rs +937 -20
  36. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/src/utils/generic.rs +145 -36
  37. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/src/vuln_api_stub/mod.rs +135 -8
  38. corgea_cli-1.10.0/src/wait.rs +171 -0
  39. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/tests/cli_deps.rs +127 -1
  40. corgea_cli-1.10.0/tests/cli_deps_skill.rs +39 -0
  41. corgea_cli-1.10.0/tests/cli_scan_sbom.rs +219 -0
  42. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/tests/cli_verdict.rs +51 -0
  43. corgea_cli-1.10.0/tests/cloud_commands_e2e/common/mod.rs +842 -0
  44. corgea_cli-1.10.0/tests/cloud_commands_e2e/inspect.rs +140 -0
  45. corgea_cli-1.10.0/tests/cloud_commands_e2e/main.rs +7 -0
  46. corgea_cli-1.10.0/tests/cloud_commands_e2e/scan_list.rs +148 -0
  47. corgea_cli-1.10.0/tests/cloud_commands_e2e/upload_wait.rs +149 -0
  48. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/tests/common/mod.rs +197 -1
  49. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/tests/fixtures/README.md +1 -0
  50. corgea_cli-1.10.0/tests/fixtures/java-maven-alias/pom.xml +19 -0
  51. corgea_cli-1.10.0/tests/fixtures/java-maven-chained/pom.xml +20 -0
  52. corgea_cli-1.10.0/tests/fixtures/java-maven-deep-chain/pom.xml +25 -0
  53. corgea_cli-1.10.0/tests/fixtures/java-maven-managed/pom.xml +29 -0
  54. corgea_cli-1.10.0/tests/fixtures/java-maven-parent/pom.xml +29 -0
  55. corgea_cli-1.10.0/tests/fixtures/java-maven-plugin-deps/pom.xml +62 -0
  56. corgea_cli-1.10.0/tests/fixtures/java-maven-profile-mgmt/pom.xml +37 -0
  57. corgea_cli-1.10.0/tests/fixtures/java-maven-props/pom.xml +27 -0
  58. corgea_cli-1.10.0/tests/fixtures/java-maven-revision/pom.xml +19 -0
  59. corgea_cli-1.10.0/tests/fixtures/mixed-monorepo/services/api/requirements.txt +2 -0
  60. corgea_cli-1.10.0/tests/fixtures/mixed-monorepo/services/web/package-lock.json +29 -0
  61. corgea_cli-1.10.0/tests/fixtures/mixed-monorepo/services/web/package.json +10 -0
  62. corgea_cli-1.10.0/tests/list_code_quality.rs +209 -0
  63. corgea_cli-1.10.0/tests/list_resolution.rs +374 -0
  64. corgea_cli-1.10.0/tests/wait_resolution.rs +358 -0
  65. corgea_cli-1.9.2/.github/workflows/update_docs..yml +0 -27
  66. corgea_cli-1.9.2/build_release.sh +0 -34
  67. corgea_cli-1.9.2/src/deps/report.rs +0 -172
  68. corgea_cli-1.9.2/src/deps/tests/findings_tests.rs +0 -25
  69. corgea_cli-1.9.2/src/deps/tests/maven_tests.rs +0 -129
  70. corgea_cli-1.9.2/src/deps/tests/report_tests.rs +0 -29
  71. corgea_cli-1.9.2/src/wait.rs +0 -102
  72. corgea_cli-1.9.2/tests/cli_deps_skill.rs +0 -10
  73. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/.codex/hooks.json +0 -0
  74. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/.github/workflows/npm-publish.yml +0 -0
  75. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/.github/workflows/release.yml +0 -0
  76. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/.github/workflows/staging-contract.yml +0 -0
  77. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/AGENTS.md +0 -0
  78. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/LICENSE +0 -0
  79. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/examples/deps_skill.rs +0 -0
  80. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/harness +0 -0
  81. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/package.json +0 -0
  82. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/pyproject.toml +0 -0
  83. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/src/advisories.rs +0 -0
  84. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/src/authorize.rs +0 -0
  85. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/src/cicd.rs +0 -0
  86. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/src/deps/detect.rs +0 -0
  87. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/src/deps/diff.rs +0 -0
  88. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/src/deps/ecosystems/npm.rs +0 -0
  89. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/src/deps/ecosystems/pypi.rs +0 -0
  90. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/src/deps/explain.rs +0 -0
  91. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/src/deps/findings.rs +0 -0
  92. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/src/deps/model.rs +0 -0
  93. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/src/deps/parse/mod.rs +0 -0
  94. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/src/deps/parse/npm_lock.rs +0 -0
  95. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/src/deps/parse/python_lock.rs +0 -0
  96. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/src/deps/policy.rs +0 -0
  97. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/src/deps/tests/common.rs +0 -0
  98. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/src/deps/tests/detect_tests.rs +0 -0
  99. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/src/deps/tests/diff_tests.rs +0 -0
  100. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/src/deps/tests/explain_tests.rs +0 -0
  101. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/src/deps/tests/mod.rs +0 -0
  102. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/src/deps/tests/npm_tests.rs +0 -0
  103. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/src/deps/tests/policy_tests.rs +0 -0
  104. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/src/deps/tests/pypi_tests.rs +0 -0
  105. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/src/deps/tests/robustness_tests.rs +0 -0
  106. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/src/deps/tests/slice0_tests.rs +0 -0
  107. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/src/inspect.rs +0 -0
  108. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/src/lib.rs +0 -0
  109. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/src/log.rs +0 -0
  110. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/src/precheck/detect.rs +0 -0
  111. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/src/precheck/exec.rs +0 -0
  112. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/src/precheck/parse.rs +0 -0
  113. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/src/precheck/render.rs +0 -0
  114. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/src/precheck/tree.rs +0 -0
  115. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/src/precheck/uv.rs +0 -0
  116. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/src/scanners/parsers/checkmarx.rs +0 -0
  117. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/src/scanners/parsers/coverity.rs +0 -0
  118. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/src/scanners/parsers/mod.rs +0 -0
  119. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/src/scanners/parsers/sarif.rs +0 -0
  120. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/src/scanners/parsers/semgrep.rs +0 -0
  121. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/src/setup_hooks.rs +0 -0
  122. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/src/skill.rs +0 -0
  123. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/src/targets.rs +0 -0
  124. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/src/utils/terminal.rs +0 -0
  125. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/src/verify_deps/mod.rs +0 -0
  126. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/src/verify_deps/registry.rs +0 -0
  127. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/src/vuln_api/mod.rs +0 -0
  128. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/tests/cli_advisories.rs +0 -0
  129. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/tests/cli_bare_install.rs +0 -0
  130. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/tests/cli_exec_fallback.rs +0 -0
  131. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/tests/cli_install.rs +0 -0
  132. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/tests/cli_npm_ci.rs +0 -0
  133. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/tests/cli_provenance.rs +0 -0
  134. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/tests/cli_remediation.rs +0 -0
  135. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/tests/cli_tree.rs +0 -0
  136. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/tests/cli_uv_sync.rs +0 -0
  137. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/tests/fixtures/go-mod-smoke/go.mod +0 -0
  138. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/tests/fixtures/go-mod-smoke/go.sum +0 -0
  139. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/tests/fixtures/java-gradle/build.gradle +0 -0
  140. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/tests/fixtures/java-gradle/gradle.lockfile +0 -0
  141. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/tests/fixtures/java-maven/pom.xml +0 -0
  142. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/tests/fixtures/malformed/not-xml-pom.xml +0 -0
  143. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/tests/fixtures/malformed/package-lock.json +0 -0
  144. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/tests/fixtures/malformed/package.json +0 -0
  145. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/tests/fixtures/malformed/poetry.lock +0 -0
  146. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/tests/fixtures/malformed/pyproject.toml +0 -0
  147. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/tests/fixtures/malformed/truncated-poetry.lock +0 -0
  148. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/tests/fixtures/node-app/.corgea/deps.yml +0 -0
  149. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/tests/fixtures/node-app/package-lock.json +0 -0
  150. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/tests/fixtures/node-app/package.json +0 -0
  151. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/tests/fixtures/node-monorepo/package-lock.json +0 -0
  152. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/tests/fixtures/node-monorepo/package.json +0 -0
  153. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/tests/fixtures/node-monorepo/packages/a/package.json +0 -0
  154. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/tests/fixtures/node-monorepo/packages/b/package.json +0 -0
  155. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/tests/fixtures/node-pnpm/package.json +0 -0
  156. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/tests/fixtures/node-pnpm/pnpm-lock.yaml +0 -0
  157. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/tests/fixtures/node-stale/package-lock.json +0 -0
  158. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/tests/fixtures/node-stale/package.json +0 -0
  159. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/tests/fixtures/node-transitive/package-lock.json +0 -0
  160. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/tests/fixtures/node-transitive/package.json +0 -0
  161. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/tests/fixtures/node-yarn/package.json +0 -0
  162. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/tests/fixtures/node-yarn/yarn.lock +0 -0
  163. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/tests/fixtures/python-pip-nolock/requirements.txt +0 -0
  164. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/tests/fixtures/python-poetry/poetry.lock +0 -0
  165. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/tests/fixtures/python-poetry/pyproject.toml +0 -0
  166. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/tests/fixtures/python-poetry-multi/poetry.lock +0 -0
  167. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/tests/fixtures/python-poetry-multi/pyproject.toml +0 -0
  168. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/tests/fixtures/python-uv-requirements/pyproject.toml +0 -0
  169. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/tests/fixtures/python-uv-requirements/requirements.txt +0 -0
  170. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/tests/fixtures/python-uv-requirements/uv.lock +0 -0
  171. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/tests/fixtures/vuln_api/README.md +0 -0
  172. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/tests/fixtures/vuln_api/check_clean.json +0 -0
  173. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/tests/fixtures/vuln_api/check_malware.json +0 -0
  174. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/tests/fixtures/vuln_api/check_unknown.json +0 -0
  175. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/tests/fixtures/vuln_api/check_vulnerable.json +0 -0
  176. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/tests/fixtures/vuln_api/package_profile.json +0 -0
  177. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/tests/fixtures/vuln_api/package_profile_not_found.json +0 -0
  178. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/tests/harness_smoke.rs +0 -0
  179. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/tests/logging_e2e.rs +0 -0
  180. {corgea_cli-1.9.2 → corgea_cli-1.10.0}/tests/vuln_api_contract.rs +0 -0
@@ -12,6 +12,13 @@ on:
12
12
  permissions:
13
13
  contents: write
14
14
 
15
+ env:
16
+ # Highest glibc a *-gnu binary may require. Linux builds are cross-linked
17
+ # against this floor so the artifacts do not inherit the runner's glibc.
18
+ GLIBC_FLOOR: "2.17"
19
+ ZIG_VERSION: "0.13.0"
20
+ CARGO_ZIGBUILD_VERSION: "0.23.0"
21
+
15
22
  jobs:
16
23
  native-binaries:
17
24
  name: Build and Upload Native Binaries
@@ -24,9 +31,12 @@ jobs:
24
31
  - os: ubuntu-latest
25
32
  target: x86_64-unknown-linux-musl
26
33
  binary_name: corgea
27
- - os: ubuntu-24.04-arm
34
+ - os: ubuntu-latest
28
35
  target: aarch64-unknown-linux-gnu
29
36
  binary_name: corgea
37
+ - os: ubuntu-latest
38
+ target: aarch64-unknown-linux-musl
39
+ binary_name: corgea
30
40
  - os: macos-latest
31
41
  target: x86_64-apple-darwin
32
42
  binary_name: corgea
@@ -44,16 +54,68 @@ jobs:
44
54
  with:
45
55
  ref: ${{ inputs.tag || github.ref }}
46
56
 
47
- - name: Install musl tools
48
- if: matrix.target == 'x86_64-unknown-linux-musl'
49
- run: sudo apt-get install -y musl-tools
50
-
51
57
  - name: Install Rust Target
52
58
  run: rustup target add ${{ matrix.target }}
53
59
 
54
- - name: Build Binary
60
+ - name: Install Zig
61
+ if: runner.os == 'Linux'
62
+ uses: mlugg/setup-zig@d1434d08867e3ee9daa34448df10607b98908d29 # v2.2.1
63
+ with:
64
+ version: ${{ env.ZIG_VERSION }}
65
+
66
+ - name: Install cargo-zigbuild
67
+ if: runner.os == 'Linux'
68
+ uses: taiki-e/install-action@18b1216eba7f8039b0f8d131d5473787f0edce68 # v2.85.3
69
+ with:
70
+ tool: cargo-zigbuild@${{ env.CARGO_ZIGBUILD_VERSION }}
71
+
72
+ - name: Build Binary (Linux)
73
+ if: runner.os == 'Linux'
74
+ shell: bash
75
+ run: |
76
+ build_target="${{ matrix.target }}"
77
+ if [[ "$build_target" == *-gnu ]]; then
78
+ build_target="${build_target}.${GLIBC_FLOOR}"
79
+ fi
80
+ cargo zigbuild --release --target "$build_target"
81
+
82
+ - name: Build Binary (macOS and Windows)
83
+ if: runner.os != 'Linux'
55
84
  run: cargo build --release --target ${{ matrix.target }}
56
85
 
86
+ - name: Verify Linux Runtime Compatibility
87
+ if: runner.os == 'Linux'
88
+ shell: bash
89
+ run: |
90
+ scripts/check-linux-binary.sh \
91
+ "target/${{ matrix.target }}/release/${{ matrix.binary_name }}" \
92
+ "${{ matrix.target }}"
93
+
94
+ # The aarch64 artifacts are cross-built, so nothing else in CI would ever
95
+ # execute them. Run them under qemu to catch a binary that passes the
96
+ # header checks but cannot actually start.
97
+ - name: Smoke Test Linux Binary
98
+ if: runner.os == 'Linux'
99
+ shell: bash
100
+ run: |
101
+ binary="target/${{ matrix.target }}/release/${{ matrix.binary_name }}"
102
+
103
+ case "${{ matrix.target }}" in
104
+ aarch64-*-gnu)
105
+ sudo apt-get update -qq
106
+ sudo apt-get install -y -qq qemu-user-static libc6-arm64-cross
107
+ qemu-aarch64-static -L /usr/aarch64-linux-gnu "$binary" --version
108
+ ;;
109
+ aarch64-*-musl)
110
+ sudo apt-get update -qq
111
+ sudo apt-get install -y -qq qemu-user-static
112
+ qemu-aarch64-static "$binary" --version
113
+ ;;
114
+ *)
115
+ "$binary" --version
116
+ ;;
117
+ esac
118
+
57
119
  - name: Archive Binary (Unix)
58
120
  if: runner.os != 'Windows'
59
121
  shell: bash
@@ -4,9 +4,11 @@ on:
4
4
  push:
5
5
  branches:
6
6
  - main
7
- - master
8
7
  pull_request:
9
8
 
9
+ permissions:
10
+ contents: read
11
+
10
12
  jobs:
11
13
  rust-tests:
12
14
  runs-on: ubuntu-latest
@@ -5,6 +5,7 @@
5
5
  *.zip
6
6
  *.profraw
7
7
  node_modules/
8
+ /vendor/
8
9
  /packages/*/vendor/
9
10
 
10
11
  .claude/
@@ -369,7 +369,7 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"
369
369
 
370
370
  [[package]]
371
371
  name = "corgea"
372
- version = "1.9.2"
372
+ version = "1.10.0"
373
373
  dependencies = [
374
374
  "chrono",
375
375
  "clap",
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "corgea"
3
- version = "1.9.2"
3
+ version = "1.10.0"
4
4
  edition = "2021"
5
5
  readme = "README.md"
6
6
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: corgea-cli
3
- Version: 1.9.2
3
+ Version: 1.10.0
4
4
  Classifier: Development Status :: 5 - Production/Stable
5
5
  Classifier: Environment :: Console
6
6
  Classifier: Intended Audience :: Developers
@@ -20,6 +20,11 @@ pip install corgea-cli
20
20
  ### Manual Installation
21
21
  You can get the latest binaries for your OS from https://github.com/Corgea/cli/releases.
22
22
 
23
+ On Linux, both a `-gnu` and a `-musl` binary are published for x86_64 and
24
+ aarch64. The `-gnu` builds run on glibc 2.17 and newer; the `-musl` builds are
25
+ fully static and have no libc requirement at all, which makes them the safer
26
+ pick for minimal containers and CI runners.
27
+
23
28
  ### Setup
24
29
  Once the binary is installed, login with your token from the Corgea app.
25
30
  ```
@@ -69,8 +69,29 @@ Pushing an annotated `vX.Y.Z` tag to `main` fans out to three GitHub Actions wor
69
69
  ## What gets built
70
70
 
71
71
  - **PyPI wheels** (`release.yml`): Linux (x86_64, x86), Windows (x64, x86), macOS (x86_64, aarch64), plus an sdist. Asserts `manylinux2014` tags for broad Linux compatibility.
72
- - **Native binaries** (`release-binaries.yml`): `x86_64-unknown-linux-gnu`, `x86_64-unknown-linux-musl`, `aarch64-unknown-linux-gnu`, `x86_64-apple-darwin`, `aarch64-apple-darwin`, `x86_64-pc-windows-msvc`.
73
- - **npm binary bundling** (`npm-publish.yml` → `scripts/npm/bundle-binaries.js`): downloads the GitHub Release zips and lays them out as `vendor/<target>/corgea/corgea`. At runtime `bin/corgea.js` selects the binary for the host OS/arch. npm ships 5 of the 6 targets (Linux x64 uses the musl build).
72
+ - **Native binaries** (`release-binaries.yml`): `x86_64-unknown-linux-gnu`, `x86_64-unknown-linux-musl`, `aarch64-unknown-linux-gnu`, `aarch64-unknown-linux-musl`, `x86_64-apple-darwin`, `aarch64-apple-darwin`, `x86_64-pc-windows-msvc`.
73
+ - **npm binary bundling** (`npm-publish.yml` → `scripts/npm/bundle-binaries.js`): downloads the GitHub Release zips and lays them out as `vendor/<target>/corgea/corgea`. At runtime `bin/corgea.js` selects the binary for the host OS/arch. npm ships 5 of the 7 targets (both Linux arches use the musl build).
74
+
75
+ ### Linux glibc floor
76
+
77
+ Building a `*-gnu` target natively stamps the *runner's* glibc into the binary's
78
+ ELF version-need table, and the loader then refuses to start it on any host with
79
+ an older glibc. Every release from `v1.7.2` through `v1.9.2` shipped Linux gnu
80
+ binaries that required `GLIBC_2.39`, so they failed on Ubuntu 22.04 (glibc 2.35)
81
+ and older with `version 'GLIBC_2.38' not found`.
82
+
83
+ All four Linux targets are therefore cross-built on `ubuntu-latest` with
84
+ [`cargo-zigbuild`](https://github.com/rust-cross/cargo-zigbuild), pinning the gnu
85
+ targets to the `GLIBC_FLOOR` declared in `release-binaries.yml` (currently
86
+ `2.17`, i.e. RHEL 7 / Ubuntu 14.04 and newer). `scripts/check-linux-binary.sh`
87
+ then re-reads each artifact and fails the build if a gnu binary exceeds the
88
+ floor, or if a musl binary is not fully static. Run it locally with:
89
+
90
+ ```bash
91
+ scripts/check-linux-binary.sh target/aarch64-unknown-linux-gnu/release/corgea aarch64-unknown-linux-gnu
92
+ ```
93
+
94
+ Raising `GLIBC_FLOOR` drops support for older distros — change it deliberately.
74
95
 
75
96
  ## Release notes
76
97
 
@@ -10,7 +10,7 @@ function resolveTargetTriple() {
10
10
  case "linux":
11
11
  case "android":
12
12
  if (process.arch === "x64") return "x86_64-unknown-linux-musl";
13
- if (process.arch === "arm64") return "aarch64-unknown-linux-gnu";
13
+ if (process.arch === "arm64") return "aarch64-unknown-linux-musl";
14
14
  return null;
15
15
  case "darwin":
16
16
  if (process.arch === "x64") return "x86_64-apple-darwin";
@@ -0,0 +1,48 @@
1
+ #!/bin/bash
2
+
3
+ BUILD_OS="$(uname)"
4
+
5
+ # Keep in sync with GLIBC_FLOOR in .github/workflows/release-binaries.yml. Linux
6
+ # binaries are cross-linked against this floor so they do not pick up whatever
7
+ # glibc the build host happens to ship.
8
+ GLIBC_FLOOR="${GLIBC_FLOOR:-2.17}"
9
+
10
+ if [ $BUILD_OS == "Darwin" ]; then
11
+ TARGETS=("aarch64-apple-darwin" "x86_64-apple-darwin")
12
+ elif [ $BUILD_OS == "Linux" ]; then
13
+ TARGETS=("aarch64-unknown-linux-gnu" "aarch64-unknown-linux-musl" "x86_64-unknown-linux-gnu" "x86_64-unknown-linux-musl")
14
+
15
+ if ! command -v cargo-zigbuild >/dev/null 2>&1; then
16
+ echo "cargo-zigbuild is required to build the Linux targets."
17
+ echo "Install it with: cargo install cargo-zigbuild && pip install ziglang"
18
+ exit 1
19
+ fi
20
+ else
21
+ echo "Are you building from a supported OS? (Darwin/Linux)"
22
+ exit 1
23
+ fi
24
+
25
+ for target in "${TARGETS[@]}"
26
+ do
27
+ if [ $BUILD_OS == "Darwin" ]; then
28
+ cargo build -r --target $target || exit 1
29
+ else
30
+ build_target="$target"
31
+ if [[ "$target" == *-gnu ]]; then
32
+ build_target="${target}.${GLIBC_FLOOR}"
33
+ fi
34
+
35
+ cargo zigbuild -r --target "$build_target" || exit 1
36
+ GLIBC_FLOOR="$GLIBC_FLOOR" \
37
+ ./scripts/check-linux-binary.sh "target/$target/release/corgea" "$target" || exit 1
38
+ fi
39
+
40
+ zip_file_name="corgea-$target.zip"
41
+
42
+ # if zip_file_name exists, remove it
43
+ if [ -f $zip_file_name ]; then
44
+ rm $zip_file_name
45
+ fi
46
+
47
+ zip -j $zip_file_name "target/$target/release/corgea"
48
+ done
@@ -0,0 +1,84 @@
1
+ #!/usr/bin/env bash
2
+ #
3
+ # Gate on the runtime requirements of a released Linux binary.
4
+ #
5
+ # Linking against the build runner's glibc stamps that version into the ELF
6
+ # version-need table, and the loader refuses the binary on any host with an
7
+ # older glibc. Runner images move forward on their own schedule, so without
8
+ # this check the supported floor silently follows them.
9
+ #
10
+ # scripts/check-linux-binary.sh <binary> <target-triple>
11
+ #
12
+ # GLIBC_FLOOR (default 2.17) is the highest glibc version a *-gnu binary may
13
+ # require. *-musl binaries must be fully static instead.
14
+
15
+ set -euo pipefail
16
+
17
+ binary=${1:-}
18
+ triple=${2:-}
19
+ floor=${GLIBC_FLOOR:-2.17}
20
+
21
+ if [ -z "$binary" ] || [ -z "$triple" ]; then
22
+ echo "usage: $0 <binary> <target-triple>" >&2
23
+ exit 2
24
+ fi
25
+
26
+ if [ ! -f "$binary" ]; then
27
+ echo "FAIL: $binary does not exist" >&2
28
+ exit 1
29
+ fi
30
+
31
+ case "$triple" in
32
+ aarch64-*) want_machine="AArch64" ;;
33
+ x86_64-*) want_machine="X86-64" ;;
34
+ *)
35
+ echo "FAIL: unsupported target triple: $triple" >&2
36
+ exit 1
37
+ ;;
38
+ esac
39
+
40
+ machine=$(readelf -h "$binary" | sed -n 's/^ *Machine: *//p')
41
+ case "$machine" in
42
+ *"$want_machine"*) ;;
43
+ *)
44
+ echo "FAIL: $binary is '$machine', expected $want_machine for $triple" >&2
45
+ exit 1
46
+ ;;
47
+ esac
48
+
49
+ case "$triple" in
50
+ *-musl)
51
+ if readelf -lW "$binary" | grep -q INTERP; then
52
+ echo "FAIL: $binary is dynamically linked; musl builds must be static" >&2
53
+ exit 1
54
+ fi
55
+ echo "OK: $binary ($triple) is statically linked"
56
+ ;;
57
+
58
+ *-gnu)
59
+ # A binary with no versioned glibc references is fine, but grep exits 1 on
60
+ # no match, so run it outside the pipeline that feeds the assignment.
61
+ # Requiring a digit keeps unversioned tags such as GLIBC_PRIVATE out.
62
+ version_info=$(readelf -V "$binary")
63
+ needed=$(grep -oE 'GLIBC_[0-9]+(\.[0-9]+)*' <<<"$version_info" | sed 's/^GLIBC_//' | sort -uV || true)
64
+
65
+ if [ -z "$needed" ]; then
66
+ echo "OK: $binary ($triple) requires no versioned glibc symbols"
67
+ exit 0
68
+ fi
69
+
70
+ highest=$(echo "$needed" | tail -1)
71
+ if [ "$(printf '%s\n%s\n' "$highest" "$floor" | sort -V | tail -1)" != "$floor" ]; then
72
+ echo "FAIL: $binary requires glibc $highest, above the $floor floor" >&2
73
+ echo " versions required: $(echo "$needed" | tr '\n' ' ')" >&2
74
+ exit 1
75
+ fi
76
+
77
+ echo "OK: $binary ($triple) requires at most glibc $highest (floor $floor)"
78
+ ;;
79
+
80
+ *)
81
+ echo "FAIL: unsupported libc in target triple: $triple" >&2
82
+ exit 1
83
+ ;;
84
+ esac
@@ -7,7 +7,7 @@ const { unzipSync } = require("fflate");
7
7
 
8
8
  const TARGETS = [
9
9
  { triple: "x86_64-unknown-linux-musl", binary: "corgea" },
10
- { triple: "aarch64-unknown-linux-gnu", binary: "corgea" },
10
+ { triple: "aarch64-unknown-linux-musl", binary: "corgea" },
11
11
  { triple: "x86_64-apple-darwin", binary: "corgea" },
12
12
  { triple: "aarch64-apple-darwin", binary: "corgea" },
13
13
  { triple: "x86_64-pc-windows-msvc", binary: "corgea.exe" },
@@ -33,14 +33,26 @@ corgea scan --scan-type secrets # Single scan type
33
33
  corgea scan --scan-type blast,policy,secrets,pii # Multiple scan types
34
34
  corgea scan --scan-type policy --policy 1 # Specific policy ID
35
35
  corgea scan --fail-on CR # Exit 1 on critical issues (CR, HI, ME, LO)
36
- corgea scan --fail # Exit 1 based on project blocking rules
36
+ corgea scan --fail-on malicious # Exit 1 if any dependency is classified malicious
37
+ corgea scan --fail-on HI,malicious # Comma-separated conditions combine
38
+ corgea scan --block-on criticals # Exit 1 if the scan violates the named CI blocking rules
39
+ corgea scan --block-on criticals,malicious-deps # Comma-separated rule slugs
40
+ corgea scan --fail # Deprecated: exit 1 based on every active blocking rule
37
41
  corgea scan --out-format json --out-file r.json # Export (json, html, sarif, markdown)
42
+ corgea scan --sbom # Also write a CycloneDX SBOM to bom.json
43
+ corgea scan --sbom sbom.cdx.json # SBOM to a custom file
38
44
  corgea scan --project-name my-service # Override project name
39
45
  ```
40
46
 
41
47
  Scan types: `blast` (base AI), `policy` (PolicyIQ), `malicious`, `secrets`, `pii`.
42
48
 
43
- `--only-uncommitted` and `--target` are mutually exclusive. `--fail-on` and `--fail` are mutually exclusive.
49
+ `--fail-on` takes comma-separated conditions: severity thresholds `CR`, `HI`, `ME`, `LO` (trip at or above the level) and/or `malicious` (trips when any dependency in the scan is classified malicious). Use `malicious` to block supply-chain findings in CI across every ecosystem the scan covers, including those the `corgea npm`/`corgea pip` install gate does not.
50
+
51
+ `--block-on` takes comma-separated blocking-rule slugs. Blocking rules are configured in the web app and each one applies either to pull requests or to CI. Only CI rules can be named by `--block-on`; a slug that is unknown, inactive, or scoped to pull requests is a hard error (exit 1) rather than a silently skipped gate. The slug is shown next to each rule in the web app and is derived from the rule name, so renaming a rule changes its slug. Name rules for the condition that trips them — `criticals`, not `no-criticals` — so that `--block-on` reads as a direct assertion rather than a double negative.
52
+
53
+ `--fail` is deprecated. It evaluates every active blocking rule regardless of what it applies to; use `--block-on` to name the CI rules a pipeline should enforce.
54
+
55
+ `--only-uncommitted` and `--target` are mutually exclusive. `--fail-on`, `--fail`, and `--block-on` are mutually exclusive.
44
56
 
45
57
  ### Upload — `corgea upload [report]`
46
58
 
@@ -51,10 +63,13 @@ corgea upload path/to/report.json # JSON, SARIF, Coverity XML
51
63
  corgea upload path/to/report.fpr # Fortify FPR
52
64
  corgea upload report.sarif --project-name svc # Custom project name
53
65
  cat report.json | corgea upload # From stdin
66
+ corgea upload report.json --wait # Wait for scan to complete and print results
54
67
  ```
55
68
 
56
69
  Supported: Semgrep JSON, SARIF, Checkmarx (CLI/Web/XML), Coverity, Fortify FPR.
57
70
 
71
+ By default `upload` prints the scan page URL so you can track the results. Pass `--wait` to block until the scan completes and print the results (like `corgea scan`).
72
+
58
73
  ### Wait — `corgea wait [scan_id]`
59
74
 
60
75
  ```bash
@@ -68,6 +83,7 @@ corgea wait --scan-id SCAN_ID # Wait for specific scan
68
83
  corgea ls # List scans
69
84
  corgea ls --issues --scan-id SCAN_ID # Issues for a scan
70
85
  corgea ls --sca-issues # SCA (dependency) issues
86
+ corgea ls --code-quality # Code quality issues
71
87
  corgea ls --issues --page 2 --page-size 10 # Pagination
72
88
  corgea ls --issues --scan-id SCAN_ID --json # JSON output
73
89
  ```
@@ -76,6 +92,7 @@ corgea ls --issues --scan-id SCAN_ID --json # JSON output
76
92
  |------|-------|-------------|
77
93
  | `--issues` | `-i` | List code/SAST issues |
78
94
  | `--sca-issues` | `-c` | List SCA issues |
95
+ | `--code-quality` | `-q` | List code quality issues (alias `--quality`) |
79
96
  | `--scan-id` | `-s` | Filter to a scan |
80
97
  | `--page` | `-p` | Page number |
81
98
  | `--page-size` | | Items per page |
@@ -129,6 +146,22 @@ Agent environments default to compact TSV; force output with `--format human|age
129
146
  Examples: `corgea deps policy init`; `corgea deps policy init --exist-ok --format quiet`
130
147
 
131
148
  Notes: `deps scan --out-format table|json|sarif` is the report/export selector; do not combine it with `deps scan --format`.
149
+
150
+ ### Dependency finding catalog
151
+
152
+ | ID | Status | Severity | Title | Description | Remediation |
153
+ | --- | --- | --- | --- | --- | --- |
154
+ | `DEP001` | emitted | High | Missing lockfile | The dependency manifest has no expected lockfile, so resolution is not reproducible. | Generate and commit the ecosystem lockfile. |
155
+ | `DEP002` | emitted | High | Stale lockfile | A manifest dependency is missing from its lockfile. | Regenerate and commit the lockfile. |
156
+ | `DEP003` | emitted | Medium | Direct dependency uses broad range | A direct dependency uses a bounded version range. | Pin an exact version or explicitly allow the range by policy. |
157
+ | `DEP004` | emitted | High | Wildcard or latest dependency | A direct dependency uses wildcard, latest, or another unbounded range. | Pin an exact version. |
158
+ | `DEP005` | emitted | High | Mutable Git branch dependency | A direct dependency is sourced from a mutable Git branch reference. | Pin a commit SHA or immutable release tag. |
159
+ | `DEP006` | emitted | High | URL/tarball dependency without checksum | A direct URL or tarball dependency has no integrity checksum. | Add an integrity checksum or pin a registry package. |
160
+ | `DEP008` | emitted | Medium | Lockfile integrity hash missing | A lockfile entry lacks its integrity hash. | Add the integrity hash to the lockfile entry. |
161
+ | `DEP010` | reserved | Medium | Vulnerable package advisory | Reserved for vulnerable-package/advisory findings; `corgea deps` does not emit it. | Handle this code in an advisory or install-wrapper flow, never in `corgea deps`. |
162
+ | `DEP014` | emitted | Low | Duplicate versions of same package | More than one resolved version of a package is present. | Align or deduplicate the resolved dependency versions. |
163
+ | `DEP019` | emitted | Medium | Unsupported lockfile | A detected lockfile format is not supported by the parser. | Use a supported lockfile or wait for parser support. |
164
+ | `DEP021` | emitted | High | Mutable artifact version | A direct artifact version is mutable, such as a Maven SNAPSHOT. | Pin an immutable release version. |
132
165
  <!-- END GENERATED CORGEA DEPS SKILL -->
133
166
 
134
167
  ### Advisories — `corgea advisories check`
@@ -330,6 +363,8 @@ corgea inspect --issue --diff ISSUE_ID
330
363
 
331
364
  ```bash
332
365
  corgea scan --fail-on CR --out-format sarif --out-file results.sarif
366
+ corgea scan --fail-on CR,malicious --out-format sarif --out-file results.sarif # also block malicious dependencies
367
+ corgea scan --block-on criticals --out-format sarif --out-file results.sarif # gate on a CI blocking rule from the web app
333
368
  ```
334
369
 
335
370
  ### Upload third-party reports
@@ -343,6 +378,7 @@ corgea upload report.json --project-name my-app
343
378
  ```bash
344
379
  corgea scan --out-format html --out-file report.html
345
380
  corgea scan --out-format sarif --out-file report.sarif
381
+ corgea scan --out-format sarif --out-file report.sarif --sbom bom.json # SARIF + CycloneDX SBOM
346
382
  ```
347
383
 
348
384
  ## Severity Levels
@@ -4,6 +4,14 @@ use std::{env, fs, io};
4
4
 
5
5
  pub const DEFAULT_VULN_API_URL: &str = "https://cve-worker-staging.corgea.workers.dev";
6
6
 
7
+ /// Whether `DEFAULT_VULN_API_URL` is an endpoint Corgea tokens belong to.
8
+ /// The `-staging` hostname is historical: this worker serves as the production
9
+ /// vuln-api, so a token may be sent to it and authenticated (fail-closed)
10
+ /// verdicts apply by default. Set to `false` if the default is ever repointed
11
+ /// at an endpoint that customer tokens should not reach — token-send and
12
+ /// fail-closed then both require the explicit opt-in.
13
+ pub const DEFAULT_VULN_API_URL_IS_PRODUCTION: bool = true;
14
+
7
15
  #[derive(Serialize, Deserialize, Clone)]
8
16
  pub struct Config {
9
17
  pub(crate) url: String,
@@ -0,0 +1,201 @@
1
+ use crate::deps::model::Severity;
2
+
3
+ #[derive(Debug, Clone, Copy, PartialEq, Eq)]
4
+ pub enum FindingStatus {
5
+ Emitted,
6
+ Reserved,
7
+ Deprecated,
8
+ }
9
+
10
+ impl FindingStatus {
11
+ pub const fn as_str(self) -> &'static str {
12
+ match self {
13
+ Self::Emitted => "emitted",
14
+ Self::Reserved => "reserved",
15
+ Self::Deprecated => "deprecated",
16
+ }
17
+ }
18
+ }
19
+
20
+ #[derive(Debug, Clone, Copy, PartialEq, Eq)]
21
+ pub struct FindingDefinition {
22
+ pub id: &'static str,
23
+ pub title: &'static str,
24
+ pub severity: Severity,
25
+ pub description: &'static str,
26
+ pub remediation: &'static str,
27
+ pub status: FindingStatus,
28
+ }
29
+
30
+ pub const FINDING_DEFINITIONS: &[FindingDefinition] = &[
31
+ FindingDefinition {
32
+ id: "DEP001",
33
+ title: "Missing lockfile",
34
+ severity: Severity::High,
35
+ description:
36
+ "The dependency manifest has no expected lockfile, so resolution is not reproducible.",
37
+ remediation: "Generate and commit the ecosystem lockfile.",
38
+ status: FindingStatus::Emitted,
39
+ },
40
+ FindingDefinition {
41
+ id: "DEP002",
42
+ title: "Stale lockfile",
43
+ severity: Severity::High,
44
+ description: "A manifest dependency is missing from its lockfile.",
45
+ remediation: "Regenerate and commit the lockfile.",
46
+ status: FindingStatus::Emitted,
47
+ },
48
+ FindingDefinition {
49
+ id: "DEP003",
50
+ title: "Direct dependency uses broad range",
51
+ severity: Severity::Medium,
52
+ description: "A direct dependency uses a bounded version range.",
53
+ remediation: "Pin an exact version or explicitly allow the range by policy.",
54
+ status: FindingStatus::Emitted,
55
+ },
56
+ FindingDefinition {
57
+ id: "DEP004",
58
+ title: "Wildcard or latest dependency",
59
+ severity: Severity::High,
60
+ description: "A direct dependency uses wildcard, latest, or another unbounded range.",
61
+ remediation: "Pin an exact version.",
62
+ status: FindingStatus::Emitted,
63
+ },
64
+ FindingDefinition {
65
+ id: "DEP005",
66
+ title: "Mutable Git branch dependency",
67
+ severity: Severity::High,
68
+ description: "A direct dependency is sourced from a mutable Git branch reference.",
69
+ remediation: "Pin a commit SHA or immutable release tag.",
70
+ status: FindingStatus::Emitted,
71
+ },
72
+ FindingDefinition {
73
+ id: "DEP006",
74
+ title: "URL/tarball dependency without checksum",
75
+ severity: Severity::High,
76
+ description: "A direct URL or tarball dependency has no integrity checksum.",
77
+ remediation: "Add an integrity checksum or pin a registry package.",
78
+ status: FindingStatus::Emitted,
79
+ },
80
+ FindingDefinition {
81
+ id: "DEP008",
82
+ title: "Lockfile integrity hash missing",
83
+ severity: Severity::Medium,
84
+ description: "A lockfile entry lacks its integrity hash.",
85
+ remediation: "Add the integrity hash to the lockfile entry.",
86
+ status: FindingStatus::Emitted,
87
+ },
88
+ FindingDefinition {
89
+ id: "DEP010",
90
+ title: "Vulnerable package advisory",
91
+ severity: Severity::Medium,
92
+ description:
93
+ "Reserved for vulnerable-package/advisory findings; `corgea deps` does not emit it.",
94
+ remediation:
95
+ "Handle this code in an advisory or install-wrapper flow, never in `corgea deps`.",
96
+ status: FindingStatus::Reserved,
97
+ },
98
+ FindingDefinition {
99
+ id: "DEP014",
100
+ title: "Duplicate versions of same package",
101
+ severity: Severity::Low,
102
+ description: "More than one resolved version of a package is present.",
103
+ remediation: "Align or deduplicate the resolved dependency versions.",
104
+ status: FindingStatus::Emitted,
105
+ },
106
+ FindingDefinition {
107
+ id: "DEP019",
108
+ title: "Unsupported lockfile",
109
+ severity: Severity::Medium,
110
+ description: "A detected lockfile format is not supported by the parser.",
111
+ remediation: "Use a supported lockfile or wait for parser support.",
112
+ status: FindingStatus::Emitted,
113
+ },
114
+ FindingDefinition {
115
+ id: "DEP021",
116
+ title: "Mutable artifact version",
117
+ severity: Severity::High,
118
+ description: "A direct artifact version is mutable, such as a Maven SNAPSHOT.",
119
+ remediation: "Pin an immutable release version.",
120
+ status: FindingStatus::Emitted,
121
+ },
122
+ ];
123
+
124
+ pub fn definition(id: &str) -> Option<&'static FindingDefinition> {
125
+ FINDING_DEFINITIONS
126
+ .iter()
127
+ .find(|definition| definition.id == id)
128
+ }
129
+
130
+ pub fn emitted_definition(id: &str) -> Option<&'static FindingDefinition> {
131
+ definition(id).filter(|definition| definition.status == FindingStatus::Emitted)
132
+ }
133
+
134
+ #[cfg(test)]
135
+ mod tests {
136
+ use super::{definition, emitted_definition, FindingStatus, FINDING_DEFINITIONS};
137
+
138
+ const EXPECTED_IDS: &[&str] = &[
139
+ "DEP001", "DEP002", "DEP003", "DEP004", "DEP005", "DEP006", "DEP008", "DEP010", "DEP014",
140
+ "DEP019", "DEP021",
141
+ ];
142
+ const EXPECTED_EMITTED_IDS: &[&str] = &[
143
+ "DEP001", "DEP002", "DEP003", "DEP004", "DEP005", "DEP006", "DEP008", "DEP014", "DEP019",
144
+ "DEP021",
145
+ ];
146
+
147
+ #[test]
148
+ fn definitions_have_exact_ordered_unique_ids() {
149
+ let ids: Vec<_> = FINDING_DEFINITIONS
150
+ .iter()
151
+ .map(|definition| definition.id)
152
+ .collect();
153
+ assert_eq!(ids, EXPECTED_IDS);
154
+ assert!(ids.windows(2).all(|pair| pair[0] < pair[1]));
155
+ }
156
+
157
+ #[test]
158
+ fn definitions_have_nonempty_canonical_metadata() {
159
+ for definition in FINDING_DEFINITIONS {
160
+ assert!(!definition.id.is_empty());
161
+ assert!(!definition.title.is_empty());
162
+ assert!(!definition.description.is_empty());
163
+ assert!(!definition.remediation.is_empty());
164
+ }
165
+ }
166
+
167
+ #[test]
168
+ fn general_lookup_round_trips_registered_definitions() {
169
+ for expected in FINDING_DEFINITIONS {
170
+ assert_eq!(definition(expected.id), Some(expected));
171
+ }
172
+ assert!(definition("DEP999").is_none());
173
+ }
174
+
175
+ #[test]
176
+ fn definitions_have_exact_emitted_ids() {
177
+ let emitted_ids: Vec<_> = FINDING_DEFINITIONS
178
+ .iter()
179
+ .filter(|definition| definition.status == FindingStatus::Emitted)
180
+ .map(|definition| definition.id)
181
+ .collect();
182
+ assert_eq!(emitted_ids, EXPECTED_EMITTED_IDS);
183
+ }
184
+
185
+ #[test]
186
+ fn emitted_lookup_excludes_reserved_dep010() {
187
+ assert_eq!(
188
+ definition("DEP010").unwrap().status,
189
+ FindingStatus::Reserved
190
+ );
191
+ assert!(emitted_definition("DEP010").is_none());
192
+ assert!(emitted_definition("DEP999").is_none());
193
+ }
194
+
195
+ #[test]
196
+ fn statuses_have_lowercase_strings() {
197
+ assert_eq!(FindingStatus::Emitted.as_str(), "emitted");
198
+ assert_eq!(FindingStatus::Reserved.as_str(), "reserved");
199
+ assert_eq!(FindingStatus::Deprecated.as_str(), "deprecated");
200
+ }
201
+ }