Expand description
What an agent will actually read as project instructions.
Phase 3 of SPEC_INSTRUCTION_AND_MEMORY_PORTABILITY_2026_09_09.md. Until
now AgentMux could say what it wrote to an agent’s working directory and
nothing about what the agent would read there. A repository’s own
CLAUDE.md or AGENTS.md can be the majority of what an agent is told,
and §2.4 established that the only thing ever recorded about one was a
single boolean — no path, no hash, no content.
Read-only, permanently. This module opens files and hashes them. It
never writes one, and nothing downstream of it may either: the ownership
protection in SPEC_CLAUDE_MD_OWNERSHIP_PROTECTION_2026_08_22.md exists
because a foreign instruction file is not ours, and a portability feature
must not become a back door into overwriting one (spec §5.2).
The file set comes from the provider registry’s native_instruction_sources
— every path a provider picks up on its own — rather than from
startup_instructions_filename, which names only the single file AgentMux
writes. For Copilot those differ by three files.
Structs§
- Project
Instruction File - One resolved project-instruction file.
- Scan
Outcome 🔒 - What a scan ran into, beyond the files it found.
Enums§
- Instruction
Owner - Who wrote an instruction file.
Constants§
- MAX_
INSTRUCTION_ FILE_ BYTES - Per-file read ceiling.
- MAX_
SCANNED_ 🔒DIRECTORIES - Collect qualifying files under one declared scan directory.
- MAX_
SCANNED_ INSTRUCTION_ FILES - Ceiling on files discovered by directory scan, per scan entry.
- MAX_
TOTAL_ INSTRUCTION_ BYTES - Ceiling on the total content this resolver will return in one call.
Functions§
- classify_
owner 🔒 - Who owns this file — by marker, or by construction.
- effective_
working_ dir - The directory this agent will actually run in.
- paths_
for_ 🔒provider - Every path this provider reads, plus AgentMux’s own side file.
- read_
one 🔒 - Read one instruction file, whatever state it is in.
- resolve_
project_ instructions - Everything
provider_idwill read as instructions fromworking_directory. - scan_
dir 🔒 - Collect qualifying files under one declared scan directory.