diff --git a/docs/roadmap/remediation.md b/docs/roadmap/remediation.md index 1afd4fb..9be758d 100644 --- a/docs/roadmap/remediation.md +++ b/docs/roadmap/remediation.md @@ -187,6 +187,8 @@ basis for the analysis. ## Finding 6 — Skipped directory imports copy shared patterns per declaration +**Status** — Complete. Inherited directory policies borrow the read-only load snapshot. Import selection and no-base tests passed. + **Priority P3.** With no base, `acquireContextlessInput` calls `prepareImportDeclarations`, which holds one full resolved policy per declaration. Each directory declaration that inherits the load-wide diff --git a/internal/engine/import_spec.go b/internal/engine/import_spec.go index e1e95e4..1855510 100644 --- a/internal/engine/import_spec.go +++ b/internal/engine/import_spec.go @@ -124,7 +124,8 @@ func resolveImportPolicy(spec importDeclarationSpec, defaults ImportDefaults) (r if spec.patternSet { policy.pattern = cloneStrings(spec.pattern) } else { - policy.pattern = cloneStrings(defaults.Pattern) + // Defaults belong to the load's snapshot. Selectors only read them. + policy.pattern = defaults.Pattern } } if spec.depthSet && !policy.recursive {