@clear-capabilities/agentic-security-scanner 0.144.0 → 0.145.0

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 (69) hide show
  1. package/CHANGELOG.md +251 -0
  2. package/bin/agentic-security.js +294 -3
  3. package/dist/113.index.js +11 -3
  4. package/dist/178.index.js +24 -6
  5. package/dist/271.index.js +165 -0
  6. package/dist/384.index.js +1 -1
  7. package/dist/435.index.js +22 -0
  8. package/dist/444.index.js +11 -2
  9. package/dist/449.index.js +76 -12
  10. package/dist/526.index.js +11 -3
  11. package/dist/637.index.js +27 -5
  12. package/dist/970.index.js +65 -1
  13. package/dist/agentic-security.mjs +9 -9
  14. package/dist/agentic-security.mjs.sha256 +1 -1
  15. package/package.json +14 -8
  16. package/src/compare.js +6 -1
  17. package/src/dataflow/CLAUDE.md +1 -1
  18. package/src/engine.js +488 -29
  19. package/src/fix/apply-fix-service.js +1 -0
  20. package/src/history-scan.js +22 -5
  21. package/src/ir/CLAUDE.md +1 -1
  22. package/src/lsp/server.js +49 -2
  23. package/src/mcp/tools.js +20 -0
  24. package/src/pipeline/assurance-mode.js +64 -1
  25. package/src/pipeline/finding-schema.js +8 -1
  26. package/src/posture/CLAUDE.md +121 -0
  27. package/src/posture/accuracy-scorecard.js +60 -0
  28. package/src/posture/artifact-registry.js +24 -0
  29. package/src/posture/auditor-walkthrough.js +116 -13
  30. package/src/posture/compliance-policy.js +12 -2
  31. package/src/posture/cross-repo-memory.js +7 -2
  32. package/src/posture/fix-history.js +25 -2
  33. package/src/posture/fix-verify.js +9 -1
  34. package/src/posture/fleet.js +0 -0
  35. package/src/posture/git-history.js +13 -5
  36. package/src/posture/material-change.js +21 -2
  37. package/src/posture/mttr.js +75 -12
  38. package/src/posture/pre-incident-archaeology.js +39 -7
  39. package/src/posture/privacy-framework.js +14 -0
  40. package/src/posture/provenance/ai-authorship.js +68 -0
  41. package/src/posture/provenance/branch-entry.js +80 -0
  42. package/src/posture/provenance/cache.js +143 -0
  43. package/src/posture/provenance/confidence.js +36 -0
  44. package/src/posture/provenance/coordinator.js +786 -0
  45. package/src/posture/provenance/dag-walk.js +249 -0
  46. package/src/posture/provenance/evidence-attribution.js +59 -0
  47. package/src/posture/provenance/git-evidence.js +310 -0
  48. package/src/posture/provenance/lifecycle.js +208 -0
  49. package/src/posture/provenance/missing-control-resolver.js +137 -0
  50. package/src/posture/provenance/origin-resolver.js +342 -0
  51. package/src/posture/provenance/predicate-replay.js +133 -0
  52. package/src/posture/provenance/providers/config.js +39 -0
  53. package/src/posture/provenance/providers/github.js +62 -0
  54. package/src/posture/provenance/providers/gitlab.js +58 -0
  55. package/src/posture/provenance/repo-lineage.js +74 -0
  56. package/src/posture/provenance/sca-origin.js +139 -0
  57. package/src/posture/provenance/schema.js +255 -0
  58. package/src/posture/provenance/transitive-sca.js +147 -0
  59. package/src/posture/provenance/validate.js +30 -0
  60. package/src/posture/provenance-evidence-bundle.js +144 -0
  61. package/src/posture/sbom-diff.js +15 -2
  62. package/src/posture/secret-history.js +10 -2
  63. package/src/posture/state-dir.js +38 -14
  64. package/src/posture/vuln-archaeology.js +8 -2
  65. package/src/pr-delta.js +25 -4
  66. package/src/report/index.js +197 -3
  67. package/src/runScan.js +34 -5
  68. package/src/sast/rate-limit.js +33 -3
  69. package/src/util/git-hardening.js +128 -0
package/dist/970.index.js CHANGED
@@ -11,6 +11,7 @@ export const modules = {
11
11
  /* harmony export */ evaluateAssuranceMode: () => (/* binding */ evaluateAssuranceMode)
12
12
  /* harmony export */ });
13
13
  /* unused harmony export _internals */
14
+ /* harmony import */ var _posture_provenance_schema_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4594);
14
15
  // Assurance modes (assurance-hardening PRD FR-204).
15
16
  //
16
17
  // "Add assurance modes: advisory, standard, and strict | Strict mode fails
