diff --git a/csharp/ql/lib/semmle/code/csharp/dataflow/Bound.qll b/csharp/ql/lib/semmle/code/csharp/dataflow/Bound.qll
index 08826b7ae8f1..65af6fb13a81 100644
--- a/csharp/ql/lib/semmle/code/csharp/dataflow/Bound.qll
+++ b/csharp/ql/lib/semmle/code/csharp/dataflow/Bound.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes for representing abstract bounds for use in, for example, range analysis.
  */
+overlay[local?]
+module;
 
 private import internal.rangeanalysis.BoundSpecific
 
diff --git a/csharp/ql/lib/semmle/code/csharp/dataflow/ModulusAnalysis.qll b/csharp/ql/lib/semmle/code/csharp/dataflow/ModulusAnalysis.qll
index 3e5a45da247d..1451a605cdb0 100644
--- a/csharp/ql/lib/semmle/code/csharp/dataflow/ModulusAnalysis.qll
+++ b/csharp/ql/lib/semmle/code/csharp/dataflow/ModulusAnalysis.qll
@@ -3,6 +3,8 @@
  * an expression, `b` is a `Bound` (typically zero or the value of an SSA
  * variable), and `v` is an integer in the range `[0 .. m-1]`.
  */
+overlay[local?]
+module;
 
 private import internal.rangeanalysis.ModulusAnalysisSpecific::Private
 private import Bound
diff --git a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/rangeanalysis/Sign.qll b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/rangeanalysis/Sign.qll
index 30cc089f30bb..a8b715648321 100644
--- a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/rangeanalysis/Sign.qll
+++ b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/rangeanalysis/Sign.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 newtype TSign =
   TNeg() or
   TZero() or
diff --git a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/rangeanalysis/SignAnalysisCommon.qll b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/rangeanalysis/SignAnalysisCommon.qll
index 6f0067517f90..8f8d884c9566 100644
--- a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/rangeanalysis/SignAnalysisCommon.qll
+++ b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/rangeanalysis/SignAnalysisCommon.qll
@@ -5,6 +5,8 @@
  * The analysis is implemented as an abstract interpretation over the
  * three-valued domain `{negative, zero, positive}`.
  */
+overlay[local?]
+module;
 
 private import SignAnalysisSpecific::Private
 private import SsaReadPositionCommon
diff --git a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/rangeanalysis/SsaReadPositionCommon.qll b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/rangeanalysis/SsaReadPositionCommon.qll
index 08335f6680dd..1e3c4db95bed 100644
--- a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/rangeanalysis/SsaReadPositionCommon.qll
+++ b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/rangeanalysis/SsaReadPositionCommon.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes for representing a position at which an SSA variable is read.
  */
+overlay[local?]
+module;
 
 private import SsaReadPositionSpecific
 import SsaReadPositionSpecific::Public
diff --git a/java/ql/lib/Customizations.qll b/java/ql/lib/Customizations.qll
index 1f5716726e30..f083e0864507 100644
--- a/java/ql/lib/Customizations.qll
+++ b/java/ql/lib/Customizations.qll
@@ -8,5 +8,7 @@
  * the `RemoteFlowSource` and `AdditionalTaintStep` classes associated with the security queries
  * to model frameworks that are not covered by the standard library.
  */
+overlay[local?]
+module;
 
 import java
diff --git a/java/ql/lib/IDEContextual.qll b/java/ql/lib/IDEContextual.qll
index f26956bcca01..e74d51898e8d 100644
--- a/java/ql/lib/IDEContextual.qll
+++ b/java/ql/lib/IDEContextual.qll
@@ -1,6 +1,8 @@
 /**
  * Provides shared predicates related to contextual queries in the code viewer.
  */
+overlay[local?]
+module;
 
 import semmle.files.FileSystem
 private import codeql.util.FileSystem
diff --git a/java/ql/lib/default.qll b/java/ql/lib/default.qll
index 79ed05a7c378..66060273e966 100644
--- a/java/ql/lib/default.qll
+++ b/java/ql/lib/default.qll
@@ -1,3 +1,5 @@
 /** DEPRECATED: use `java.qll` instead. */
+overlay[local?]
+module;
 
 import java
diff --git a/java/ql/lib/definitions.qll b/java/ql/lib/definitions.qll
index aa5de3eb4019..f0a4e859b08e 100644
--- a/java/ql/lib/definitions.qll
+++ b/java/ql/lib/definitions.qll
@@ -2,6 +2,8 @@
  * Provides classes and predicates related to jump-to-definition links
  * in the code viewer.
  */
+overlay[local?]
+module;
 
 import java
 import IDEContextual
diff --git a/java/ql/lib/experimental/quantum/JCA.qll b/java/ql/lib/experimental/quantum/JCA.qll
index 16afa26347fe..113f031f55bc 100644
--- a/java/ql/lib/experimental/quantum/JCA.qll
+++ b/java/ql/lib/experimental/quantum/JCA.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 import java
 import semmle.code.java.dataflow.DataFlow
 import semmle.code.java.dataflow.TaintTracking
diff --git a/java/ql/lib/experimental/quantum/Language.qll b/java/ql/lib/experimental/quantum/Language.qll
index 59164901c10c..975a8ad8e1fe 100644
--- a/java/ql/lib/experimental/quantum/Language.qll
+++ b/java/ql/lib/experimental/quantum/Language.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 private import java as Language
 private import semmle.code.java.security.InsecureRandomnessQuery
 private import semmle.code.java.security.RandomQuery
diff --git a/java/ql/lib/external/ExternalArtifact.qll b/java/ql/lib/external/ExternalArtifact.qll
index 2e782a6a4da1..cdba653062ad 100644
--- a/java/ql/lib/external/ExternalArtifact.qll
+++ b/java/ql/lib/external/ExternalArtifact.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 import java
 
 class ExternalData extends @externalDataElement {
diff --git a/java/ql/lib/java.qll b/java/ql/lib/java.qll
index ce0905184f40..9644343e93b6 100644
--- a/java/ql/lib/java.qll
+++ b/java/ql/lib/java.qll
@@ -1,4 +1,6 @@
 /** Provides all default Java QL imports. */
+overlay[local?]
+module;
 
 import Customizations
 import semmle.code.FileSystem
diff --git a/java/ql/lib/qlpack.yml b/java/ql/lib/qlpack.yml
index 35f35a391c5f..c95223fa7630 100644
--- a/java/ql/lib/qlpack.yml
+++ b/java/ql/lib/qlpack.yml
@@ -23,3 +23,4 @@ dataExtensions:
   - ext/generated/*.model.yml
   - ext/experimental/*.model.yml
 warnOnImplicitThis: true
+compileForOverlayEval: true
diff --git a/java/ql/lib/semmle/code/FileSystem.qll b/java/ql/lib/semmle/code/FileSystem.qll
index a7c38b41ca54..92c888304ff6 100644
--- a/java/ql/lib/semmle/code/FileSystem.qll
+++ b/java/ql/lib/semmle/code/FileSystem.qll
@@ -1,4 +1,6 @@
 /** Provides classes for working with files and folders. */
+overlay[local?]
+module;
 
 import Location
 private import codeql.util.FileSystem
diff --git a/java/ql/lib/semmle/code/Location.qll b/java/ql/lib/semmle/code/Location.qll
index abc1d19d0f89..7265164e8e15 100644
--- a/java/ql/lib/semmle/code/Location.qll
+++ b/java/ql/lib/semmle/code/Location.qll
@@ -3,9 +3,12 @@
  *
  * Locations represent parts of files and are used to map elements to their source location.
  */
+overlay[local?]
+module;
 
 import FileSystem
 import semmle.code.java.Element
+private import semmle.code.java.Overlay
 private import semmle.code.SMAP
 
 /** Holds if element `e` has name `name`. */
@@ -219,3 +222,16 @@ private predicate fixedHasLocation(Top l, Location loc, File f) {
   not hasSourceLocation(l, _, _) and
   locations_default(loc, f, _, _, _, _)
 }
+
+overlay[local]
+private predicate discardableLocation(string file, @location l) {
+  not isOverlay() and
+  file = getRawFileForLoc(l) and
+  not exists(@file f | hasLocation(f, l))
+}
+
+/** Discard base locations in files fully extracted in the overlay. */
+overlay[discard_entity]
+private predicate discardLocation(@location l) {
+  exists(string file | discardableLocation(file, l) and extractedInOverlay(file))
+}
diff --git a/java/ql/lib/semmle/code/SMAP.qll b/java/ql/lib/semmle/code/SMAP.qll
index 575d54f92de1..96243a78d7b4 100644
--- a/java/ql/lib/semmle/code/SMAP.qll
+++ b/java/ql/lib/semmle/code/SMAP.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for working with SMAP files (see JSR-045).
  */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/Unit.qll b/java/ql/lib/semmle/code/Unit.qll
index 83a4a03321d9..e31457eae1aa 100644
--- a/java/ql/lib/semmle/code/Unit.qll
+++ b/java/ql/lib/semmle/code/Unit.qll
@@ -1,3 +1,5 @@
 /** Provides the `Unit` class. */
+overlay[local?]
+module;
 
 import codeql.util.Unit
diff --git a/java/ql/lib/semmle/code/configfiles/ConfigFiles.qll b/java/ql/lib/semmle/code/configfiles/ConfigFiles.qll
index 282f1c1228a3..0c69f45c56fa 100644
--- a/java/ql/lib/semmle/code/configfiles/ConfigFiles.qll
+++ b/java/ql/lib/semmle/code/configfiles/ConfigFiles.qll
@@ -2,6 +2,8 @@
  * Provides classes and predicates for working with configuration files, such
  * as Java `.properties` or `.ini` files.
  */
+overlay[local?]
+module;
 
 import semmle.code.Location
 
diff --git a/java/ql/lib/semmle/code/java/Annotation.qll b/java/ql/lib/semmle/code/java/Annotation.qll
index f39b1f3420a5..ba5ce65daac8 100644
--- a/java/ql/lib/semmle/code/java/Annotation.qll
+++ b/java/ql/lib/semmle/code/java/Annotation.qll
@@ -8,6 +8,8 @@
  * Each annotation type has zero or more annotation elements that contain a
  * name and possibly a value.
  */
+overlay[local?]
+module;
 
 import Element
 import Expr
diff --git a/java/ql/lib/semmle/code/java/Collections.qll b/java/ql/lib/semmle/code/java/Collections.qll
index 9fd64dc60ee3..d121512c3196 100644
--- a/java/ql/lib/semmle/code/java/Collections.qll
+++ b/java/ql/lib/semmle/code/java/Collections.qll
@@ -2,6 +2,8 @@
  * Provides classes and predicates for reasoning about instances of
  * `java.util.Collection` and their methods.
  */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/Compilation.qll b/java/ql/lib/semmle/code/java/Compilation.qll
index c52f308e8e33..835505390468 100644
--- a/java/ql/lib/semmle/code/java/Compilation.qll
+++ b/java/ql/lib/semmle/code/java/Compilation.qll
@@ -1,6 +1,8 @@
 /**
  * Provides a class representing individual compiler invocations that occurred during the build.
  */
+overlay[local?]
+module;
 
 import semmle.code.FileSystem
 
diff --git a/java/ql/lib/semmle/code/java/CompilationUnit.qll b/java/ql/lib/semmle/code/java/CompilationUnit.qll
index 9b4b58e9a9bd..546c3d26ea39 100644
--- a/java/ql/lib/semmle/code/java/CompilationUnit.qll
+++ b/java/ql/lib/semmle/code/java/CompilationUnit.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for working with Java compilation units.
  */
+overlay[local?]
+module;
 
 import Element
 import Package
diff --git a/java/ql/lib/semmle/code/java/Completion.qll b/java/ql/lib/semmle/code/java/Completion.qll
index 6ccdb16df725..35d3c83e2ee9 100644
--- a/java/ql/lib/semmle/code/java/Completion.qll
+++ b/java/ql/lib/semmle/code/java/Completion.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for representing completions.
  */
+overlay[local?]
+module;
 
 /*
  * A completion represents how a statement or expression terminates.
diff --git a/java/ql/lib/semmle/code/java/Concurrency.qll b/java/ql/lib/semmle/code/java/Concurrency.qll
index 61e76525ec87..0e510db3443b 100644
--- a/java/ql/lib/semmle/code/java/Concurrency.qll
+++ b/java/ql/lib/semmle/code/java/Concurrency.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 import java
 
 /**
diff --git a/java/ql/lib/semmle/code/java/Constants.qll b/java/ql/lib/semmle/code/java/Constants.qll
index 9e35a925be33..0cad92b7fc6d 100644
--- a/java/ql/lib/semmle/code/java/Constants.qll
+++ b/java/ql/lib/semmle/code/java/Constants.qll
@@ -1,6 +1,8 @@
 /**
  * Provdides a module to calculate constant integer and boolean values.
  */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/ControlFlowGraph.qll b/java/ql/lib/semmle/code/java/ControlFlowGraph.qll
index 0d9d685cc716..25ec9dc9ef4a 100644
--- a/java/ql/lib/semmle/code/java/ControlFlowGraph.qll
+++ b/java/ql/lib/semmle/code/java/ControlFlowGraph.qll
@@ -7,6 +7,8 @@
  * statement, an expression, or an exit node for a callable, indicating that
  * execution of the callable terminates.
  */
+overlay[local?]
+module;
 
 /*
  * The implementation is centered around the concept of a _completion_, which
diff --git a/java/ql/lib/semmle/code/java/Conversions.qll b/java/ql/lib/semmle/code/java/Conversions.qll
index f3deb311a3df..76b74fd1eb7c 100644
--- a/java/ql/lib/semmle/code/java/Conversions.qll
+++ b/java/ql/lib/semmle/code/java/Conversions.qll
@@ -4,6 +4,8 @@
  *
  * See the Java Language Specification, Section 5, for details.
  */
+overlay[local?]
+module;
 
 import java
 import semmle.code.java.arithmetic.Overflow
diff --git a/java/ql/lib/semmle/code/java/Dependency.qll b/java/ql/lib/semmle/code/java/Dependency.qll
index 8514bcb466a1..138ab7523a4d 100644
--- a/java/ql/lib/semmle/code/java/Dependency.qll
+++ b/java/ql/lib/semmle/code/java/Dependency.qll
@@ -1,6 +1,8 @@
 /**
  * Provides utility predicates for representing dependencies between types.
  */
+overlay[local?]
+module;
 
 import Type
 import Generics
diff --git a/java/ql/lib/semmle/code/java/DependencyCounts.qll b/java/ql/lib/semmle/code/java/DependencyCounts.qll
index 4cb958373a93..13709ebaf291 100644
--- a/java/ql/lib/semmle/code/java/DependencyCounts.qll
+++ b/java/ql/lib/semmle/code/java/DependencyCounts.qll
@@ -1,6 +1,8 @@
 /**
  * This library provides utility predicates for representing the number of dependencies between types.
  */
+overlay[local?]
+module;
 
 import Type
 import Generics
diff --git a/java/ql/lib/semmle/code/java/Diagnostics.qll b/java/ql/lib/semmle/code/java/Diagnostics.qll
index 0134b32c5c0e..c93e6850b3de 100644
--- a/java/ql/lib/semmle/code/java/Diagnostics.qll
+++ b/java/ql/lib/semmle/code/java/Diagnostics.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes representing warnings generated during compilation.
  */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/Element.qll b/java/ql/lib/semmle/code/java/Element.qll
index 2032d72ee5f9..dca3c8d91eb6 100644
--- a/java/ql/lib/semmle/code/java/Element.qll
+++ b/java/ql/lib/semmle/code/java/Element.qll
@@ -1,6 +1,8 @@
 /**
  * Provides a class that represents named elements in Java programs.
  */
+overlay[local?]
+module;
 
 import CompilationUnit
 import semmle.code.Location
diff --git a/java/ql/lib/semmle/code/java/Exception.qll b/java/ql/lib/semmle/code/java/Exception.qll
index 0b92975a580d..abd934994626 100644
--- a/java/ql/lib/semmle/code/java/Exception.qll
+++ b/java/ql/lib/semmle/code/java/Exception.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for working with Java exceptions.
  */
+overlay[local?]
+module;
 
 import Element
 import Type
diff --git a/java/ql/lib/semmle/code/java/Expr.qll b/java/ql/lib/semmle/code/java/Expr.qll
index e7dd817cecd9..cafffae52bd2 100644
--- a/java/ql/lib/semmle/code/java/Expr.qll
+++ b/java/ql/lib/semmle/code/java/Expr.qll
@@ -1,10 +1,13 @@
 /**
  * Provides classes for working with Java expressions.
  */
+overlay[local?]
+module;
 
 import java
 private import semmle.code.java.frameworks.android.Compose
 private import semmle.code.java.Constants
+private import semmle.code.java.Overlay
 
 /** A common super-class that represents all kinds of expressions. */
 class Expr extends ExprParent, @expr {
@@ -2699,3 +2702,15 @@ class RecordPatternExpr extends Expr, @recordpatternexpr {
     )
   }
 }
+
+overlay[local]
+private predicate discardableExpr(string file, @expr e) {
+  not isOverlay() and
+  file = getRawFile(e)
+}
+
+/** Discard base expressions in files fully extracted in the overlay. */
+overlay[discard_entity]
+private predicate discardExpr(@expr e) {
+  exists(string file | discardableExpr(file, e) and extractedInOverlay(file))
+}
diff --git a/java/ql/lib/semmle/code/java/GeneratedFiles.qll b/java/ql/lib/semmle/code/java/GeneratedFiles.qll
index 31a229f507f2..7c4a6d4cbb5a 100644
--- a/java/ql/lib/semmle/code/java/GeneratedFiles.qll
+++ b/java/ql/lib/semmle/code/java/GeneratedFiles.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for working with the most common types of generated files.
  */
+overlay[local?]
+module;
 
 import Type
 private import semmle.code.java.frameworks.JavaxAnnotations
diff --git a/java/ql/lib/semmle/code/java/Generics.qll b/java/ql/lib/semmle/code/java/Generics.qll
index a50dcabe2245..e0204b1beace 100644
--- a/java/ql/lib/semmle/code/java/Generics.qll
+++ b/java/ql/lib/semmle/code/java/Generics.qll
@@ -30,6 +30,8 @@
  *
  * The terminology for generic methods is analogous.
  */
+overlay[local?]
+module;
 
 import Type
 
diff --git a/java/ql/lib/semmle/code/java/Import.qll b/java/ql/lib/semmle/code/java/Import.qll
index cef66c34ae15..aed041155555 100644
--- a/java/ql/lib/semmle/code/java/Import.qll
+++ b/java/ql/lib/semmle/code/java/Import.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for working with Java imports.
  */
+overlay[local?]
+module;
 
 import semmle.code.Location
 import CompilationUnit
diff --git a/java/ql/lib/semmle/code/java/J2EE.qll b/java/ql/lib/semmle/code/java/J2EE.qll
index 70c207a35794..4412b3715e34 100644
--- a/java/ql/lib/semmle/code/java/J2EE.qll
+++ b/java/ql/lib/semmle/code/java/J2EE.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for working with J2EE bean types.
  */
+overlay[local?]
+module;
 
 import Type
 
diff --git a/java/ql/lib/semmle/code/java/JDK.qll b/java/ql/lib/semmle/code/java/JDK.qll
index 27a8b2a9ca73..897e857ba108 100644
--- a/java/ql/lib/semmle/code/java/JDK.qll
+++ b/java/ql/lib/semmle/code/java/JDK.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for working with standard classes and methods from the JDK.
  */
+overlay[local?]
+module;
 
 import Member
 import semmle.code.java.security.ExternalProcess
diff --git a/java/ql/lib/semmle/code/java/JDKAnnotations.qll b/java/ql/lib/semmle/code/java/JDKAnnotations.qll
index 5f3e70688558..aac7242ad4f1 100644
--- a/java/ql/lib/semmle/code/java/JDKAnnotations.qll
+++ b/java/ql/lib/semmle/code/java/JDKAnnotations.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes that represent standard annotations from the JDK.
  */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/JMX.qll b/java/ql/lib/semmle/code/java/JMX.qll
index 11849be0beee..3f18e0ecf3d3 100644
--- a/java/ql/lib/semmle/code/java/JMX.qll
+++ b/java/ql/lib/semmle/code/java/JMX.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for working with JMX bean types.
  */
+overlay[local?]
+module;
 
 import Type
 
diff --git a/java/ql/lib/semmle/code/java/Javadoc.qll b/java/ql/lib/semmle/code/java/Javadoc.qll
index f14d8776ddc4..101bab2723e0 100644
--- a/java/ql/lib/semmle/code/java/Javadoc.qll
+++ b/java/ql/lib/semmle/code/java/Javadoc.qll
@@ -1,8 +1,11 @@
 /**
  * Provides classes and predicates for working with Javadoc documentation.
  */
+overlay[local?]
+module;
 
 import semmle.code.Location
