isExternalId returns true for absolute paths outside layer roots even when include matches
The include check is evaluated before the layerRoots check. If an absolute path outside all layer roots matches an include pattern, it correctly returns false. However, if the path is inside a layer root but does NOT match any include pattern, it falls through to the NODE_MODULES_RE check and returns false (correct). But if the path is outside all layer roots AND does NOT match any include pattern, it returns true — even if the path is not in node_modules. This is the intended behavior for linked libs, but the function name and comment suggest it's about "external" meaning "should not get auto-imports". The issue is that the include parameter is documented as "node_modules layers" but the function applies it to ALL paths, not just node_modules paths. This could cause a linked lib that happens to match an include pattern to incorrectly get auto-imports injected. The logic is correct for the current use case, but the semantics are confusing and fragile — if someone adds an include pattern for a non-node_modules path, it would unexpectedly affect linked libs.