@@ -55,6 +56,8 @@ export const modules = {
55
56
  // mode to behave differently from advisory, that is a deliberate, separate
56
57
  // decision -- not something to guess at here.
57
58
 
59
+
60
+
58
61
  const ASSURANCE_MODES = Object.freeze(['advisory', 'standard', 'strict']);
59
62
  const DEFAULT_ASSURANCE_MODE = 'standard';
60
63
 
@@ -69,7 +72,7 @@ function _isValidMode(mode) {
69
72
  * ok:false only ever happens in strict mode; advisory/standard always ok:true
70
73
  * (they report, they do not gate).
71
74
  */
72
- function evaluateAssuranceMode(mode, scanHealth) {
75
+ function evaluateAssuranceMode(mode, scanHealth, findings = []) {
73
76
  const effectiveMode = _isValidMode(mode) ? mode : DEFAULT_ASSURANCE_MODE;
74
77
  const conditions = Array.isArray(scanHealth?.conditions) ? scanHealth.conditions : [];
75
78
 
@@ -98,6 +101,67 @@ function evaluateAssuranceMode(mode, scanHealth) {
98
101
  conditions,
99
102
  };
100
103
  }
104
+
105
+ // M2 §2.5: strict cares about overall scan completeness, which now
106
+ // explicitly includes PROVENANCE completeness, not just detector/analyzer
107
+ // completeness. A finding whose findingProvenance status is outside
108
+ // ['complete','uncommitted'] — including a finding with NO
109
+ // findingProvenance at all, e.g. --no-provenance was used — means strict
110
+ // cannot vouch for this scan's provenance the same way it already refuses
111
+ // to vouch for a scan with a failed analyzer.
112
+ //
113
+ // KNOWN INTERACTION: scan.secrets/scan.logicVulns are unconditionally
114
+ // stamped not_available today (M0+M1 deliberately deferred real origin
115
+ // resolution for those two channels — see the M2/M3/M4 design spec's
116
+ // §2.6). Any real secret or logic finding therefore fails strict mode
117
+ // until that resolution work lands. This is the literal, intended
118
+ // consequence of "never false certainty" applied to strict's own
119
+ // definition, not an oversight — a strict-mode operator with secrets
120
+ // findings should expect this until M3+ closes that gap.
121
+ //
122
+ // This list is INCOMPLETE without scan.supplyChain, and the omission
123
+ // matters more than the secrets/logic one above because it hits nearly
124
+ // every real project. engine.js stamps every supplyChain entry
125
+ // not_available too (see the loop over `supplyChain` right after the
126
+ // `annotateGitProvenance` calls), and that bucket covers three distinct
127
+ // populations, not one:
128
+ //
129
+ // - transitive `vulnerable_dep` findings: a genuine, if currently
130
+ // unresolved, DEFERRAL — same shape as secrets/logicVulns above. The
131
+ // vulnerable version was never declared in this repo's own manifests,
132
+ // so there is no local commit to walk yet, but one could exist to
133
+ // resolve in a later phase.
134
+ // - `unpinned_dep` / `no_lockfile` findings: a CATEGORY ERROR, not a
135
+ // deferral. These describe an ABSENT state (a version range with no
136
+ // pin, a manifest with no lockfile) — there is no "commit that
137
+ // introduced a missing lockfile" for any future resolver to find,
138
+ // because the finding is about the absence of an event, not an event
139
+ // itself. No amount of future engineering work makes these resolvable.
140
+ //
141
+ // Direct `vulnerable_dep` findings DO go through real origin resolution
142
+ // (`resolveDirectSCAOrigin`, gated on `isDirect`) and are not part of this
143
+ // limitation.
144
+ //
145
+ // Net effect: because `unpinned_dep`/`no_lockfile` findings are a category
146
+ // error rather than a deferral, `--assurance strict` will fail on nearly
147
+ // any real project that has a `package.json` (or equivalent manifest)
148
+ // today — an unpinned or unlocked dependency is common, and this check has
149
+ // no way to ever resolve one. This is a known, disclosed limitation of the
150
+ // current implementation, not a bug, and it is not something this check
151
+ // should route around: exempting these finding types from the strict-mode
152
+ // gate was considered and deliberately deferred to a future milestone
153
+ // rather than done here, so strict mode keeps refusing to vouch for
154
+ // provenance it cannot actually speak to.
155
+ const badProvenance = (Array.isArray(findings) ? findings : []).filter((f) => !(0,_posture_provenance_schema_js__WEBPACK_IMPORTED_MODULE_0__/* .isProvenanceHealthy */ .lL)(f?.findingProvenance));
156
+ if (badProvenance.length > 0) {
157
+ return {
158
+ ok: false,
159
+ mode: 'strict',
160
+ reason: `strict mode requires complete finding provenance; ${badProvenance.length} finding(s) have status outside [complete, uncommitted]`,
161
+ conditions,
162
+ };
163
+ }
164
+
101
165
  return { ok: true, mode: 'strict', reason: null, conditions };
102
166
  }
103
167