+private import semmle.code.java.Overlay
 
 /** A Javadoc parent is an element whose child can be some Javadoc documentation. */
 class JavadocParent extends @javadocParent, Top {
@@ -194,3 +197,15 @@ class KtCommentSection extends @ktcommentsection {
   /** Gets the string representation of this section. */
   string toString() { result = this.getContent() }
 }
+
+overlay[local]
+private predicate discardableJavadoc(string file, @javadoc d) {
+  not isOverlay() and
+  exists(@member m | file = getRawFile(m) and hasJavadoc(m, d))
+}
+
+/** Discard javadoc entities in files fully extracted in the overlay. */
+overlay[discard_entity]
+private predicate discardJavadoc(@javadoc d) {
+  exists(string file | discardableJavadoc(file, d) and extractedInOverlay(file))
+}
diff --git a/java/ql/lib/semmle/code/java/KotlinType.qll b/java/ql/lib/semmle/code/java/KotlinType.qll
index 3e5597c5579d..9d29f3b441ef 100644
--- a/java/ql/lib/semmle/code/java/KotlinType.qll
+++ b/java/ql/lib/semmle/code/java/KotlinType.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for working with Kotlin types.
  */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/Maps.qll b/java/ql/lib/semmle/code/java/Maps.qll
index 1089e8924156..25c8659f2c9e 100644
--- a/java/ql/lib/semmle/code/java/Maps.qll
+++ b/java/ql/lib/semmle/code/java/Maps.qll
@@ -2,6 +2,8 @@
  * Provides classes and predicates for reasoning about instances of
  * `java.util.Map` and their methods.
  */
+overlay[local?]
+module;
 
 import java
 import Collections
diff --git a/java/ql/lib/semmle/code/java/Member.qll b/java/ql/lib/semmle/code/java/Member.qll
index f6f4ca56f92d..805ab0bf9402 100644
--- a/java/ql/lib/semmle/code/java/Member.qll
+++ b/java/ql/lib/semmle/code/java/Member.qll
@@ -2,6 +2,8 @@
  * Provides classes and predicates for working with members of Java classes and interfaces,
  * that is, methods, constructors, fields and nested types.
  */
+overlay[local?]
+module;
 
 import Element
 import Type
@@ -9,6 +11,7 @@ import Annotation
 import Exception
 import metrics.MetricField
 private import dispatch.VirtualDispatch
+private import semmle.code.java.Overlay
 
 /**
  * A common abstraction for type member declarations,
@@ -621,7 +624,13 @@ class SrcMethod extends Method {
       then implementsInterfaceMethod(result, this)
       else result.getASourceOverriddenMethod*() = this
     ) and
-    (exists(result.getBody()) or result.hasModifier("native"))
+    (
+      // We allow empty method bodies for the local overlay variant to allow
+      // calls to methods only fully extracted in base.
+      isOverlay() or
+      exists(result.getBody()) or
+      result.hasModifier("native")
+    )
   }
 }
 
@@ -895,3 +904,33 @@ class ExtensionMethod extends Method {
     else result = 0
   }
 }
+
+overlay[local]
+private predicate discardableMethod(string file, @method m) {
+  not isOverlay() and
+  file = getRawFile(m) and
+  exists(@classorinterface c | methods(m, _, _, _, c, _) and isAnonymClass(c, _))
+}
+
+/** Discard base methods on anonymous classes in files fully extracted in the overlay. */
+overlay[discard_entity]
+private predicate discardAnonMethod(@method m) {
+  exists(string file | discardableMethod(file, m) and extractedInOverlay(file))
+}
+
+overlay[local]
+private predicate discardableBaseMethod(string file, @method m) {
+  not isOverlay() and
+  file = getRawFile(m)
+}
+
+overlay[local]
+private predicate usedOverlayMethod(@method m) { isOverlay() and methods(m, _, _, _, _, _) }
+
+/** Discard base methods in files fully extracted in the overlay that were not extracted in the overlay. */
+overlay[discard_entity]
+private predicate discardMethod(@method m) {
+  exists(string file |
+    discardableBaseMethod(file, m) and extractedInOverlay(file) and not usedOverlayMethod(m)
+  )
+}
diff --git a/java/ql/lib/semmle/code/java/Modifier.qll b/java/ql/lib/semmle/code/java/Modifier.qll
index 150b65be6716..864691bf835b 100644
--- a/java/ql/lib/semmle/code/java/Modifier.qll
+++ b/java/ql/lib/semmle/code/java/Modifier.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for working with Java modifiers.
  */
+overlay[local?]
+module;
 
 import Element
 
diff --git a/java/ql/lib/semmle/code/java/Modules.qll b/java/ql/lib/semmle/code/java/Modules.qll
index c8aed33a0fc3..a1bceb72e0bb 100644
--- a/java/ql/lib/semmle/code/java/Modules.qll
+++ b/java/ql/lib/semmle/code/java/Modules.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes for working with Java modules.
  */
+overlay[local?]
+module;
 
 import CompilationUnit
 
diff --git a/java/ql/lib/semmle/code/java/NumberFormatException.qll b/java/ql/lib/semmle/code/java/NumberFormatException.qll
index 841d64b0098d..83f66d1a709d 100644
--- a/java/ql/lib/semmle/code/java/NumberFormatException.qll
+++ b/java/ql/lib/semmle/code/java/NumberFormatException.qll
@@ -1,4 +1,6 @@
 /** Provides classes and predicates for reasoning about `java.lang.NumberFormatException`. */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/Overlay.qll b/java/ql/lib/semmle/code/java/Overlay.qll
new file mode 100644
index 000000000000..3120abe722dd
--- /dev/null
+++ b/java/ql/lib/semmle/code/java/Overlay.qll
@@ -0,0 +1,38 @@
+overlay[local?]
+module;
+
+import java
+
+/**
+ * A local predicate that always holds for the overlay variant and
+ * never holds for the base variant. This is used to define local
+ * predicates that behave differently for the base and overlay variant.
+ */
+overlay[local]
+predicate isOverlay() { databaseMetadata("isOverlay", "true") }
+
+/** Gets the raw file for a locatable. */
+overlay[local]
+string getRawFile(@locatable el) {
+  exists(@location loc, @file file |
+    hasLocation(el, loc) and
+    locations_default(loc, file, _, _, _, _) and
+    files(file, result)
+  )
+}
+
+/** Gets the raw file for a location. */
+overlay[local]
+string getRawFileForLoc(@location l) {
+  exists(@file f | locations_default(l, f, _, _, _, _) and files(f, result))
+}
+
+/** Holds for files fully extracted in the overlay. */
+overlay[local]
+predicate extractedInOverlay(string file) {
+  isOverlay() and
+  // The incremental Java extractor extracts skeletons without method
+  // bodies for dependencies. numlines is used to restrict attention
+  // to fully extracted files.
+  exists(@locatable l | numlines(l, _, _, _) and file = getRawFile(l))
+}
diff --git a/java/ql/lib/semmle/code/java/Package.qll b/java/ql/lib/semmle/code/java/Package.qll
index 466c97e561d6..e0621f4de541 100644
--- a/java/ql/lib/semmle/code/java/Package.qll
+++ b/java/ql/lib/semmle/code/java/Package.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for working with Java packages.
  */
+overlay[local?]
+module;
 
 import Element
 import Type
diff --git a/java/ql/lib/semmle/code/java/PrettyPrintAst.qll b/java/ql/lib/semmle/code/java/PrettyPrintAst.qll
index de1bf3100a37..3d907a5a0991 100644
--- a/java/ql/lib/semmle/code/java/PrettyPrintAst.qll
+++ b/java/ql/lib/semmle/code/java/PrettyPrintAst.qll
@@ -2,6 +2,8 @@
  * Provides pretty-printed representations of the AST, in particular top-level
  * classes and interfaces.
  */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/PrintAst.qll b/java/ql/lib/semmle/code/java/PrintAst.qll
index 0af012234bb2..52d344401d70 100644
--- a/java/ql/lib/semmle/code/java/PrintAst.qll
+++ b/java/ql/lib/semmle/code/java/PrintAst.qll
@@ -5,6 +5,8 @@
  * extend `PrintAstConfiguration` and override `shouldPrint` to hold for only the elements
  * you wish to view the AST for.
  */
+overlay[local?]
+module;
 
 import java
 import semmle.code.java.regex.RegexTreeView as RegexTreeView
diff --git a/java/ql/lib/semmle/code/java/Reflection.qll b/java/ql/lib/semmle/code/java/Reflection.qll
index da287387e173..e37187231b93 100644
--- a/java/ql/lib/semmle/code/java/Reflection.qll
+++ b/java/ql/lib/semmle/code/java/Reflection.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for working with Java Reflection.
  */
+overlay[local?]
+module;
 
 import java
 import JDKAnnotations
diff --git a/java/ql/lib/semmle/code/java/Serializability.qll b/java/ql/lib/semmle/code/java/Serializability.qll
index 479d1d8cdb01..639cc0c18eba 100644
--- a/java/ql/lib/semmle/code/java/Serializability.qll
+++ b/java/ql/lib/semmle/code/java/Serializability.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for working with Java Serialization.
  */
+overlay[local?]
+module;
 
 import java
 private import frameworks.jackson.JacksonSerializability
diff --git a/java/ql/lib/semmle/code/java/Statement.qll b/java/ql/lib/semmle/code/java/Statement.qll
index da9621f9ce3a..d1e7e748bc35 100644
--- a/java/ql/lib/semmle/code/java/Statement.qll
+++ b/java/ql/lib/semmle/code/java/Statement.qll
@@ -1,9 +1,12 @@
 /**
  * Provides classes and predicates for working with Java statements.
  */
+overlay[local?]
+module;
 
 import Expr
 import metrics.MetricStmt
+private import semmle.code.java.Overlay
 
 /** A common super-class of all statements. */
 class Stmt extends StmtParent, ExprParent, @stmt {
@@ -985,3 +988,15 @@ class SuperConstructorInvocationStmt extends Stmt, ConstructorCall, @superconstr
 
   override string getAPrimaryQlClass() { result = "SuperConstructorInvocationStmt" }
 }
+
+overlay[local]
+private predicate discardableStmt(string file, @stmt s) {
+  not isOverlay() and
+  file = getRawFile(s)
+}
+
+/** Discard base statements in files fully extracted in the overlay. */
+overlay[discard_entity]
+private predicate discardStmt(@stmt s) {
+  exists(string file | discardableStmt(file, s) and extractedInOverlay(file))
+}
diff --git a/java/ql/lib/semmle/code/java/StringFormat.qll b/java/ql/lib/semmle/code/java/StringFormat.qll
index 4ed39c02a841..da69a5b9b8ff 100644
--- a/java/ql/lib/semmle/code/java/StringFormat.qll
+++ b/java/ql/lib/semmle/code/java/StringFormat.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for reasoning about string formatting.
  */
+overlay[local?]
+module;
 
 import java
 import dataflow.DefUse
diff --git a/java/ql/lib/semmle/code/java/Type.qll b/java/ql/lib/semmle/code/java/Type.qll
index 5036bbea6224..c30dd7012bfb 100644
--- a/java/ql/lib/semmle/code/java/Type.qll
+++ b/java/ql/lib/semmle/code/java/Type.qll
@@ -9,6 +9,8 @@
  * Classes and interfaces can also be local (`LocalClassOrInterface`, `LocalClass`) or anonymous (`AnonymousClass`).
  * Enumerated types (`EnumType`) and records (`Record`) are special kinds of classes.
  */
+overlay[local?]
+module;
 
 import Member
 import Modifier
@@ -668,6 +670,7 @@ class RefType extends Type, Annotatable, Modifiable, @reftype {
    *
    * For the definition of the notion of *erasure* see JLS v8, section 4.6 (Type Erasure).
    */
+  overlay[caller?]
   pragma[inline]
   RefType commonSubtype(RefType other) {
     result.getASourceSupertype*() = erase(this) and
@@ -1257,6 +1260,7 @@ private Type erase(Type t) {
  *
  * For the definition of the notion of *erasure* see JLS v8, section 4.6 (Type Erasure).
  */
+overlay[caller?]
 pragma[inline]
 predicate haveIntersection(RefType t1, RefType t2) {
   exists(RefType e1, RefType e2 | e1 = erase(t1) and e2 = erase(t2) |
diff --git a/java/ql/lib/semmle/code/java/UnitTests.qll b/java/ql/lib/semmle/code/java/UnitTests.qll
index f229440e4eed..6c05fecab01c 100644
--- a/java/ql/lib/semmle/code/java/UnitTests.qll
+++ b/java/ql/lib/semmle/code/java/UnitTests.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for working with test classes and methods.
  */
+overlay[local?]
+module;
 
 import Type
 import Member
diff --git a/java/ql/lib/semmle/code/java/Variable.qll b/java/ql/lib/semmle/code/java/Variable.qll
index a4cf09df055d..9b8b42b71fba 100644
--- a/java/ql/lib/semmle/code/java/Variable.qll
+++ b/java/ql/lib/semmle/code/java/Variable.qll
@@ -1,8 +1,11 @@
 /**
  * Provides classes and predicates for working with Java variables and their declarations.
  */
+overlay[local?]
+module;
 
 import Element
+private import semmle.code.java.Overlay
 
 /** A variable is a field, a local variable or a parameter. */
 class Variable extends @variable, Annotatable, Element, Modifiable {
@@ -131,3 +134,15 @@ class Parameter extends Element, @param, LocalScopeVariable {
   /** Holds if this is an anonymous parameter, `_` */
   predicate isAnonymous() { this.getName() = "" }
 }
+
+overlay[local]
+private predicate discardableLocalVarDecl(string file, @localscopevariable l) {
+  not isOverlay() and
+  file = getRawFile(l)
+}
+
+/** Discard base local scoped variables in files fully extracted in the overlay. */
+overlay[discard_entity]
+private predicate discardLocalVarDecl(@localscopevariable l) {
+  exists(string file | discardableLocalVarDecl(file, l) and extractedInOverlay(file))
+}
diff --git a/java/ql/lib/semmle/code/java/arithmetic/Overflow.qll b/java/ql/lib/semmle/code/java/arithmetic/Overflow.qll
index e92d8352fe9b..471f271eb866 100644
--- a/java/ql/lib/semmle/code/java/arithmetic/Overflow.qll
+++ b/java/ql/lib/semmle/code/java/arithmetic/Overflow.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 import java
 
 /** A subclass of `PrimitiveType` with width-based ordering methods. */
diff --git a/java/ql/lib/semmle/code/java/comparison/Comparison.qll b/java/ql/lib/semmle/code/java/comparison/Comparison.qll
index 27ed9271e999..7aea0f6fb258 100644
--- a/java/ql/lib/semmle/code/java/comparison/Comparison.qll
+++ b/java/ql/lib/semmle/code/java/comparison/Comparison.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 import java
 
 /**
diff --git a/java/ql/lib/semmle/code/java/controlflow/BasicBlocks.qll b/java/ql/lib/semmle/code/java/controlflow/BasicBlocks.qll
index 284ee1dad0ce..4e65001d7f29 100644
--- a/java/ql/lib/semmle/code/java/controlflow/BasicBlocks.qll
+++ b/java/ql/lib/semmle/code/java/controlflow/BasicBlocks.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for working with basic blocks in Java.
  */
+overlay[local?]
+module;
 
 import java
 import Dominance
diff --git a/java/ql/lib/semmle/code/java/controlflow/Dominance.qll b/java/ql/lib/semmle/code/java/controlflow/Dominance.qll
index 6f0cb3d255c5..e2a50ba06df6 100644
--- a/java/ql/lib/semmle/code/java/controlflow/Dominance.qll
+++ b/java/ql/lib/semmle/code/java/controlflow/Dominance.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for control-flow graph dominance.
  */
+overlay[local?]
+module;
 
 import java
 
@@ -93,6 +95,7 @@ predicate iDominates(ControlFlowNode dominator, ControlFlowNode node) {
 }
 
 /** Holds if `dom` strictly dominates `node`. */
+overlay[caller?]
 pragma[inline]
 predicate strictlyDominates(ControlFlowNode dom, ControlFlowNode node) {
   // This predicate is gigantic, so it must be inlined.
@@ -102,6 +105,7 @@ predicate strictlyDominates(ControlFlowNode dom, ControlFlowNode node) {
 }
 
 /** Holds if `dom` dominates `node`. (This is reflexive.) */
+overlay[caller?]
 pragma[inline]
 predicate dominates(ControlFlowNode dom, ControlFlowNode node) {
   // This predicate is gigantic, so it must be inlined.
@@ -111,6 +115,7 @@ predicate dominates(ControlFlowNode dom, ControlFlowNode node) {
 }
 
 /** Holds if `dom` strictly post-dominates `node`. */
+overlay[caller?]
 pragma[inline]
 predicate strictlyPostDominates(ControlFlowNode dom, ControlFlowNode node) {
   // This predicate is gigantic, so it must be inlined.
@@ -120,6 +125,7 @@ predicate strictlyPostDominates(ControlFlowNode dom, ControlFlowNode node) {
 }
 
 /** Holds if `dom` post-dominates `node`. (This is reflexive.) */
+overlay[caller?]
 pragma[inline]
 predicate postDominates(ControlFlowNode dom, ControlFlowNode node) {
   // This predicate is gigantic, so it must be inlined.
diff --git a/java/ql/lib/semmle/code/java/controlflow/Guards.qll b/java/ql/lib/semmle/code/java/controlflow/Guards.qll
index 4042e7b29624..9395e6dd8cce 100644
--- a/java/ql/lib/semmle/code/java/controlflow/Guards.qll
+++ b/java/ql/lib/semmle/code/java/controlflow/Guards.qll
@@ -2,6 +2,8 @@
  * Provides classes and predicates for reasoning about guards and the control
  * flow elements controlled by those guards.
  */
+overlay[local?]
+module;
 
 import java
 private import semmle.code.java.controlflow.Dominance
diff --git a/java/ql/lib/semmle/code/java/controlflow/Paths.qll b/java/ql/lib/semmle/code/java/controlflow/Paths.qll
index 8f87e19404a6..fb14c226484d 100644
--- a/java/ql/lib/semmle/code/java/controlflow/Paths.qll
+++ b/java/ql/lib/semmle/code/java/controlflow/Paths.qll
@@ -2,6 +2,8 @@
  * This library provides predicates for reasoning about the set of all paths
  * through a callable.
  */
+overlay[local?]
+module;
 
 import java
 import semmle.code.java.dispatch.VirtualDispatch
diff --git a/java/ql/lib/semmle/code/java/controlflow/SuccessorType.qll b/java/ql/lib/semmle/code/java/controlflow/SuccessorType.qll
index f03e4690a95a..feabc47552f3 100644
--- a/java/ql/lib/semmle/code/java/controlflow/SuccessorType.qll
+++ b/java/ql/lib/semmle/code/java/controlflow/SuccessorType.qll
@@ -1,6 +1,8 @@
 /**
  * Provides different types of control flow successor types.
  */
+overlay[local?]
+module;
 
 import java
 private import codeql.util.Boolean
diff --git a/java/ql/lib/semmle/code/java/controlflow/UnreachableBlocks.qll b/java/ql/lib/semmle/code/java/controlflow/UnreachableBlocks.qll
index 0ade780bc00c..0247417c6bb6 100644
--- a/java/ql/lib/semmle/code/java/controlflow/UnreachableBlocks.qll
+++ b/java/ql/lib/semmle/code/java/controlflow/UnreachableBlocks.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for identifying unreachable blocks under a "closed-world" assumption.
  */
+overlay[local?]
+module;
 
 import java
 import semmle.code.java.controlflow.Guards
diff --git a/java/ql/lib/semmle/code/java/controlflow/internal/GuardsLogic.qll b/java/ql/lib/semmle/code/java/controlflow/internal/GuardsLogic.qll
index 4cb3bc74f97f..d5dc39d9e141 100644
--- a/java/ql/lib/semmle/code/java/controlflow/internal/GuardsLogic.qll
+++ b/java/ql/lib/semmle/code/java/controlflow/internal/GuardsLogic.qll
@@ -2,6 +2,8 @@
  * Provides predicates for working with the internal logic of the `Guards`
  * library.
  */
+overlay[local?]
+module;
 
 import java
 import semmle.code.java.controlflow.Guards
diff --git a/java/ql/lib/semmle/code/java/controlflow/internal/Preconditions.qll b/java/ql/lib/semmle/code/java/controlflow/internal/Preconditions.qll
index 6e6c5ec47f9c..a0d2e4ef03ec 100644
--- a/java/ql/lib/semmle/code/java/controlflow/internal/Preconditions.qll
+++ b/java/ql/lib/semmle/code/java/controlflow/internal/Preconditions.qll
@@ -3,6 +3,8 @@
  * `com.google.common.base.Preconditions` and
  * `org.apache.commons.lang3.Validate`.
  */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/controlflow/internal/SwitchCases.qll b/java/ql/lib/semmle/code/java/controlflow/internal/SwitchCases.qll
index 1d94f075abbe..5366fa78a539 100644
--- a/java/ql/lib/semmle/code/java/controlflow/internal/SwitchCases.qll
+++ b/java/ql/lib/semmle/code/java/controlflow/internal/SwitchCases.qll
@@ -1,4 +1,6 @@
 /** Provides utility predicates relating to switch cases. */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/controlflow/unreachableblocks/ExcludeDebuggingProfilingLogging.qll b/java/ql/lib/semmle/code/java/controlflow/unreachableblocks/ExcludeDebuggingProfilingLogging.qll
index 7b7a5943f6c6..bda7f9bee740 100644
--- a/java/ql/lib/semmle/code/java/controlflow/unreachableblocks/ExcludeDebuggingProfilingLogging.qll
+++ b/java/ql/lib/semmle/code/java/controlflow/unreachableblocks/ExcludeDebuggingProfilingLogging.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 import java
 import semmle.code.java.controlflow.UnreachableBlocks
 
diff --git a/java/ql/lib/semmle/code/java/dataflow/ApiSinks.qll b/java/ql/lib/semmle/code/java/dataflow/ApiSinks.qll
index c600bb1672d8..56027a4507c8 100644
--- a/java/ql/lib/semmle/code/java/dataflow/ApiSinks.qll
+++ b/java/ql/lib/semmle/code/java/dataflow/ApiSinks.qll
@@ -1,4 +1,6 @@
 /** Provides classes representing various flow sinks for data flow / taint tracking. */
+overlay[local?]
+module;
 
 private import semmle.code.java.dataflow.FlowSinks as FlowSinks
 
diff --git a/java/ql/lib/semmle/code/java/dataflow/ApiSources.qll b/java/ql/lib/semmle/code/java/dataflow/ApiSources.qll
index 8649b5cf830d..add0ec0d9a5b 100644
--- a/java/ql/lib/semmle/code/java/dataflow/ApiSources.qll
+++ b/java/ql/lib/semmle/code/java/dataflow/ApiSources.qll
@@ -1,4 +1,6 @@
 /** Provides classes representing various flow sources for data flow / taint tracking. */
+overlay[local?]
+module;
 
 private import semmle.code.java.dataflow.FlowSources as FlowSources
 
diff --git a/java/ql/lib/semmle/code/java/dataflow/Bound.qll b/java/ql/lib/semmle/code/java/dataflow/Bound.qll
index 08826b7ae8f1..65af6fb13a81 100644
--- a/java/ql/lib/semmle/code/java/dataflow/Bound.qll
+++ b/java/ql/lib/semmle/code/java/dataflow/Bound.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes for representing abstract bounds for use in, for example, range analysis.
  */
+overlay[local?]
+module;
 
 private import internal.rangeanalysis.BoundSpecific
 
diff --git a/java/ql/lib/semmle/code/java/dataflow/DataFlow.qll b/java/ql/lib/semmle/code/java/dataflow/DataFlow.qll
index ab48577c02e7..54eb809c7b97 100644
--- a/java/ql/lib/semmle/code/java/dataflow/DataFlow.qll
+++ b/java/ql/lib/semmle/code/java/dataflow/DataFlow.qll
@@ -2,6 +2,8 @@
  * Provides classes for performing local (intra-procedural) and
  * global (inter-procedural) data flow analyses.
  */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/dataflow/DefUse.qll b/java/ql/lib/semmle/code/java/dataflow/DefUse.qll
index 9fa08d62c27f..a93f2e30b462 100644
--- a/java/ql/lib/semmle/code/java/dataflow/DefUse.qll
+++ b/java/ql/lib/semmle/code/java/dataflow/DefUse.qll
@@ -2,6 +2,8 @@
  * Provides classes and predicates for def-use and use-use pairs. Built on top of the SSA library for
  * maximal precision.
  */
+overlay[local?]
+module;
 
 import java
 private import SSA
diff --git a/java/ql/lib/semmle/code/java/dataflow/ExternalFlow.qll b/java/ql/lib/semmle/code/java/dataflow/ExternalFlow.qll
index a38e54f05134..d1849df0f3ec 100644
--- a/java/ql/lib/semmle/code/java/dataflow/ExternalFlow.qll
+++ b/java/ql/lib/semmle/code/java/dataflow/ExternalFlow.qll
@@ -86,6 +86,8 @@
  *    This information is used in a heuristic for dataflow analysis to determine, if a
  *    model or source code should be used for determining flow.
  */
+overlay[local?]
+module;
 
 import java
 private import semmle.code.java.dataflow.DataFlow::DataFlow
diff --git a/java/ql/lib/semmle/code/java/dataflow/FlowSinks.qll b/java/ql/lib/semmle/code/java/dataflow/FlowSinks.qll
index 72cd96f6745c..61066774e52b 100644
--- a/java/ql/lib/semmle/code/java/dataflow/FlowSinks.qll
+++ b/java/ql/lib/semmle/code/java/dataflow/FlowSinks.qll
@@ -1,4 +1,6 @@
 /** Provides classes representing various flow sinks for data flow / taint tracking. */
+overlay[local?]
+module;
 
 private import java
 private import semmle.code.java.dataflow.ExternalFlow
diff --git a/java/ql/lib/semmle/code/java/dataflow/FlowSources.qll b/java/ql/lib/semmle/code/java/dataflow/FlowSources.qll
index f63eae183c49..8c6ac60eb24f 100644
--- a/java/ql/lib/semmle/code/java/dataflow/FlowSources.qll
+++ b/java/ql/lib/semmle/code/java/dataflow/FlowSources.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes representing various flow sources for taint tracking.
  */
+overlay[local?]
+module;
 
 import java
 import semmle.code.java.dataflow.DataFlow
diff --git a/java/ql/lib/semmle/code/java/dataflow/FlowSteps.qll b/java/ql/lib/semmle/code/java/dataflow/FlowSteps.qll
index d081a6289ecd..8bf2a4683926 100644
--- a/java/ql/lib/semmle/code/java/dataflow/FlowSteps.qll
+++ b/java/ql/lib/semmle/code/java/dataflow/FlowSteps.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes representing various flow steps for taint tracking.
  */
+overlay[local?]
+module;
 
 private import java
 private import semmle.code.java.dataflow.DataFlow
diff --git a/java/ql/lib/semmle/code/java/dataflow/FlowSummary.qll b/java/ql/lib/semmle/code/java/dataflow/FlowSummary.qll
index acea2a10784f..d038851d8374 100644
--- a/java/ql/lib/semmle/code/java/dataflow/FlowSummary.qll
+++ b/java/ql/lib/semmle/code/java/dataflow/FlowSummary.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for defining flow summaries.
  */
+overlay[local?]
+module;
 
 import java
 private import internal.FlowSummaryImpl as Impl
diff --git a/java/ql/lib/semmle/code/java/dataflow/InstanceAccess.qll b/java/ql/lib/semmle/code/java/dataflow/InstanceAccess.qll
index 0bae1b5e9c10..feeb0d100c64 100644
--- a/java/ql/lib/semmle/code/java/dataflow/InstanceAccess.qll
+++ b/java/ql/lib/semmle/code/java/dataflow/InstanceAccess.qll
@@ -2,6 +2,8 @@
  * Provides classes and predicates for reasoning about explicit and implicit
  * instance accesses.
  */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/dataflow/IntegerGuards.qll b/java/ql/lib/semmle/code/java/dataflow/IntegerGuards.qll
index 58d77b649788..817fa17d6a60 100644
--- a/java/ql/lib/semmle/code/java/dataflow/IntegerGuards.qll
+++ b/java/ql/lib/semmle/code/java/dataflow/IntegerGuards.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for integer guards.
  */
+overlay[local?]
+module;
 
 import java
 private import SSA
diff --git a/java/ql/lib/semmle/code/java/dataflow/ModulusAnalysis.qll b/java/ql/lib/semmle/code/java/dataflow/ModulusAnalysis.qll
index 3e5a45da247d..1451a605cdb0 100644
--- a/java/ql/lib/semmle/code/java/dataflow/ModulusAnalysis.qll
+++ b/java/ql/lib/semmle/code/java/dataflow/ModulusAnalysis.qll
@@ -3,6 +3,8 @@
  * an expression, `b` is a `Bound` (typically zero or the value of an SSA
  * variable), and `v` is an integer in the range `[0 .. m-1]`.
  */
+overlay[local?]
+module;
 
 private import internal.rangeanalysis.ModulusAnalysisSpecific::Private
 private import Bound
diff --git a/java/ql/lib/semmle/code/java/dataflow/NullGuards.qll b/java/ql/lib/semmle/code/java/dataflow/NullGuards.qll
index 2dd72d78a2ea..5c6cdb919ef3 100644
--- a/java/ql/lib/semmle/code/java/dataflow/NullGuards.qll
+++ b/java/ql/lib/semmle/code/java/dataflow/NullGuards.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for null guards.
  */
+overlay[local?]
+module;
 
 import java
 import SSA
diff --git a/java/ql/lib/semmle/code/java/dataflow/Nullness.qll b/java/ql/lib/semmle/code/java/dataflow/Nullness.qll
index 36ad96c497f0..f3912277b338 100644
--- a/java/ql/lib/semmle/code/java/dataflow/Nullness.qll
+++ b/java/ql/lib/semmle/code/java/dataflow/Nullness.qll
@@ -6,6 +6,8 @@
  * hold, so results guarded by, for example, `assert x != null;` or
  * `if (x == null) { assert false; }` are excluded.
  */
+overlay[local?]
+module;
 
 /*
  * Implementation details:
diff --git a/java/ql/lib/semmle/code/java/dataflow/RangeAnalysis.qll b/java/ql/lib/semmle/code/java/dataflow/RangeAnalysis.qll
index 64f68b9c075a..49ce242e4a43 100644
--- a/java/ql/lib/semmle/code/java/dataflow/RangeAnalysis.qll
+++ b/java/ql/lib/semmle/code/java/dataflow/RangeAnalysis.qll
@@ -8,6 +8,8 @@
  * If an inferred bound relies directly on a condition, then this condition is
  * reported as the reason for the bound.
  */
+overlay[local?]
+module;
 
 /*
  * This library tackles range analysis as a flow problem. Consider e.g.:
diff --git a/java/ql/lib/semmle/code/java/dataflow/RangeUtils.qll b/java/ql/lib/semmle/code/java/dataflow/RangeUtils.qll
index 444fec8f8659..7d38d83b0967 100644
--- a/java/ql/lib/semmle/code/java/dataflow/RangeUtils.qll
+++ b/java/ql/lib/semmle/code/java/dataflow/RangeUtils.qll
@@ -1,6 +1,8 @@
 /**
  * Provides utility predicates for range analysis.
  */
+overlay[local?]
+module;
 
 import java
 private import SSA
diff --git a/java/ql/lib/semmle/code/java/dataflow/SSA.qll b/java/ql/lib/semmle/code/java/dataflow/SSA.qll
index 680088b7c554..dd902b70e35a 100644
--- a/java/ql/lib/semmle/code/java/dataflow/SSA.qll
+++ b/java/ql/lib/semmle/code/java/dataflow/SSA.qll
@@ -10,6 +10,8 @@
  * of the field in case the field is not amenable to a non-trivial SSA
  * representation.
  */
+overlay[local?]
+module;
 
 import java
 private import internal.SsaImpl
diff --git a/java/ql/lib/semmle/code/java/dataflow/SignAnalysis.qll b/java/ql/lib/semmle/code/java/dataflow/SignAnalysis.qll
index 9cd629f4ef97..568bc8b6d580 100644
--- a/java/ql/lib/semmle/code/java/dataflow/SignAnalysis.qll
+++ b/java/ql/lib/semmle/code/java/dataflow/SignAnalysis.qll
@@ -5,5 +5,7 @@
  * The analysis is implemented as an abstract interpretation over the
  * three-valued domain `{negative, zero, positive}`.
  */
+overlay[local?]
+module;
 
 import semmle.code.java.dataflow.internal.rangeanalysis.SignAnalysisCommon
diff --git a/java/ql/lib/semmle/code/java/dataflow/StringPrefixes.qll b/java/ql/lib/semmle/code/java/dataflow/StringPrefixes.qll
index ed10d8aa4bb8..4b1bd0131bd4 100644
--- a/java/ql/lib/semmle/code/java/dataflow/StringPrefixes.qll
+++ b/java/ql/lib/semmle/code/java/dataflow/StringPrefixes.qll
@@ -25,6 +25,8 @@
  * String.format("%sfoo:%s", notSuffix, suffix4);
  * ```
  */
+overlay[local?]
+module;
 
 import java
 private import semmle.code.java.dataflow.TaintTracking
diff --git a/java/ql/lib/semmle/code/java/dataflow/TaintTracking.qll b/java/ql/lib/semmle/code/java/dataflow/TaintTracking.qll
index e62850fbc389..159604a95bd6 100644
--- a/java/ql/lib/semmle/code/java/dataflow/TaintTracking.qll
+++ b/java/ql/lib/semmle/code/java/dataflow/TaintTracking.qll
@@ -2,6 +2,8 @@
  * Provides classes for performing local (intra-procedural) and
  * global (inter-procedural) taint-tracking analyses.
  */
+overlay[local?]
+module;
 
 import semmle.code.java.dataflow.DataFlow
 import semmle.code.java.dataflow.internal.TaintTrackingUtil::StringBuilderVarModule
diff --git a/java/ql/lib/semmle/code/java/dataflow/TypeFlow.qll b/java/ql/lib/semmle/code/java/dataflow/TypeFlow.qll
index f2fcbc5951d4..8ce9b1b91202 100644
--- a/java/ql/lib/semmle/code/java/dataflow/TypeFlow.qll
+++ b/java/ql/lib/semmle/code/java/dataflow/TypeFlow.qll
@@ -7,6 +7,8 @@
  * type has a subtype or if an inferred upper bound passed through at least one
  * explicit or implicit cast that lost type information.
  */
+overlay[local?]
+module;
 
 import java as J
 private import semmle.code.java.dispatch.VirtualDispatch
diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/BaseSSA.qll b/java/ql/lib/semmle/code/java/dataflow/internal/BaseSSA.qll
index 874aca871832..e01525eda8c6 100644
--- a/java/ql/lib/semmle/code/java/dataflow/internal/BaseSSA.qll
+++ b/java/ql/lib/semmle/code/java/dataflow/internal/BaseSSA.qll
@@ -10,6 +10,8 @@
  * This is a restricted version of SSA.qll that only handles `LocalScopeVariable`s
  * in order to not depend on virtual dispatch.
  */
+overlay[local?]
+module;
 
 import java
 private import codeql.ssa.Ssa as SsaImplCommon
diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/ContainerFlow.qll b/java/ql/lib/semmle/code/java/dataflow/internal/ContainerFlow.qll
index e007ecd85ae5..f93139592269 100644
--- a/java/ql/lib/semmle/code/java/dataflow/internal/ContainerFlow.qll
+++ b/java/ql/lib/semmle/code/java/dataflow/internal/ContainerFlow.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 import java
 import semmle.code.java.Collections
 import semmle.code.java.Maps
diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/ContentDataFlow.qll b/java/ql/lib/semmle/code/java/dataflow/internal/ContentDataFlow.qll
index 2c9b12170440..ec14f494dd95 100644
--- a/java/ql/lib/semmle/code/java/dataflow/internal/ContentDataFlow.qll
+++ b/java/ql/lib/semmle/code/java/dataflow/internal/ContentDataFlow.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 private import java
 private import DataFlowImplSpecific
 private import codeql.dataflow.internal.ContentDataFlowImpl
diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowDispatch.qll b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowDispatch.qll
index f63df6ad09ec..dc58529ed263 100644
--- a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowDispatch.qll
+++ b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowDispatch.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 private import java
 private import DataFlowPrivate
 private import DataFlowUtil
@@ -210,6 +213,7 @@ private module DispatchImpl {
   }
 
   /** Holds if arguments at position `apos` match parameters at position `ppos`. */
+  overlay[caller?]
   pragma[inline]
   predicate parameterMatch(ParameterPosition ppos, ArgumentPosition apos) { ppos = apos }
 }
diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl.qll b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl.qll
index 689e58daab89..1917c2007fe1 100644
--- a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl.qll
+++ b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 private import DataFlowImplSpecific
 private import codeql.dataflow.internal.DataFlowImpl
 private import semmle.code.Location
diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImplCommon.qll b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImplCommon.qll
index 00f388dfdf3a..d9a6a98b4598 100644
--- a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImplCommon.qll
+++ b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImplCommon.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 private import DataFlowImplSpecific
 private import semmle.code.Location
 private import codeql.dataflow.internal.DataFlowImplCommon
diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImplConsistency.qll b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImplConsistency.qll
index 0272af417ace..164bc9abbbdb 100644
--- a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImplConsistency.qll
+++ b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImplConsistency.qll
@@ -2,6 +2,8 @@
  * Provides consistency queries for checking invariants in the language-specific
  * data-flow classes and predicates.
  */
+overlay[local?]
+module;
 
 private import java
 private import DataFlowImplSpecific
diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImplSpecific.qll b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImplSpecific.qll
index 95b2baeab1ce..65034ee08b93 100644
--- a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImplSpecific.qll
+++ b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImplSpecific.qll
@@ -1,6 +1,8 @@
 /**
  * Provides Java-specific definitions for use in the data flow library.
  */
+overlay[local?]
+module;
 
 private import semmle.code.Location
 private import codeql.dataflow.DataFlow
diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowNodes.qll b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowNodes.qll
index 7778f6ebc353..61063498b9e0 100644
--- a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowNodes.qll
+++ b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowNodes.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 private import java
 private import semmle.code.java.dataflow.InstanceAccess
 private import semmle.code.java.dataflow.ExternalFlow
diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowPrivate.qll b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowPrivate.qll
index 9e924df12780..164e2d8aa262 100644
--- a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowPrivate.qll
+++ b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowPrivate.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 private import java
 private import DataFlowUtil
 private import DataFlowImplCommon
diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowUtil.qll b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowUtil.qll
index 6000c37c6cdd..ab2f7f89cb46 100644
--- a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowUtil.qll
+++ b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowUtil.qll
@@ -1,6 +1,8 @@
 /**
  * Basic definitions for use in the data flow library.
  */
+overlay[local?]
+module;
 
 private import java
 private import DataFlowPrivate
@@ -77,6 +79,7 @@ private module ThisFlow {
  * Holds if data can flow from `node1` to `node2` in zero or more
  * local (intra-procedural) steps.
  */
+overlay[caller?]
 pragma[inline]
 predicate localFlow(Node node1, Node node2) { node1 = node2 or localFlowStepPlus(node1, node2) }
 
@@ -86,6 +89,7 @@ private predicate localFlowStepPlus(Node node1, Node node2) = fastTC(localFlowSt
  * Holds if data can flow from `e1` to `e2` in zero or more
  * local (intra-procedural) steps.
  */
+overlay[caller?]
 pragma[inline]
 predicate localExprFlow(Expr e1, Expr e2) { localFlow(exprNode(e1), exprNode(e2)) }
 
diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/ExternalFlowExtensions.qll b/java/ql/lib/semmle/code/java/dataflow/internal/ExternalFlowExtensions.qll
index ff931cbc5cee..32b5d289e28c 100644
--- a/java/ql/lib/semmle/code/java/dataflow/internal/ExternalFlowExtensions.qll
+++ b/java/ql/lib/semmle/code/java/dataflow/internal/ExternalFlowExtensions.qll
@@ -1,6 +1,8 @@
 /**
  * This module provides extensible predicates for defining MaD models.
  */
+overlay[local?]
+module;
 
 /**
  * Holds if a source model exists for the given parameters.
diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/FlowSummaryImpl.qll b/java/ql/lib/semmle/code/java/dataflow/internal/FlowSummaryImpl.qll
index bbb40785d6b4..a2d25cadd883 100644
--- a/java/ql/lib/semmle/code/java/dataflow/internal/FlowSummaryImpl.qll
+++ b/java/ql/lib/semmle/code/java/dataflow/internal/FlowSummaryImpl.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for defining flow summaries.
  */
+overlay[local?]
+module;
 
 private import java
 private import codeql.dataflow.internal.FlowSummaryImpl
diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/ModelExclusions.qll b/java/ql/lib/semmle/code/java/dataflow/internal/ModelExclusions.qll
index cc95a2b5c1ff..9635592476fa 100644
--- a/java/ql/lib/semmle/code/java/dataflow/internal/ModelExclusions.qll
+++ b/java/ql/lib/semmle/code/java/dataflow/internal/ModelExclusions.qll
@@ -1,4 +1,6 @@
 /** Provides classes and predicates for exclusions related to MaD models. */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/SsaImpl.qll b/java/ql/lib/semmle/code/java/dataflow/internal/SsaImpl.qll
index 2a1ea8b0e068..45ad9d0a73b7 100644
--- a/java/ql/lib/semmle/code/java/dataflow/internal/SsaImpl.qll
+++ b/java/ql/lib/semmle/code/java/dataflow/internal/SsaImpl.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 import java
 private import codeql.ssa.Ssa as SsaImplCommon
 private import semmle.code.java.dataflow.SSA
diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/TaintTrackingImplSpecific.qll b/java/ql/lib/semmle/code/java/dataflow/internal/TaintTrackingImplSpecific.qll
index 0f756200abeb..1ac2c7c60fe8 100644
--- a/java/ql/lib/semmle/code/java/dataflow/internal/TaintTrackingImplSpecific.qll
+++ b/java/ql/lib/semmle/code/java/dataflow/internal/TaintTrackingImplSpecific.qll
@@ -1,6 +1,8 @@
 /**
  * Provides Java-specific definitions for use in the taint tracking library.
  */
+overlay[local?]
+module;
 
 private import codeql.dataflow.TaintTracking
 private import DataFlowImplSpecific
diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/TaintTrackingUtil.qll b/java/ql/lib/semmle/code/java/dataflow/internal/TaintTrackingUtil.qll
index d4890b96f8e8..40e361ed1588 100644
--- a/java/ql/lib/semmle/code/java/dataflow/internal/TaintTrackingUtil.qll
+++ b/java/ql/lib/semmle/code/java/dataflow/internal/TaintTrackingUtil.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 private import java
 private import semmle.code.java.dataflow.DataFlow
 private import semmle.code.java.Collections
@@ -20,6 +23,7 @@ private import semmle.code.java.frameworks.JaxWS
  * Holds if taint can flow from `src` to `sink` in zero or more
  * local (intra-procedural) steps.
  */
+overlay[caller?]
 pragma[inline]
 predicate localTaint(DataFlow::Node src, DataFlow::Node sink) { localTaintStep*(src, sink) }
 
@@ -27,6 +31,7 @@ predicate localTaint(DataFlow::Node src, DataFlow::Node sink) { localTaintStep*(
  * Holds if taint can flow from `src` to `sink` in zero or more
  * local (intra-procedural) steps.
  */
+overlay[caller?]
 pragma[inline]
 predicate localExprTaint(Expr src, Expr sink) {
   localTaint(DataFlow::exprNode(src), DataFlow::exprNode(sink))
@@ -69,6 +74,7 @@ module LocalTaintFlow<nodeSig/1 source, nodeSig/1 sink> {
    * (intra-procedural) steps that are restricted to be part of a path between
    * `source` and `sink`.
    */
+  overlay[caller?]
   pragma[inline]
   predicate hasFlow(DataFlow::Node n1, DataFlow::Node n2) { step*(n1, n2) }
 
@@ -77,6 +83,7 @@ module LocalTaintFlow<nodeSig/1 source, nodeSig/1 sink> {
    * (intra-procedural) steps that are restricted to be part of a path between
    * `source` and `sink`.
    */
+  overlay[caller?]
   pragma[inline]
   predicate hasExprFlow(Expr n1, Expr n2) {
     hasFlow(DataFlow::exprNode(n1), DataFlow::exprNode(n2))
diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/BoundSpecific.qll b/java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/BoundSpecific.qll
index 0af549f1f7ee..a1c690b7df4c 100644
--- a/java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/BoundSpecific.qll
+++ b/java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/BoundSpecific.qll
@@ -1,6 +1,8 @@
 /**
  * Provides Java-specific definitions for bounds.
  */
+overlay[local?]
+module;
 
 private import java as J
 private import semmle.code.java.dataflow.SSA as Ssa
diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/ModulusAnalysisSpecific.qll b/java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/ModulusAnalysisSpecific.qll
index b639947793b5..ae77ab7ea01f 100644
--- a/java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/ModulusAnalysisSpecific.qll
+++ b/java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/ModulusAnalysisSpecific.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 module Private {
   private import java as J
   private import semmle.code.java.dataflow.SSA as Ssa
diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/Sign.qll b/java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/Sign.qll
index 30cc089f30bb..a8b715648321 100644
--- a/java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/Sign.qll
+++ b/java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/Sign.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 newtype TSign =
   TNeg() or
   TZero() or
diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/SignAnalysisCommon.qll b/java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/SignAnalysisCommon.qll
index 6f0067517f90..8f8d884c9566 100644
--- a/java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/SignAnalysisCommon.qll
+++ b/java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/SignAnalysisCommon.qll
@@ -5,6 +5,8 @@
  * The analysis is implemented as an abstract interpretation over the
  * three-valued domain `{negative, zero, positive}`.
  */
+overlay[local?]
+module;
 
 private import SignAnalysisSpecific::Private
 private import SsaReadPositionCommon
diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/SignAnalysisSpecific.qll b/java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/SignAnalysisSpecific.qll
index 04e896b26011..10026e0a53d2 100644
--- a/java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/SignAnalysisSpecific.qll
+++ b/java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/SignAnalysisSpecific.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 /**
  * Provides Java-specific definitions for use in sign analysis.
  */
diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/SsaReadPositionCommon.qll b/java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/SsaReadPositionCommon.qll
index 08335f6680dd..1e3c4db95bed 100644
--- a/java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/SsaReadPositionCommon.qll
+++ b/java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/SsaReadPositionCommon.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes for representing a position at which an SSA variable is read.
  */
+overlay[local?]
+module;
 
 private import SsaReadPositionSpecific
 import SsaReadPositionSpecific::Public
diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/SsaReadPositionSpecific.qll b/java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/SsaReadPositionSpecific.qll
index 9b081150e893..dbd7736acde4 100644
--- a/java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/SsaReadPositionSpecific.qll
+++ b/java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/SsaReadPositionSpecific.qll
@@ -1,6 +1,8 @@
 /**
  * Provides Java-specific definitions for use in the `SsaReadPosition`.
  */
+overlay[local?]
+module;
 
 private import semmle.code.java.dataflow.SSA as Ssa
 private import semmle.code.java.controlflow.BasicBlocks as BB
diff --git a/java/ql/lib/semmle/code/java/deadcode/DeadCode.qll b/java/ql/lib/semmle/code/java/deadcode/DeadCode.qll
index cab159b18043..140d5e9e2c81 100644
--- a/java/ql/lib/semmle/code/java/deadcode/DeadCode.qll
+++ b/java/ql/lib/semmle/code/java/deadcode/DeadCode.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 import java
 import semmle.code.java.deadcode.DeadEnumConstant
 import semmle.code.java.deadcode.DeadCodeCustomizations
diff --git a/java/ql/lib/semmle/code/java/deadcode/DeadEnumConstant.qll b/java/ql/lib/semmle/code/java/deadcode/DeadEnumConstant.qll
index e87671dba714..3a8491b8428e 100644
--- a/java/ql/lib/semmle/code/java/deadcode/DeadEnumConstant.qll
+++ b/java/ql/lib/semmle/code/java/deadcode/DeadEnumConstant.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 import java
 
 /**
diff --git a/java/ql/lib/semmle/code/java/deadcode/DeadField.qll b/java/ql/lib/semmle/code/java/deadcode/DeadField.qll
index 2dcbb96f3b59..016350f23ec2 100644
--- a/java/ql/lib/semmle/code/java/deadcode/DeadField.qll
+++ b/java/ql/lib/semmle/code/java/deadcode/DeadField.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 import java
 import semmle.code.java.deadcode.DeadCode
 import semmle.code.java.frameworks.javaee.Persistence
diff --git a/java/ql/lib/semmle/code/java/deadcode/EntryPoints.qll b/java/ql/lib/semmle/code/java/deadcode/EntryPoints.qll
index 7c0a2fdc2d37..ec8ad6e2d4ff 100644
--- a/java/ql/lib/semmle/code/java/deadcode/EntryPoints.qll
+++ b/java/ql/lib/semmle/code/java/deadcode/EntryPoints.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 import java
 import semmle.code.java.deadcode.DeadCode
 import semmle.code.java.deadcode.frameworks.CamelEntryPoints
diff --git a/java/ql/lib/semmle/code/java/deadcode/SpringEntryPoints.qll b/java/ql/lib/semmle/code/java/deadcode/SpringEntryPoints.qll
index f280d9bf8285..7ee7416cecc4 100644
--- a/java/ql/lib/semmle/code/java/deadcode/SpringEntryPoints.qll
+++ b/java/ql/lib/semmle/code/java/deadcode/SpringEntryPoints.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 import java
 import semmle.code.java.deadcode.DeadCode
 import semmle.code.java.frameworks.spring.Spring
diff --git a/java/ql/lib/semmle/code/java/deadcode/StrutsEntryPoints.qll b/java/ql/lib/semmle/code/java/deadcode/StrutsEntryPoints.qll
index 86910a921f8a..a40417debcb5 100644
--- a/java/ql/lib/semmle/code/java/deadcode/StrutsEntryPoints.qll
+++ b/java/ql/lib/semmle/code/java/deadcode/StrutsEntryPoints.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 import java
 import semmle.code.java.deadcode.DeadCode
 import semmle.code.java.frameworks.struts.StrutsActions
diff --git a/java/ql/lib/semmle/code/java/deadcode/TestEntryPoints.qll b/java/ql/lib/semmle/code/java/deadcode/TestEntryPoints.qll
index b8013d2947a8..d8674817b17c 100644
--- a/java/ql/lib/semmle/code/java/deadcode/TestEntryPoints.qll
+++ b/java/ql/lib/semmle/code/java/deadcode/TestEntryPoints.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 import java
 import semmle.code.java.deadcode.DeadCode
 import semmle.code.java.frameworks.Cucumber
diff --git a/java/ql/lib/semmle/code/java/deadcode/WebEntryPoints.qll b/java/ql/lib/semmle/code/java/deadcode/WebEntryPoints.qll
index fc2d5f69df9a..df9ef0a7b7c5 100644
--- a/java/ql/lib/semmle/code/java/deadcode/WebEntryPoints.qll
+++ b/java/ql/lib/semmle/code/java/deadcode/WebEntryPoints.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 import java
 import semmle.code.java.deadcode.DeadCode
 import semmle.code.java.frameworks.gwt.GWT
diff --git a/java/ql/lib/semmle/code/java/deadcode/frameworks/CamelEntryPoints.qll b/java/ql/lib/semmle/code/java/deadcode/frameworks/CamelEntryPoints.qll
index a96565c606e4..453d75e179b5 100644
--- a/java/ql/lib/semmle/code/java/deadcode/frameworks/CamelEntryPoints.qll
+++ b/java/ql/lib/semmle/code/java/deadcode/frameworks/CamelEntryPoints.qll
@@ -1,6 +1,8 @@
 /**
  * Apache Camel is a messaging framework, which can integrate with Spring.
  */
+overlay[local?]
+module;
 
 import java
 import semmle.code.java.deadcode.DeadCode
diff --git a/java/ql/lib/semmle/code/java/deadcode/frameworks/FitNesseEntryPoints.qll b/java/ql/lib/semmle/code/java/deadcode/frameworks/FitNesseEntryPoints.qll
index a829ccef7d27..c817a9b7dac9 100644
--- a/java/ql/lib/semmle/code/java/deadcode/frameworks/FitNesseEntryPoints.qll
+++ b/java/ql/lib/semmle/code/java/deadcode/frameworks/FitNesseEntryPoints.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 import default
 import semmle.code.java.deadcode.DeadCode
 import external.ExternalArtifact
diff --git a/java/ql/lib/semmle/code/java/deadcode/frameworks/GigaSpacesXAPEntryPoints.qll b/java/ql/lib/semmle/code/java/deadcode/frameworks/GigaSpacesXAPEntryPoints.qll
index 39cb18db80a7..3e231e23fc31 100644
--- a/java/ql/lib/semmle/code/java/deadcode/frameworks/GigaSpacesXAPEntryPoints.qll
+++ b/java/ql/lib/semmle/code/java/deadcode/frameworks/GigaSpacesXAPEntryPoints.qll
@@ -1,6 +1,8 @@
 /**
  * GigaSpaces XAP (eXtreme Application Platform) is a distributed in-memory "datagrid".
  */
+overlay[local?]
+module;
 
 import java
 import semmle.code.java.deadcode.DeadCode
diff --git a/java/ql/lib/semmle/code/java/dispatch/DispatchFlow.qll b/java/ql/lib/semmle/code/java/dispatch/DispatchFlow.qll
index bd293eed6b3a..a9988e920c62 100644
--- a/java/ql/lib/semmle/code/java/dispatch/DispatchFlow.qll
+++ b/java/ql/lib/semmle/code/java/dispatch/DispatchFlow.qll
@@ -5,6 +5,8 @@
  * data flow check for lambdas, anonymous classes, and other sufficiently
  * private classes where all object instantiations are accounted for.
  */
+overlay[local?]
+module;
 
 import java
 private import VirtualDispatch
diff --git a/java/ql/lib/semmle/code/java/dispatch/ObjFlow.qll b/java/ql/lib/semmle/code/java/dispatch/ObjFlow.qll
index 293ba894fdfb..12fe1cba5e99 100644
--- a/java/ql/lib/semmle/code/java/dispatch/ObjFlow.qll
+++ b/java/ql/lib/semmle/code/java/dispatch/ObjFlow.qll
@@ -6,6 +6,8 @@
  * The set of dispatch targets for `Object.toString()` calls are reduced based
  * on possible data flow from objects of more specific types to the qualifier.
  */
+overlay[local?]
+module;
 
 import java
 private import VirtualDispatch
diff --git a/java/ql/lib/semmle/code/java/dispatch/VirtualDispatch.qll b/java/ql/lib/semmle/code/java/dispatch/VirtualDispatch.qll
index 78bf1ad0bdc1..877a62fb9455 100644
--- a/java/ql/lib/semmle/code/java/dispatch/VirtualDispatch.qll
+++ b/java/ql/lib/semmle/code/java/dispatch/VirtualDispatch.qll
@@ -2,6 +2,8 @@
  * Provides predicates for reasoning about runtime call targets through virtual
  * dispatch.
  */
+overlay[local?]
+module;
 
 import java
 import semmle.code.java.dataflow.TypeFlow
diff --git a/java/ql/lib/semmle/code/java/dispatch/WrappedInvocation.qll b/java/ql/lib/semmle/code/java/dispatch/WrappedInvocation.qll
index f7840f197853..e76c252662a3 100644
--- a/java/ql/lib/semmle/code/java/dispatch/WrappedInvocation.qll
+++ b/java/ql/lib/semmle/code/java/dispatch/WrappedInvocation.qll
@@ -2,6 +2,8 @@
  * Provides classes and predicates for reasoning about calls that may invoke one
  * of their arguments.
  */
+overlay[local?]
+module;
 
 import java
 import VirtualDispatch
diff --git a/java/ql/lib/semmle/code/java/dispatch/internal/Unification.qll b/java/ql/lib/semmle/code/java/dispatch/internal/Unification.qll
index 6c92f7298d92..cd585de58e4e 100644
--- a/java/ql/lib/semmle/code/java/dispatch/internal/Unification.qll
+++ b/java/ql/lib/semmle/code/java/dispatch/internal/Unification.qll
@@ -1,6 +1,8 @@
 /**
  * Provides a module to check whether two `ParameterizedType`s are unifiable.
  */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/environment/SystemProperty.qll b/java/ql/lib/semmle/code/java/environment/SystemProperty.qll
index bee91d7c6b7f..add93ee56c39 100644
--- a/java/ql/lib/semmle/code/java/environment/SystemProperty.qll
+++ b/java/ql/lib/semmle/code/java/environment/SystemProperty.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for working with java system properties.
  */
+overlay[local?]
+module;
 
 import java
 private import semmle.code.java.dataflow.DataFlow
diff --git a/java/ql/lib/semmle/code/java/frameworks/ApacheHttp.qll b/java/ql/lib/semmle/code/java/frameworks/ApacheHttp.qll
index 61f6aa9a34ea..73078c1da83c 100644
--- a/java/ql/lib/semmle/code/java/frameworks/ApacheHttp.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/ApacheHttp.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates related to `org.apache.http.*` and `org.apache.hc.*`.
  */
+overlay[local?]
+module;
 
 import java
 private import semmle.code.java.dataflow.FlowSteps
diff --git a/java/ql/lib/semmle/code/java/frameworks/ApacheLdap.qll b/java/ql/lib/semmle/code/java/frameworks/ApacheLdap.qll
index 8bcba2f044eb..6d76caf36d55 100644
--- a/java/ql/lib/semmle/code/java/frameworks/ApacheLdap.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/ApacheLdap.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for working with the Apache LDAP API.
  */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/Assertions.qll b/java/ql/lib/semmle/code/java/frameworks/Assertions.qll
index e1601c854e4e..9849be5f3603 100644
--- a/java/ql/lib/semmle/code/java/frameworks/Assertions.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/Assertions.qll
@@ -5,6 +5,8 @@
  * `org.junit.jupiter.api.Assertions`, `com.google.common.base.Preconditions`,
  * and `java.util.Objects`.
  */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/Camel.qll b/java/ql/lib/semmle/code/java/frameworks/Camel.qll
index 381ee3cb28e2..137855b5fa1a 100644
--- a/java/ql/lib/semmle/code/java/frameworks/Camel.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/Camel.qll
@@ -1,6 +1,8 @@
 /**
  * Apache Camel messaging framework.
  */
+overlay[local?]
+module;
 
 import java
 import semmle.code.java.frameworks.spring.SpringCamel
diff --git a/java/ql/lib/semmle/code/java/frameworks/Castor.qll b/java/ql/lib/semmle/code/java/frameworks/Castor.qll
index f1e1b8257252..2becb2fbf178 100644
--- a/java/ql/lib/semmle/code/java/frameworks/Castor.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/Castor.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for working with the Castor framework.
  */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/Cucumber.qll b/java/ql/lib/semmle/code/java/frameworks/Cucumber.qll
index 9bcfb24bae5a..15e71a25f890 100644
--- a/java/ql/lib/semmle/code/java/frameworks/Cucumber.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/Cucumber.qll
@@ -1,6 +1,8 @@
 /**
  * Cucumber is an open-source project for writing executable acceptance tests in human-readable `.feature` files.
  */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/FastJson.qll b/java/ql/lib/semmle/code/java/frameworks/FastJson.qll
index c9f7d9e8b89d..305f795017a6 100644
--- a/java/ql/lib/semmle/code/java/frameworks/FastJson.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/FastJson.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for working with the FastJson framework.
  */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/Flexjson.qll b/java/ql/lib/semmle/code/java/frameworks/Flexjson.qll
index 55a8e2624386..2e5cb2ce9593 100644
--- a/java/ql/lib/semmle/code/java/frameworks/Flexjson.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/Flexjson.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes for working with the Flexjson framework.
  */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/Guice.qll b/java/ql/lib/semmle/code/java/frameworks/Guice.qll
index 8dfb63983982..bf6a3d5467cc 100644
--- a/java/ql/lib/semmle/code/java/frameworks/Guice.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/Guice.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for working with the Guice framework.
  */
+overlay[local?]
+module;
 
 import java
 import semmle.code.java.dataflow.FlowSteps
diff --git a/java/ql/lib/semmle/code/java/frameworks/HessianBurlap.qll b/java/ql/lib/semmle/code/java/frameworks/HessianBurlap.qll
index e3c5269e5b20..3a10b75a2a69 100644
--- a/java/ql/lib/semmle/code/java/frameworks/HessianBurlap.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/HessianBurlap.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for working with the HessianBurlap framework.
  */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/Hibernate.qll b/java/ql/lib/semmle/code/java/frameworks/Hibernate.qll
index 28b281014547..4e5050b412ca 100644
--- a/java/ql/lib/semmle/code/java/frameworks/Hibernate.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/Hibernate.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for working with the Hibernate framework.
  */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/InputStream.qll b/java/ql/lib/semmle/code/java/frameworks/InputStream.qll
index 8f37ecc24ea0..f6097e8c4492 100644
--- a/java/ql/lib/semmle/code/java/frameworks/InputStream.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/InputStream.qll
@@ -1,4 +1,6 @@
 /** Provides definitions related to `java.io.InputStream`. */
+overlay[local?]
+module;
 
 import java
 private import semmle.code.java.dataflow.DataFlow
diff --git a/java/ql/lib/semmle/code/java/frameworks/IoJsonWebToken.qll b/java/ql/lib/semmle/code/java/frameworks/IoJsonWebToken.qll
index 3da90bb7e67a..b4573013295b 100644
--- a/java/ql/lib/semmle/code/java/frameworks/IoJsonWebToken.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/IoJsonWebToken.qll
@@ -1,4 +1,6 @@
 /** Predicates and classes to reason about the `io.jsonwebtoken` library. */
+overlay[local?]
+module;
 
 import java
 private import semmle.code.java.dataflow.DataFlow
diff --git a/java/ql/lib/semmle/code/java/frameworks/JAXB.qll b/java/ql/lib/semmle/code/java/frameworks/JAXB.qll
index e25add17ccb1..96075bbccf3c 100644
--- a/java/ql/lib/semmle/code/java/frameworks/JAXB.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/JAXB.qll
@@ -1,4 +1,6 @@
 /** Definitions related to JAXB. */
+overlay[local?]
+module;
 
 import semmle.code.java.Type
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/JUnitAnnotations.qll b/java/ql/lib/semmle/code/java/frameworks/JUnitAnnotations.qll
index d74fe683f063..ad58cd486e16 100644
--- a/java/ql/lib/semmle/code/java/frameworks/JUnitAnnotations.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/JUnitAnnotations.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for working with annotations from the `JUnit` framework.
  */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/JYaml.qll b/java/ql/lib/semmle/code/java/frameworks/JYaml.qll
index 9d77b86f6c1d..cd9414521c4e 100644
--- a/java/ql/lib/semmle/code/java/frameworks/JYaml.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/JYaml.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for working with the JYaml framework.
  */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/Jabsorb.qll b/java/ql/lib/semmle/code/java/frameworks/Jabsorb.qll
index eede97b411cb..e8bb82f156fe 100644
--- a/java/ql/lib/semmle/code/java/frameworks/Jabsorb.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/Jabsorb.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes for working with the Jabsorb JSON-RPC ORB framework.
  */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/Jackson.qll b/java/ql/lib/semmle/code/java/frameworks/Jackson.qll
index 605370ec594f..5c1d02759231 100644
--- a/java/ql/lib/semmle/code/java/frameworks/Jackson.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/Jackson.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for working with the Jackson serialization framework.
  */
+overlay[local?]
+module;
 
 import java
 private import semmle.code.java.dataflow.DataFlow
diff --git a/java/ql/lib/semmle/code/java/frameworks/JavaxAnnotations.qll b/java/ql/lib/semmle/code/java/frameworks/JavaxAnnotations.qll
index 0f5da6c39eac..22f33d346df0 100644
--- a/java/ql/lib/semmle/code/java/frameworks/JavaxAnnotations.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/JavaxAnnotations.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for working with annotations in the `javax` package.
  */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/JaxWS.qll b/java/ql/lib/semmle/code/java/frameworks/JaxWS.qll
index a0f891fd36ea..62289f737c02 100644
--- a/java/ql/lib/semmle/code/java/frameworks/JaxWS.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/JaxWS.qll
@@ -2,6 +2,8 @@
  * Definitions relating to JAX-WS (Java/Jakarta API for XML Web Services) and JAX-RS
  * (Java/Jakarta API for RESTful Web Services).
  */
+overlay[local?]
+module;
 
 import java
 private import semmle.code.java.frameworks.Networking
diff --git a/java/ql/lib/semmle/code/java/frameworks/Jdbc.qll b/java/ql/lib/semmle/code/java/frameworks/Jdbc.qll
index 37be7dcf09a7..c7172527d1fe 100644
--- a/java/ql/lib/semmle/code/java/frameworks/Jdbc.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/Jdbc.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for working with the Java JDBC API.
  */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/Jms.qll b/java/ql/lib/semmle/code/java/frameworks/Jms.qll
index 653582100bdb..3cc76771a776 100644
--- a/java/ql/lib/semmle/code/java/frameworks/Jms.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/Jms.qll
@@ -1,4 +1,6 @@
 /** Provides definitions for working with the JMS library. */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/Jndi.qll b/java/ql/lib/semmle/code/java/frameworks/Jndi.qll
index 267cdcd59dc8..0d7d481dc1d0 100644
--- a/java/ql/lib/semmle/code/java/frameworks/Jndi.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/Jndi.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for working with the Java JNDI API.
  */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/JoddJson.qll b/java/ql/lib/semmle/code/java/frameworks/JoddJson.qll
index d92b80ca32b5..3f28b2e8c7e4 100644
--- a/java/ql/lib/semmle/code/java/frameworks/JoddJson.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/JoddJson.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for working with the Jodd JSON framework.
  */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/JsonIo.qll b/java/ql/lib/semmle/code/java/frameworks/JsonIo.qll
index 85f3a5ef06bb..433277a64728 100644
--- a/java/ql/lib/semmle/code/java/frameworks/JsonIo.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/JsonIo.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for working with the Json-io framework.
  */
+overlay[local?]
+module;
 
 import java
 import semmle.code.java.Maps
diff --git a/java/ql/lib/semmle/code/java/frameworks/Kryo.qll b/java/ql/lib/semmle/code/java/frameworks/Kryo.qll
index 7dde62c4ba4b..77a423a8a9ef 100644
--- a/java/ql/lib/semmle/code/java/frameworks/Kryo.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/Kryo.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for working with the Kryo serialization framework.
  */
+overlay[local?]
+module;
 
 import java
 private import semmle.code.java.dataflow.DataFlow
diff --git a/java/ql/lib/semmle/code/java/frameworks/Lombok.qll b/java/ql/lib/semmle/code/java/frameworks/Lombok.qll
index 39ee7c5393d5..84a890c498f8 100644
--- a/java/ql/lib/semmle/code/java/frameworks/Lombok.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/Lombok.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for identifying use of the Lombok framework.
  */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/Mail.qll b/java/ql/lib/semmle/code/java/frameworks/Mail.qll
index eeb9665dc2ed..c61e5ae34f99 100644
--- a/java/ql/lib/semmle/code/java/frameworks/Mail.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/Mail.qll
@@ -1,4 +1,6 @@
 /** Provides classes and predicates to work with email */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/Mockito.qll b/java/ql/lib/semmle/code/java/frameworks/Mockito.qll
index 0f5971a68ace..1a8d987a38e4 100644
--- a/java/ql/lib/semmle/code/java/frameworks/Mockito.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/Mockito.qll
@@ -3,6 +3,8 @@
  *
  * QL classes are provided for detecting uses of Mockito annotations on fields.
  */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/MyBatis.qll b/java/ql/lib/semmle/code/java/frameworks/MyBatis.qll
index c7fc09a33b4d..e3f89186821b 100644
--- a/java/ql/lib/semmle/code/java/frameworks/MyBatis.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/MyBatis.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for working with the MyBatis framework.
  */
+overlay[local?]
+module;
 
 import java
 private import semmle.code.java.dataflow.DataFlow
diff --git a/java/ql/lib/semmle/code/java/frameworks/Netty.qll b/java/ql/lib/semmle/code/java/frameworks/Netty.qll
index 9a72c7f64043..caaa429d69ec 100644
--- a/java/ql/lib/semmle/code/java/frameworks/Netty.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/Netty.qll
@@ -1,4 +1,6 @@
 /** Provides definitions related to the Netty framework. */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/Networking.qll b/java/ql/lib/semmle/code/java/frameworks/Networking.qll
index 1139d0d00621..6eeb5aa90241 100644
--- a/java/ql/lib/semmle/code/java/frameworks/Networking.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/Networking.qll
@@ -1,6 +1,8 @@
 /**
  * Definitions related to `java.net.*`.
  */
+overlay[local?]
+module;
 
 import semmle.code.java.Type
 private import semmle.code.java.dataflow.DataFlow
diff --git a/java/ql/lib/semmle/code/java/frameworks/OpenSaml.qll b/java/ql/lib/semmle/code/java/frameworks/OpenSaml.qll
index c8b9a320ec1b..5327db3af865 100644
--- a/java/ql/lib/semmle/code/java/frameworks/OpenSaml.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/OpenSaml.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for working with the OpenSAML libraries.
  */
+overlay[local?]
+module;
 
 import java
 private import semmle.code.java.security.InsecureRandomnessQuery
diff --git a/java/ql/lib/semmle/code/java/frameworks/Properties.qll b/java/ql/lib/semmle/code/java/frameworks/Properties.qll
index 15e7b6878858..50a13c236744 100644
--- a/java/ql/lib/semmle/code/java/frameworks/Properties.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/Properties.qll
@@ -1,4 +1,6 @@
 /** Definitions related to `java.util.Properties`. */
+overlay[local?]
+module;
 
 import semmle.code.java.Type
 private import semmle.code.java.dataflow.FlowSteps
diff --git a/java/ql/lib/semmle/code/java/frameworks/Protobuf.qll b/java/ql/lib/semmle/code/java/frameworks/Protobuf.qll
index 14224bc148de..bbaa56f46119 100644
--- a/java/ql/lib/semmle/code/java/frameworks/Protobuf.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/Protobuf.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for working with the Protobuf framework.
  */
+overlay[local?]
+module;
 
 import java
 import semmle.code.java.dataflow.FlowSteps
diff --git a/java/ql/lib/semmle/code/java/frameworks/Regex.qll b/java/ql/lib/semmle/code/java/frameworks/Regex.qll
index 780dec48b923..f63f46c38780 100644
--- a/java/ql/lib/semmle/code/java/frameworks/Regex.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/Regex.qll
@@ -1,4 +1,6 @@
 /** Definitions related to `java.util.regex`. */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/Rmi.qll b/java/ql/lib/semmle/code/java/frameworks/Rmi.qll
index 922f90bccb62..03ea238982d6 100644
--- a/java/ql/lib/semmle/code/java/frameworks/Rmi.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/Rmi.qll
@@ -1,4 +1,6 @@
 /** Remote Method Invocation. */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/Selenium.qll b/java/ql/lib/semmle/code/java/frameworks/Selenium.qll
index 0ea61ae0ecfe..6a85d5b09159 100644
--- a/java/ql/lib/semmle/code/java/frameworks/Selenium.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/Selenium.qll
@@ -2,6 +2,8 @@
  * Provides classes and predicates for identifying classes reflectively constructed by Selenium using the
  * `PageFactory.initElements(...)` method.
  */
+overlay[local?]
+module;
 
 import default
 import semmle.code.java.Reflection
diff --git a/java/ql/lib/semmle/code/java/frameworks/Servlets.qll b/java/ql/lib/semmle/code/java/frameworks/Servlets.qll
index 80e80c019b0a..7d7beb74fc30 100644
--- a/java/ql/lib/semmle/code/java/frameworks/Servlets.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/Servlets.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for working with the Java Servlet API.
  */
+overlay[local?]
+module;
 
 import semmle.code.java.Type
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/SnakeYaml.qll b/java/ql/lib/semmle/code/java/frameworks/SnakeYaml.qll
index 3bde32912180..0edbad2196e1 100644
--- a/java/ql/lib/semmle/code/java/frameworks/SnakeYaml.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/SnakeYaml.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for working with the SnakeYaml serialization framework.
  */
+overlay[local?]
+module;
 
 import java
 import semmle.code.java.dataflow.DataFlow
diff --git a/java/ql/lib/semmle/code/java/frameworks/SpringJdbc.qll b/java/ql/lib/semmle/code/java/frameworks/SpringJdbc.qll
index 82eedca44e88..192e579a4f6b 100644
--- a/java/ql/lib/semmle/code/java/frameworks/SpringJdbc.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/SpringJdbc.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for working with the Spring JDBC framework.
  */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/SpringLdap.qll b/java/ql/lib/semmle/code/java/frameworks/SpringLdap.qll
index da40caf37445..79c3739dde4f 100644
--- a/java/ql/lib/semmle/code/java/frameworks/SpringLdap.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/SpringLdap.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for working with the Spring LDAP API.
  */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/SpringWeb.qll b/java/ql/lib/semmle/code/java/frameworks/SpringWeb.qll
index a011af98cd5c..9bb856e22604 100644
--- a/java/ql/lib/semmle/code/java/frameworks/SpringWeb.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/SpringWeb.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 import java
 import spring.SpringController
 import spring.SpringWeb
diff --git a/java/ql/lib/semmle/code/java/frameworks/Stream.qll b/java/ql/lib/semmle/code/java/frameworks/Stream.qll
index a449f8bd99a6..8927355d6377 100644
--- a/java/ql/lib/semmle/code/java/frameworks/Stream.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/Stream.qll
@@ -1,4 +1,6 @@
 /** Definitions related to `java.util.stream`. */
+overlay[local?]
+module;
 
 private import semmle.code.java.dataflow.FlowSummary
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/ThreadLocal.qll b/java/ql/lib/semmle/code/java/frameworks/ThreadLocal.qll
index 826eed8dffcc..c813c0383eb6 100644
--- a/java/ql/lib/semmle/code/java/frameworks/ThreadLocal.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/ThreadLocal.qll
@@ -1,4 +1,6 @@
 /** Definitions related to `java.lang.ThreadLocal`. */
+overlay[local?]
+module;
 
 import java
 private import semmle.code.java.dataflow.DataFlow
diff --git a/java/ql/lib/semmle/code/java/frameworks/Thrift.qll b/java/ql/lib/semmle/code/java/frameworks/Thrift.qll
index 4e07a2730dc2..5272745b4e97 100644
--- a/java/ql/lib/semmle/code/java/frameworks/Thrift.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/Thrift.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for working with the Apache Thrift framework.
  */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/UnboundId.qll b/java/ql/lib/semmle/code/java/frameworks/UnboundId.qll
index bfb7a6604246..6359fbf2afbc 100644
--- a/java/ql/lib/semmle/code/java/frameworks/UnboundId.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/UnboundId.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for working with the UnboundID API.
  */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/XStream.qll b/java/ql/lib/semmle/code/java/frameworks/XStream.qll
index 0e62459e13d8..aca6117023ee 100644
--- a/java/ql/lib/semmle/code/java/frameworks/XStream.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/XStream.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for working with the XStream XML serialization framework.
  */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/YamlBeans.qll b/java/ql/lib/semmle/code/java/frameworks/YamlBeans.qll
index b5db59926be4..040ae60fc710 100644
--- a/java/ql/lib/semmle/code/java/frameworks/YamlBeans.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/YamlBeans.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for working with the YamlBeans framework.
  */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/android/Android.qll b/java/ql/lib/semmle/code/java/frameworks/android/Android.qll
index befcc036205e..85df4366ec27 100644
--- a/java/ql/lib/semmle/code/java/frameworks/android/Android.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/android/Android.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for working with Android components.
  */
+overlay[local?]
+module;
 
 import java
 private import semmle.code.xml.AndroidManifest
diff --git a/java/ql/lib/semmle/code/java/frameworks/android/AsyncTask.qll b/java/ql/lib/semmle/code/java/frameworks/android/AsyncTask.qll
index 226a80709456..1aba64a4c7e0 100644
--- a/java/ql/lib/semmle/code/java/frameworks/android/AsyncTask.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/android/AsyncTask.qll
@@ -1,4 +1,6 @@
 /** Provides classes and predicates to reason about `AsyncTask`s in Android. */
+overlay[local?]
+module;
 
 import java
 private import semmle.code.java.dataflow.DataFlow
diff --git a/java/ql/lib/semmle/code/java/frameworks/android/Compose.qll b/java/ql/lib/semmle/code/java/frameworks/android/Compose.qll
index 0e6399cba1f0..9123600d4e48 100644
--- a/java/ql/lib/semmle/code/java/frameworks/android/Compose.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/android/Compose.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for working with components generated by the Android's Jetpack Compose compiler.
  */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/android/ContentProviders.qll b/java/ql/lib/semmle/code/java/frameworks/android/ContentProviders.qll
index 7bcd4baa3e50..f344377b9cd8 100644
--- a/java/ql/lib/semmle/code/java/frameworks/android/ContentProviders.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/android/ContentProviders.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for working with Content Providers.
  */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/android/ExternalStorage.qll b/java/ql/lib/semmle/code/java/frameworks/android/ExternalStorage.qll
index 7eb088a9514f..c07ddea6dbab 100644
--- a/java/ql/lib/semmle/code/java/frameworks/android/ExternalStorage.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/android/ExternalStorage.qll
@@ -1,4 +1,6 @@
 /** Provides definitions for working with uses of Android external storage */
+overlay[local?]
+module;
 
 import java
 private import semmle.code.java.security.FileReadWrite
diff --git a/java/ql/lib/semmle/code/java/frameworks/android/Fragment.qll b/java/ql/lib/semmle/code/java/frameworks/android/Fragment.qll
index debdd69e1944..64c92955ee7b 100644
--- a/java/ql/lib/semmle/code/java/frameworks/android/Fragment.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/android/Fragment.qll
@@ -1,4 +1,6 @@
 /** Provides classes and predicates to track Android fragments. */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/android/Intent.qll b/java/ql/lib/semmle/code/java/frameworks/android/Intent.qll
index 6e321b0ad900..c3b58873d1f0 100644
--- a/java/ql/lib/semmle/code/java/frameworks/android/Intent.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/android/Intent.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 import java
 private import semmle.code.java.frameworks.android.Android
 private import semmle.code.java.dataflow.DataFlow
diff --git a/java/ql/lib/semmle/code/java/frameworks/android/Layout.qll b/java/ql/lib/semmle/code/java/frameworks/android/Layout.qll
index ee430b62d577..0f6f5d845b86 100644
--- a/java/ql/lib/semmle/code/java/frameworks/android/Layout.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/android/Layout.qll
@@ -1,4 +1,6 @@
 /** Provides classes and predicates for working with Android layouts and UI elements. */
+overlay[local?]
+module;
 
 import java
 import semmle.code.xml.AndroidManifest
diff --git a/java/ql/lib/semmle/code/java/frameworks/android/OnActivityResultSource.qll b/java/ql/lib/semmle/code/java/frameworks/android/OnActivityResultSource.qll
index 5253526f0fd1..5a1a9bf8c7a0 100644
--- a/java/ql/lib/semmle/code/java/frameworks/android/OnActivityResultSource.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/android/OnActivityResultSource.qll
@@ -1,4 +1,6 @@
 /** Provides a remote flow source for Android's `Activity.onActivityResult` method. */
+overlay[local?]
+module;
 
 import java
 private import semmle.code.java.dataflow.DataFlow
diff --git a/java/ql/lib/semmle/code/java/frameworks/android/PendingIntent.qll b/java/ql/lib/semmle/code/java/frameworks/android/PendingIntent.qll
index 1c17d3c9b8df..720be6dce03a 100644
--- a/java/ql/lib/semmle/code/java/frameworks/android/PendingIntent.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/android/PendingIntent.qll
@@ -1,4 +1,6 @@
 /** Provides classes and predicates related to the class `PendingIntent`. */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/android/SQLite.qll b/java/ql/lib/semmle/code/java/frameworks/android/SQLite.qll
index 2898b6aee54f..f46f4e0e51d6 100644
--- a/java/ql/lib/semmle/code/java/frameworks/android/SQLite.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/android/SQLite.qll
@@ -1,4 +1,6 @@
 /** Provides classes and predicates for working with SQLite databases. */
+overlay[local?]
+module;
 
 import java
 private import semmle.code.java.dataflow.FlowSteps
diff --git a/java/ql/lib/semmle/code/java/frameworks/android/SharedPreferences.qll b/java/ql/lib/semmle/code/java/frameworks/android/SharedPreferences.qll
index a3298fd70d87..a11857e9f1f4 100644
--- a/java/ql/lib/semmle/code/java/frameworks/android/SharedPreferences.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/android/SharedPreferences.qll
@@ -1,4 +1,6 @@
 /** Provides classes related to `android.content.SharedPreferences`. */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/android/Slice.qll b/java/ql/lib/semmle/code/java/frameworks/android/Slice.qll
index 96ccb2a4401e..60811d9bc2d6 100644
--- a/java/ql/lib/semmle/code/java/frameworks/android/Slice.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/android/Slice.qll
@@ -1,4 +1,6 @@
 /** Provides classes and predicates related to `androidx.slice`. */
+overlay[local?]
+module;
 
 import java
 private import semmle.code.java.dataflow.DataFlow
diff --git a/java/ql/lib/semmle/code/java/frameworks/android/WebView.qll b/java/ql/lib/semmle/code/java/frameworks/android/WebView.qll
index 78eeae4bdf22..8fa804f52797 100644
--- a/java/ql/lib/semmle/code/java/frameworks/android/WebView.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/android/WebView.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 import java
 
 /** The class `android.webkit.WebView`. */
diff --git a/java/ql/lib/semmle/code/java/frameworks/android/Widget.qll b/java/ql/lib/semmle/code/java/frameworks/android/Widget.qll
index 9a2729f5b794..7b277a797f90 100644
--- a/java/ql/lib/semmle/code/java/frameworks/android/Widget.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/android/Widget.qll
@@ -1,4 +1,6 @@
 /** Provides classes and predicates for working with Android widgets. */
+overlay[local?]
+module;
 
 import java
 private import semmle.code.java.dataflow.ExternalFlow
diff --git a/java/ql/lib/semmle/code/java/frameworks/android/XmlParsing.qll b/java/ql/lib/semmle/code/java/frameworks/android/XmlParsing.qll
index 4e6c39f25757..2235bc5eaecc 100644
--- a/java/ql/lib/semmle/code/java/frameworks/android/XmlParsing.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/android/XmlParsing.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 import java
 
 class XmlPullParser extends Interface {
diff --git a/java/ql/lib/semmle/code/java/frameworks/apache/Collections.qll b/java/ql/lib/semmle/code/java/frameworks/apache/Collections.qll
index 24030e35045d..97d51fc2cbc4 100644
--- a/java/ql/lib/semmle/code/java/frameworks/apache/Collections.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/apache/Collections.qll
@@ -1,4 +1,6 @@
 /** Definitions related to the Apache Commons Collections library. */
+overlay[local?]
+module;
 
 import java
 private import semmle.code.java.dataflow.FlowSteps
diff --git a/java/ql/lib/semmle/code/java/frameworks/apache/CommonsXml.qll b/java/ql/lib/semmle/code/java/frameworks/apache/CommonsXml.qll
index 5e72b26e009b..163bd773dad0 100644
--- a/java/ql/lib/semmle/code/java/frameworks/apache/CommonsXml.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/apache/CommonsXml.qll
@@ -1,4 +1,6 @@
 /** Provides XML definitions related to the `org.apache.commons` package. */
+overlay[local?]
+module;
 
 import java
 private import semmle.code.java.dataflow.RangeUtils
diff --git a/java/ql/lib/semmle/code/java/frameworks/apache/Lang.qll b/java/ql/lib/semmle/code/java/frameworks/apache/Lang.qll
index 9ea2400b8718..27c7f9530ad1 100644
--- a/java/ql/lib/semmle/code/java/frameworks/apache/Lang.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/apache/Lang.qll
@@ -1,4 +1,6 @@
 /** Definitions related to the Apache Commons Lang library. */
+overlay[local?]
+module;
 
 import java
 private import semmle.code.java.dataflow.FlowSteps
diff --git a/java/ql/lib/semmle/code/java/frameworks/camel/CamelJavaAnnotations.qll b/java/ql/lib/semmle/code/java/frameworks/camel/CamelJavaAnnotations.qll
index 1d42bd4c94b4..b1637038b99a 100644
--- a/java/ql/lib/semmle/code/java/frameworks/camel/CamelJavaAnnotations.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/camel/CamelJavaAnnotations.qll
@@ -14,6 +14,8 @@
  *
  * This creates a route to the `ConsumeMdb` class for messages sent to "activemq:queue:sayhello".
  */
+overlay[local?]
+module;
 
 import java
 import semmle.code.java.Reflection
diff --git a/java/ql/lib/semmle/code/java/frameworks/camel/CamelJavaDSL.qll b/java/ql/lib/semmle/code/java/frameworks/camel/CamelJavaDSL.qll
index ed09baf8ead2..df8903266592 100644
--- a/java/ql/lib/semmle/code/java/frameworks/camel/CamelJavaDSL.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/camel/CamelJavaDSL.qll
@@ -13,6 +13,8 @@
  *
  * This creates a route to the `TargetBean` class for messages sent to "direct.start".
  */
+overlay[local?]
+module;
 
 import java
 import semmle.code.java.Reflection
diff --git a/java/ql/lib/semmle/code/java/frameworks/gigaspaces/GigaSpaces.qll b/java/ql/lib/semmle/code/java/frameworks/gigaspaces/GigaSpaces.qll
index 2b99e0fcff0b..a03ed1c5266e 100644
--- a/java/ql/lib/semmle/code/java/frameworks/gigaspaces/GigaSpaces.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/gigaspaces/GigaSpaces.qll
@@ -1,6 +1,8 @@
 /**
  * GigaSpaces XAP (eXtreme Application Platform) is a distributed in-memory "datagrid".
  */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/google/GoogleHttpClientApi.qll b/java/ql/lib/semmle/code/java/frameworks/google/GoogleHttpClientApi.qll
index db8bc2574c13..5e0304ca7b2a 100644
--- a/java/ql/lib/semmle/code/java/frameworks/google/GoogleHttpClientApi.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/google/GoogleHttpClientApi.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 import java
 import semmle.code.java.Serializability
 import semmle.code.java.dataflow.DataFlow
diff --git a/java/ql/lib/semmle/code/java/frameworks/google/Gson.qll b/java/ql/lib/semmle/code/java/frameworks/google/Gson.qll
index 9dc38a529415..7185c87b09f2 100644
--- a/java/ql/lib/semmle/code/java/frameworks/google/Gson.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/google/Gson.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes for working with the Gson framework.
  */
+overlay[local?]
+module;
 
 import java
 import semmle.code.java.dataflow.DataFlow
diff --git a/java/ql/lib/semmle/code/java/frameworks/google/GsonSerializability.qll b/java/ql/lib/semmle/code/java/frameworks/google/GsonSerializability.qll
index 6abaee8ff720..bd8973b0adb8 100644
--- a/java/ql/lib/semmle/code/java/frameworks/google/GsonSerializability.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/google/GsonSerializability.qll
@@ -2,6 +2,8 @@
  * Provides classes and predicates for working with Java Serialization in the context of
  * the `com.google.gson` JSON processing framework.
  */
+overlay[local?]
+module;
 
 import java
 private import semmle.code.java.Serializability
diff --git a/java/ql/lib/semmle/code/java/frameworks/guava/Collections.qll b/java/ql/lib/semmle/code/java/frameworks/guava/Collections.qll
index 94dd356f62d7..aebdb22f42ac 100644
--- a/java/ql/lib/semmle/code/java/frameworks/guava/Collections.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/guava/Collections.qll
@@ -1,4 +1,6 @@
 /** Definitions of flow steps through the collection types in the Guava framework */
+overlay[local?]
+module;
 
 import java
 private import semmle.code.java.dataflow.DataFlow
diff --git a/java/ql/lib/semmle/code/java/frameworks/guava/Guava.qll b/java/ql/lib/semmle/code/java/frameworks/guava/Guava.qll
index 5dd8aaa18eeb..545aae763d55 100644
--- a/java/ql/lib/semmle/code/java/frameworks/guava/Guava.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/guava/Guava.qll
@@ -1,6 +1,8 @@
 /**
  * Definitions for tracking taint steps through the Guava framework.
  */
+overlay[local?]
+module;
 
 import java
 import Collections
diff --git a/java/ql/lib/semmle/code/java/frameworks/gwt/GWT.qll b/java/ql/lib/semmle/code/java/frameworks/gwt/GWT.qll
index 6780a9261b9b..a58e49aa76f0 100644
--- a/java/ql/lib/semmle/code/java/frameworks/gwt/GWT.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/gwt/GWT.qll
@@ -1,4 +1,6 @@
 /** Provides classes and predicates for working with the GWT framework. */
+overlay[local?]
+module;
 
 import java
 import GwtXml
diff --git a/java/ql/lib/semmle/code/java/frameworks/gwt/GwtUiBinder.qll b/java/ql/lib/semmle/code/java/frameworks/gwt/GwtUiBinder.qll
index 8532cc81bb30..d692740f40e6 100644
--- a/java/ql/lib/semmle/code/java/frameworks/gwt/GwtUiBinder.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/gwt/GwtUiBinder.qll
@@ -4,6 +4,8 @@
  * The UiBinder framework allows the specification of user interfaces in XML template files. These
  * can then be interacted with programmatically by writing an associated owner class.
  */
+overlay[local?]
+module;
 
 import java
 import GwtUiBinderXml
diff --git a/java/ql/lib/semmle/code/java/frameworks/gwt/GwtUiBinderXml.qll b/java/ql/lib/semmle/code/java/frameworks/gwt/GwtUiBinderXml.qll
index 0fb8ed3cd70d..fef34f1bc44d 100644
--- a/java/ql/lib/semmle/code/java/frameworks/gwt/GwtUiBinderXml.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/gwt/GwtUiBinderXml.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for identifying GWT UiBinder framework XML templates.
  */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/gwt/GwtXml.qll b/java/ql/lib/semmle/code/java/frameworks/gwt/GwtXml.qll
index e143d06cccbc..b36824543005 100644
--- a/java/ql/lib/semmle/code/java/frameworks/gwt/GwtXml.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/gwt/GwtXml.qll
@@ -1,4 +1,6 @@
 /** Provides classes and predicates for working with `*.gwt.xml` files. */
+overlay[local?]
+module;
 
 import semmle.code.xml.XML
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/hudson/Hudson.qll b/java/ql/lib/semmle/code/java/frameworks/hudson/Hudson.qll
index ae316cf649e5..44752f94576b 100644
--- a/java/ql/lib/semmle/code/java/frameworks/hudson/Hudson.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/hudson/Hudson.qll
@@ -1,4 +1,6 @@
 /** Provides classes and predicates related to the Hudson framework. */
+overlay[local?]
+module;
 
 import java
 private import semmle.code.java.dataflow.FlowSources
diff --git a/java/ql/lib/semmle/code/java/frameworks/j2objc/J2ObjC.qll b/java/ql/lib/semmle/code/java/frameworks/j2objc/J2ObjC.qll
index 2e9b04d6a8ce..abb24b909e97 100644
--- a/java/ql/lib/semmle/code/java/frameworks/j2objc/J2ObjC.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/j2objc/J2ObjC.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for working with OCNI (Objective-C Native Interface).
  */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/jOOQ.qll b/java/ql/lib/semmle/code/java/frameworks/jOOQ.qll
index 2aa78e9425da..e5bad7435d58 100644
--- a/java/ql/lib/semmle/code/java/frameworks/jOOQ.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/jOOQ.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for working with the jOOQ framework.
  */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/jackson/JacksonSerializability.qll b/java/ql/lib/semmle/code/java/frameworks/jackson/JacksonSerializability.qll
index 8e1077d8bc01..aa7da753f434 100644
--- a/java/ql/lib/semmle/code/java/frameworks/jackson/JacksonSerializability.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/jackson/JacksonSerializability.qll
@@ -2,6 +2,8 @@
  * Provides classes and predicates for working with Java Serialization in the context of
  * the `com.fasterxml.jackson` JSON processing framework.
  */
+overlay[local?]
+module;
 
 import java
 import semmle.code.java.Serializability
diff --git a/java/ql/lib/semmle/code/java/frameworks/javaee/JavaServerFaces.qll b/java/ql/lib/semmle/code/java/frameworks/javaee/JavaServerFaces.qll
index b4ae1b1c19cb..2f749962e94d 100644
--- a/java/ql/lib/semmle/code/java/frameworks/javaee/JavaServerFaces.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/javaee/JavaServerFaces.qll
@@ -1,4 +1,6 @@
 /** Provides classes and predicates for working with Java Server Faces. */
+overlay[local?]
+module;
 
 import default
 import semmle.code.java.frameworks.javaee.jsf.JSFAnnotations
diff --git a/java/ql/lib/semmle/code/java/frameworks/javaee/Persistence.qll b/java/ql/lib/semmle/code/java/frameworks/javaee/Persistence.qll
index b38cba889e00..b5031d7dff08 100644
--- a/java/ql/lib/semmle/code/java/frameworks/javaee/Persistence.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/javaee/Persistence.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for working with the JavaEE Persistence API.
  */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/javaee/PersistenceXML.qll b/java/ql/lib/semmle/code/java/frameworks/javaee/PersistenceXML.qll
index 7564dafa37e0..e6ada894fc6f 100644
--- a/java/ql/lib/semmle/code/java/frameworks/javaee/PersistenceXML.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/javaee/PersistenceXML.qll
@@ -2,6 +2,8 @@
  * Provides classes and predicates for working with JavaEE
  * persistence configuration XML files (`persistence.xml`).
  */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/javaee/Xml.qll b/java/ql/lib/semmle/code/java/frameworks/javaee/Xml.qll
index c1a0b08d8e7c..222b778ba588 100644
--- a/java/ql/lib/semmle/code/java/frameworks/javaee/Xml.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/javaee/Xml.qll
@@ -1,4 +1,6 @@
 /** Provides definitions related to the `javax.xml` package. */
+overlay[local?]
+module;
 
 import java
 private import semmle.code.java.security.XmlParsers
diff --git a/java/ql/lib/semmle/code/java/frameworks/javaee/ejb/EJB.qll b/java/ql/lib/semmle/code/java/frameworks/javaee/ejb/EJB.qll
index d165370d1391..2b003b3c94e7 100644
--- a/java/ql/lib/semmle/code/java/frameworks/javaee/ejb/EJB.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/javaee/ejb/EJB.qll
@@ -1,4 +1,6 @@
 /** Provides classes and predicates for working with Enterprise Java Beans. */
+overlay[local?]
+module;
 
 import java
 import EJBJarXML
diff --git a/java/ql/lib/semmle/code/java/frameworks/javaee/ejb/EJBJarXML.qll b/java/ql/lib/semmle/code/java/frameworks/javaee/ejb/EJBJarXML.qll
index f44d77d89bd3..dc465ddc4c62 100644
--- a/java/ql/lib/semmle/code/java/frameworks/javaee/ejb/EJBJarXML.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/javaee/ejb/EJBJarXML.qll
@@ -2,6 +2,8 @@
  * Provides classes and predicates for working with
  * EJB deployment descriptor XML files (`ejb-jar.xml`).
  */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/javaee/ejb/EJBRestrictions.qll b/java/ql/lib/semmle/code/java/frameworks/javaee/ejb/EJBRestrictions.qll
index f5a52490768c..2f5a88ba5c81 100644
--- a/java/ql/lib/semmle/code/java/frameworks/javaee/ejb/EJBRestrictions.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/javaee/ejb/EJBRestrictions.qll
@@ -2,6 +2,8 @@
  * Provides classes and predicates for modeling
  * EJB Programming Restrictions (see EJB 3.0 specification, section 21.1.2).
  */
+overlay[local?]
+module;
 
 import java
 import EJB
diff --git a/java/ql/lib/semmle/code/java/frameworks/javaee/jsf/JSFAnnotations.qll b/java/ql/lib/semmle/code/java/frameworks/javaee/jsf/JSFAnnotations.qll
index 1db82875ad94..3338fa840ab0 100644
--- a/java/ql/lib/semmle/code/java/frameworks/javaee/jsf/JSFAnnotations.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/javaee/jsf/JSFAnnotations.qll
@@ -1,4 +1,6 @@
 /** Provides classes and predicates for working with Java Server Faces annotations. */
+overlay[local?]
+module;
 
 import default
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/javaee/jsf/JSFFacesContextXML.qll b/java/ql/lib/semmle/code/java/frameworks/javaee/jsf/JSFFacesContextXML.qll
index 13ed765638d9..060398f648c1 100644
--- a/java/ql/lib/semmle/code/java/frameworks/javaee/jsf/JSFFacesContextXML.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/javaee/jsf/JSFFacesContextXML.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes for JSF "Application Configuration Resources File", usually called `faces-config.xml`.
  */
+overlay[local?]
+module;
 
 import default
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/javaee/jsf/JSFRenderer.qll b/java/ql/lib/semmle/code/java/frameworks/javaee/jsf/JSFRenderer.qll
index 546d3be69833..df646e8a9a2c 100644
--- a/java/ql/lib/semmle/code/java/frameworks/javaee/jsf/JSFRenderer.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/javaee/jsf/JSFRenderer.qll
@@ -1,4 +1,6 @@
 /** Provides classes and predicates for working with JavaServer Faces renderer. */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/javase/Beans.qll b/java/ql/lib/semmle/code/java/frameworks/javase/Beans.qll
index dbdaf6960f31..1aa39c638286 100644
--- a/java/ql/lib/semmle/code/java/frameworks/javase/Beans.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/javase/Beans.qll
@@ -1,4 +1,6 @@
 /** Provides definitions related to the `java.beans` package. */
+overlay[local?]
+module;
 
 import java
 private import semmle.code.java.security.XmlParsers
diff --git a/java/ql/lib/semmle/code/java/frameworks/javase/Http.qll b/java/ql/lib/semmle/code/java/frameworks/javase/Http.qll
index 5f03c0b190fd..addc4a576bdc 100644
--- a/java/ql/lib/semmle/code/java/frameworks/javase/Http.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/javase/Http.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates related to `java.net.http.*`.
  */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/javase/WebSocket.qll b/java/ql/lib/semmle/code/java/frameworks/javase/WebSocket.qll
index 17d3d4579d2a..2ea26630619b 100644
--- a/java/ql/lib/semmle/code/java/frameworks/javase/WebSocket.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/javase/WebSocket.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes for identifying methods called by the Java SE WebSocket package.
  */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/kotlin/IO.qll b/java/ql/lib/semmle/code/java/frameworks/kotlin/IO.qll
index 38af34bc6900..1c8181206f54 100644
--- a/java/ql/lib/semmle/code/java/frameworks/kotlin/IO.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/kotlin/IO.qll
@@ -1,4 +1,6 @@
 /** Provides classes and predicates related to `kotlin.io`. */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/kotlin/Kotlin.qll b/java/ql/lib/semmle/code/java/frameworks/kotlin/Kotlin.qll
index 206996af321d..3f4d0e04c691 100644
--- a/java/ql/lib/semmle/code/java/frameworks/kotlin/Kotlin.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/kotlin/Kotlin.qll
@@ -1,4 +1,6 @@
 /** Provides classes and predicates related to `kotlin`. */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/kotlin/Serialization.qll b/java/ql/lib/semmle/code/java/frameworks/kotlin/Serialization.qll
index c0269266a59e..1dc22be1a8b9 100644
--- a/java/ql/lib/semmle/code/java/frameworks/kotlin/Serialization.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/kotlin/Serialization.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for working with the `kotlinx.serialization` plugin.
  */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/kotlin/Text.qll b/java/ql/lib/semmle/code/java/frameworks/kotlin/Text.qll
index 8521b2847848..1b576251f873 100644
--- a/java/ql/lib/semmle/code/java/frameworks/kotlin/Text.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/kotlin/Text.qll
@@ -1,4 +1,6 @@
 /** Provides classes and predicates related to `kotlin.text`. */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/mdht/MdhtXml.qll b/java/ql/lib/semmle/code/java/frameworks/mdht/MdhtXml.qll
index b762fbcc8639..dc5ea6809948 100644
--- a/java/ql/lib/semmle/code/java/frameworks/mdht/MdhtXml.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/mdht/MdhtXml.qll
@@ -1,4 +1,6 @@
 /** Provides definitions related to XML parsing in Model-Driven Health Tools. */
+overlay[local?]
+module;
 
 import java
 private import semmle.code.java.security.XmlParsers
diff --git a/java/ql/lib/semmle/code/java/frameworks/owasp/Esapi.qll b/java/ql/lib/semmle/code/java/frameworks/owasp/Esapi.qll
index 19cabda7073f..fe95cd0d39d3 100644
--- a/java/ql/lib/semmle/code/java/frameworks/owasp/Esapi.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/owasp/Esapi.qll
@@ -1,4 +1,6 @@
 /** Classes and predicates for reasoning about the `owasp.easpi` package. */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/play/Play.qll b/java/ql/lib/semmle/code/java/frameworks/play/Play.qll
index 7b99b23704e3..bbf6385fc0ad 100644
--- a/java/ql/lib/semmle/code/java/frameworks/play/Play.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/play/Play.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for working with the Play framework.
  */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/ratpack/RatpackExec.qll b/java/ql/lib/semmle/code/java/frameworks/ratpack/RatpackExec.qll
index 7efa72c3164a..f8259e95a2ee 100644
--- a/java/ql/lib/semmle/code/java/frameworks/ratpack/RatpackExec.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/ratpack/RatpackExec.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates related to `ratpack.exec.*`.
  */
+overlay[local?]
+module;
 
 import java
 private import semmle.code.java.dataflow.DataFlow
diff --git a/java/ql/lib/semmle/code/java/frameworks/rundeck/RundeckXml.qll b/java/ql/lib/semmle/code/java/frameworks/rundeck/RundeckXml.qll
index 0f271e073e6e..78e7fbf30a9b 100644
--- a/java/ql/lib/semmle/code/java/frameworks/rundeck/RundeckXml.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/rundeck/RundeckXml.qll
@@ -1,4 +1,6 @@
 /** Provides definitions related to XML parsing in Rundeck. */
+overlay[local?]
+module;
 
 import java
 private import semmle.code.java.security.XmlParsers
diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/Spring.qll b/java/ql/lib/semmle/code/java/frameworks/spring/Spring.qll
index 2b09288610e4..1c9c67838d48 100644
--- a/java/ql/lib/semmle/code/java/frameworks/spring/Spring.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/spring/Spring.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 import java
 import semmle.code.java.frameworks.spring.SpringAbstractRef
 import semmle.code.java.frameworks.spring.SpringAlias
diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringAbstractRef.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringAbstractRef.qll
index 4dd4b0ab9478..23ea64bd898e 100644
--- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringAbstractRef.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringAbstractRef.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 import java
 import semmle.code.java.frameworks.spring.SpringXMLElement
 import semmle.code.java.frameworks.spring.SpringBean
diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringAlias.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringAlias.qll
index cbc4f025dacd..aab0bba6be2b 100644
--- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringAlias.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringAlias.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 import java
 import semmle.code.java.frameworks.spring.SpringXMLElement
 import semmle.code.java.frameworks.spring.SpringBean
diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringArgType.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringArgType.qll
index bddf5f01f9ea..37a162cc8901 100644
--- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringArgType.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringArgType.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 import java
 import semmle.code.java.frameworks.spring.SpringXMLElement
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringAttribute.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringAttribute.qll
index a20eef4d0d75..d99a28c56181 100644
--- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringAttribute.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringAttribute.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 import java
 import semmle.code.java.frameworks.spring.SpringXMLElement
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringAutowire.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringAutowire.qll
index 966db95afce6..e758811b368e 100644
--- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringAutowire.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringAutowire.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for identifying methods and constructors called by Spring injection.
  */
+overlay[local?]
+module;
 
 import java
 import SpringComponentScan
diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringBean.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringBean.qll
index a53cbf67090f..ec06e9f28905 100644
--- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringBean.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringBean.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 import java
 import semmle.code.java.frameworks.spring.SpringXMLElement
 import semmle.code.java.frameworks.spring.SpringBeanRefType
diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringBeanFile.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringBeanFile.qll
index d96f264b91f5..810182d8f1f0 100644
--- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringBeanFile.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringBeanFile.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 import java
 import semmle.code.java.frameworks.spring.SpringBean
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringBeanRefType.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringBeanRefType.qll
index 4d85a56ab2bf..490fe3e05610 100644
--- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringBeanRefType.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringBeanRefType.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 import java
 import semmle.code.java.frameworks.spring.SpringBean
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringBoot.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringBoot.qll
index d77e4549e4e7..155afd41ba5e 100644
--- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringBoot.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringBoot.qll
@@ -2,6 +2,8 @@
  * Provides classes for working with Spring classes and interfaces from
  * `org.springframework.boot.*`.
  */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringCamel.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringCamel.qll
index 6fec620ccd55..28108865af41 100644
--- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringCamel.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringCamel.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for identifying Spring integration for the Apache Camel messaging framework.
  */
+overlay[local?]
+module;
 
 import java
 import semmle.code.java.frameworks.spring.SpringXMLElement
diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringComponentScan.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringComponentScan.qll
index d285e9d0e6a5..b5b3e9834c05 100644
--- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringComponentScan.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringComponentScan.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 import java
 import semmle.code.java.frameworks.spring.SpringAutowire
 import semmle.code.java.frameworks.spring.SpringXMLElement
diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringConstructorArg.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringConstructorArg.qll
index e434e53ca3dd..3f0cc6a25af2 100644
--- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringConstructorArg.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringConstructorArg.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 import java
 import semmle.code.java.frameworks.spring.SpringXMLElement
 import semmle.code.java.frameworks.spring.SpringBean
diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringController.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringController.qll
index c93993336d95..ee00433da129 100644
--- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringController.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringController.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 import java
 import semmle.code.java.Maps
 import SpringWeb
diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringDescription.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringDescription.qll
index 34cf13a95716..5bcc2e896eb1 100644
--- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringDescription.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringDescription.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 import java
 import semmle.code.java.frameworks.spring.SpringXMLElement
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringEntry.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringEntry.qll
index e2ce38ea44e0..a568a6ee8c77 100644
--- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringEntry.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringEntry.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 import java
 import semmle.code.java.frameworks.spring.SpringXMLElement
 import semmle.code.java.frameworks.spring.SpringBean
diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringExpression.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringExpression.qll
index 49ec6e1fd8a5..aa02643d698e 100644
--- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringExpression.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringExpression.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes for working with the Spring Expression Language (SpEL).
  */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringFlex.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringFlex.qll
index af0afa91f4c3..a7b1b655693b 100644
--- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringFlex.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringFlex.qll
@@ -2,6 +2,8 @@
  * Provides classes and predicates for the Spring BlazeDS integration. BlazeDS allows Java applications to integrate with
  * Apache Flex applications, which are ultimately deployed as Adobe Flash applications.
  */
+overlay[local?]
+module;
 
 import java
 import semmle.code.java.frameworks.spring.SpringBean
diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringHttp.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringHttp.qll
index e12e2b2643a0..5f9271c01490 100644
--- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringHttp.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringHttp.qll
@@ -2,6 +2,8 @@
  * Provides classes for working with Spring classes and interfaces from
  * `org.springframework.http`.
  */
+overlay[local?]
+module;
 
 import java
 private import semmle.code.java.dataflow.DataFlow
diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringIdRef.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringIdRef.qll
index 0b8b3e3a87b4..6dc2b313841a 100644
--- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringIdRef.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringIdRef.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 import java
 import semmle.code.java.frameworks.spring.SpringAbstractRef
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringImport.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringImport.qll
index 688a14da32e2..1081b157d224 100644
--- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringImport.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringImport.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 import java
 import semmle.code.java.frameworks.spring.SpringXMLElement
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringInitializingBean.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringInitializingBean.qll
index 216333da38ae..2766df0b8bc9 100644
--- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringInitializingBean.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringInitializingBean.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 import java
 
 /**
diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringKey.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringKey.qll
index 5f07b2277067..b48834dc738e 100644
--- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringKey.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringKey.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 import java
 import semmle.code.java.frameworks.spring.SpringXMLElement
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringList.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringList.qll
index 455fb956eb19..7e9b3423f888 100644
--- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringList.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringList.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 import java
 import semmle.code.java.frameworks.spring.SpringListOrSet
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringListOrSet.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringListOrSet.qll
index 521795d8b221..075cf7b7d8b4 100644
--- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringListOrSet.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringListOrSet.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 import java
 import semmle.code.java.frameworks.spring.SpringMergable
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringLookupMethod.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringLookupMethod.qll
index 4b17c23612a6..7371991cdaa6 100644
--- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringLookupMethod.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringLookupMethod.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 import java
 import semmle.code.java.frameworks.spring.SpringXMLElement
 import semmle.code.java.frameworks.spring.SpringBean
diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringMap.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringMap.qll
index 19b2cfffdac7..a5766d7c7111 100644
--- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringMap.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringMap.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 import java
 import semmle.code.java.frameworks.spring.SpringMergable
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringMergable.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringMergable.qll
index baef7d3b91af..94402918b8ee 100644
--- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringMergable.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringMergable.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 import java
 import semmle.code.java.frameworks.spring.SpringXMLElement
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringMeta.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringMeta.qll
index 640305b313a2..d4a524c3502f 100644
--- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringMeta.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringMeta.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 import java
 import semmle.code.java.frameworks.spring.SpringXMLElement
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringNull.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringNull.qll
index c3f2c00a2b72..f08746dae5a3 100644
--- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringNull.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringNull.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 import java
 import semmle.code.java.frameworks.spring.SpringXMLElement
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringProfile.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringProfile.qll
index 48a2b3679901..2d8a4577e567 100644
--- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringProfile.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringProfile.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 import java
 import semmle.code.java.frameworks.spring.SpringComponentScan
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringProp.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringProp.qll
index 771370a3e7a1..96da7fa271c5 100644
--- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringProp.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringProp.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 import java
 import semmle.code.java.frameworks.spring.SpringXMLElement
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringProperty.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringProperty.qll
index a83eeed13fab..aec85de58d4e 100644
--- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringProperty.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringProperty.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 import java
 import semmle.code.java.frameworks.spring.SpringXMLElement
 import semmle.code.java.frameworks.spring.SpringBean
diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringProps.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringProps.qll
index 59a094f67612..00e7e8e52536 100644
--- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringProps.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringProps.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 import java
 import semmle.code.java.frameworks.spring.SpringMergable
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringQualifier.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringQualifier.qll
index eb57b37efe0a..ad927f48cbbc 100644
--- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringQualifier.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringQualifier.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 import java
 import semmle.code.java.frameworks.spring.SpringXMLElement
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringRef.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringRef.qll
index 89d58ff47fcd..8b799d632c23 100644
--- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringRef.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringRef.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 import java
 import semmle.code.java.frameworks.spring.SpringAbstractRef
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringReplacedMethod.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringReplacedMethod.qll
index 47e8d182898a..cf32c940f864 100644
--- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringReplacedMethod.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringReplacedMethod.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 import java
 import semmle.code.java.frameworks.spring.SpringXMLElement
 import semmle.code.java.frameworks.spring.SpringBean
diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringSecurity.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringSecurity.qll
index 835b679d50a6..694dae05773a 100644
--- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringSecurity.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringSecurity.qll
@@ -2,6 +2,8 @@
  * Provides classes for working with Spring classes and interfaces from
  * `org.springframework.security.*`.
  */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringSet.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringSet.qll
index 21aca5ff54eb..4f75d08401b7 100644
--- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringSet.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringSet.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 import java
 import semmle.code.java.frameworks.spring.SpringListOrSet
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringValue.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringValue.qll
index 55854d60f9c7..68cdfa7efcc2 100644
--- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringValue.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringValue.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 import java
 import semmle.code.java.frameworks.spring.SpringXMLElement
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringWeb.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringWeb.qll
index 88db87e7e21e..362d4b323648 100644
--- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringWeb.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringWeb.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes for working with Spring web requests.
  */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringWebClient.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringWebClient.qll
index e84108394704..0580415a3448 100644
--- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringWebClient.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringWebClient.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes for working with Spring web clients.
  */
+overlay[local?]
+module;
 
 import java
 import SpringHttp
diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/SpringXMLElement.qll b/java/ql/lib/semmle/code/java/frameworks/spring/SpringXMLElement.qll
index 312cd659b398..21bea51cd223 100644
--- a/java/ql/lib/semmle/code/java/frameworks/spring/SpringXMLElement.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/spring/SpringXMLElement.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 import java
 import semmle.code.java.frameworks.spring.SpringBeanFile
 import semmle.code.java.frameworks.spring.SpringBean
diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/metrics/MetricSpringBean.qll b/java/ql/lib/semmle/code/java/frameworks/spring/metrics/MetricSpringBean.qll
index ffbc5c9e5ecc..7624d4665719 100644
--- a/java/ql/lib/semmle/code/java/frameworks/spring/metrics/MetricSpringBean.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/spring/metrics/MetricSpringBean.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 import semmle.code.java.frameworks.spring.SpringBean
 import semmle.code.java.frameworks.spring.SpringBeanFile
 import semmle.code.java.frameworks.spring.SpringEntry
diff --git a/java/ql/lib/semmle/code/java/frameworks/spring/metrics/MetricSpringBeanFile.qll b/java/ql/lib/semmle/code/java/frameworks/spring/metrics/MetricSpringBeanFile.qll
index 999e34d1cea3..45d432848838 100644
--- a/java/ql/lib/semmle/code/java/frameworks/spring/metrics/MetricSpringBeanFile.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/spring/metrics/MetricSpringBeanFile.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 import semmle.code.java.frameworks.spring.SpringBean
 import semmle.code.java.frameworks.spring.SpringBeanFile
 import semmle.code.java.frameworks.spring.metrics.MetricSpringBean
diff --git a/java/ql/lib/semmle/code/java/frameworks/stapler/Stapler.qll b/java/ql/lib/semmle/code/java/frameworks/stapler/Stapler.qll
index 599a08094dd4..28ca95b55413 100644
--- a/java/ql/lib/semmle/code/java/frameworks/stapler/Stapler.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/stapler/Stapler.qll
@@ -1,4 +1,6 @@
 /** Provides classes and predicates related to the Stapler framework. */
+overlay[local?]
+module;
 
 import java
 private import semmle.code.java.dataflow.DataFlow
diff --git a/java/ql/lib/semmle/code/java/frameworks/struts/Struts2Serializability.qll b/java/ql/lib/semmle/code/java/frameworks/struts/Struts2Serializability.qll
index cb8b876be7ad..f9981a30393e 100644
--- a/java/ql/lib/semmle/code/java/frameworks/struts/Struts2Serializability.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/struts/Struts2Serializability.qll
@@ -2,6 +2,8 @@
  * Provides classes and predicates for working with objects bound from Http requests in the context of
  * the Struts2 web framework.
  */
+overlay[local?]
+module;
 
 import java
 private import semmle.code.java.Serializability
diff --git a/java/ql/lib/semmle/code/java/frameworks/struts/StrutsActions.qll b/java/ql/lib/semmle/code/java/frameworks/struts/StrutsActions.qll
index 4200e83d4db2..6c5799d02750 100644
--- a/java/ql/lib/semmle/code/java/frameworks/struts/StrutsActions.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/struts/StrutsActions.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 import java
 import semmle.code.java.frameworks.struts.StrutsConventions
 import semmle.code.java.frameworks.struts.StrutsXML
diff --git a/java/ql/lib/semmle/code/java/frameworks/struts/StrutsAnnotations.qll b/java/ql/lib/semmle/code/java/frameworks/struts/StrutsAnnotations.qll
index d97415354b35..823951b1d3c5 100644
--- a/java/ql/lib/semmle/code/java/frameworks/struts/StrutsAnnotations.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/struts/StrutsAnnotations.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 import java
 
 /**
diff --git a/java/ql/lib/semmle/code/java/frameworks/struts/StrutsConventions.qll b/java/ql/lib/semmle/code/java/frameworks/struts/StrutsConventions.qll
index 17ff35371945..3e2fd5c0b974 100644
--- a/java/ql/lib/semmle/code/java/frameworks/struts/StrutsConventions.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/struts/StrutsConventions.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 import java
 import semmle.code.java.frameworks.struts.StrutsAnnotations
 import semmle.code.java.frameworks.struts.StrutsXML
diff --git a/java/ql/lib/semmle/code/java/frameworks/struts/StrutsXML.qll b/java/ql/lib/semmle/code/java/frameworks/struts/StrutsXML.qll
index 273034978d17..33131a1641da 100644
--- a/java/ql/lib/semmle/code/java/frameworks/struts/StrutsXML.qll
+++ b/java/ql/lib/semmle/code/java/frameworks/struts/StrutsXML.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 import java
 
 /**
diff --git a/java/ql/lib/semmle/code/java/metrics/MetricCallable.qll b/java/ql/lib/semmle/code/java/metrics/MetricCallable.qll
index d3dca781e54b..e6fa5d9e5c26 100644
--- a/java/ql/lib/semmle/code/java/metrics/MetricCallable.qll
+++ b/java/ql/lib/semmle/code/java/metrics/MetricCallable.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for computing metrics on Java methods and constructors.
  */
+overlay[local?]
+module;
 
 import semmle.code.java.Member
 
diff --git a/java/ql/lib/semmle/code/java/metrics/MetricElement.qll b/java/ql/lib/semmle/code/java/metrics/MetricElement.qll
index 086389e143cd..f9d57df7f800 100644
--- a/java/ql/lib/semmle/code/java/metrics/MetricElement.qll
+++ b/java/ql/lib/semmle/code/java/metrics/MetricElement.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for computing metrics on Java elements.
  */
+overlay[local?]
+module;
 
 import semmle.code.java.Element
 import semmle.code.java.Type
diff --git a/java/ql/lib/semmle/code/java/metrics/MetricField.qll b/java/ql/lib/semmle/code/java/metrics/MetricField.qll
index ef8e692ba5f8..32e3b263c282 100644
--- a/java/ql/lib/semmle/code/java/metrics/MetricField.qll
+++ b/java/ql/lib/semmle/code/java/metrics/MetricField.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for computing metrics on Java fields.
  */
+overlay[local?]
+module;
 
 import semmle.code.java.Member
 
diff --git a/java/ql/lib/semmle/code/java/metrics/MetricPackage.qll b/java/ql/lib/semmle/code/java/metrics/MetricPackage.qll
index eafdd57dd8ac..fa7556316429 100644
--- a/java/ql/lib/semmle/code/java/metrics/MetricPackage.qll
+++ b/java/ql/lib/semmle/code/java/metrics/MetricPackage.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for computing metrics on Java packages.
  */
+overlay[local?]
+module;
 
 import semmle.code.java.Package
 import MetricElement
diff --git a/java/ql/lib/semmle/code/java/metrics/MetricRefType.qll b/java/ql/lib/semmle/code/java/metrics/MetricRefType.qll
index 17271394b2e6..1652a1200708 100644
--- a/java/ql/lib/semmle/code/java/metrics/MetricRefType.qll
+++ b/java/ql/lib/semmle/code/java/metrics/MetricRefType.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for computing metrics on Java classes and interfaces.
  */
+overlay[local?]
+module;
 
 import semmle.code.java.Type
 import MetricElement
diff --git a/java/ql/lib/semmle/code/java/metrics/MetricStmt.qll b/java/ql/lib/semmle/code/java/metrics/MetricStmt.qll
index b818c30edf6f..bc2cf5ae1072 100644
--- a/java/ql/lib/semmle/code/java/metrics/MetricStmt.qll
+++ b/java/ql/lib/semmle/code/java/metrics/MetricStmt.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for computing metrics on Java statements.
  */
+overlay[local?]
+module;
 
 import semmle.code.java.Statement
 
diff --git a/java/ql/lib/semmle/code/java/os/OSCheck.qll b/java/ql/lib/semmle/code/java/os/OSCheck.qll
index e3b3e56f72ce..97ad27c83dfb 100644
--- a/java/ql/lib/semmle/code/java/os/OSCheck.qll
+++ b/java/ql/lib/semmle/code/java/os/OSCheck.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for guards that check for the current OS.
  */
+overlay[local?]
+module;
 
 import java
 import semmle.code.java.controlflow.Guards
diff --git a/java/ql/lib/semmle/code/java/regex/RegexFlowConfigs.qll b/java/ql/lib/semmle/code/java/regex/RegexFlowConfigs.qll
index 763b96f5a02d..6a934bdd5785 100644
--- a/java/ql/lib/semmle/code/java/regex/RegexFlowConfigs.qll
+++ b/java/ql/lib/semmle/code/java/regex/RegexFlowConfigs.qll
@@ -1,6 +1,8 @@
 /**
  * Defines configurations and steps for handling regexes
  */
+overlay[local?]
+module;
 
 import java
 import semmle.code.java.dataflow.ExternalFlow
diff --git a/java/ql/lib/semmle/code/java/regex/RegexTreeView.qll b/java/ql/lib/semmle/code/java/regex/RegexTreeView.qll
index a07d7c741faa..0fe4b47ec485 100644
--- a/java/ql/lib/semmle/code/java/regex/RegexTreeView.qll
+++ b/java/ql/lib/semmle/code/java/regex/RegexTreeView.qll
@@ -1,4 +1,6 @@
 /** Provides a class hierarchy corresponding to a parse tree of regular expressions. */
+overlay[local?]
+module;
 
 private import semmle.code.java.regex.regex as RE // importing under a namescape to avoid naming conflict for `Top`.
 private import codeql.regex.nfa.NfaUtils as NfaUtils
diff --git a/java/ql/lib/semmle/code/java/regex/regex.qll b/java/ql/lib/semmle/code/java/regex/regex.qll
index f0336c2d0235..13f398699663 100644
--- a/java/ql/lib/semmle/code/java/regex/regex.qll
+++ b/java/ql/lib/semmle/code/java/regex/regex.qll
@@ -1,6 +1,8 @@
 /**
  * Definitions for parsing regular expressions.
  */
+overlay[local?]
+module;
 
 import java
 private import RegexFlowConfigs
diff --git a/java/ql/lib/semmle/code/java/security/AndroidIntentRedirection.qll b/java/ql/lib/semmle/code/java/security/AndroidIntentRedirection.qll
index 56c45611b142..08a86092afbb 100644
--- a/java/ql/lib/semmle/code/java/security/AndroidIntentRedirection.qll
+++ b/java/ql/lib/semmle/code/java/security/AndroidIntentRedirection.qll
@@ -1,4 +1,6 @@
 /** Provides classes to reason about Android Intent redirect vulnerabilities. */
+overlay[local?]
+module;
 
 import java
 private import semmle.code.java.controlflow.Guards
diff --git a/java/ql/lib/semmle/code/java/security/AndroidLocalAuthQuery.qll b/java/ql/lib/semmle/code/java/security/AndroidLocalAuthQuery.qll
index 4a31dc2568d1..aaa7dbc562b8 100644
--- a/java/ql/lib/semmle/code/java/security/AndroidLocalAuthQuery.qll
+++ b/java/ql/lib/semmle/code/java/security/AndroidLocalAuthQuery.qll
@@ -1,4 +1,6 @@
 /** Definitions for the insecure local authentication query. */
+overlay[local?]
+module;
 
 import java
 private import semmle.code.java.dataflow.DataFlow
diff --git a/java/ql/lib/semmle/code/java/security/AndroidWebViewCertificateValidationQuery.qll b/java/ql/lib/semmle/code/java/security/AndroidWebViewCertificateValidationQuery.qll
index 8d53766e0080..728eca0eaf10 100644
--- a/java/ql/lib/semmle/code/java/security/AndroidWebViewCertificateValidationQuery.qll
+++ b/java/ql/lib/semmle/code/java/security/AndroidWebViewCertificateValidationQuery.qll
@@ -1,4 +1,6 @@
 /** Definitions for the web view certificate validation query */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/security/ArbitraryApkInstallation.qll b/java/ql/lib/semmle/code/java/security/ArbitraryApkInstallation.qll
index 0402aca69872..8600ecda7ad1 100644
--- a/java/ql/lib/semmle/code/java/security/ArbitraryApkInstallation.qll
+++ b/java/ql/lib/semmle/code/java/security/ArbitraryApkInstallation.qll
@@ -1,4 +1,6 @@
 /** Provide classes to reason about Android Intents that can install APKs. */
+overlay[local?]
+module;
 
 import java
 import semmle.code.java.frameworks.android.Intent
diff --git a/java/ql/lib/semmle/code/java/security/ArithmeticCommon.qll b/java/ql/lib/semmle/code/java/security/ArithmeticCommon.qll
index 785dce3da7ed..5a8b5e975085 100644
--- a/java/ql/lib/semmle/code/java/security/ArithmeticCommon.qll
+++ b/java/ql/lib/semmle/code/java/security/ArithmeticCommon.qll
@@ -1,4 +1,6 @@
 /** Provides guards and predicates to reason about arithmetic. */
+overlay[local?]
+module;
 
 import semmle.code.java.arithmetic.Overflow
 import semmle.code.java.controlflow.Guards
diff --git a/java/ql/lib/semmle/code/java/security/CommandArguments.qll b/java/ql/lib/semmle/code/java/security/CommandArguments.qll
index eb4f589ac7f7..f161a83d17b0 100644
--- a/java/ql/lib/semmle/code/java/security/CommandArguments.qll
+++ b/java/ql/lib/semmle/code/java/security/CommandArguments.qll
@@ -1,6 +1,8 @@
 /**
  * Definitions for reasoning about lists and arrays that are to be used as arguments to an external process.
  */
+overlay[local?]
+module;
 
 import java
 import semmle.code.java.dataflow.SSA
diff --git a/java/ql/lib/semmle/code/java/security/ControlledString.qll b/java/ql/lib/semmle/code/java/security/ControlledString.qll
index c760bf14e855..fa201b2e8b6f 100644
--- a/java/ql/lib/semmle/code/java/security/ControlledString.qll
+++ b/java/ql/lib/semmle/code/java/security/ControlledString.qll
@@ -3,6 +3,8 @@
  * There is positive evidence that they are fully controlled by
  * the program source code.
  */
+overlay[local?]
+module;
 
 import semmle.code.java.Expr
 import semmle.code.java.security.Validation
diff --git a/java/ql/lib/semmle/code/java/security/Cookies.qll b/java/ql/lib/semmle/code/java/security/Cookies.qll
index 202f18921ca6..b4db1b8fe467 100644
--- a/java/ql/lib/semmle/code/java/security/Cookies.qll
+++ b/java/ql/lib/semmle/code/java/security/Cookies.qll
@@ -1,4 +1,6 @@
 /** Provides definitions to reason about HTTP cookies. */
+overlay[local?]
+module;
 
 import java
 private import semmle.code.java.frameworks.Netty
diff --git a/java/ql/lib/semmle/code/java/security/Encryption.qll b/java/ql/lib/semmle/code/java/security/Encryption.qll
index ee8c1f5fbedc..b948a94962c7 100644
--- a/java/ql/lib/semmle/code/java/security/Encryption.qll
+++ b/java/ql/lib/semmle/code/java/security/Encryption.qll
@@ -1,6 +1,8 @@
 /**
  * Provides predicates and classes relating to encryption in Java.
  */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/security/ExternalAPIs.qll b/java/ql/lib/semmle/code/java/security/ExternalAPIs.qll
index 360493e26356..809f45aa45a3 100644
--- a/java/ql/lib/semmle/code/java/security/ExternalAPIs.qll
+++ b/java/ql/lib/semmle/code/java/security/ExternalAPIs.qll
@@ -2,6 +2,8 @@
  * Definitions for reasoning about untrusted data used in APIs defined outside the
  * database.
  */
+overlay[local?]
+module;
 
 import java
 import semmle.code.java.dataflow.FlowSources
diff --git a/java/ql/lib/semmle/code/java/security/ExternalProcess.qll b/java/ql/lib/semmle/code/java/security/ExternalProcess.qll
index 58f7457e9e30..600a45e509a0 100644
--- a/java/ql/lib/semmle/code/java/security/ExternalProcess.qll
+++ b/java/ql/lib/semmle/code/java/security/ExternalProcess.qll
@@ -1,4 +1,6 @@
 /** Definitions related to external processes. */
+overlay[local?]
+module;
 
 import semmle.code.java.Member
 private import semmle.code.java.dataflow.DataFlow
diff --git a/java/ql/lib/semmle/code/java/security/FileReadWrite.qll b/java/ql/lib/semmle/code/java/security/FileReadWrite.qll
index 34d7ca1f2014..ae1b3f025a1a 100644
--- a/java/ql/lib/semmle/code/java/security/FileReadWrite.qll
+++ b/java/ql/lib/semmle/code/java/security/FileReadWrite.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 import java
 
 /**
diff --git a/java/ql/lib/semmle/code/java/security/FileWritable.qll b/java/ql/lib/semmle/code/java/security/FileWritable.qll
index bb5d952802d1..d1833bf64d4d 100644
--- a/java/ql/lib/semmle/code/java/security/FileWritable.qll
+++ b/java/ql/lib/semmle/code/java/security/FileWritable.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 import java
 
 /**
diff --git a/java/ql/lib/semmle/code/java/security/FragmentInjection.qll b/java/ql/lib/semmle/code/java/security/FragmentInjection.qll
index a22fad4d85e7..8cd5e32a5ecd 100644
--- a/java/ql/lib/semmle/code/java/security/FragmentInjection.qll
+++ b/java/ql/lib/semmle/code/java/security/FragmentInjection.qll
@@ -1,4 +1,6 @@
 /** Provides classes and predicates to reason about Android Fragment injection vulnerabilities. */
+overlay[local?]
+module;
 
 import java
 private import semmle.code.java.dataflow.TaintTracking
diff --git a/java/ql/lib/semmle/code/java/security/GroovyInjection.qll b/java/ql/lib/semmle/code/java/security/GroovyInjection.qll
index ea688a26f6ec..45d664897775 100644
--- a/java/ql/lib/semmle/code/java/security/GroovyInjection.qll
+++ b/java/ql/lib/semmle/code/java/security/GroovyInjection.qll
@@ -1,4 +1,6 @@
 /** Provides classes to reason about Groovy code injection attacks. */
+overlay[local?]
+module;
 
 private import semmle.code.java.dataflow.DataFlow
 private import semmle.code.java.dataflow.ExternalFlow
diff --git a/java/ql/lib/semmle/code/java/security/HardcodedCredentials.qll b/java/ql/lib/semmle/code/java/security/HardcodedCredentials.qll
index 0b373fa27f80..f7e0b9954858 100644
--- a/java/ql/lib/semmle/code/java/security/HardcodedCredentials.qll
+++ b/java/ql/lib/semmle/code/java/security/HardcodedCredentials.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates relating to hardcoded credentials.
  */
+overlay[local?]
+module;
 
 import java
 import SensitiveApi
diff --git a/java/ql/lib/semmle/code/java/security/HardcodedCredentialsComparison.qll b/java/ql/lib/semmle/code/java/security/HardcodedCredentialsComparison.qll
index d15d9d05d301..c6ad9458ba91 100644
--- a/java/ql/lib/semmle/code/java/security/HardcodedCredentialsComparison.qll
+++ b/java/ql/lib/semmle/code/java/security/HardcodedCredentialsComparison.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates to detect comparing a parameter to a hard-coded credential.
  */
+overlay[local?]
+module;
 
 import java
 import HardcodedCredentials
diff --git a/java/ql/lib/semmle/code/java/security/HardcodedPasswordField.qll b/java/ql/lib/semmle/code/java/security/HardcodedPasswordField.qll
index 995428b8e94f..03b3f7500809 100644
--- a/java/ql/lib/semmle/code/java/security/HardcodedPasswordField.qll
+++ b/java/ql/lib/semmle/code/java/security/HardcodedPasswordField.qll
@@ -1,6 +1,8 @@
 /**
  * Provides a predicate identifying assignments of harcoded values to password fields.
  */
+overlay[local?]
+module;
 
 import java
 import HardcodedCredentials
diff --git a/java/ql/lib/semmle/code/java/security/HttpsUrls.qll b/java/ql/lib/semmle/code/java/security/HttpsUrls.qll
index b56b8ba9c9f5..071f95b49902 100644
--- a/java/ql/lib/semmle/code/java/security/HttpsUrls.qll
+++ b/java/ql/lib/semmle/code/java/security/HttpsUrls.qll
@@ -1,4 +1,6 @@
 /** Provides classes and predicates to reason about plaintext HTTP vulnerabilities. */
+overlay[local?]
+module;
 
 import java
 private import semmle.code.java.dataflow.DataFlow
diff --git a/java/ql/lib/semmle/code/java/security/ImplicitPendingIntents.qll b/java/ql/lib/semmle/code/java/security/ImplicitPendingIntents.qll
index 650527e88e45..94951c10c532 100644
--- a/java/ql/lib/semmle/code/java/security/ImplicitPendingIntents.qll
+++ b/java/ql/lib/semmle/code/java/security/ImplicitPendingIntents.qll
@@ -1,4 +1,6 @@
 /** Provides classes and predicates for working with implicit `PendingIntent`s. */
+overlay[local?]
+module;
 
 import java
 private import semmle.code.java.dataflow.ExternalFlow
diff --git a/java/ql/lib/semmle/code/java/security/ImplicitPendingIntentsQuery.qll b/java/ql/lib/semmle/code/java/security/ImplicitPendingIntentsQuery.qll
index a57f643d8176..f66309c97bec 100644
--- a/java/ql/lib/semmle/code/java/security/ImplicitPendingIntentsQuery.qll
+++ b/java/ql/lib/semmle/code/java/security/ImplicitPendingIntentsQuery.qll
@@ -1,4 +1,6 @@
 /** Provides taint tracking configurations to be used in queries related to implicit `PendingIntent`s. */
+overlay[local?]
+module;
 
 import java
 import semmle.code.java.dataflow.TaintTracking
diff --git a/java/ql/lib/semmle/code/java/security/ImplicitlyExportedAndroidComponent.qll b/java/ql/lib/semmle/code/java/security/ImplicitlyExportedAndroidComponent.qll
index 4aa21c4a260b..11cfcb1c6e57 100644
--- a/java/ql/lib/semmle/code/java/security/ImplicitlyExportedAndroidComponent.qll
+++ b/java/ql/lib/semmle/code/java/security/ImplicitlyExportedAndroidComponent.qll
@@ -1,4 +1,6 @@
 /** Provides a class to identify implicitly exported Android components. */
+overlay[local?]
+module;
 
 private import semmle.code.xml.AndroidManifest
 
diff --git a/java/ql/lib/semmle/code/java/security/InformationLeak.qll b/java/ql/lib/semmle/code/java/security/InformationLeak.qll
index 8fe7d2151650..ba7a7a52a707 100644
--- a/java/ql/lib/semmle/code/java/security/InformationLeak.qll
+++ b/java/ql/lib/semmle/code/java/security/InformationLeak.qll
@@ -1,4 +1,6 @@
 /** Provides classes to reason about System Information Leak vulnerabilities. */
+overlay[local?]
+module;
 
 import java
 import semmle.code.java.dataflow.DataFlow
diff --git a/java/ql/lib/semmle/code/java/security/InsecureBasicAuth.qll b/java/ql/lib/semmle/code/java/security/InsecureBasicAuth.qll
index b21492406adf..9d26077396bf 100644
--- a/java/ql/lib/semmle/code/java/security/InsecureBasicAuth.qll
+++ b/java/ql/lib/semmle/code/java/security/InsecureBasicAuth.qll
@@ -1,4 +1,6 @@
 /** Provides classes and predicates to reason about Insecure Basic Authentication vulnerabilities. */
+overlay[local?]
+module;
 
 import java
 import semmle.code.java.dataflow.DataFlow
diff --git a/java/ql/lib/semmle/code/java/security/InsecureLdapAuth.qll b/java/ql/lib/semmle/code/java/security/InsecureLdapAuth.qll
index 52d58afc9e76..117484b0241e 100644
--- a/java/ql/lib/semmle/code/java/security/InsecureLdapAuth.qll
+++ b/java/ql/lib/semmle/code/java/security/InsecureLdapAuth.qll
@@ -1,4 +1,6 @@
 /** Provides classes to reason about insecure LDAP authentication. */
+overlay[local?]
+module;
 
 import java
 private import semmle.code.java.dataflow.DataFlow
diff --git a/java/ql/lib/semmle/code/java/security/InsecureTrustManager.qll b/java/ql/lib/semmle/code/java/security/InsecureTrustManager.qll
index 41d8f28573ca..54e2b00b8f4b 100644
--- a/java/ql/lib/semmle/code/java/security/InsecureTrustManager.qll
+++ b/java/ql/lib/semmle/code/java/security/InsecureTrustManager.qll
@@ -1,4 +1,6 @@
 /** Provides classes and predicates to reason about insecure `TrustManager`s. */
+overlay[local?]
+module;
 
 import java
 private import semmle.code.java.controlflow.Guards
diff --git a/java/ql/lib/semmle/code/java/security/InsufficientKeySize.qll b/java/ql/lib/semmle/code/java/security/InsufficientKeySize.qll
index 1f80136fdf19..6d28a124b854 100644
--- a/java/ql/lib/semmle/code/java/security/InsufficientKeySize.qll
+++ b/java/ql/lib/semmle/code/java/security/InsufficientKeySize.qll
@@ -1,4 +1,6 @@
 /** Provides classes and predicates related to insufficient key sizes in Java. */
+overlay[local?]
+module;
 
 private import semmle.code.java.security.Encryption
 private import semmle.code.java.dataflow.DataFlow
diff --git a/java/ql/lib/semmle/code/java/security/InsufficientKeySizeQuery.qll b/java/ql/lib/semmle/code/java/security/InsufficientKeySizeQuery.qll
index 876b2efd8409..d105db336101 100644
--- a/java/ql/lib/semmle/code/java/security/InsufficientKeySizeQuery.qll
+++ b/java/ql/lib/semmle/code/java/security/InsufficientKeySizeQuery.qll
@@ -1,4 +1,6 @@
 /** Provides data flow configurations to be used in queries related to insufficient key sizes. */
+overlay[local?]
+module;
 
 import semmle.code.java.dataflow.DataFlow
 import semmle.code.java.security.InsufficientKeySize
diff --git a/java/ql/lib/semmle/code/java/security/IntentUriPermissionManipulation.qll b/java/ql/lib/semmle/code/java/security/IntentUriPermissionManipulation.qll
index 2f9470f2bb9a..5ba3a6723467 100644
--- a/java/ql/lib/semmle/code/java/security/IntentUriPermissionManipulation.qll
+++ b/java/ql/lib/semmle/code/java/security/IntentUriPermissionManipulation.qll
@@ -2,6 +2,8 @@
  * Provides classes and predicates to reason about Intent URI permission manipulation
  * vulnerabilities on Android.
  */
+overlay[local?]
+module;
 
 import java
 private import semmle.code.java.controlflow.Guards
diff --git a/java/ql/lib/semmle/code/java/security/JWT.qll b/java/ql/lib/semmle/code/java/security/JWT.qll
index c282d32ea099..3f546d4edc05 100644
--- a/java/ql/lib/semmle/code/java/security/JWT.qll
+++ b/java/ql/lib/semmle/code/java/security/JWT.qll
@@ -1,4 +1,6 @@
 /** Provides classes for working with JSON Web Token (JWT) libraries. */
+overlay[local?]
+module;
 
 import java
 private import semmle.code.java.dataflow.FlowSinks
diff --git a/java/ql/lib/semmle/code/java/security/JndiInjection.qll b/java/ql/lib/semmle/code/java/security/JndiInjection.qll
index 3df8d6df378e..0e61a53c0ab0 100644
--- a/java/ql/lib/semmle/code/java/security/JndiInjection.qll
+++ b/java/ql/lib/semmle/code/java/security/JndiInjection.qll
@@ -1,4 +1,6 @@
 /** Provides classes to reason about JNDI injection vulnerabilities. */
+overlay[local?]
+module;
 
 import java
 private import semmle.code.java.dataflow.DataFlow
diff --git a/java/ql/lib/semmle/code/java/security/LdapInjection.qll b/java/ql/lib/semmle/code/java/security/LdapInjection.qll
index 54c8e28ba63d..ff92d40cf556 100644
--- a/java/ql/lib/semmle/code/java/security/LdapInjection.qll
+++ b/java/ql/lib/semmle/code/java/security/LdapInjection.qll
@@ -1,4 +1,6 @@
 /** Provides classes to reason about LDAP injection attacks. */
+overlay[local?]
+module;
 
 import java
 import semmle.code.java.dataflow.TaintTracking
diff --git a/java/ql/lib/semmle/code/java/security/ListOfConstantsSanitizer.qll b/java/ql/lib/semmle/code/java/security/ListOfConstantsSanitizer.qll
index cc57fbce648d..4294ac84f687 100644
--- a/java/ql/lib/semmle/code/java/security/ListOfConstantsSanitizer.qll
+++ b/java/ql/lib/semmle/code/java/security/ListOfConstantsSanitizer.qll
@@ -2,6 +2,8 @@
  * Provides a default taint sanitizer identifying comparisons against lists of
  * compile-time constants.
  */
+overlay[local?]
+module;
 
 import java
 private import codeql.typeflow.UniversalFlow as UniversalFlow
diff --git a/java/ql/lib/semmle/code/java/security/LogInjection.qll b/java/ql/lib/semmle/code/java/security/LogInjection.qll
index 554aa8e4ebc9..da5a1dc73a0c 100644
--- a/java/ql/lib/semmle/code/java/security/LogInjection.qll
+++ b/java/ql/lib/semmle/code/java/security/LogInjection.qll
@@ -1,4 +1,6 @@
 /** Provides classes and predicates related to Log Injection vulnerabilities. */
+overlay[local?]
+module;
 
 import java
 private import semmle.code.java.dataflow.DataFlow
diff --git a/java/ql/lib/semmle/code/java/security/Mail.qll b/java/ql/lib/semmle/code/java/security/Mail.qll
index 64bc22e4622f..5c68355ec3ee 100644
--- a/java/ql/lib/semmle/code/java/security/Mail.qll
+++ b/java/ql/lib/semmle/code/java/security/Mail.qll
@@ -1,4 +1,6 @@
 /** Provides classes and predicates to reason about email vulnerabilities. */
+overlay[local?]
+module;
 
 import java
 import semmle.code.java.frameworks.Mail
diff --git a/java/ql/lib/semmle/code/java/security/MvelInjection.qll b/java/ql/lib/semmle/code/java/security/MvelInjection.qll
index a9773ffe1860..dc804d4a1854 100644
--- a/java/ql/lib/semmle/code/java/security/MvelInjection.qll
+++ b/java/ql/lib/semmle/code/java/security/MvelInjection.qll
@@ -1,4 +1,6 @@
 /** Provides classes to reason about MVEL injection attacks. */
+overlay[local?]
+module;
 
 import java
 private import semmle.code.java.dataflow.DataFlow
diff --git a/java/ql/lib/semmle/code/java/security/OgnlInjection.qll b/java/ql/lib/semmle/code/java/security/OgnlInjection.qll
index 37f31618fc32..e3f93b39ece1 100644
--- a/java/ql/lib/semmle/code/java/security/OgnlInjection.qll
+++ b/java/ql/lib/semmle/code/java/security/OgnlInjection.qll
@@ -1,4 +1,6 @@
 /** Provides classes to reason about OGNL injection vulnerabilities. */
+overlay[local?]
+module;
 
 import java
 private import semmle.code.java.dataflow.DataFlow
diff --git a/java/ql/lib/semmle/code/java/security/PartialPathTraversal.qll b/java/ql/lib/semmle/code/java/security/PartialPathTraversal.qll
index aaf578a6225f..63ffb62ef63b 100644
--- a/java/ql/lib/semmle/code/java/security/PartialPathTraversal.qll
+++ b/java/ql/lib/semmle/code/java/security/PartialPathTraversal.qll
@@ -1,4 +1,6 @@
 /** Provides classes to reason about partial path traversal vulnerabilities. */
+overlay[local?]
+module;
 
 import java
 private import semmle.code.java.dataflow.DataFlow
diff --git a/java/ql/lib/semmle/code/java/security/PathSanitizer.qll b/java/ql/lib/semmle/code/java/security/PathSanitizer.qll
index f3385c94646b..ed0761f6869e 100644
--- a/java/ql/lib/semmle/code/java/security/PathSanitizer.qll
+++ b/java/ql/lib/semmle/code/java/security/PathSanitizer.qll
@@ -1,4 +1,6 @@
 /** Provides classes and predicates to reason about sanitization of path injection vulnerabilities. */
+overlay[local?]
+module;
 
 import java
 private import semmle.code.java.controlflow.Guards
diff --git a/java/ql/lib/semmle/code/java/security/QueryInjection.qll b/java/ql/lib/semmle/code/java/security/QueryInjection.qll
index df316155ba1a..583a41ce9335 100644
--- a/java/ql/lib/semmle/code/java/security/QueryInjection.qll
+++ b/java/ql/lib/semmle/code/java/security/QueryInjection.qll
@@ -1,4 +1,6 @@
 /** Provides classes to reason about database query language injection vulnerabilities. */
+overlay[local?]
+module;
 
 import java
 import semmle.code.java.dataflow.DataFlow
diff --git a/java/ql/lib/semmle/code/java/security/RandomDataSource.qll b/java/ql/lib/semmle/code/java/security/RandomDataSource.qll
index b44bcc07efe2..f040c858d9ce 100644
--- a/java/ql/lib/semmle/code/java/security/RandomDataSource.qll
+++ b/java/ql/lib/semmle/code/java/security/RandomDataSource.qll
@@ -1,6 +1,8 @@
 /**
  * Defines classes representing random data sources.
  */
+overlay[local?]
+module;
 
 import java
 private import semmle.code.java.dataflow.TypeFlow
diff --git a/java/ql/lib/semmle/code/java/security/RelativePaths.qll b/java/ql/lib/semmle/code/java/security/RelativePaths.qll
index 458bb7aea5d4..0c9e145268b6 100644
--- a/java/ql/lib/semmle/code/java/security/RelativePaths.qll
+++ b/java/ql/lib/semmle/code/java/security/RelativePaths.qll
@@ -1,4 +1,6 @@
 /** Detection of strings and arrays of strings containing relative paths. */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/security/RequestForgery.qll b/java/ql/lib/semmle/code/java/security/RequestForgery.qll
index 1f3ce61406f7..5eb35c05cd47 100644
--- a/java/ql/lib/semmle/code/java/security/RequestForgery.qll
+++ b/java/ql/lib/semmle/code/java/security/RequestForgery.qll
@@ -1,4 +1,6 @@
 /** Provides classes to reason about server-side request forgery (SSRF) attacks. */
+overlay[local?]
+module;
 
 import java
 import semmle.code.java.frameworks.Networking
diff --git a/java/ql/lib/semmle/code/java/security/ResponseSplitting.qll b/java/ql/lib/semmle/code/java/security/ResponseSplitting.qll
index 340f696db622..1238793ffd70 100644
--- a/java/ql/lib/semmle/code/java/security/ResponseSplitting.qll
+++ b/java/ql/lib/semmle/code/java/security/ResponseSplitting.qll
@@ -1,4 +1,6 @@
 /** Provides classes to reason about header splitting attacks. */
+overlay[local?]
+module;
 
 import java
 import semmle.code.java.dataflow.DataFlow
diff --git a/java/ql/lib/semmle/code/java/security/Sanitizers.qll b/java/ql/lib/semmle/code/java/security/Sanitizers.qll
index 5340ba344823..21e7ccf264f9 100644
--- a/java/ql/lib/semmle/code/java/security/Sanitizers.qll
+++ b/java/ql/lib/semmle/code/java/security/Sanitizers.qll
@@ -1,4 +1,6 @@
 /** Classes to represent sanitizers commonly used in dataflow and taint tracking configurations. */
+overlay[local?]
+module;
 
 import java
 private import semmle.code.java.dataflow.DataFlow
diff --git a/java/ql/lib/semmle/code/java/security/SecurityFlag.qll b/java/ql/lib/semmle/code/java/security/SecurityFlag.qll
index dab5d52bcb20..30718e3300fb 100644
--- a/java/ql/lib/semmle/code/java/security/SecurityFlag.qll
+++ b/java/ql/lib/semmle/code/java/security/SecurityFlag.qll
@@ -1,6 +1,8 @@
 /**
  * Provides utility predicates to spot variable names, parameter names, and string literals that suggest deliberately insecure settings.
  */
+overlay[local?]
+module;
 
 import java
 import semmle.code.java.controlflow.Guards
diff --git a/java/ql/lib/semmle/code/java/security/SecurityTests.qll b/java/ql/lib/semmle/code/java/security/SecurityTests.qll
index d2260de22a19..d8b714c18a1e 100644
--- a/java/ql/lib/semmle/code/java/security/SecurityTests.qll
+++ b/java/ql/lib/semmle/code/java/security/SecurityTests.qll
@@ -1,4 +1,6 @@
 /** Test detection for the security pack. */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/security/SensitiveActions.qll b/java/ql/lib/semmle/code/java/security/SensitiveActions.qll
index 2320afb8eef0..6733219a8d5f 100644
--- a/java/ql/lib/semmle/code/java/security/SensitiveActions.qll
+++ b/java/ql/lib/semmle/code/java/security/SensitiveActions.qll
@@ -10,6 +10,8 @@
  * in a fashion that the user can control. This includes authorization
  * methods such as logins, and sending of data, etc.
  */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/security/SensitiveApi.qll b/java/ql/lib/semmle/code/java/security/SensitiveApi.qll
index 559919f792ec..408fe73f904b 100644
--- a/java/ql/lib/semmle/code/java/security/SensitiveApi.qll
+++ b/java/ql/lib/semmle/code/java/security/SensitiveApi.qll
@@ -1,6 +1,8 @@
 /**
  * Provides predicates defining methods that consume sensitive data, such as usernames and passwords.
  */
+overlay[local?]
+module;
 
 import java
 private import semmle.code.java.dataflow.DataFlow
diff --git a/java/ql/lib/semmle/code/java/security/SpelInjection.qll b/java/ql/lib/semmle/code/java/security/SpelInjection.qll
index 13eb195eae46..3c36b207ac03 100644
--- a/java/ql/lib/semmle/code/java/security/SpelInjection.qll
+++ b/java/ql/lib/semmle/code/java/security/SpelInjection.qll
@@ -1,4 +1,6 @@
 /** Provides classes to reason about SpEL injection attacks. */
+overlay[local?]
+module;
 
 import java
 private import semmle.code.java.dataflow.DataFlow
diff --git a/java/ql/lib/semmle/code/java/security/SpringBootActuatorsQuery.qll b/java/ql/lib/semmle/code/java/security/SpringBootActuatorsQuery.qll
index 68c20adabdd1..9fb4e753aab5 100644
--- a/java/ql/lib/semmle/code/java/security/SpringBootActuatorsQuery.qll
+++ b/java/ql/lib/semmle/code/java/security/SpringBootActuatorsQuery.qll
@@ -1,4 +1,6 @@
 /** Provides classes and predicates to reason about exposed actuators in Spring Boot. */
+overlay[local?]
+module;
 
 import java
 private import semmle.code.java.frameworks.spring.SpringSecurity
diff --git a/java/ql/lib/semmle/code/java/security/SpringCsrfProtection.qll b/java/ql/lib/semmle/code/java/security/SpringCsrfProtection.qll
index c4259ee5b9de..88a53ef13e75 100644
--- a/java/ql/lib/semmle/code/java/security/SpringCsrfProtection.qll
+++ b/java/ql/lib/semmle/code/java/security/SpringCsrfProtection.qll
@@ -1,4 +1,6 @@
 /** Provides predicates to reason about disabling CSRF protection in Spring. */
+overlay[local?]
+module;
 
 import java
 
diff --git a/java/ql/lib/semmle/code/java/security/SqlConcatenatedLib.qll b/java/ql/lib/semmle/code/java/security/SqlConcatenatedLib.qll
index 5d3b1c803d22..2d59b18fa90e 100644
--- a/java/ql/lib/semmle/code/java/security/SqlConcatenatedLib.qll
+++ b/java/ql/lib/semmle/code/java/security/SqlConcatenatedLib.qll
@@ -1,4 +1,6 @@
 /** Definitions used by `SqlConcatenated.ql`. */
+overlay[local?]
+module;
 
 import semmle.code.java.security.ControlledString
 import semmle.code.java.dataflow.TaintTracking
diff --git a/java/ql/lib/semmle/code/java/security/TempDirUtils.qll b/java/ql/lib/semmle/code/java/security/TempDirUtils.qll
index 33b6c46b916c..3d1623fa334c 100644
--- a/java/ql/lib/semmle/code/java/security/TempDirUtils.qll
+++ b/java/ql/lib/semmle/code/java/security/TempDirUtils.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for reasoning about temporary file/directory creations.
  */
+overlay[local?]
+module;
 
 import java
 private import semmle.code.java.environment.SystemProperty
diff --git a/java/ql/lib/semmle/code/java/security/TemplateInjection.qll b/java/ql/lib/semmle/code/java/security/TemplateInjection.qll
index 0b703780a035..58c48bb7f224 100644
--- a/java/ql/lib/semmle/code/java/security/TemplateInjection.qll
+++ b/java/ql/lib/semmle/code/java/security/TemplateInjection.qll
@@ -1,4 +1,6 @@
 /** Definitions related to the server-side template injection (SST) query. */
+overlay[local?]
+module;
 
 import java
 private import semmle.code.java.dataflow.FlowSources
diff --git a/java/ql/lib/semmle/code/java/security/UnsafeAndroidAccess.qll b/java/ql/lib/semmle/code/java/security/UnsafeAndroidAccess.qll
index afd3af221bed..3137ad423e0e 100644
--- a/java/ql/lib/semmle/code/java/security/UnsafeAndroidAccess.qll
+++ b/java/ql/lib/semmle/code/java/security/UnsafeAndroidAccess.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes to reason about Unsafe Resource Fetching vulnerabilities in Android.
  */
+overlay[local?]
+module;
 
 import java
 private import semmle.code.java.dataflow.DataFlow
diff --git a/java/ql/lib/semmle/code/java/security/UnsafeCertTrust.qll b/java/ql/lib/semmle/code/java/security/UnsafeCertTrust.qll
index 60f0cef83847..61a76afecc8d 100644
--- a/java/ql/lib/semmle/code/java/security/UnsafeCertTrust.qll
+++ b/java/ql/lib/semmle/code/java/security/UnsafeCertTrust.qll
@@ -1,4 +1,6 @@
 /** Provides classes and predicates to reason about unsafe certificate trust vulnerablities. */
+overlay[local?]
+module;
 
 import java
 private import semmle.code.java.frameworks.Networking
diff --git a/java/ql/lib/semmle/code/java/security/UnsafeContentUriResolution.qll b/java/ql/lib/semmle/code/java/security/UnsafeContentUriResolution.qll
index b19d06bbf88c..7cd10142a1e5 100644
--- a/java/ql/lib/semmle/code/java/security/UnsafeContentUriResolution.qll
+++ b/java/ql/lib/semmle/code/java/security/UnsafeContentUriResolution.qll
@@ -1,4 +1,6 @@
 /** Provides classes to reason about vulnerabilites related to content URIs. */
+overlay[local?]
+module;
 
 import java
 private import semmle.code.java.dataflow.FlowSinks
diff --git a/java/ql/lib/semmle/code/java/security/UrlRedirect.qll b/java/ql/lib/semmle/code/java/security/UrlRedirect.qll
index 02f66e3f0e95..be6addfa2529 100644
--- a/java/ql/lib/semmle/code/java/security/UrlRedirect.qll
+++ b/java/ql/lib/semmle/code/java/security/UrlRedirect.qll
@@ -1,4 +1,6 @@
 /** Provides classes to reason about URL redirect attacks. */
+overlay[local?]
+module;
 
 import java
 import semmle.code.java.dataflow.DataFlow
diff --git a/java/ql/lib/semmle/code/java/security/Validation.qll b/java/ql/lib/semmle/code/java/security/Validation.qll
index 664c55e70d82..69f57474317f 100644
--- a/java/ql/lib/semmle/code/java/security/Validation.qll
+++ b/java/ql/lib/semmle/code/java/security/Validation.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 import semmle.code.java.Expr
 import semmle.code.java.dataflow.SSA
 import semmle.code.java.controlflow.Guards
diff --git a/java/ql/lib/semmle/code/java/security/XPath.qll b/java/ql/lib/semmle/code/java/security/XPath.qll
index c2992fdc272a..cc3fde30091b 100644
--- a/java/ql/lib/semmle/code/java/security/XPath.qll
+++ b/java/ql/lib/semmle/code/java/security/XPath.qll
@@ -1,4 +1,6 @@
 /** Provides classes to reason about XPath vulnerabilities. */
+overlay[local?]
+module;
 
 import java
 import semmle.code.java.dataflow.DataFlow
diff --git a/java/ql/lib/semmle/code/java/security/XSS.qll b/java/ql/lib/semmle/code/java/security/XSS.qll
index 9aafcd15f683..990371cc8cfe 100644
--- a/java/ql/lib/semmle/code/java/security/XSS.qll
+++ b/java/ql/lib/semmle/code/java/security/XSS.qll
@@ -1,4 +1,6 @@
 /** Provides classes to reason about Cross-site scripting (XSS) vulnerabilities. */
+overlay[local?]
+module;
 
 import java
 import semmle.code.java.frameworks.Servlets
diff --git a/java/ql/lib/semmle/code/java/security/XmlParsers.qll b/java/ql/lib/semmle/code/java/security/XmlParsers.qll
index 5ca1dd95f99e..8bb2a015a14d 100644
--- a/java/ql/lib/semmle/code/java/security/XmlParsers.qll
+++ b/java/ql/lib/semmle/code/java/security/XmlParsers.qll
@@ -1,4 +1,6 @@
 /** Provides classes and predicates for modeling XML parsers in Java. */
+overlay[local?]
+module;
 
 import java
 import semmle.code.java.dataflow.DataFlow
diff --git a/java/ql/lib/semmle/code/java/security/XsltInjection.qll b/java/ql/lib/semmle/code/java/security/XsltInjection.qll
index 56affafa2029..d54e92066443 100644
--- a/java/ql/lib/semmle/code/java/security/XsltInjection.qll
+++ b/java/ql/lib/semmle/code/java/security/XsltInjection.qll
@@ -1,4 +1,6 @@
 /** Provides classes to reason about XSLT injection vulnerabilities. */
+overlay[local?]
+module;
 
 import java
 import semmle.code.java.dataflow.DataFlow
diff --git a/java/ql/lib/semmle/code/java/security/Xxe.qll b/java/ql/lib/semmle/code/java/security/Xxe.qll
index cf30b3c19c0d..5c3d075bfb1c 100644
--- a/java/ql/lib/semmle/code/java/security/Xxe.qll
+++ b/java/ql/lib/semmle/code/java/security/Xxe.qll
@@ -1,4 +1,6 @@
 /** Provides classes to reason about XML eXternal Entity (XXE) vulnerabilities. */
+overlay[local?]
+module;
 
 import java
 private import semmle.code.java.dataflow.DataFlow
diff --git a/java/ql/lib/semmle/code/java/security/internal/ArraySizing.qll b/java/ql/lib/semmle/code/java/security/internal/ArraySizing.qll
index 29c4d0e5e3df..185b1b8a46e2 100644
--- a/java/ql/lib/semmle/code/java/security/internal/ArraySizing.qll
+++ b/java/ql/lib/semmle/code/java/security/internal/ArraySizing.qll
@@ -1,4 +1,6 @@
 /** Provides predicates and classes to reason about the sizing and indexing of arrays. */
+overlay[local?]
+module;
 
 import java
 private import semmle.code.java.dataflow.DataFlow
diff --git a/java/ql/lib/semmle/code/java/security/internal/BoundingChecks.qll b/java/ql/lib/semmle/code/java/security/internal/BoundingChecks.qll
index 88dec6c2bb78..81bf8727e4fd 100644
--- a/java/ql/lib/semmle/code/java/security/internal/BoundingChecks.qll
+++ b/java/ql/lib/semmle/code/java/security/internal/BoundingChecks.qll
@@ -2,6 +2,8 @@
  * Provides classes and predicates for determining upper and lower bounds on a value determined by bounding checks that
  * have been made on dominant paths.
  */
+overlay[local?]
+module;
 
 import java
 private import semmle.code.java.controlflow.Guards
diff --git a/java/ql/lib/semmle/code/java/security/internal/EncryptionKeySizes.qll b/java/ql/lib/semmle/code/java/security/internal/EncryptionKeySizes.qll
index 46df3a3ca7bb..f42e31b2d7e5 100644
--- a/java/ql/lib/semmle/code/java/security/internal/EncryptionKeySizes.qll
+++ b/java/ql/lib/semmle/code/java/security/internal/EncryptionKeySizes.qll
@@ -4,6 +4,8 @@
  * Provides predicates for recommended encryption key sizes.
  * Such that we can share this logic across our CodeQL analysis of different languages.
  */
+overlay[local?]
+module;
 
 /** Returns the minimum recommended key size for RSA. */
 int minSecureKeySizeRsa() { result = 2048 }
diff --git a/java/ql/lib/semmle/code/java/security/regexp/RegexInjection.qll b/java/ql/lib/semmle/code/java/security/regexp/RegexInjection.qll
index 92d5dab5289a..eb27ec873752 100644
--- a/java/ql/lib/semmle/code/java/security/regexp/RegexInjection.qll
+++ b/java/ql/lib/semmle/code/java/security/regexp/RegexInjection.qll
@@ -1,4 +1,6 @@
 /** Provides classes and predicates related to regex injection in Java. */
+overlay[local?]
+module;
 
 import java
 private import semmle.code.java.dataflow.DataFlow
diff --git a/java/ql/lib/semmle/code/xml/AndroidManifest.qll b/java/ql/lib/semmle/code/xml/AndroidManifest.qll
index ad69546a4140..d20165a031ff 100644
--- a/java/ql/lib/semmle/code/xml/AndroidManifest.qll
+++ b/java/ql/lib/semmle/code/xml/AndroidManifest.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for working with Android manifest files.
  */
+overlay[local?]
+module;
 
 import XML
 
diff --git a/java/ql/lib/semmle/code/xml/Ant.qll b/java/ql/lib/semmle/code/xml/Ant.qll
index 59cd2889096a..84d6ea927f72 100644
--- a/java/ql/lib/semmle/code/xml/Ant.qll
+++ b/java/ql/lib/semmle/code/xml/Ant.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for working with targets in Apache Ant build files.
  */
+overlay[local?]
+module;
 
 import XML
 
diff --git a/java/ql/lib/semmle/code/xml/MavenPom.qll b/java/ql/lib/semmle/code/xml/MavenPom.qll
index 313a0e08bd83..68c81c4ab905 100644
--- a/java/ql/lib/semmle/code/xml/MavenPom.qll
+++ b/java/ql/lib/semmle/code/xml/MavenPom.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for working with Maven POM files and their content.
  */
+overlay[local?]
+module;
 
 import XML
 
diff --git a/java/ql/lib/semmle/code/xml/WebXML.qll b/java/ql/lib/semmle/code/xml/WebXML.qll
index c356081c95f6..c741ce7c66b0 100644
--- a/java/ql/lib/semmle/code/xml/WebXML.qll
+++ b/java/ql/lib/semmle/code/xml/WebXML.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 import java
 
 /**
diff --git a/java/ql/lib/semmle/code/xml/XML.qll b/java/ql/lib/semmle/code/xml/XML.qll
index 54157809260b..e4073362fc6f 100644
--- a/java/ql/lib/semmle/code/xml/XML.qll
+++ b/java/ql/lib/semmle/code/xml/XML.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for working with XML files and their content.
  */
+overlay[local?]
+module;
 
 import semmle.files.FileSystem
 private import codeql.xml.Xml
diff --git a/java/ql/lib/semmle/files/FileSystem.qll b/java/ql/lib/semmle/files/FileSystem.qll
index f56d54866140..bb55214dcd3b 100644
--- a/java/ql/lib/semmle/files/FileSystem.qll
+++ b/java/ql/lib/semmle/files/FileSystem.qll
@@ -1,3 +1,5 @@
 /** Provides classes for working with files and folders. */
+overlay[local?]
+module;
 
 import semmle.code.FileSystem
diff --git a/java/ql/lib/utils/test/internal/InlineExpectationsTestImpl.qll b/java/ql/lib/utils/test/internal/InlineExpectationsTestImpl.qll
index cd62fdb757e0..446b6a544c34 100644
--- a/java/ql/lib/utils/test/internal/InlineExpectationsTestImpl.qll
+++ b/java/ql/lib/utils/test/internal/InlineExpectationsTestImpl.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 private import java as J
 private import codeql.util.test.InlineExpectationsTest
 
diff --git a/java/ql/src/experimental/Security/CWE/CWE-020/Log4jJndiInjection.ql b/java/ql/src/experimental/Security/CWE/CWE-020/Log4jJndiInjection.ql
index 84c4bb01c126..3abaa7bdcfa3 100644
--- a/java/ql/src/experimental/Security/CWE/CWE-020/Log4jJndiInjection.ql
+++ b/java/ql/src/experimental/Security/CWE/CWE-020/Log4jJndiInjection.ql
@@ -22,6 +22,7 @@ import semmle.code.java.dataflow.ExternalFlow
 private import semmle.code.java.security.Sanitizers
 import Log4jInjectionFlow::PathGraph
 
+overlay[local?]
 deprecated private class ActivateModels extends ActiveExperimentalModels {
   ActivateModels() { this = "log4j-injection" }
 }
diff --git a/java/ql/src/experimental/Security/CWE/CWE-036/OpenStream.ql b/java/ql/src/experimental/Security/CWE/CWE-036/OpenStream.ql
index c84037719da9..0929ca3eb805 100644
--- a/java/ql/src/experimental/Security/CWE/CWE-036/OpenStream.ql
+++ b/java/ql/src/experimental/Security/CWE/CWE-036/OpenStream.ql
@@ -17,6 +17,7 @@ import semmle.code.java.dataflow.FlowSources
 import semmle.code.java.dataflow.ExternalFlow
 import RemoteUrlToOpenStreamFlow::PathGraph
 
+overlay[local?]
 deprecated private class ActivateModels extends ActiveExperimentalModels {
   ActivateModels() { this = "openstream-called-on-tainted-url" }
 }
diff --git a/java/ql/src/experimental/Security/CWE/CWE-073/FilePathInjection.ql b/java/ql/src/experimental/Security/CWE/CWE-073/FilePathInjection.ql
index c87097458520..11bb600ffe85 100644
--- a/java/ql/src/experimental/Security/CWE/CWE-073/FilePathInjection.ql
+++ b/java/ql/src/experimental/Security/CWE/CWE-073/FilePathInjection.ql
@@ -22,6 +22,7 @@ import semmle.code.java.security.PathSanitizer
 private import semmle.code.java.security.Sanitizers
 import InjectFilePathFlow::PathGraph
 
+overlay[local?]
 deprecated private class ActivateModels extends ActiveExperimentalModels {
   ActivateModels() { this = "file-path-injection" }
 }
diff --git a/java/ql/src/experimental/Security/CWE/CWE-078/ExecTainted.ql b/java/ql/src/experimental/Security/CWE/CWE-078/ExecTainted.ql
index 08f7631af828..c13bc3bb245c 100644
--- a/java/ql/src/experimental/Security/CWE/CWE-078/ExecTainted.ql
+++ b/java/ql/src/experimental/Security/CWE/CWE-078/ExecTainted.ql
@@ -18,6 +18,7 @@ import semmle.code.java.security.CommandLineQuery
 import InputToArgumentToExecFlow::PathGraph
 private import semmle.code.java.dataflow.ExternalFlow
 
+overlay[local?]
 deprecated private class ActivateModels extends ActiveExperimentalModels {
   ActivateModels() { this = "jsch-os-injection" }
 }
diff --git a/java/ql/src/experimental/Security/CWE/CWE-200/AndroidWebResourceResponse.qll b/java/ql/src/experimental/Security/CWE/CWE-200/AndroidWebResourceResponse.qll
index bd898df205a8..b988398e4c26 100644
--- a/java/ql/src/experimental/Security/CWE/CWE-200/AndroidWebResourceResponse.qll
+++ b/java/ql/src/experimental/Security/CWE/CWE-200/AndroidWebResourceResponse.qll
@@ -7,6 +7,7 @@ private import semmle.code.java.dataflow.ExternalFlow
 private import semmle.code.java.dataflow.FlowSteps
 private import semmle.code.java.frameworks.android.WebView
 
+overlay[local?]
 private class ActivateModels extends ActiveExperimentalModels {
   ActivateModels() { this = "android-web-resource-response" }
 }
diff --git a/java/ql/src/experimental/Security/CWE/CWE-400/ThreadResourceAbuse.qll b/java/ql/src/experimental/Security/CWE/CWE-400/ThreadResourceAbuse.qll
index ce6de1a06798..12ba6769f742 100644
--- a/java/ql/src/experimental/Security/CWE/CWE-400/ThreadResourceAbuse.qll
+++ b/java/ql/src/experimental/Security/CWE/CWE-400/ThreadResourceAbuse.qll
@@ -8,6 +8,7 @@ import semmle.code.java.arithmetic.Overflow
 import semmle.code.java.dataflow.FlowSteps
 import semmle.code.java.controlflow.Guards
 
+overlay[local?]
 private class ActivateModels extends ActiveExperimentalModels {
   ActivateModels() { this = "thread-resource-abuse" }
 }
diff --git a/java/ql/src/experimental/Security/CWE/CWE-625/PermissiveDotRegexQuery.qll b/java/ql/src/experimental/Security/CWE/CWE-625/PermissiveDotRegexQuery.qll
index 8fe997793f4a..f8e328902504 100644
--- a/java/ql/src/experimental/Security/CWE/CWE-625/PermissiveDotRegexQuery.qll
+++ b/java/ql/src/experimental/Security/CWE/CWE-625/PermissiveDotRegexQuery.qll
@@ -9,6 +9,7 @@ import semmle.code.java.controlflow.Guards
 import semmle.code.java.security.UrlRedirect
 import Regex
 
+overlay[local?]
 private class ActivateModels extends ActiveExperimentalModels {
   ActivateModels() { this = "permissive-dot-regex-query" }
 }
diff --git a/python/ql/lib/semmle/python/security/internal/EncryptionKeySizes.qll b/python/ql/lib/semmle/python/security/internal/EncryptionKeySizes.qll
index 46df3a3ca7bb..f42e31b2d7e5 100644
--- a/python/ql/lib/semmle/python/security/internal/EncryptionKeySizes.qll
+++ b/python/ql/lib/semmle/python/security/internal/EncryptionKeySizes.qll
@@ -4,6 +4,8 @@
  * Provides predicates for recommended encryption key sizes.
  * Such that we can share this logic across our CodeQL analysis of different languages.
  */
+overlay[local?]
+module;
 
 /** Returns the minimum recommended key size for RSA. */
 int minSecureKeySizeRsa() { result = 2048 }
diff --git a/shared/controlflow/codeql/controlflow/BasicBlock.qll b/shared/controlflow/codeql/controlflow/BasicBlock.qll
index 9c26b18c0938..132920e329fb 100644
--- a/shared/controlflow/codeql/controlflow/BasicBlock.qll
+++ b/shared/controlflow/codeql/controlflow/BasicBlock.qll
@@ -5,6 +5,8 @@
  * INTERNAL use only. This is an experimental API subject to change without
  * notice.
  */
+overlay[local?]
+module;
 
 private import codeql.util.Location
 
diff --git a/shared/controlflow/codeql/controlflow/Cfg.qll b/shared/controlflow/codeql/controlflow/Cfg.qll
index bb49cc8d8aee..c9d7d4147347 100644
--- a/shared/controlflow/codeql/controlflow/Cfg.qll
+++ b/shared/controlflow/codeql/controlflow/Cfg.qll
@@ -2,6 +2,8 @@
  * Provides a shared interface and implementation for constructing control-flow graphs
  * (CFGs) from abstract syntax trees (ASTs).
  */
+overlay[local?]
+module;
 
 private import codeql.util.Location
 private import codeql.util.FileSystem
diff --git a/shared/dataflow/codeql/dataflow/DataFlow.qll b/shared/dataflow/codeql/dataflow/DataFlow.qll
index 93327f5ad6a3..3483287e3b39 100644
--- a/shared/dataflow/codeql/dataflow/DataFlow.qll
+++ b/shared/dataflow/codeql/dataflow/DataFlow.qll
@@ -3,6 +3,8 @@
  * adds a global analysis, mainly exposed through the `Global` and `GlobalWithState`
  * modules.
  */
+overlay[local?]
+module;
 
 private import codeql.util.Location
 
diff --git a/shared/dataflow/codeql/dataflow/TaintTracking.qll b/shared/dataflow/codeql/dataflow/TaintTracking.qll
index 24aea44320e0..bd4b4ecd6ca5 100644
--- a/shared/dataflow/codeql/dataflow/TaintTracking.qll
+++ b/shared/dataflow/codeql/dataflow/TaintTracking.qll
@@ -2,6 +2,8 @@
  * Provides modules for performing local (intra-procedural) and
  * global (inter-procedural) taint-tracking analyses.
  */
+overlay[local?]
+module;
 
 private import DataFlow as DF
 private import internal.DataFlowImpl
diff --git a/shared/dataflow/codeql/dataflow/VariableCapture.qll b/shared/dataflow/codeql/dataflow/VariableCapture.qll
index c2c84b7f0f87..4df415f90ad9 100644
--- a/shared/dataflow/codeql/dataflow/VariableCapture.qll
+++ b/shared/dataflow/codeql/dataflow/VariableCapture.qll
@@ -2,6 +2,8 @@
  * Provides a module for synthesizing data-flow nodes and related step relations
  * for supporting flow through captured variables.
  */
+overlay[local?]
+module;
 
 private import codeql.util.Boolean
 private import codeql.util.Unit
diff --git a/shared/dataflow/codeql/dataflow/internal/AccessPathSyntax.qll b/shared/dataflow/codeql/dataflow/internal/AccessPathSyntax.qll
index 17b979e42a66..78b6db4090a5 100644
--- a/shared/dataflow/codeql/dataflow/internal/AccessPathSyntax.qll
+++ b/shared/dataflow/codeql/dataflow/internal/AccessPathSyntax.qll
@@ -5,6 +5,8 @@
  * This file is used by the shared data flow library and by the JavaScript libraries
  * (which does not use the shared data flow libraries).
  */
+overlay[local?]
+module;
 
 /**
  * Convenience-predicate for extracting two capture groups at once.
diff --git a/shared/dataflow/codeql/dataflow/internal/ContentDataFlowImpl.qll b/shared/dataflow/codeql/dataflow/internal/ContentDataFlowImpl.qll
index 1eaa84505419..baf473efff16 100644
--- a/shared/dataflow/codeql/dataflow/internal/ContentDataFlowImpl.qll
+++ b/shared/dataflow/codeql/dataflow/internal/ContentDataFlowImpl.qll
@@ -22,6 +22,8 @@
  * steps, followed by 0 or more stores, with value-preserving steps allowed in
  * between all other steps.
  */
+overlay[local?]
+module;
 
 private import codeql.dataflow.DataFlow
 private import codeql.util.Boolean
diff --git a/shared/dataflow/codeql/dataflow/internal/DataFlowImpl.qll b/shared/dataflow/codeql/dataflow/internal/DataFlowImpl.qll
index a13c71f554cc..a7e0736432ac 100644
--- a/shared/dataflow/codeql/dataflow/internal/DataFlowImpl.qll
+++ b/shared/dataflow/codeql/dataflow/internal/DataFlowImpl.qll
@@ -3,6 +3,8 @@
  *
  * Provides an implementation of global (interprocedural) data flow.
  */
+overlay[local?]
+module;
 
 private import codeql.util.Unit
 private import codeql.util.Option
@@ -792,6 +794,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
             innercc = getCallContextCall(call, inner)
           }
 
+          overlay[caller?]
           pragma[inline]
           predicate fwdFlowIn(
             Call call, ArgNd arg, Callable inner, ParamNd p, Cc outercc, CcCall innercc,
@@ -2321,6 +2324,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
                * For more information, see
                * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/).
                */
+              overlay[caller?]
               pragma[inline]
               deprecated final predicate hasLocationInfo(
                 string filepath, int startline, int startcolumn, int endline, int endcolumn
@@ -2524,6 +2528,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
 
       class ApHeadContent = Unit;
 
+      overlay[caller?]
       pragma[inline]
       ApHeadContent getHeadContent(Ap ap) { exists(result) and ap = true }
 
diff --git a/shared/dataflow/codeql/dataflow/internal/DataFlowImplCommon.qll b/shared/dataflow/codeql/dataflow/internal/DataFlowImplCommon.qll
index 845da27aae7a..288814c4c511 100644
--- a/shared/dataflow/codeql/dataflow/internal/DataFlowImplCommon.qll
+++ b/shared/dataflow/codeql/dataflow/internal/DataFlowImplCommon.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 private import codeql.dataflow.DataFlow
 private import codeql.typetracking.TypeTracking as Tt
 private import codeql.util.Location
@@ -288,6 +291,7 @@ module MakeImplCommon<LocationSig Location, InputSig<Location> Lang> {
      * to `lambdaCall`, if any. That is, `lastCall` is able to target the enclosing
      * callable of `lambdaCall`.
      */
+    overlay[global]
     pragma[nomagic]
     predicate revLambdaFlow(
       Call lambdaCall, LambdaCallKind kind, Node node, Type t, boolean toReturn, boolean toJump,
@@ -674,6 +678,7 @@ module MakeImplCommon<LocationSig Location, InputSig<Location> Lang> {
 
       class CcCall = CallContextCall;
 
+      overlay[caller?]
       pragma[inline]
       predicate matchesCall(CcCall cc, Call call) {
         cc = Input2::getSpecificCallContextCall(call, _) or
@@ -885,6 +890,7 @@ module MakeImplCommon<LocationSig Location, InputSig<Location> Lang> {
     pragma[nomagic]
     private Callable getEnclosingCallable0() { nodeEnclosingCallable(this.projectToNode(), result) }
 
+    overlay[caller?]
     pragma[inline]
     Callable getEnclosingCallable() {
       pragma[only_bind_out](this).getEnclosingCallable0() = pragma[only_bind_into](result)
@@ -899,6 +905,7 @@ module MakeImplCommon<LocationSig Location, InputSig<Location> Lang> {
       isTopType(result) and this.isImplicitReadNode(_)
     }
 
+    overlay[caller?]
     pragma[inline]
     Type getType() { pragma[only_bind_out](this).getType0() = pragma[only_bind_into](result) }
 
@@ -2410,12 +2417,14 @@ module MakeImplCommon<LocationSig Location, InputSig<Location> Lang> {
    * predicate ensures that joins go from `n` to the result instead of the other
    * way around.
    */
+  overlay[caller?]
   pragma[inline]
   Callable getNodeEnclosingCallable(Node n) {
     nodeEnclosingCallable(pragma[only_bind_out](n), pragma[only_bind_into](result))
   }
 
   /** Gets the type of `n` used for type pruning. */
+  overlay[caller?]
   pragma[inline]
   Type getNodeDataFlowType(Node n) {
     nodeType(pragma[only_bind_out](n), pragma[only_bind_into](result))
diff --git a/shared/dataflow/codeql/dataflow/internal/DataFlowImplConsistency.qll b/shared/dataflow/codeql/dataflow/internal/DataFlowImplConsistency.qll
index 7721a5df0445..83abd41f5e6e 100644
--- a/shared/dataflow/codeql/dataflow/internal/DataFlowImplConsistency.qll
+++ b/shared/dataflow/codeql/dataflow/internal/DataFlowImplConsistency.qll
@@ -2,6 +2,8 @@
  * Provides consistency queries for checking invariants in the language-specific
  * data-flow classes and predicates.
  */
+overlay[local?]
+module;
 
 private import codeql.dataflow.DataFlow as DF
 private import codeql.dataflow.TaintTracking as TT
diff --git a/shared/dataflow/codeql/dataflow/internal/DataFlowImplStage1.qll b/shared/dataflow/codeql/dataflow/internal/DataFlowImplStage1.qll
index f9eaea566cd8..c7883df0de18 100644
--- a/shared/dataflow/codeql/dataflow/internal/DataFlowImplStage1.qll
+++ b/shared/dataflow/codeql/dataflow/internal/DataFlowImplStage1.qll
@@ -4,6 +4,8 @@
  * Provides an implementation of a fast initial pruning of global
  * (interprocedural) data flow reachability (Stage 1).
  */
+overlay[local?]
+module;
 
 private import codeql.util.Unit
 private import codeql.util.Location
@@ -1784,6 +1786,7 @@ module MakeImplStage1<LocationSig Location, InputSig<Location> Lang> {
            * For more information, see
            * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/).
            */
+          overlay[caller?]
           pragma[inline]
           deprecated predicate hasLocationInfo(
             string filepath, int startline, int startcolumn, int endline, int endcolumn
diff --git a/shared/dataflow/codeql/dataflow/internal/FlowSummaryImpl.qll b/shared/dataflow/codeql/dataflow/internal/FlowSummaryImpl.qll
index e6da5d3a37f6..3eda6709517c 100644
--- a/shared/dataflow/codeql/dataflow/internal/FlowSummaryImpl.qll
+++ b/shared/dataflow/codeql/dataflow/internal/FlowSummaryImpl.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for defining flow summaries.
  */
+overlay[local?]
+module;
 
 private import codeql.dataflow.DataFlow as DF
 private import codeql.util.Location
diff --git a/shared/dataflow/codeql/dataflow/test/ProvenancePathGraph.qll b/shared/dataflow/codeql/dataflow/test/ProvenancePathGraph.qll
index 2171c9096434..4a5e92fd5897 100644
--- a/shared/dataflow/codeql/dataflow/test/ProvenancePathGraph.qll
+++ b/shared/dataflow/codeql/dataflow/test/ProvenancePathGraph.qll
@@ -5,6 +5,8 @@
  * In addition to the `PathGraph`, a `query predicate models` is provided to
  * list the contents of the referenced MaD rows.
  */
+overlay[local?]
+module;
 
 private import codeql.dataflow.DataFlow as DF
 
diff --git a/shared/mad/codeql/mad/ModelValidation.qll b/shared/mad/codeql/mad/ModelValidation.qll
index 4c1d6793d652..98b2a212c316 100644
--- a/shared/mad/codeql/mad/ModelValidation.qll
+++ b/shared/mad/codeql/mad/ModelValidation.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates related to validating models-as-data rows.
  */
+overlay[local?]
+module;
 
 /** Provides predicates for determining if a model exists for a given `kind`. */
 signature module KindValidationConfigSig {
diff --git a/shared/mad/codeql/mad/dynamic/GraphExport.qll b/shared/mad/codeql/mad/dynamic/GraphExport.qll
index e28c82f47ab3..b666a96fb67a 100644
--- a/shared/mad/codeql/mad/dynamic/GraphExport.qll
+++ b/shared/mad/codeql/mad/dynamic/GraphExport.qll
@@ -1,6 +1,8 @@
 /**
  * Contains predicates for converting an arbitrary graph to a set of `typeModel` rows.
  */
+overlay[local?]
+module;
 
 private import codeql.util.Location
 
diff --git a/shared/mad/codeql/mad/modelgenerator/internal/ModelGeneratorImpl.qll b/shared/mad/codeql/mad/modelgenerator/internal/ModelGeneratorImpl.qll
index 829bf267c226..51dafc2cc96a 100644
--- a/shared/mad/codeql/mad/modelgenerator/internal/ModelGeneratorImpl.qll
+++ b/shared/mad/codeql/mad/modelgenerator/internal/ModelGeneratorImpl.qll
@@ -4,6 +4,8 @@
  * Provides classes and predicates related to capturing summary, source,
  * and sink models of the Standard or a 3rd party library.
  */
+overlay[local?]
+module;
 
 private import codeql.dataflow.DataFlow
 private import codeql.dataflow.TaintTracking as Tt
diff --git a/shared/mad/codeql/mad/modelgenerator/internal/ModelPrinting.qll b/shared/mad/codeql/mad/modelgenerator/internal/ModelPrinting.qll
index d4fbd9062b63..a5f9145714bf 100644
--- a/shared/mad/codeql/mad/modelgenerator/internal/ModelPrinting.qll
+++ b/shared/mad/codeql/mad/modelgenerator/internal/ModelPrinting.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 signature module ModelPrintingLangSig {
   /**
    * A class of callables.
diff --git a/shared/quantum/codeql/quantum/experimental/Model.qll b/shared/quantum/codeql/quantum/experimental/Model.qll
index d4a900f9bcac..e3ed4aea5d7a 100644
--- a/shared/quantum/codeql/quantum/experimental/Model.qll
+++ b/shared/quantum/codeql/quantum/experimental/Model.qll
@@ -1,6 +1,8 @@
 /**
  * A language-independent library for reasoning about cryptography.
  */
+overlay[local?]
+module;
 
 import codeql.util.Location
 
diff --git a/shared/rangeanalysis/codeql/rangeanalysis/ModulusAnalysis.qll b/shared/rangeanalysis/codeql/rangeanalysis/ModulusAnalysis.qll
index db3377ff3cc1..f7864a01f446 100644
--- a/shared/rangeanalysis/codeql/rangeanalysis/ModulusAnalysis.qll
+++ b/shared/rangeanalysis/codeql/rangeanalysis/ModulusAnalysis.qll
@@ -3,6 +3,8 @@
  * an expression, `b` is a `Bound` (typically zero or the value of an SSA
  * variable), and `v` is an integer in the range `[0 .. m-1]`.
  */
+overlay[local?]
+module;
 
 /*
  * The main recursion has base cases in both `ssaModulus` (for guarded reads) and `exprModulus`
diff --git a/shared/rangeanalysis/codeql/rangeanalysis/RangeAnalysis.qll b/shared/rangeanalysis/codeql/rangeanalysis/RangeAnalysis.qll
index 445ec9f0b8d3..1d17ad8346c4 100644
--- a/shared/rangeanalysis/codeql/rangeanalysis/RangeAnalysis.qll
+++ b/shared/rangeanalysis/codeql/rangeanalysis/RangeAnalysis.qll
@@ -8,6 +8,8 @@
  * If an inferred bound relies directly on a condition, then this condition is
  * reported as the reason for the bound.
  */
+overlay[local?]
+module;
 
 /*
  * This library tackles range analysis as a flow problem. Consider e.g.:
diff --git a/shared/rangeanalysis/codeql/rangeanalysis/internal/RangeUtils.qll b/shared/rangeanalysis/codeql/rangeanalysis/internal/RangeUtils.qll
index d6eeb781f391..1592102bc8e6 100644
--- a/shared/rangeanalysis/codeql/rangeanalysis/internal/RangeUtils.qll
+++ b/shared/rangeanalysis/codeql/rangeanalysis/internal/RangeUtils.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 private import codeql.rangeanalysis.RangeAnalysis
 private import codeql.util.Location
 
diff --git a/shared/regex/codeql/regex/HostnameRegexp.qll b/shared/regex/codeql/regex/HostnameRegexp.qll
index fc77b9b56e2e..7d97d71ccef9 100644
--- a/shared/regex/codeql/regex/HostnameRegexp.qll
+++ b/shared/regex/codeql/regex/HostnameRegexp.qll
@@ -2,6 +2,8 @@
  * Provides predicates for reasoning about regular expressions
  * that match URLs and hostname patterns.
  */
+overlay[local?]
+module;
 
 private import RegexTreeView
 
diff --git a/shared/regex/codeql/regex/MissingRegExpAnchor.qll b/shared/regex/codeql/regex/MissingRegExpAnchor.qll
index c4fe642b790d..722d1baafd6c 100644
--- a/shared/regex/codeql/regex/MissingRegExpAnchor.qll
+++ b/shared/regex/codeql/regex/MissingRegExpAnchor.qll
@@ -2,6 +2,8 @@
  * Provides predicates for reasoning about regular expressions
  * without anchors.
  */
+overlay[local?]
+module;
 
 private import RegexTreeView
 import HostnameRegexp as HostnameShared
diff --git a/shared/regex/codeql/regex/OverlyLargeRangeQuery.qll b/shared/regex/codeql/regex/OverlyLargeRangeQuery.qll
index 57d7d365611b..88645a2abde1 100644
--- a/shared/regex/codeql/regex/OverlyLargeRangeQuery.qll
+++ b/shared/regex/codeql/regex/OverlyLargeRangeQuery.qll
@@ -1,6 +1,8 @@
 /**
  * Classes and predicates for working with suspicious character ranges.
  */
+overlay[local?]
+module;
 
 private import RegexTreeView
 
diff --git a/shared/regex/codeql/regex/RegexTreeView.qll b/shared/regex/codeql/regex/RegexTreeView.qll
index 03d8fcfcbcd6..7a37a2eaceb9 100644
--- a/shared/regex/codeql/regex/RegexTreeView.qll
+++ b/shared/regex/codeql/regex/RegexTreeView.qll
@@ -1,6 +1,8 @@
 /**
  * This file contains a `RegexTreeViewSig` module describing the syntax tree of regular expressions.
  */
+overlay[local?]
+module;
 
 /**
  * A signature describing the syntax tree of regular expressions.
diff --git a/shared/regex/codeql/regex/nfa/BadTagFilterQuery.qll b/shared/regex/codeql/regex/nfa/BadTagFilterQuery.qll
index 0d040bc6f64c..a38229da4971 100644
--- a/shared/regex/codeql/regex/nfa/BadTagFilterQuery.qll
+++ b/shared/regex/codeql/regex/nfa/BadTagFilterQuery.qll
@@ -1,6 +1,8 @@
 /**
  * Provides predicates for reasoning about bad tag filter vulnerabilities.
  */
+overlay[local?]
+module;
 
 private import NfaUtils as NfaUtils
 private import RegexpMatching as RM
diff --git a/shared/regex/codeql/regex/nfa/ExponentialBackTracking.qll b/shared/regex/codeql/regex/nfa/ExponentialBackTracking.qll
index 450ee807089d..23f764973715 100644
--- a/shared/regex/codeql/regex/nfa/ExponentialBackTracking.qll
+++ b/shared/regex/codeql/regex/nfa/ExponentialBackTracking.qll
@@ -61,6 +61,8 @@
  *   * Lastly we ensure that any state reached by repeating `n` copies of `w` has
  *     a suffix `x` (possible empty) that is most likely __not__ accepted.
  */
+overlay[local?]
+module;
 
 private import NfaUtils as NfaUtils
 private import codeql.regex.RegexTreeView
diff --git a/shared/regex/codeql/regex/nfa/NfaUtils.qll b/shared/regex/codeql/regex/nfa/NfaUtils.qll
index d074081b6ac2..e1be49796e00 100644
--- a/shared/regex/codeql/regex/nfa/NfaUtils.qll
+++ b/shared/regex/codeql/regex/nfa/NfaUtils.qll
@@ -1,6 +1,8 @@
 /**
  * A shared library for creating and reasoning about NFA's.
  */
+overlay[local?]
+module;
 
 private import codeql.regex.RegexTreeView
 private import codeql.util.Numbers
diff --git a/shared/regex/codeql/regex/nfa/RegexpMatching.qll b/shared/regex/codeql/regex/nfa/RegexpMatching.qll
index fae1cea5f8c1..85c21b355a4b 100644
--- a/shared/regex/codeql/regex/nfa/RegexpMatching.qll
+++ b/shared/regex/codeql/regex/nfa/RegexpMatching.qll
@@ -2,6 +2,8 @@
  * Provides predicates for reasoning about which strings are matched by a regular expression,
  * and for testing which capture groups are filled when a particular regexp matches a string.
  */
+overlay[local?]
+module;
 
 private import NfaUtils as NfaUtils
 private import codeql.regex.RegexTreeView
diff --git a/shared/regex/codeql/regex/nfa/SuperlinearBackTracking.qll b/shared/regex/codeql/regex/nfa/SuperlinearBackTracking.qll
index 6eb18aeeebc9..fca1641207d4 100644
--- a/shared/regex/codeql/regex/nfa/SuperlinearBackTracking.qll
+++ b/shared/regex/codeql/regex/nfa/SuperlinearBackTracking.qll
@@ -34,6 +34,8 @@
  * It has the same suffix detection issue as the `js/redos` query, which can cause false positives.
  * It also doesn't find all transitions in the product automaton, which can cause false negatives.
  */
+overlay[local?]
+module;
 
 private import NfaUtils as NfaUtils
 private import codeql.regex.RegexTreeView
@@ -99,6 +101,7 @@ module Make<RegexTreeViewSig TreeImpl> {
     /**
      * Holds if the tuple `(r1, r2, r3)` might be on path from a start-state to an end-state in the product automaton.
      */
+    overlay[caller?]
     pragma[inline]
     predicate isFeasibleTuple(State r1, State r2, State r3) {
       // The first element is either inside a repetition (or the start state itself)
diff --git a/shared/ssa/codeql/ssa/Ssa.qll b/shared/ssa/codeql/ssa/Ssa.qll
index 4734cf7e414b..d9a017920171 100644
--- a/shared/ssa/codeql/ssa/Ssa.qll
+++ b/shared/ssa/codeql/ssa/Ssa.qll
@@ -2,6 +2,8 @@
  * Provides a language-independent implementation of static single assignment
  * (SSA) form.
  */
+overlay[local?]
+module;
 
 private import codeql.util.Location
 private import codeql.util.Unit
diff --git a/shared/threat-models/codeql/threatmodels/ThreatModels.qll b/shared/threat-models/codeql/threatmodels/ThreatModels.qll
index 19dfd0d1a656..dbb220c46e67 100644
--- a/shared/threat-models/codeql/threatmodels/ThreatModels.qll
+++ b/shared/threat-models/codeql/threatmodels/ThreatModels.qll
@@ -4,6 +4,8 @@
  * This module provides extensible predicates for configuring which kinds of MaD models
  * are applicable to generic queries.
  */
+overlay[local?]
+module;
 
 /**
  * Holds configuration entries to specify which threat models are enabled.
diff --git a/shared/typeflow/codeql/typeflow/TypeFlow.qll b/shared/typeflow/codeql/typeflow/TypeFlow.qll
index a2ae213ecb7f..52a911974091 100644
--- a/shared/typeflow/codeql/typeflow/TypeFlow.qll
+++ b/shared/typeflow/codeql/typeflow/TypeFlow.qll
@@ -7,6 +7,8 @@
  * type has a subtype or if an inferred upper bound passed through at least one
  * explicit or implicit cast that lost type information.
  */
+overlay[local?]
+module;
 
 private import codeql.util.Location
 
diff --git a/shared/typeflow/codeql/typeflow/UniversalFlow.qll b/shared/typeflow/codeql/typeflow/UniversalFlow.qll
index 75b210f8cebb..e5f07690a183 100644
--- a/shared/typeflow/codeql/typeflow/UniversalFlow.qll
+++ b/shared/typeflow/codeql/typeflow/UniversalFlow.qll
@@ -25,6 +25,8 @@
  * that subsequently calculated properties hold under the assumption that the
  * value is not null.
  */
+overlay[local?]
+module;
 
 private import codeql.util.Location
 private import codeql.util.Unit
diff --git a/shared/typeflow/codeql/typeflow/internal/TypeFlowImpl.qll b/shared/typeflow/codeql/typeflow/internal/TypeFlowImpl.qll
index f17b809ca32d..437e1ab31992 100644
--- a/shared/typeflow/codeql/typeflow/internal/TypeFlowImpl.qll
+++ b/shared/typeflow/codeql/typeflow/internal/TypeFlowImpl.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 private import codeql.typeflow.TypeFlow
 private import codeql.typeflow.UniversalFlow as UniversalFlow
 private import codeql.util.Location
diff --git a/shared/typeinference/codeql/typeinference/internal/TypeInference.qll b/shared/typeinference/codeql/typeinference/internal/TypeInference.qll
index f152d4a16422..f2d13137de0b 100644
--- a/shared/typeinference/codeql/typeinference/internal/TypeInference.qll
+++ b/shared/typeinference/codeql/typeinference/internal/TypeInference.qll
@@ -122,6 +122,8 @@
  * }
  * ```
  */
+overlay[local?]
+module;
 
 private import codeql.util.Location
 
@@ -849,6 +851,7 @@ module Make1<LocationSig Location, InputSig1<Location> Input1> {
         )
       }
 
+      overlay[caller?]
       pragma[inline]
       predicate baseTypeMentionHasNonTypeParameterAt(
         Type sub, TypeMention baseMention, TypePath path, Type t
@@ -856,6 +859,7 @@ module Make1<LocationSig Location, InputSig1<Location> Input1> {
         not t = sub.getATypeParameter() and baseTypeMentionHasTypeAt(sub, baseMention, path, t)
       }
 
+      overlay[caller?]
       pragma[inline]
       predicate baseTypeMentionHasTypeParameterAt(
         Type sub, TypeMention baseMention, TypePath path, TypeParameter tp
diff --git a/shared/typetracking/codeql/typetracking/TypeTracking.qll b/shared/typetracking/codeql/typetracking/TypeTracking.qll
index 7a411adb6333..da5b129241a7 100644
--- a/shared/typetracking/codeql/typetracking/TypeTracking.qll
+++ b/shared/typetracking/codeql/typetracking/TypeTracking.qll
@@ -2,6 +2,8 @@
  * Provides classes and predicates for simple data-flow reachability suitable
  * for tracking types.
  */
+overlay[local?]
+module;
 
 private import codeql.util.Location
 
diff --git a/shared/typetracking/codeql/typetracking/internal/SummaryTypeTracker.qll b/shared/typetracking/codeql/typetracking/internal/SummaryTypeTracker.qll
index b942446d43ba..36dce0d081e4 100644
--- a/shared/typetracking/codeql/typetracking/internal/SummaryTypeTracker.qll
+++ b/shared/typetracking/codeql/typetracking/internal/SummaryTypeTracker.qll
@@ -3,6 +3,8 @@
  * To use this, you must implement the `Input` signature. You can then use the predicates in the `Output`
  * signature to implement the predicates of the same names inside `TypeTrackerSpecific.qll`.
  */
+overlay[local?]
+module;
 
 /** The classes and predicates needed to generate type-tracking steps from summaries. */
 signature module Input {
diff --git a/shared/typetracking/codeql/typetracking/internal/TypeTrackingImpl.qll b/shared/typetracking/codeql/typetracking/internal/TypeTrackingImpl.qll
index b36edca04e7c..fcfcfe9ecd1d 100644
--- a/shared/typetracking/codeql/typetracking/internal/TypeTrackingImpl.qll
+++ b/shared/typetracking/codeql/typetracking/internal/TypeTrackingImpl.qll
@@ -2,6 +2,8 @@
  * Provides classes and predicates for simple data-flow reachability suitable
  * for tracking types.
  */
+overlay[local?]
+module;
 
 private import codeql.util.Boolean
 private import codeql.util.Option
@@ -510,6 +512,7 @@ module TypeTracking<LocationSig Location, TypeTrackingInput<Location> I> {
      * }
      * ```
      */
+    overlay[caller?]
     pragma[inline]
     TypeTracker smallstep(Node nodeFrom, Node nodeTo) {
       result = this.smallstepNoSimpleLocalFlowStep(nodeFrom, nodeTo)
@@ -654,6 +657,7 @@ module TypeTracking<LocationSig Location, TypeTrackingInput<Location> I> {
      * }
      * ```
      */
+    overlay[caller?]
     pragma[inline]
     TypeBackTracker smallstep(Node nodeFrom, Node nodeTo) {
       result = this.smallstepNoSimpleLocalFlowStep(nodeFrom, nodeTo)
diff --git a/shared/typos/codeql/typos/TypoDatabase.qll b/shared/typos/codeql/typos/TypoDatabase.qll
index a41f003a8c0c..7f1a8c2a3e73 100644
--- a/shared/typos/codeql/typos/TypoDatabase.qll
+++ b/shared/typos/codeql/typos/TypoDatabase.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 /**
  * Holds if `wrong` is a common misspelling of `right`.
  *
diff --git a/shared/util/codeql/util/AlertFiltering.qll b/shared/util/codeql/util/AlertFiltering.qll
index 97acd803f01e..1bc366c0416d 100644
--- a/shared/util/codeql/util/AlertFiltering.qll
+++ b/shared/util/codeql/util/AlertFiltering.qll
@@ -2,6 +2,8 @@
  * Provides the `restrictAlertsTo` extensible predicate to restrict alerts to specific source
  * locations, and the `AlertFilteringImpl` parameterized module to apply the filtering.
  */
+overlay[local?]
+module;
 
 private import codeql.util.Location
 
diff --git a/shared/util/codeql/util/Boolean.qll b/shared/util/codeql/util/Boolean.qll
index b58dc9a308f3..0f35421c408a 100644
--- a/shared/util/codeql/util/Boolean.qll
+++ b/shared/util/codeql/util/Boolean.qll
@@ -1,4 +1,6 @@
 /** Provides the `Boolean` class. */
+overlay[local?]
+module;
 
 /**
  * A utility class that is equivalent to `boolean`.
diff --git a/shared/util/codeql/util/DenseRank.qll b/shared/util/codeql/util/DenseRank.qll
index 0dccbbd48803..89ab865e9595 100644
--- a/shared/util/codeql/util/DenseRank.qll
+++ b/shared/util/codeql/util/DenseRank.qll
@@ -2,6 +2,8 @@
  * Provides modules for computing dense `rank`s. See the `DenseRank` module
  * below for a more detailed explanation.
  */
+overlay[local?]
+module;
 
 /** Provides the input to `DenseRank`. */
 signature module DenseRankInputSig {
diff --git a/shared/util/codeql/util/Either.qll b/shared/util/codeql/util/Either.qll
index d514b9eaed58..a6796f99f38b 100644
--- a/shared/util/codeql/util/Either.qll
+++ b/shared/util/codeql/util/Either.qll
@@ -1,4 +1,6 @@
 /** Provides a module for constructing a union `Either` type. */
+overlay[local?]
+module;
 
 /** A type with `toString`. */
 private signature class TypeWithToString {
diff --git a/shared/util/codeql/util/FilePath.qll b/shared/util/codeql/util/FilePath.qll
index 1b047f3c91ce..ff62ce6ee5e3 100644
--- a/shared/util/codeql/util/FilePath.qll
+++ b/shared/util/codeql/util/FilePath.qll
@@ -1,4 +1,6 @@
 /** Provides a utility for normalizing filepaths. */
+overlay[local?]
+module;
 
 /**
  * A filepath that should be normalized.
diff --git a/shared/util/codeql/util/FileSystem.qll b/shared/util/codeql/util/FileSystem.qll
index 2b120faaacea..fe724190f746 100644
--- a/shared/util/codeql/util/FileSystem.qll
+++ b/shared/util/codeql/util/FileSystem.qll
@@ -1,4 +1,6 @@
 /** Provides classes for working with files and folders. */
+overlay[local?]
+module;
 
 /** Provides the input specification of the files and folders implementation. */
 signature module InputSig {
diff --git a/shared/util/codeql/util/Location.qll b/shared/util/codeql/util/Location.qll
index 8faa1ee4eeb9..c592f2c55564 100644
--- a/shared/util/codeql/util/Location.qll
+++ b/shared/util/codeql/util/Location.qll
@@ -1,4 +1,6 @@
 /** Provides classes for working with locations. */
+overlay[local?]
+module;
 
 /**
  * A location as given by a file, a start line, a start column,
diff --git a/shared/util/codeql/util/Numbers.qll b/shared/util/codeql/util/Numbers.qll
index 050f3c023f11..126307d41b4e 100644
--- a/shared/util/codeql/util/Numbers.qll
+++ b/shared/util/codeql/util/Numbers.qll
@@ -2,6 +2,8 @@
  * Provides predicates for working with numeric values and their string
  * representations.
  */
+overlay[local?]
+module;
 
 /**
  * Gets the integer value of `binary` when interpreted as binary. `binary` must
diff --git a/shared/util/codeql/util/Option.qll b/shared/util/codeql/util/Option.qll
index 8ba4d8e840bc..65a5e8724526 100644
--- a/shared/util/codeql/util/Option.qll
+++ b/shared/util/codeql/util/Option.qll
@@ -1,4 +1,6 @@
 /** Provides a module for constructing optional versions of types. */
+overlay[local?]
+module;
 
 /** A type with `toString`. */
 private signature class TypeWithToString {
diff --git a/shared/util/codeql/util/ReportStats.qll b/shared/util/codeql/util/ReportStats.qll
index 03f381b5b9b3..947eff548e75 100644
--- a/shared/util/codeql/util/ReportStats.qll
+++ b/shared/util/codeql/util/ReportStats.qll
@@ -1,6 +1,7 @@
 /**
  * Provides the `ReportStats` module for reporting database quality statistics.
  */
+overlay[local?]
 module;
 
 signature module StatsSig {
diff --git a/shared/util/codeql/util/Strings.qll b/shared/util/codeql/util/Strings.qll
index 6b8b6f2fb1d0..c82c23a9988b 100644
--- a/shared/util/codeql/util/Strings.qll
+++ b/shared/util/codeql/util/Strings.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 private import Numbers
 
 /**
diff --git a/shared/util/codeql/util/Unit.qll b/shared/util/codeql/util/Unit.qll
index a0db9d7030f7..27e890788ff9 100644
--- a/shared/util/codeql/util/Unit.qll
+++ b/shared/util/codeql/util/Unit.qll
@@ -1,4 +1,6 @@
 /** Provides the `Unit` class. */
+overlay[local?]
+module;
 
 /** The unit type. */
 private newtype TUnit = TMkUnit()
diff --git a/shared/util/codeql/util/Void.qll b/shared/util/codeql/util/Void.qll
index 886687b54602..28501cb9aca6 100644
--- a/shared/util/codeql/util/Void.qll
+++ b/shared/util/codeql/util/Void.qll
@@ -1,4 +1,6 @@
 /** Provides the empty `Void` class. */
+overlay[local?]
+module;
 
 /** The empty void type. */
 private newtype TVoid = TMkVoid() { none() }
diff --git a/shared/util/codeql/util/suppression/AlertSuppression.qll b/shared/util/codeql/util/suppression/AlertSuppression.qll
index fad8d96566c0..722791148679 100644
--- a/shared/util/codeql/util/suppression/AlertSuppression.qll
+++ b/shared/util/codeql/util/suppression/AlertSuppression.qll
@@ -1,3 +1,6 @@
+overlay[local?]
+module;
+
 signature class AstNode {
   predicate hasLocationInfo(
     string filepath, int startline, int startcolumn, int endline, int endcolumn
diff --git a/shared/util/codeql/util/test/ExternalLocationPostProcessing.qll b/shared/util/codeql/util/test/ExternalLocationPostProcessing.qll
index 2ebd2b452828..4515bdabc79a 100644
--- a/shared/util/codeql/util/test/ExternalLocationPostProcessing.qll
+++ b/shared/util/codeql/util/test/ExternalLocationPostProcessing.qll
@@ -6,6 +6,7 @@
  * VS Code, but prevents the "Location is outside of test directory" warning
  * when executed through `codeql test run`.
  */
+overlay[local?]
 module;
 
 external private predicate queryResults(string relation, int row, int column, string data);
diff --git a/shared/xml/codeql/xml/Xml.qll b/shared/xml/codeql/xml/Xml.qll
index 02d0ffc66fda..9620b156719e 100644
--- a/shared/xml/codeql/xml/Xml.qll
+++ b/shared/xml/codeql/xml/Xml.qll
@@ -1,6 +1,8 @@
 /**
  * Provides classes and predicates for working with XML files and their content.
  */
+overlay[local?]
+module;
 
 private import codeql.util.Location
 private import codeql.util.FileSystem
diff --git a/shared/yaml/codeql/serverless/ServerLess.qll b/shared/yaml/codeql/serverless/ServerLess.qll
index a0322ad47a12..009b50c7d1ca 100644
--- a/shared/yaml/codeql/serverless/ServerLess.qll
+++ b/shared/yaml/codeql/serverless/ServerLess.qll
@@ -2,6 +2,8 @@
  * Provides classes and predicates for working with serverless handlers.
  * E.g. [AWS](https://docs.aws.amazon.com/lambda/latest/dg/nodejs-handler.html) or [serverless](https://npmjs.com/package/serverless)
  */
+overlay[local?]
+module;
 
 /**
  * Provides the input for the `ServerLess` module.
diff --git a/shared/yaml/codeql/yaml/Yaml.qll b/shared/yaml/codeql/yaml/Yaml.qll
index 1467fd09d137..153ff5979c8e 100644
--- a/shared/yaml/codeql/yaml/Yaml.qll
+++ b/shared/yaml/codeql/yaml/Yaml.qll
@@ -4,6 +4,8 @@
  * YAML documents are represented as abstract syntax trees whose nodes
  * are either YAML values or alias nodes referring to another YAML value.
  */
+overlay[local?]
+module;
 
 /** Provides the input specification of YAML implementation. */
 signature module InputSig {