private boolean isSource(FromSourceLocation sourceLocation) {
        if (sourceLocation == null) {
            return true;
        }

        String location = sourceLocation.getSourceLocation().getFilename();
        int offsetFromStart = findOffsetFromStart(location);

        for (Path path : sources) {
            String pathString = path.toString();
            int offsetFromStartInSource = findOffsetFromStart(pathString);
            // Compare the strings in a way that normalizes them and strips off protocols.
            if (location.regionMatches(offsetFromStart, pathString, offsetFromStartInSource, pathString.length())) {
                return true;
            }
        }

        return false;
    }
Checks if the given metadata key-value pair is either not present
in the old model (thus a new, source metadata), or is present and
the filename of the entry in the original model matches one of
the defined {@code sources}.

@param metadataKey Metadata key to check.
@return Returns true if this metadata is considered a source entry.
smithy-build/src/main/java/software/amazon/smithy/build/PluginContext.java