Skip to content

Fix explicit relative references in nested instruction files - #414

Merged
Brian Krabach (bkrabach) merged 3 commits into
mainfrom
fix/nested-instruction-references
Sep 25, 2026
Merged

Brian Krabach (bkrabach) merged 3 commits into
mainfrom
fix/nested-instruction-references

Conversation

@bkrabach

@bkrabach Brian Krabach (bkrabach) commented Sep 25, 2026 •

Copy link
Copy Markdown
Collaborator

An instruction file such as rules/AGENTS.md containing @./tasks.md currently loads the workspace's tasks.md, even though the loader passes the referring directory recursively. Resolve explicit ./ and ../ references beside their referring file. Keep bare @AGENTS.md workspace-relative so Anchors continues to load the current project's instructions; preserve namespaces, home paths, missing-file behavior and legacy resolver implementations.

Adds an optional per-call resolver capability without mutating shared resolver state or bypassing subclass policy. Tracks visited paths separately from content deduplication so identical global/project instruction files can each load their distinct relative task rules.

Validation: 188 tests passed across mention expansion, real prompt factories, bundle preparation and subprocess behavior. Five new checks fail against the unmodified installed Foundation. The generic instruction fixture verifies rule delivery across repeated turns, refreshed factories, two bundle namespaces, edits and removal; it makes no model requests and does not access personal files. Ruff and diff checks passed.

Class-wide review covered current Amplifier MODULES.md, local inventories, Microsoft code search and known community sources. The equivalent amplifier-lib loader is being patched in parallel; CLI/Unified require a small optional-capability adapter. Community Rust/Lakehouse implementations and the runtime bounding wrapper have separate compatibility gaps recorded for follow-up.

Bundle-declared context: files now pass through the same recursive loader. Tests cover that entry point, filenames containing spaces, edits and fresh/resumed prompt factories. Raw file-tool results and attachments remain literal content. All production behavior is generic; no filename is special-cased.

@bkrabach
Brian Krabach (bkrabach) marked this pull request as ready for review September 25, 2026 12:57
@bkrabach
Brian Krabach (bkrabach) merged commit 89575c3 into main Sep 25, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant