From ef420c943bec20928766f10647a81ed2f99a454b Mon Sep 17 00:00:00 2001 From: Eric Rakestraw Date: Mon, 9 Nov 2026 21:20:48 +0000 Subject: [PATCH] Reuse default import patterns --- docs/roadmap/remediation.md | 2 ++ internal/engine/import_spec.go | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) 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 {