Expand description
Discovery of workspace context files (AGENTS.md and friends).
A mission arrives as data (PROPOSAL.md Bet 4), and the largest part of that data is the workspace’s own instructions. This module finds them and orders them; it does not interpret them.
Precedence runs least-specific to most-specific: a global file, then each ancestor directory from the outermost inward, then the workspace root. The rendered output preserves that order, so a more specific document is read last and reads as an override.
Each of those directories is asked for AGENTS.md and then, only if it has
none, for CLAUDE.md — one document per directory, the first name that is
there. Both files are the same convention under two names, and a repository
that carries only the older one is not a repository with no instructions.
Structs§
- Context
Config - How to look for context files. Every knob has a convention-shaped default; none of them encode a task.
- Context
Document - One discovered context file, with the text as it was on disk.
- Workspace
Context - The context files that apply to one workspace, ordered weakest-first.
Enums§
- Context
Error - Anything that can go wrong while discovering context.
- Context
Scope - Where a context document was found. Ordering is precedence:
Globalis the weakest,Workspacethe strongest. - System
Prompt - What a host says on top of what the workspace says.
Constants§
- DEFAULT_
CONTEXT_ FALLBACK_ FILE - What basis reads in a directory that has no
DEFAULT_CONTEXT_FILE. - DEFAULT_
CONTEXT_ FILE - The default file name basis looks for. Chosen by convention, not by basis —
AGENTS.mdis a cross-agent standard.