From ccedd79cad348817d85ce8f0c575ad5ba77b9cdc Mon Sep 17 00:00:00 2001 From: Eric Rakestraw Date: Sat, 5 Dec 2026 19:16:28 +0000 Subject: [PATCH] Clarify import path and resource context semantics --- docs/roadmap/absolute-imports.md | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/docs/roadmap/absolute-imports.md b/docs/roadmap/absolute-imports.md index 26a411c..1ea191c 100644 --- a/docs/roadmap/absolute-imports.md +++ b/docs/roadmap/absolute-imports.md @@ -74,6 +74,12 @@ An absolute glob establishes its absolute starting location; it does not scan the declaring file's directory first. Handle path roots separately from pattern segments so normalization preserves wildcard and escape semantics. +Preserve traversal order when parent segments follow wildcards. For example, +`services/*/../shared/*.yml` must expand the wildcard directory segment before +processing its following `..`, using the existing link-handling rules. Cleaning +the complete pattern as though `*` were a literal directory name would change +which directories are visited and could suppress relevant access errors. + Relative imports in an acquired file resolve from that file's own canonical directory, including when it lies outside the main file's directory. YAML `destination` and `placement` continue to describe configuration-tree placement; @@ -100,6 +106,13 @@ operations. The existing `fs.ValidPath` conventions for `Filesystem.File` and one conceptual absolute/relative rule across host and supplied filesystems while respecting the selected namespace. +The namespace-root interpretation of a leading `/` applies to YAML selectors. +Symlink target strings returned by a supplied filesystem retain their existing +interpretation and validation, including existing `fs.ReadLinkFS` capability +handling. Do not apply YAML selector rewriting to those target strings; a host +absolute target returned by a filesystem wrapper must not be reinterpreted as +an absolute YAML path within that namespace. + ### Explicit roots and links Keep relative-path base selection independent of optional import containment. @@ -153,6 +166,13 @@ without an explicit containment root receives a passive context rooted at that source's canonical directory, with `BaseDir` equal to `.`. With an explicit root, continue using it for the passive context as today. +For a synthetic host source with `BaseDir` and no explicit `Root`, use that +`BaseDir` as its default passive resource root, with resource `BaseDir` equal to +`.`. Imports inside that resource root share it; external imports receive the +source-directory-rooted context described above. A main-relative input preserves +its inherited resource context, including its resource root and base coordinates, +instead of manufacturing a new resource root from its relative lookup base. + This gives an external file the default resource scope it would have when loaded directly, while retaining established consumers' contexts. A caller needing resource access beyond that directory can select a broader explicit context. @@ -240,7 +260,10 @@ configuration to adopt the release. inspection interactions. Verify namespace-root YAML selectors separately from unchanged Go filesystem argument conventions. Include compatibility cases for existing valid relative imports, explicit roots, synthetic contexts and passive - resource coordinates. Reuse existing semantic, budget and cleanup coverage + resource coordinates. Include a glob with parent traversal after a wildcard, + synthetic host contexts with an omitted root, inherited main-relative resource + contexts, and the distinction between native YAML selectors and native symlink + targets. Reuse existing semantic, budget and cleanup coverage rather than adding a Cartesian test matrix or performance thresholds. The implementation plan will own sequencing and concrete verification commands.