Skip to main content

Module context

Module context 

Source
Expand description

Agent-facing context aggregation.

The Context envelope is the payload repograph context emits — for each in-scope repository, the inlined content of every file matching the user’s selected agents’ file patterns. Stable JSON shape is the contract with downstream AI agents.

Pattern resolution is deliberately bounded: flat patterns (e.g. CLAUDE.md) are checked by direct existence, glob patterns under a known parent directory (e.g. .cursor/rules/*.md) are matched against a single non- recursive directory listing. We never walk the repo tree blindly — that’s the kind of behavior that would force us to add .gitignore semantics to avoid traversing node_modules, and the registry’s patterns don’t need it.

Structs§

AgentDoc
One agent’s matched files within a single repo.
Context
Top-level payload emitted by repograph context. schema_version is the contract — additive-only at 1; breaking changes bump it.
MatchedFile
One file the resolver matched against an agent’s pattern set.
RepoContext
Per-repo block of the Context envelope.

Enums§

Scope
The scope a repograph context invocation was resolved against.

Constants§

SCHEMA_VERSION
The current (and only) Context schema version. Downstream agents pin on this; bumping it is a breaking change.

Functions§

resolve_agent_docs
Walk the registry’s patterns for each agent against repo_root.