Skip to main content

Module project_instructions

Module project_instructions 

Source
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§

ProjectInstructionFile
One resolved project-instruction file.
ScanOutcome 🔒
What a scan ran into, beyond the files it found.

Enums§

InstructionOwner
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_id will read as instructions from working_directory.
scan_dir 🔒
Collect qualifying files under one declared scan directory.