Skip to content

op references

Mikhail Deynekin edited this page Nov 22, 2026 · 7 revisions

references

Every place a symbol is used.

Group Navigation and reading
Edition community — works without a licence
Capability search — the feature that carries this operation; the licence matrix is on 15 · Editions and licensing
MCP tool ragraf_references · read-only · idempotent · requires fqn
CLI ragraf -p <config> query references …

Why it exists

The question "where else does this appear" is not answered by calls alone: a translation key (uses_key), a Perl package variable (reads_var), a table reference (queries) and a route (routes) are uses too, and without them nodes that nothing calls had no answer at all (P1-3). Stage 10 then added the kind of evidence to every link: an answer used to carry provenance and confidence, and provenance=stated reads like proof, while a binding by name is a conclusion, not a fact.

What it solves

  • List every place a symbol is used, including the non-call uses that a call graph misses.
  • Decide whether a link is a fact or an inference: the kind of evidence is named on each link, next to its confidence.
  • Keep weak links visible: the threshold is deliberately not applied here, the summary names how many links were shown, and min_confidence names how many it cut.

How to use it

The call that produced the answer below, as a command line:

$ ragraf -p demo-corpus.yaml query references --fqn db_query

The same call through MCP: ragraf_references(fqn=…).

The answer below was captured on the demo corpus, not written for the page:

{
 "op": "references",
 "index_rev": "rev-0002",
 "capability": "degraded",
 "provenance": "index",
 "found": true,
 "result": [
  {
   "from": {
    "node_id": "f7008bbf4f92b2bce040de37aa49b051f4df2e8d",
    "kind": "method",
    "name": "ordersOfUser",
    "fqn": "OrderController::ordersOfUser",
    "path": "web/order.php",
    "start_line": 15,
    "end_line": 20
   },
   "kind": "calls",
   "provenance": "stated",
   "evidence": "web/order.php:19",
   "confidence": 1.0,
   "evidence_kind": "signature_match",
   "evidence_how": "fqn-name"
  },
  {
   "from": {
    "node_id": "fa2eb96da5ac09c39e2d02ca2767a6bf58b38434",
    "kind": "file",
    "name": "order2.php",
    "fqn": "web/order2.php",
    "path": "web/order2.php",
    "start_line": 1,
    "end_line": 6
   },
   "kind": "calls",
   "provenance": "stated",
   "evidence": "web/order2.php:5",
   "confidence": 1.0,
   "evidence_kind": "signature_match",
   "evidence_how": "fqn-name"
  }
 ],
 "limits_count": 2
}

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.

Parameters

Name Type Default
fqn str required
limit int 100
min_confidence float | None None

What it returns

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): evidence, suggest.

The envelope around the result is the same for every operation; how to read it: 04 · Operations reference.

How it works

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 evidence_mod.classify, evidence_mod.how_of, evidence_mod.label, evidence_mod.summarize
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 evidence, suggest into the answer envelope
Empty answer yes, and names where to go instead: search, live_read
flowchart TD
  Start[query references]
  Rev{index revision}
  NoIndex[refused: no index]
  Call0[evidence_mod.classify]
  Call1[evidence_mod.how_of]
  Call2[evidence_mod.label]
  Found{found}
  Empty[empty result + suggest: search live_read]
  Out[envelope with result]
  Start --> Rev
  Rev -- none --> NoIndex
  Rev -- rev-N --> Call0
  Call0 --> Call1
  Call1 --> Call2
  Call2 --> Found
  Found -- no --> Empty
  Found -- yes --> Out
Loading

Where it stops

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 references.

Around this group

← previous in the group: symbol

→ next in the group: code

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_references in src/ragraf/facade.py:3822 (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_references, src/ragraf/facade.py:3822, 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.

Clone this wiki locally