Repository navigation
op diff
What changed between revisions: files, symbols, edges, regressions.
| Group | Code graph |
| 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_diff · read-only · idempotent |
| CLI | ragraf -p <config> query diff … |
Drift existed only for the database layer, while the question "did the series of edits break anything" was answered by eye over a diff. Here the facts of the index answer it: what appeared and disappeared, which function lost its callers, and which table stopped being filled. The limits of trust are named in the answer, because one of the revisions may have been built with capability=degraded, where part of the edges never existed.
- Compare two revisions of the index by files, symbols and edges.
- Find regressions: a function that no longer has callers, a table that stopped being filled.
- Read "disappeared" with its caveat: on a degraded revision it can mean "was not parsed".
The call that produced the answer below, as a command line:
$ ragraf -p demo-corpus.yaml query diff
The same call through MCP: ragraf_diff().
The answer below was captured on the demo corpus, not written for the page:
{
"op": "diff",
"index_rev": "rev-0002",
"capability": "degraded",
"provenance": "index",
"found": true,
"result": {
"from": "rev-0001",
"to": "rev-0002",
"same": false,
"modes": {
"from": {
"capability": "degraded",
"state": "ready",
"file_count": 11,
"node_count": 68,
"edge_count": 89,
"created_at": "2026-11-10T20:06:17+03:00",
"rev_id": "rev-0001"
},
"to": {
"capability": "degraded",
"state": "ready",
"file_count": 11,
"node_count": 69,
"edge_count": 91,
"created_at": "2026-11-10T20:08:38+03:00",
"rev_id": "rev-0002"
}
},
"files": {
"added": [],
"removed": [],
"changed": [
"web/order_lib.php"
],
"counts": {
"added": 0,
"removed": 0,
"changed": 1,
"before": 11,
"after": 11
}
},
"symbols": {
"added": [],
"removed": [],
"counts": {
"added": 1,
"removed": 0,
"before": 22,
"after": 23
}
},
"edges": {
"by_kind": {
"calls": {},
"calls_builtin": {},
"calls_heuristic": {},
"contains": {},
"defines": {},
"imports": {},
"imports_heuristic": {},
"instantiates": {},
"queries": {},
"reads_superglobal": {},
"routes": {},
"uses_class": {}
},
"total": {
"before": 89,
"after": 91
}
},
"callers_lost": {
"items": [],
"count": 0
},
"writes_lost": {
"items": [],
"count": 0
}
},
"limits_count": 3
}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 |
|---|---|---|
since |
str | None |
None |
limit |
int |
50 |
result is assembled at runtime, so the code carries no static list of its keys: the shape is whatever the sentence above describes, and the diagram below shows the steps that build it.
The body also writes these fields into the answer envelope itself (extra): note, regressions, suggest.
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 | no module function: the body computes the answer itself |
| 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 |
note, regressions, suggest into the answer envelope |
| Empty answer | yes, and names where to go instead: index_status, drift_report
|
flowchart TD
Start[query diff]
Rev{index revision}
NoIndex[refused: no index]
Body[operation body]
Found{found}
Empty[empty result + suggest: index_status drift_report]
Out[envelope with result]
Start --> Rev
Rev -- none --> NoIndex
Rev -- rev-N --> Body
Body --> Found
Found -- no --> Empty
Found -- yes --> 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 Code graph 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 diff.
← previous in the group: edge_evidence
→ this is the last operation of the group
The full table with all 79 operations · A–Z index · Code graph
Where these fields come from: the parameters, their types and defaults are read from the signature op_diff in src/ragraf/facade.py:5247 (line numbers as of 0.11.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_diff, src/ragraf/facade.py:5247, 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.