pub fn load_project_instructions(
cwd: &Path,
cfg: &InstructionsConfig,
) -> ProjectInstructionsExpand description
Discover project instructions for cwd under cfg.
Order (lowest precedence first, so the deepest project file wins on conflict):
global ~/.locode/AGENTS.md, then the primary chain root→cwd, then each
extra_roots entry’s own root→dir chain. Per directory, AGENTS.override.md replaces
AGENTS.md (first-match-wins by existence). Empty/whitespace-only and gitignored files
(primary chain only) are dropped; entries are deduped by canonical path.
Synchronous by design: the walk is bounded (at most root-deep) and the files are tiny, so this runs inline once per turn (ADR-0023 “per-turn rescan”).