Repository navigation
op repo_map
Repository map: modules → files → key symbols, within a token budget.
| Group | Navigation and reading |
| Edition | community — works without a licence |
| Capability |
graph — the feature that carries this operation; the licence matrix is on 15 · Editions and licensing
|
| MCP tool |
ragraf_repo_map · read-only · idempotent |
| CLI | ragraf -p <config> query repo_map … |
A map answers what a file listing cannot: which modules exist, which files belong to each, and which symbols matter inside them, ranked by connectivity and centrality in the graph. The answer is held inside a token budget, so the map can be given to a model without filling its context.
- Learn the shape of a repository before reading any file.
- Choose where to start reading by centrality rather than by directory order.
- Keep the answer inside a stated budget of tokens.
The call that produced the answer below, as a command line:
$ ragraf -p demo-corpus.yaml query repo_map
The same call through MCP: ragraf_repo_map().
The answer below was captured on the demo corpus, not written for the page:
{
"op": "repo_map",
"index_rev": "rev-0002",
"capability": "degraded",
"provenance": "index",
"found": true,
"result": {
"files": [
{
"path": "web/order.php",
"line": 1,
"symbols": 3,
"top": [
"... 1 more"
]
},
{
"path": "src/app/models.py",
"line": 1,
"symbols": 6,
"top": [
"... 2 more"
]
},
"... 5 more"
],
"files_included": 7,
"files_total": 7,
"chars_used": 2270,
"budget_chars": 6400,
"budget_tokens": 2000,
"ranking": "centrality",
"top_centrality": [
{
"path": "web/order.php",
"score": 0.0511912
},
{
"path": "src/app/models.py",
"score": 0.04896727
},
"... 5 more"
],
"graph_compute": {
"backend": "torch-cpu",
"device": "cpu",
"nodes": 69,
"edges": 49,
"ms": 0.974,
"warmup_ms": 2.966,
"iterations": 30,
"notes_count": 1
}
},
"limits_count": 1
}The call succeeded. The answer is trimmed to two items per list and to the fields that carry no Russian prose: limits and the explanatory strings are counted in the footer below instead of being quoted.
| Name | Type | Default |
|---|---|---|
scope |
str | None |
None |
budget_tokens |
int |
2000 |
detail |
str |
'normal' |
Result keys visible in the code: budget_chars, budget_note, budget_tokens, chars_used, files, files_included, files_total, ranking, ranking_note, scope.
The body also writes these fields into the answer envelope itself (extra): budget_ok.
The envelope around the result is the same for every operation; how to read it: 04 · Operations reference.
| Step | What happens |
|---|---|
| Reads | none of the three stores directly — the answer comes through the engine the body calls, or from what the call is given |
| Calls | util.to_posix |
| Guarded by | the index revision is read (current_rev), so every fact belongs to a named revision; a missing index is refused by name (_no_index) instead of raising |
| Writes |
budget_ok into the answer envelope |
| Empty answer | no separate branch: the body returns what it computed |
flowchart TD
Start[query repo_map]
Rev{index revision}
NoIndex[refused: no index]
Call0[util.to_posix]
Out[envelope with result]
Start --> Rev
Rev -- none --> NoIndex
Rev -- rev-N --> Call0
Call0 --> Out
Every answer carries a limits field, and it is never empty when a boundary exists: that is where the limits of this particular call are named — which part of the corpus was not covered, which fact could not be confirmed, what the operation refused to guess.
The boundary of the whole Navigation and reading group is stated once, on the reference page. It is a sentence about the group, so it is not repeated here as if it were a sentence about repo_map.
← previous in the group: freshness
→ next in the group: catalog
The full table with all 87 operations · A–Z index · Navigation and reading
Where these fields come from: the parameters, their types and defaults are read from the signature op_repo_map in src/ragraf/facade.py:4580 (line numbers as of 0.12.0); the MCP annotations from the tool registration; the edition from src/ragraf/edition_baseline.json; the guards, calls, stores, envelope fields and the diagram from the body of that same method. The example is a run of tools/build-op-examples.py on the demo corpus at revision rev-0002; fields whose value is Russian prose in this build (limits, explanatory strings) are counted, not quoted. Nothing else on this page is written by hand.
The reason and the tasks above are a translation of the docstring of op_repo_map, src/ragraf/facade.py:4580, kept in tools/op-text.json next to the line it came from. That file is the only hand-written text in the pipeline; the gate tools/check-op-text.py checks that the line exists and that its text is English.